From bb45f63c7538bb2ebe29807e91c159e833e370ad Mon Sep 17 00:00:00 2001 From: Kiril Kurkianec Date: Tue, 30 Jan 2024 10:31:08 +0200 Subject: [PATCH] added debuging on add tyo hass --- custom_components/econet300/entity.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/custom_components/econet300/entity.py b/custom_components/econet300/entity.py index b5e265c..58994fc 100644 --- a/custom_components/econet300/entity.py +++ b/custom_components/econet300/entity.py @@ -73,11 +73,15 @@ async def async_added_to_hass(self): _LOGGER.error("Coordinator object does not have a 'data' attribute") return - if self.coordinator.data[self.entity_description.key] is None: + if ( + not self.coordinator.has_data(self.entity_description.key) + or self.coordinator.data[self.entity_description.key] is None + ): _LOGGER.warning( "Data key: %s was expected to exist but it doesn't", self.entity_description.key, ) + _LOGGER.debug("Coordinator available data: %s", self.coordinator.data) _LOGGER.debug("Exiting async_added_to_hass method") return