Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdelprete committed Jan 13, 2025
2 parents 0324212 + 9d8b984 commit ab43956
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions custom_components/4noks_elios4you/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,9 @@ async def async_get_data(self):
self.data[key] = int(value)
except ValueError:
# If the value cannot be converted to int, log it and skip
_LOGGER.debug(f"async_get_data: Value for {key} could not be parsed to int: {value}")
_LOGGER.debug(
f"async_get_data: Value for {key} could not be parsed to int: {value}"
)
continue # Skip the invalid value
else:
_LOGGER.debug("async_get_data (ERROR): @dat data is None")
Expand All @@ -216,7 +218,9 @@ async def async_get_data(self):
try:
self.data[key] = round(float(value), 2)
except ValueError:
_LOGGER.debug(f"async_get_data: Value for {key} could not be parsed to float: {value}")
_LOGGER.debug(
f"async_get_data: Value for {key} could not be parsed to float: {value}"
)
else:
_LOGGER.debug("async_get_data (ERROR): @sta data is None")

Expand Down Expand Up @@ -382,12 +386,12 @@ async def telnet_set_relay(self, state) -> bool:
# refresh relay_state value to avoid waiting for poll cycle
self.data["relay_state"] = out_mode
_LOGGER.debug(
f"telnet_set_relay (WARNING): set relay success - to_state: {to_state} - rel: {out_mode} - relay_state: {self.data["relay_state"]}"
f"telnet_set_relay (WARNING): set relay success - to_state: {to_state} - rel: {out_mode} - relay_state: {self.data['relay_state']}"
)
else:
set_relay = False
_LOGGER.debug(
f"telnet_set_relay (ERROR): set relay failure - to_state: {to_state} - rel: {out_mode} - relay_state: {self.data["relay_state"]}"
f"telnet_set_relay (ERROR): set relay failure - to_state: {to_state} - rel: {out_mode} - relay_state: {self.data['relay_state']}"
)
else:
_LOGGER.debug("telnet_set_relay (ERROR): rel_parsed is None")
Expand Down

0 comments on commit ab43956

Please sign in to comment.