Activate mypy. (#55965)

This commit is contained in:
jan iversen 2021-09-18 11:02:24 +02:00 committed by GitHub
parent 39bc127dd6
commit 476d04e2fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 8 deletions

View File

@ -1,4 +1,6 @@
"""Real-time information about public transport departures in Norway."""
from __future__ import annotations
from datetime import datetime, timedelta
from enturclient import EnturPublicTransportData
@ -158,9 +160,9 @@ class EnturPublicTransportSensor(SensorEntity):
self._stop = stop
self._show_on_map = show_on_map
self._name = name
self._state = None
self._state: int | None = None
self._icon = ICONS[DEFAULT_ICON_KEY]
self._attributes = {}
self._attributes: dict[str, str] = {}
@property
def name(self) -> str:
@ -168,7 +170,7 @@ class EnturPublicTransportSensor(SensorEntity):
return self._name
@property
def native_value(self) -> str:
def native_value(self) -> int | None:
"""Return the state of the sensor."""
return self._state
@ -195,7 +197,7 @@ class EnturPublicTransportSensor(SensorEntity):
self._attributes = {}
data = self.api.get_stop_info(self._stop)
data: EnturPublicTransportData = self.api.get_stop_info(self._stop)
if data is None:
self._state = None
return

View File

@ -1348,9 +1348,6 @@ ignore_errors = true
[mypy-homeassistant.components.enphase_envoy.*]
ignore_errors = true
[mypy-homeassistant.components.entur_public_transport.*]
ignore_errors = true
[mypy-homeassistant.components.evohome.*]
ignore_errors = true

View File

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