Skip to content

Commit

Permalink
Cleanup camera after late PR review (home-assistant#77880)
Browse files Browse the repository at this point in the history
Cleanup changes to camera from home-assistant#77439
  • Loading branch information
uvjustin authored Sep 6, 2022
1 parent e5ac50f commit 34da463
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion homeassistant/components/camera/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -893,10 +893,11 @@ async def websocket_update_prefs(
entity_id = changes.pop("entity_id")
try:
entity_prefs = await prefs.async_update(entity_id, **changes)
connection.send_result(msg["id"], entity_prefs)
except HomeAssistantError as ex:
_LOGGER.error("Error setting camera preferences: %s", ex)
connection.send_error(msg["id"], "update_failed", str(ex))
else:
connection.send_result(msg["id"], entity_prefs)


async def async_handle_snapshot_service(
Expand Down
3 changes: 2 additions & 1 deletion homeassistant/components/camera/prefs.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ async def async_update(
) -> dict[str, bool | int]:
"""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:
# Prefs already initialized.
Expand Down

0 comments on commit 34da463

Please sign in to comment.