mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 04:07:08 +00:00
Fix doctring newline and handle ha.state string-being
This commit is contained in:
parent
07d139b3a8
commit
bb98331ba4
@ -364,7 +364,6 @@ class RangeFilter(Filter):
|
|||||||
|
|
||||||
def _filter_state(self, new_state):
|
def _filter_state(self, new_state):
|
||||||
"""Implement the range filter."""
|
"""Implement the range filter."""
|
||||||
|
|
||||||
if new_state.state > self._upper_bound:
|
if new_state.state > self._upper_bound:
|
||||||
|
|
||||||
self._stats_internal['erasures_up'] += 1
|
self._stats_internal['erasures_up'] += 1
|
||||||
|
@ -141,7 +141,7 @@ class TestFilterSensor(unittest.TestCase):
|
|||||||
lower_bound=lower,
|
lower_bound=lower,
|
||||||
upper_bound=upper)
|
upper_bound=upper)
|
||||||
for unf_state in self.values:
|
for unf_state in self.values:
|
||||||
prev = unf_state.state
|
prev = float(unf_state.state)
|
||||||
filtered = filt.filter_state(unf_state)
|
filtered = filt.filter_state(unf_state)
|
||||||
if prev < lower:
|
if prev < lower:
|
||||||
self.assertEqual(lower, filtered.state)
|
self.assertEqual(lower, filtered.state)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user