From cf92d8c536a8faddbced58675e7cba6dfd8acfd5 Mon Sep 17 00:00:00 2001 From: Christopher Bailey Date: Mon, 26 Dec 2022 14:07:40 -0500 Subject: [PATCH] Add more logging for UniFi Protect event entities (#84575) * Add more logging for UniFi Protect event entities * Condense logging * Linting --- homeassistant/components/unifiprotect/models.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/homeassistant/components/unifiprotect/models.py b/homeassistant/components/unifiprotect/models.py index 01d4820e9a9..b7913567504 100644 --- a/homeassistant/components/unifiprotect/models.py +++ b/homeassistant/components/unifiprotect/models.py @@ -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