Cleanup camera after late PR review (#77880)
Cleanup changes to camera from #77439
This commit is contained in:
parent
e5ac50fc57
commit
34da463df0
2 changed files with 4 additions and 2 deletions
|
@ -893,10 +893,11 @@ async def websocket_update_prefs(
|
||||||
entity_id = changes.pop("entity_id")
|
entity_id = changes.pop("entity_id")
|
||||||
try:
|
try:
|
||||||
entity_prefs = await prefs.async_update(entity_id, **changes)
|
entity_prefs = await prefs.async_update(entity_id, **changes)
|
||||||
connection.send_result(msg["id"], entity_prefs)
|
|
||||||
except HomeAssistantError as ex:
|
except HomeAssistantError as ex:
|
||||||
_LOGGER.error("Error setting camera preferences: %s", ex)
|
_LOGGER.error("Error setting camera preferences: %s", ex)
|
||||||
connection.send_error(msg["id"], "update_failed", str(ex))
|
connection.send_error(msg["id"], "update_failed", str(ex))
|
||||||
|
else:
|
||||||
|
connection.send_result(msg["id"], entity_prefs)
|
||||||
|
|
||||||
|
|
||||||
async def async_handle_snapshot_service(
|
async def async_handle_snapshot_service(
|
||||||
|
|
|
@ -68,7 +68,8 @@ class CameraPreferences:
|
||||||
) -> dict[str, bool | int]:
|
) -> dict[str, bool | int]:
|
||||||
"""Update camera preferences.
|
"""Update camera preferences.
|
||||||
|
|
||||||
Returns a dict with the preferences on success or a string on error.
|
Returns a dict with the preferences on success.
|
||||||
|
Raises HomeAssistantError on failure.
|
||||||
"""
|
"""
|
||||||
if preload_stream is not UNDEFINED:
|
if preload_stream is not UNDEFINED:
|
||||||
# Prefs already initialized.
|
# Prefs already initialized.
|
||||||
|
|
Loading…
Add table
Reference in a new issue