mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 17:57:11 +00:00
Improve type hints in camera (#81794)
This commit is contained in:
parent
b7f3eb77dc
commit
402bac5ed7
@ -859,8 +859,9 @@ async def websocket_get_prefs(
|
|||||||
hass: HomeAssistant, connection: ActiveConnection, msg: dict[str, Any]
|
hass: HomeAssistant, connection: ActiveConnection, msg: dict[str, Any]
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Handle request for account info."""
|
"""Handle request for account info."""
|
||||||
prefs = hass.data[DATA_CAMERA_PREFS].get(msg["entity_id"])
|
prefs: CameraPreferences = hass.data[DATA_CAMERA_PREFS]
|
||||||
connection.send_result(msg["id"], prefs.as_dict())
|
camera_prefs = prefs.get(msg["entity_id"])
|
||||||
|
connection.send_result(msg["id"], camera_prefs.as_dict())
|
||||||
|
|
||||||
|
|
||||||
@websocket_api.websocket_command(
|
@websocket_api.websocket_command(
|
||||||
@ -876,7 +877,7 @@ async def websocket_update_prefs(
|
|||||||
hass: HomeAssistant, connection: ActiveConnection, msg: dict[str, Any]
|
hass: HomeAssistant, connection: ActiveConnection, msg: dict[str, Any]
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Handle request for account info."""
|
"""Handle request for account info."""
|
||||||
prefs = hass.data[DATA_CAMERA_PREFS]
|
prefs: CameraPreferences = hass.data[DATA_CAMERA_PREFS]
|
||||||
|
|
||||||
changes = dict(msg)
|
changes = dict(msg)
|
||||||
changes.pop("id")
|
changes.pop("id")
|
||||||
@ -955,7 +956,8 @@ async def _async_stream_endpoint_url(
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Update keepalive setting which manages idle shutdown
|
# 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.keepalive = camera_prefs.preload_stream
|
||||||
stream.orientation = camera_prefs.orientation
|
stream.orientation = camera_prefs.orientation
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user