Add strict typing to Vodafone Station (#139573)

This commit is contained in:
Simone Chemelli 2025-03-01 14:22:14 +01:00 committed by GitHub
parent 91eba0855e
commit 679b57e450
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 13 additions and 2 deletions

View File

@ -528,6 +528,7 @@ homeassistant.components.vallox.*
homeassistant.components.valve.* homeassistant.components.valve.*
homeassistant.components.velbus.* homeassistant.components.velbus.*
homeassistant.components.vlc_telnet.* homeassistant.components.vlc_telnet.*
homeassistant.components.vodafone_station.*
homeassistant.components.wake_on_lan.* homeassistant.components.wake_on_lan.*
homeassistant.components.wake_word.* homeassistant.components.wake_word.*
homeassistant.components.wallbox.* homeassistant.components.wallbox.*

View File

@ -3,7 +3,7 @@
from dataclasses import dataclass from dataclasses import dataclass
from datetime import datetime, timedelta from datetime import datetime, timedelta
from json.decoder import JSONDecodeError from json.decoder import JSONDecodeError
from typing import Any from typing import Any, cast
from aiovodafone import VodafoneStationDevice, VodafoneStationSercommApi, exceptions from aiovodafone import VodafoneStationDevice, VodafoneStationSercommApi, exceptions
@ -164,7 +164,7 @@ class VodafoneStationRouter(DataUpdateCoordinator[UpdateCoordinatorDataType]):
@property @property
def serial_number(self) -> str: def serial_number(self) -> str:
"""Device serial number.""" """Device serial number."""
return self.data.sensors["sys_serial_number"] return cast(str, self.data.sensors["sys_serial_number"])
@property @property
def device_info(self) -> DeviceInfo: def device_info(self) -> DeviceInfo:

10
mypy.ini generated
View File

@ -5039,6 +5039,16 @@ disallow_untyped_defs = true
warn_return_any = true warn_return_any = true
warn_unreachable = true warn_unreachable = true
[mypy-homeassistant.components.vodafone_station.*]
check_untyped_defs = true
disallow_incomplete_defs = true
disallow_subclassing_any = true
disallow_untyped_calls = true
disallow_untyped_decorators = true
disallow_untyped_defs = true
warn_return_any = true
warn_unreachable = true
[mypy-homeassistant.components.wake_on_lan.*] [mypy-homeassistant.components.wake_on_lan.*]
check_untyped_defs = true check_untyped_defs = true
disallow_incomplete_defs = true disallow_incomplete_defs = true