Skip to content

Commit

Permalink
Bump pyunifiprotect to 5.0.2 (#113651)
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher Bailey authored Mar 17, 2024
1 parent 885abe2 commit 0a26829
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 28 deletions.
27 changes: 2 additions & 25 deletions homeassistant/components/unifiprotect/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
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
Expand All @@ -42,11 +43,6 @@

_LOGGER = logging.getLogger(__name__)
ProtectDeviceType = ProtectAdoptableDeviceModel | NVR
SMART_EVENTS = {
EventType.SMART_DETECT,
EventType.SMART_AUDIO_DETECT,
EventType.SMART_DETECT_LINE,
}


@callback
Expand Down Expand Up @@ -231,26 +227,7 @@ def _async_process_ws_message(self, message: WSSubscriptionMessage) -> None:
# 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(
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/unifiprotect/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,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",
Expand Down
2 changes: 1 addition & 1 deletion requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2333,7 +2333,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
Expand Down
2 changes: 1 addition & 1 deletion requirements_test_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1800,7 +1800,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
Expand Down

0 comments on commit 0a26829

Please sign in to comment.