From eb8a8424a59257595dd067590cfff5ecc0faaf77 Mon Sep 17 00:00:00 2001 From: Christopher Bailey Date: Sat, 16 Mar 2024 22:15:18 -0400 Subject: [PATCH] Bump pyunifiprotect to 5.0.2 (#113651) --- homeassistant/components/unifiprotect/data.py | 27 ++----------------- .../components/unifiprotect/manifest.json | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 4 files changed, 5 insertions(+), 28 deletions(-) diff --git a/homeassistant/components/unifiprotect/data.py b/homeassistant/components/unifiprotect/data.py index 2825c2a4f3c..b82e9ff37f1 100644 --- a/homeassistant/components/unifiprotect/data.py +++ b/homeassistant/components/unifiprotect/data.py @@ -19,6 +19,7 @@ from pyunifiprotect.data import ( WSSubscriptionMessage, ) from pyunifiprotect.exceptions import ClientError, NotAuthorized +from pyunifiprotect.utils import log_event from homeassistant.config_entries import ConfigEntry from homeassistant.core import CALLBACK_TYPE, HomeAssistant, callback @@ -41,11 +42,6 @@ from .utils import async_dispatch_id as _ufpd, async_get_devices_by_type _LOGGER = logging.getLogger(__name__) ProtectDeviceType = ProtectAdoptableDeviceModel | NVR -SMART_EVENTS = { - EventType.SMART_DETECT, - EventType.SMART_AUDIO_DETECT, - EventType.SMART_DETECT_LINE, -} @callback @@ -230,26 +226,7 @@ class ProtectData: # trigger updates for camera that the event references elif isinstance(obj, Event): # type: ignore[unreachable] if _LOGGER.isEnabledFor(logging.DEBUG): - _LOGGER.debug("event WS msg: %s", obj.dict()) - if obj.type in SMART_EVENTS: - if obj.camera is not None: - if obj.end is None: - _LOGGER.debug( - "%s (%s): New smart detection started for %s (%s)", - obj.camera.name, - obj.camera.mac, - obj.smart_detect_types, - obj.id, - ) - else: - _LOGGER.debug( - "%s (%s): Smart detection ended for %s (%s)", - obj.camera.name, - obj.camera.mac, - obj.smart_detect_types, - obj.id, - ) - + log_event(obj) if obj.type is EventType.DEVICE_ADOPTED: if obj.metadata is not None and obj.metadata.device_id is not None: device = self.api.bootstrap.get_device_from_id( diff --git a/homeassistant/components/unifiprotect/manifest.json b/homeassistant/components/unifiprotect/manifest.json index 1654539d91d..1eb37befca0 100644 --- a/homeassistant/components/unifiprotect/manifest.json +++ b/homeassistant/components/unifiprotect/manifest.json @@ -42,7 +42,7 @@ "iot_class": "local_push", "loggers": ["pyunifiprotect", "unifi_discovery"], "quality_scale": "platinum", - "requirements": ["pyunifiprotect==5.0.1", "unifi-discovery==1.1.8"], + "requirements": ["pyunifiprotect==5.0.2", "unifi-discovery==1.1.8"], "ssdp": [ { "manufacturer": "Ubiquiti Networks", diff --git a/requirements_all.txt b/requirements_all.txt index 46ccc244b8e..50e99d674e9 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -2340,7 +2340,7 @@ pytrydan==0.4.0 pyudev==0.23.2 # homeassistant.components.unifiprotect -pyunifiprotect==5.0.1 +pyunifiprotect==5.0.2 # homeassistant.components.uptimerobot pyuptimerobot==22.2.0 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 1d5c3bad1a8..865fec1c2e1 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -1801,7 +1801,7 @@ pytrydan==0.4.0 pyudev==0.23.2 # homeassistant.components.unifiprotect -pyunifiprotect==5.0.1 +pyunifiprotect==5.0.2 # homeassistant.components.uptimerobot pyuptimerobot==22.2.0