diff --git a/.strict-typing b/.strict-typing index 8fc41dea4ed..765f429e5e3 100644 --- a/.strict-typing +++ b/.strict-typing @@ -78,6 +78,7 @@ homeassistant.components.aprs.* homeassistant.components.aqualogic.* homeassistant.components.aquostv.* homeassistant.components.aranet.* +homeassistant.components.arris_tg2492lg.* homeassistant.components.aruba.* homeassistant.components.aseko_pool_live.* homeassistant.components.assist_pipeline.* diff --git a/homeassistant/components/arris_tg2492lg/device_tracker.py b/homeassistant/components/arris_tg2492lg/device_tracker.py index 48b8d9f13c4..bb917af5c39 100644 --- a/homeassistant/components/arris_tg2492lg/device_tracker.py +++ b/homeassistant/components/arris_tg2492lg/device_tracker.py @@ -40,13 +40,13 @@ class ArrisDeviceScanner(DeviceScanner): self.connect_box = connect_box self.last_results: list[Device] = [] - def scan_devices(self): + def scan_devices(self) -> list[str]: """Scan for new devices and return a list with found device IDs.""" self._update_info() - return [device.mac for device in self.last_results] + return [device.mac for device in self.last_results if device.mac] - def get_device_name(self, device): + def get_device_name(self, device: str) -> str | None: """Return the name of the given device or None if we don't know.""" name = next( (result.hostname for result in self.last_results if result.mac == device), @@ -54,12 +54,12 @@ class ArrisDeviceScanner(DeviceScanner): ) return name - def _update_info(self): + def _update_info(self) -> None: """Ensure the information from the Arris TG2492LG router is up to date.""" result = self.connect_box.get_connected_devices() - last_results = [] - mac_addresses = set() + last_results: list[Device] = [] + mac_addresses: set[str | None] = set() for device in result: if device.online and device.mac not in mac_addresses: diff --git a/mypy.ini b/mypy.ini index 70949e36ef6..1c8158066ce 100644 --- a/mypy.ini +++ b/mypy.ini @@ -540,6 +540,16 @@ disallow_untyped_defs = true warn_return_any = true warn_unreachable = true +[mypy-homeassistant.components.arris_tg2492lg.*] +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.aruba.*] check_untyped_defs = true disallow_incomplete_defs = true