Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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