Skip to content

Commit

Permalink
Merge pull request #52 from AndersHoglund/cleanup
Browse files Browse the repository at this point in the history
Cleanup incomplete PR 48
  • Loading branch information
tijsverkoyen committed Feb 3, 2023
2 parents e1e654a + 4c20add commit 9063913
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions custom_components/fusion_solar/fusion_solar/energy_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,6 @@ def state(self) -> float:
f'{self.entity_id}: not producing any power, so not updating to prevent positive glitched.')
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)

if not isfloat(current_value):
_LOGGER.warning(f'{self.entity_id}: current value ({current_value}) is not a float, send 0.')
return 0

if float(new_value) < float(current_value):
_LOGGER.debug(
f'{self.entity_id}: new value ({new_value}) is smaller then current value ({entity.state}), so not updating.')
return float(current_value)

if self._data_name not in self.coordinator.data:
return None

Expand Down

0 comments on commit 9063913

Please sign in to comment.