mirror of
https://github.com/home-assistant/core.git
synced 2025-04-30 12:17:52 +00:00
Activate mypy for Filter (#54044)
This commit is contained in:
parent
54538bb72b
commit
fc1babfc92
@ -405,7 +405,7 @@ class Filter:
|
|||||||
:param entity: used for debugging only
|
:param entity: used for debugging only
|
||||||
"""
|
"""
|
||||||
if isinstance(window_size, int):
|
if isinstance(window_size, int):
|
||||||
self.states = deque(maxlen=window_size)
|
self.states: deque = deque(maxlen=window_size)
|
||||||
self.window_unit = WINDOW_SIZE_UNIT_NUMBER_EVENTS
|
self.window_unit = WINDOW_SIZE_UNIT_NUMBER_EVENTS
|
||||||
else:
|
else:
|
||||||
self.states = deque(maxlen=0)
|
self.states = deque(maxlen=0)
|
||||||
@ -476,7 +476,7 @@ class RangeFilter(Filter, SensorEntity):
|
|||||||
super().__init__(FILTER_NAME_RANGE, precision=precision, entity=entity)
|
super().__init__(FILTER_NAME_RANGE, precision=precision, entity=entity)
|
||||||
self._lower_bound = lower_bound
|
self._lower_bound = lower_bound
|
||||||
self._upper_bound = upper_bound
|
self._upper_bound = upper_bound
|
||||||
self._stats_internal = Counter()
|
self._stats_internal: Counter = Counter()
|
||||||
|
|
||||||
def _filter_state(self, new_state):
|
def _filter_state(self, new_state):
|
||||||
"""Implement the range filter."""
|
"""Implement the range filter."""
|
||||||
@ -522,7 +522,7 @@ class OutlierFilter(Filter, SensorEntity):
|
|||||||
"""
|
"""
|
||||||
super().__init__(FILTER_NAME_OUTLIER, window_size, precision, entity)
|
super().__init__(FILTER_NAME_OUTLIER, window_size, precision, entity)
|
||||||
self._radius = radius
|
self._radius = radius
|
||||||
self._stats_internal = Counter()
|
self._stats_internal: Counter = Counter()
|
||||||
self._store_raw = True
|
self._store_raw = True
|
||||||
|
|
||||||
def _filter_state(self, new_state):
|
def _filter_state(self, new_state):
|
||||||
|
3
mypy.ini
3
mypy.ini
@ -1349,9 +1349,6 @@ ignore_errors = true
|
|||||||
[mypy-homeassistant.components.evohome.*]
|
[mypy-homeassistant.components.evohome.*]
|
||||||
ignore_errors = true
|
ignore_errors = true
|
||||||
|
|
||||||
[mypy-homeassistant.components.filter.*]
|
|
||||||
ignore_errors = true
|
|
||||||
|
|
||||||
[mypy-homeassistant.components.fireservicerota.*]
|
[mypy-homeassistant.components.fireservicerota.*]
|
||||||
ignore_errors = true
|
ignore_errors = true
|
||||||
|
|
||||||
|
@ -42,7 +42,6 @@ IGNORED_MODULES: Final[list[str]] = [
|
|||||||
"homeassistant.components.enphase_envoy.*",
|
"homeassistant.components.enphase_envoy.*",
|
||||||
"homeassistant.components.entur_public_transport.*",
|
"homeassistant.components.entur_public_transport.*",
|
||||||
"homeassistant.components.evohome.*",
|
"homeassistant.components.evohome.*",
|
||||||
"homeassistant.components.filter.*",
|
|
||||||
"homeassistant.components.fireservicerota.*",
|
"homeassistant.components.fireservicerota.*",
|
||||||
"homeassistant.components.firmata.*",
|
"homeassistant.components.firmata.*",
|
||||||
"homeassistant.components.flo.*",
|
"homeassistant.components.flo.*",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user