Skip to content

Commit

Permalink
Bump pyunifiprotect to v4.22.5 (home-assistant#106781)
Browse files Browse the repository at this point in the history
  • Loading branch information
AngellusMortis authored Dec 31, 2023
1 parent 80f8102 commit ce54a12
Show file tree
Hide file tree
Showing 11 changed files with 77 additions and 3 deletions.
11 changes: 11 additions & 0 deletions homeassistant/components/unifiprotect/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -643,4 +643,15 @@ def _async_updated_event(self, device: ProtectModelWithId) -> None:
or self._attr_extra_state_attributes != previous_extra_state_attributes
or self._attr_available != previous_available
):
_LOGGER.debug(
"Updating state [%s (%s)] %s (%s, %s) -> %s (%s, %s)",
device.name,
device.mac,
previous_is_on,
previous_available,
previous_extra_state_attributes,
self._attr_is_on,
self._attr_available,
self._attr_extra_state_attributes,
)
self.async_write_ha_state()
7 changes: 7 additions & 0 deletions homeassistant/components/unifiprotect/button.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,4 +206,11 @@ def _async_updated_event(self, device: ProtectModelWithId) -> None:
previous_available = self._attr_available
self._async_update_device_from_protect(device)
if self._attr_available != previous_available:
_LOGGER.debug(
"Updating state [%s (%s)] %s -> %s",
device.name,
device.mac,
previous_available,
self._attr_available,
)
self.async_write_ha_state()
2 changes: 2 additions & 0 deletions homeassistant/components/unifiprotect/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,8 @@ 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:
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==4.22.4", "unifi-discovery==1.1.7"],
"requirements": ["pyunifiprotect==4.22.5", "unifi-discovery==1.1.7"],
"ssdp": [
{
"manufacturer": "Ubiquiti Networks",
Expand Down
11 changes: 11 additions & 0 deletions homeassistant/components/unifiprotect/media_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,17 @@ def _async_updated_event(self, device: ProtectModelWithId) -> None:
or self._attr_volume_level != previous_volume_level
or self._attr_available != previous_available
):
_LOGGER.debug(
"Updating state [%s (%s)] %s (%s, %s) -> %s (%s, %s)",
device.name,
device.mac,
previous_state,
previous_available,
previous_volume_level,
self._attr_state,
self._attr_available,
self._attr_volume_level,
)
self.async_write_ha_state()

async def async_set_volume_level(self, volume: float) -> None:
Expand Down
12 changes: 12 additions & 0 deletions homeassistant/components/unifiprotect/number.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

from dataclasses import dataclass
from datetime import timedelta
import logging

from pyunifiprotect.data import (
Camera,
Expand All @@ -25,6 +26,8 @@
from .models import PermRequired, ProtectSetableKeysMixin, T
from .utils import async_dispatch_id as _ufpd

_LOGGER = logging.getLogger(__name__)


@dataclass(frozen=True)
class NumberKeysMixin:
Expand Down Expand Up @@ -285,4 +288,13 @@ def _async_updated_event(self, device: ProtectModelWithId) -> None:
self._attr_native_value != previous_value
or self._attr_available != previous_available
):
_LOGGER.debug(
"Updating state [%s (%s)] %s (%s) -> %s (%s)",
device.name,
device.mac,
previous_value,
previous_available,
self._attr_native_value,
self._attr_available,
)
self.async_write_ha_state()
11 changes: 11 additions & 0 deletions homeassistant/components/unifiprotect/select.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,4 +420,15 @@ def _async_updated_event(self, device: ProtectModelWithId) -> None:
or self._attr_options != previous_options
or self._attr_available != previous_available
):
_LOGGER.debug(
"Updating state [%s (%s)] %s (%s, %s) -> %s (%s, %s)",
device.name,
device.mac,
previous_option,
previous_available,
previous_options,
self._attr_current_option,
self._attr_available,
self._attr_options,
)
self.async_write_ha_state()
9 changes: 9 additions & 0 deletions homeassistant/components/unifiprotect/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -730,6 +730,15 @@ def _async_updated_event(self, device: ProtectModelWithId) -> None:
self._attr_native_value != previous_value
or self._attr_available != previous_available
):
_LOGGER.debug(
"Updating state [%s (%s)] %s (%s) -> %s (%s)",
device.name,
device.mac,
previous_value,
previous_available,
self._attr_native_value,
self._attr_available,
)
self.async_write_ha_state()


Expand Down
11 changes: 11 additions & 0 deletions homeassistant/components/unifiprotect/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from __future__ import annotations

from dataclasses import dataclass
import logging
from typing import Any

from pyunifiprotect.data import (
Expand All @@ -27,6 +28,7 @@
from .models import PermRequired, ProtectSetableKeysMixin, T
from .utils import async_dispatch_id as _ufpd

_LOGGER = logging.getLogger(__name__)
ATTR_PREV_MIC = "prev_mic_level"
ATTR_PREV_RECORD = "prev_record_mode"

Expand Down Expand Up @@ -458,6 +460,15 @@ def _async_updated_event(self, device: ProtectModelWithId) -> None:
self._attr_is_on != previous_is_on
or self._attr_available != previous_available
):
_LOGGER.debug(
"Updating state [%s (%s)] %s (%s) -> %s (%s)",
device.name,
device.mac,
previous_is_on,
previous_available,
self._attr_is_on,
self._attr_available,
)
self.async_write_ha_state()


Expand Down
2 changes: 1 addition & 1 deletion requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2283,7 +2283,7 @@ pytrydan==0.4.0
pyudev==0.23.2

# homeassistant.components.unifiprotect
pyunifiprotect==4.22.4
pyunifiprotect==4.22.5

# 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 @@ -1726,7 +1726,7 @@ pytrydan==0.4.0
pyudev==0.23.2

# homeassistant.components.unifiprotect
pyunifiprotect==4.22.4
pyunifiprotect==4.22.5

# homeassistant.components.uptimerobot
pyuptimerobot==22.2.0
Expand Down

0 comments on commit ce54a12

Please sign in to comment.