mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Minor motionEye readability improvement (#54251)
This commit is contained in:
parent
4459d8674a
commit
d4a3d0462d
@ -237,8 +237,8 @@ def _add_camera(
|
|||||||
if entry.options.get(CONF_WEBHOOK_SET, DEFAULT_WEBHOOK_SET):
|
if entry.options.get(CONF_WEBHOOK_SET, DEFAULT_WEBHOOK_SET):
|
||||||
url = async_generate_motioneye_webhook(hass, entry.data[CONF_WEBHOOK_ID])
|
url = async_generate_motioneye_webhook(hass, entry.data[CONF_WEBHOOK_ID])
|
||||||
|
|
||||||
if url and (
|
if url:
|
||||||
_set_webhook(
|
set_motion_event = _set_webhook(
|
||||||
_build_url(
|
_build_url(
|
||||||
device,
|
device,
|
||||||
url,
|
url,
|
||||||
@ -250,7 +250,8 @@ def _add_camera(
|
|||||||
KEY_WEB_HOOK_NOTIFICATIONS_ENABLED,
|
KEY_WEB_HOOK_NOTIFICATIONS_ENABLED,
|
||||||
camera,
|
camera,
|
||||||
)
|
)
|
||||||
| _set_webhook(
|
|
||||||
|
set_storage_event = _set_webhook(
|
||||||
_build_url(
|
_build_url(
|
||||||
device,
|
device,
|
||||||
url,
|
url,
|
||||||
@ -262,7 +263,7 @@ def _add_camera(
|
|||||||
KEY_WEB_HOOK_STORAGE_ENABLED,
|
KEY_WEB_HOOK_STORAGE_ENABLED,
|
||||||
camera,
|
camera,
|
||||||
)
|
)
|
||||||
):
|
if set_motion_event or set_storage_event:
|
||||||
hass.async_create_task(client.async_set_camera(camera_id, camera))
|
hass.async_create_task(client.async_set_camera(camera_id, camera))
|
||||||
|
|
||||||
async_dispatcher_send(
|
async_dispatcher_send(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user