Skip to content

Commit

Permalink
debug last message received
Browse files Browse the repository at this point in the history
  • Loading branch information
grimmpp committed Feb 14, 2024
1 parent 3b09afd commit d9ab8ae
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions custom_components/eltako/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ async def async_added_to_hass(self) -> None:
def load_value_initially(self, latest_state:State):
# cast state:str to actual value
attributs = latest_state.attributes
LOGGER.debug(f"[device] eneity unique_id: {self.unique_id}")
LOGGER.debug(f"[device] latest state - state: {latest_state.state}")
LOGGER.debug(f"[device] latest state - attributes: {latest_state.attributes}")
# LOGGER.debug(f"[device] eneity unique_id: {self.unique_id}")
# LOGGER.debug(f"[device] latest state - state: {latest_state.state}")
# LOGGER.debug(f"[device] latest state - attributes: {latest_state.attributes}")
try:
if 'unknown' == latest_state.state:
if hasattr(self, '_attr_is_on'):
Expand Down Expand Up @@ -142,15 +142,15 @@ def load_value_initially(self, latest_state:State):
self._attr_native_value = None
raise e

if hasattr(self, '_attr_is_on'):
LOGGER.debug(f"[device] latest state - set {self._attr_is_on}")
elif hasattr(self, '_attr_native_value'):
LOGGER.debug(f"[device] latest state - set {self._attr_native_value}")
# if hasattr(self, '_attr_is_on'):
# LOGGER.debug(f"[device] latest state - set {self._attr_is_on}")
# elif hasattr(self, '_attr_native_value'):
# LOGGER.debug(f"[device] latest state - set {self._attr_native_value}")

LOGGER.debug(f"[device] latest state - _attr_state {self._attr_state}")
LOGGER.debug(f"[device] latest state - state {self.state}")
# LOGGER.debug(f"[device] latest state - _attr_state {self._attr_state}")
# LOGGER.debug(f"[device] latest state - state {self.state}")

LOGGER.debug(f"properties: {self.__dict__.keys()}")
# LOGGER.debug(f"properties: {self.__dict__.keys()}")

self.schedule_update_ha_state()

Expand Down

0 comments on commit d9ab8ae

Please sign in to comment.