Activate mypy for Filter (#54044)

This commit is contained in:
Milan Meulemans 2021-08-10 10:45:56 +02:00 committed by GitHub
parent 54538bb72b
commit fc1babfc92
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 7 deletions

View File

@ -405,7 +405,7 @@ class Filter:
:param entity: used for debugging only
"""
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
else:
self.states = deque(maxlen=0)
@ -476,7 +476,7 @@ class RangeFilter(Filter, SensorEntity):
super().__init__(FILTER_NAME_RANGE, precision=precision, entity=entity)
self._lower_bound = lower_bound
self._upper_bound = upper_bound
self._stats_internal = Counter()
self._stats_internal: Counter = Counter()
def _filter_state(self, new_state):
"""Implement the range filter."""
@ -522,7 +522,7 @@ class OutlierFilter(Filter, SensorEntity):
"""
super().__init__(FILTER_NAME_OUTLIER, window_size, precision, entity)
self._radius = radius
self._stats_internal = Counter()
self._stats_internal: Counter = Counter()
self._store_raw = True
def _filter_state(self, new_state):

View File

@ -1349,9 +1349,6 @@ ignore_errors = true
[mypy-homeassistant.components.evohome.*]
ignore_errors = true
[mypy-homeassistant.components.filter.*]
ignore_errors = true
[mypy-homeassistant.components.fireservicerota.*]
ignore_errors = true

View File

@ -42,7 +42,6 @@ IGNORED_MODULES: Final[list[str]] = [
"homeassistant.components.enphase_envoy.*",
"homeassistant.components.entur_public_transport.*",
"homeassistant.components.evohome.*",
"homeassistant.components.filter.*",
"homeassistant.components.fireservicerota.*",
"homeassistant.components.firmata.*",
"homeassistant.components.flo.*",