Skip to content

Commit

Permalink
Activate mypy. (home-assistant#55965)
Browse files Browse the repository at this point in the history
  • Loading branch information
janiversen authored Sep 18, 2021
1 parent 39bc127 commit 476d04e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
10 changes: 6 additions & 4 deletions homeassistant/components/entur_public_transport/sensor.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -158,17 +160,17 @@ def __init__(
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:
"""Return the name of the sensor."""
return self._name

@property
def native_value(self) -> str:
def native_value(self) -> int | None:
"""Return the state of the sensor."""
return self._state

Expand All @@ -195,7 +197,7 @@ async def async_update(self) -> None:

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
Expand Down
3 changes: 0 additions & 3 deletions mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 0 additions & 1 deletion script/hassfest/mypy_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
"homeassistant.components.dhcp.*",
"homeassistant.components.doorbird.*",
"homeassistant.components.enphase_envoy.*",
"homeassistant.components.entur_public_transport.*",
"homeassistant.components.evohome.*",
"homeassistant.components.fireservicerota.*",
"homeassistant.components.firmata.*",
Expand Down

0 comments on commit 476d04e

Please sign in to comment.