Skip to content

Commit 805c331

Browse files
Filter 0 values in low outlier filter (#4829)
1 parent e0a42e5 commit 805c331

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

custom_components/battery_notes/filters.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,10 @@ def _filter_state(self, new_state: FilterState) -> FilterState:
120120
new_state_value = cast(float, new_state.state)
121121
self._skip_processing = False
122122

123+
if new_state_value <= 0:
124+
self._skip_processing = True
125+
return new_state
126+
123127
if previous_state_values and new_state_value >= previous_state_values[-1]:
124128
_LOGGER.debug(
125129
"New value higher than last previous state, allowing. %s >= %s",

0 commit comments

Comments
 (0)