Add more logging for UniFi Protect event entities (#84575)
* Add more logging for UniFi Protect event entities * Condense logging * Linting
This commit is contained in:
parent
a70163042d
commit
cf92d8c536
1 changed files with 12 additions and 0 deletions
|
@ -83,10 +83,22 @@ class ProtectEventMixin(ProtectRequiredKeysMixin[T]):
|
|||
if value:
|
||||
event = self.get_event_obj(obj)
|
||||
value = event is not None
|
||||
if not value:
|
||||
_LOGGER.debug("%s (%s): missing event", self.name, obj.mac)
|
||||
|
||||
if event is not None and self.ufp_smart_type is not None:
|
||||
value = self.ufp_smart_type in event.smart_detect_types
|
||||
if not value:
|
||||
_LOGGER.debug(
|
||||
"%s (%s): %s not in %s",
|
||||
self.name,
|
||||
obj.mac,
|
||||
self.ufp_smart_type,
|
||||
event.smart_detect_types,
|
||||
)
|
||||
|
||||
if value:
|
||||
_LOGGER.debug("%s (%s): value is on", self.name, obj.mac)
|
||||
return value
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue