Skip to content
This repository has been archived by the owner on Aug 26, 2022. It is now read-only.

Commit

Permalink
More logging for doorbell
Browse files Browse the repository at this point in the history
  • Loading branch information
AngellusMortis committed Jan 28, 2022
1 parent b6aeafb commit d41459e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions custom_components/unifiprotect/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,13 @@ class ProtectDeviceBinarySensor(ProtectDeviceEntity, BinarySensorEntity):
def _async_update_device_from_protect(self) -> None:
super()._async_update_device_from_protect()

if self.entity_description.key == "doorbell":
new_value = self.entity_description.get_ufp_value(self.device)
if new_value != self.is_on:
_LOGGER.debug(
"Changing doorbell sensor from %s to %s", self.is_on, new_value
)

self._attr_is_on = self.entity_description.get_ufp_value(self.device)
if self.entity_description.ufp_last_trip_value is not None:
last_trip = get_nested_attr(
Expand Down

0 comments on commit d41459e

Please sign in to comment.