Skip to content

Commit

Permalink
added debuging on add tyo hass
Browse files Browse the repository at this point in the history
  • Loading branch information
KirilKurkianec committed Jan 30, 2024
1 parent 0689b29 commit bb45f63
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion custom_components/econet300/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bb45f63

Please sign in to comment.