()
return {
        "partymode": user_manager.partymode_enabled(),
        "users": user_manager.get_count(),
        "visitors": models.Counter.objects.get_or_create(id=1, defaults={"value": 0})[
            0
        ].value,
        "lightsEnabled": redis.get("lights_active"),
        "playbackError": redis.get("playback_error"),
        "alarm": redis.get("alarm_playing"),
        "defaultPlatform": "spotify" if storage.get("spotify_enabled") else "youtube",
    }
This function constructs a base state dictionary with website wide state.
    Pages sending states extend this state dictionary.
This function constructs a base state dictionary with website wide state.
    Pages sending states extend this state dictionary.
This function constructs a base state dictionary with website wide state . Pages sending states extend this state dictionary .
def state_dict() -> Dict[str, Any]:
    """This function constructs a base state dictionary with website wide state.
    Pages sending states extend this state dictionary."""
    return {
        "partymode": user_manager.partymode_enabled(),
        "users": user_manager.get_count(),
        "visitors": models.Counter.objects.get_or_create(id=1, defaults={"value": 0})[
            0
        ].value,
        "lightsEnabled": redis.get("lights_active"),
        "playbackError": redis.get("playback_error"),
        "alarm": redis.get("alarm_playing"),
        "defaultPlatform": "spotify" if storage.get("spotify_enabled") else "youtube",
    }
def state_dict ( ) -> Dict [ str , Any ] : return { "partymode" : user_manager . partymode_enabled ( ) , "users" : user_manager . get_count ( ) , "visitors" : models . Counter . objects . get_or_create ( id = 1 , defaults = { "value" : 0 } ) [ 0 ] . value , "lightsEnabled" : redis . get ( "lights_active" ) , "playbackError" : redis . get ( "playback_error" ) , "alarm" : redis . get ( "alarm_playing" ) , "defaultPlatform" : "spotify" if storage . get ( "spotify_enabled" ) else "youtube" , }