Skip to content

Commit

Permalink
Merge pull request #46 from tijsverkoyen/4-glitch-in-kiosk
Browse files Browse the repository at this point in the history
Ignore new value of '0.00' when retrieving data from the Kiosk
  • Loading branch information
tijsverkoyen authored Jan 30, 2023
2 parents 9efbd24 + e08635b commit c3680b6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions custom_components/fusion_solar/fusion_solar/energy_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ def state(self) -> float:
current_value = entity.state
new_value = self.coordinator.data[self._data_name][self._attribute]

if new_value == '0.00':
_LOGGER.debug(f'{self.entity_id}: new value ({new_value}) is 0, so not updating.')
return float(current_value)

if not isfloat(new_value):
_LOGGER.warning(f'{self.entity_id}: new value ({new_value}) is not a float, so not updating.')
return float(current_value)
Expand Down

0 comments on commit c3680b6

Please sign in to comment.