From 13a76286c4b52e24c7c3f9f795b17f4d44baa742 Mon Sep 17 00:00:00 2001 From: basbruss <4a3.brussee.bas@gmail.com> Date: Thu, 23 May 2024 21:02:46 +0200 Subject: [PATCH] Add logging --- custom_components/adaptive_cover/coordinator.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/custom_components/adaptive_cover/coordinator.py b/custom_components/adaptive_cover/coordinator.py index 652f897..7497909 100644 --- a/custom_components/adaptive_cover/coordinator.py +++ b/custom_components/adaptive_cover/coordinator.py @@ -158,6 +158,9 @@ async def async_check_cover_state_change( """Fetch and process state change event.""" _LOGGER.debug("Cover state change") data = event.data + if data["old_state"] is None: + _LOGGER.debug("Old state is None") + return self.state_change_data = StateChangedData( data["entity_id"], data["old_state"], data["new_state"] ) @@ -317,6 +320,7 @@ async def async_set_manual_position(self, entity, position): self.wait_for_target[entity] = True self.target_call[entity] = position + _LOGGER.debug("Set wait for target %s and target call %s", self.wait_for_target, self.target_call) await self.hass.services.async_call(COVER_DOMAIN, service, service_data) _LOGGER.debug("Run %s with data %s", service, service_data)