Improve type hints in camera (#81794)
parent
b7f3eb77dc
commit
402bac5ed7
|
@ -859,8 +859,9 @@ async def websocket_get_prefs(
|
|||
hass: HomeAssistant, connection: ActiveConnection, msg: dict[str, Any]
|
||||
) -> None:
|
||||
"""Handle request for account info."""
|
||||
prefs = hass.data[DATA_CAMERA_PREFS].get(msg["entity_id"])
|
||||
connection.send_result(msg["id"], prefs.as_dict())
|
||||
prefs: CameraPreferences = hass.data[DATA_CAMERA_PREFS]
|
||||
camera_prefs = prefs.get(msg["entity_id"])
|
||||
connection.send_result(msg["id"], camera_prefs.as_dict())
|
||||
|
||||
|
||||
@websocket_api.websocket_command(
|
||||
|
@ -876,7 +877,7 @@ async def websocket_update_prefs(
|
|||
hass: HomeAssistant, connection: ActiveConnection, msg: dict[str, Any]
|
||||
) -> None:
|
||||
"""Handle request for account info."""
|
||||
prefs = hass.data[DATA_CAMERA_PREFS]
|
||||
prefs: CameraPreferences = hass.data[DATA_CAMERA_PREFS]
|
||||
|
||||
changes = dict(msg)
|
||||
changes.pop("id")
|
||||
|
@ -955,7 +956,8 @@ async def _async_stream_endpoint_url(
|
|||
)
|
||||
|
||||
# Update keepalive setting which manages idle shutdown
|
||||
camera_prefs = hass.data[DATA_CAMERA_PREFS].get(camera.entity_id)
|
||||
prefs: CameraPreferences = hass.data[DATA_CAMERA_PREFS]
|
||||
camera_prefs = prefs.get(camera.entity_id)
|
||||
stream.keepalive = camera_prefs.preload_stream
|
||||
stream.orientation = camera_prefs.orientation
|
||||
|
||||
|
|
Loading…
Reference in New Issue