Skip to content

Commit

Permalink
grrr
Browse files Browse the repository at this point in the history
  • Loading branch information
marq24 committed Nov 23, 2023
1 parent ef2f926 commit 53eb617
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions custom_components/senec/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def __init__(
self._previous_float_value: float | None = None
self._is_total_increasing: bool = description is not None and isinstance(description,
ExtSensorEntityDescription) and hasattr(
description, "controls") and "only_increasing" in description.controls
description, "controls") and description.controls is not None and "only_increasing" in description.controls

@property
def state(self):
Expand All @@ -115,7 +115,8 @@ def state(self):
if not self._is_total_increasing:
return value
elif (self._previous_float_value is not None) and (value < self._previous_float_value):
_LOGGER.debug(f"Thanks for nothing Senec! prev>new for key {self._attr_translation_key} - prev:{self._previous_float_value} new: {value}")
_LOGGER.debug(
f"Thanks for nothing Senec! prev>new for key {self._attr_translation_key} - prev:{self._previous_float_value} new: {value}")
return self._previous_float_value
else:
self._previous_float_value = value
Expand Down

0 comments on commit 53eb617

Please sign in to comment.