Improve type hints in device tracker implementations (#121585)

pull/121594/head
epenet 2024-07-09 12:06:49 +02:00 committed by GitHub
parent 9ca398ef82
commit ba0cd595ff
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 3 deletions

View File

@ -54,7 +54,7 @@ class CiscoDeviceScanner(DeviceScanner):
self.success_init = self._update_info()
_LOGGER.info("Initialized cisco_ios scanner")
def get_device_name(self, device):
async def async_get_device_name(self, device: str) -> str | None:
"""Get the firmware doesn't save the name of the wireless device."""
return None

View File

@ -128,7 +128,7 @@ class SnmpScanner(DeviceScanner):
await self._async_update_info()
return [client["mac"] for client in self.last_results if client.get("mac")]
async def async_get_device_name(self, device):
async def async_get_device_name(self, device: str) -> str | None:
"""Return the name of the given device or None if we don't know."""
# We have no names
return None

View File

@ -71,7 +71,7 @@ class XiaomiMiioDeviceScanner(DeviceScanner):
return [device["mac"] for device in station_info.associated_stations]
async def async_get_device_name(self, device):
async def async_get_device_name(self, device: str) -> str | None:
"""Return None.
The repeater doesn't provide the name of the associated device.