Improve type hints in device tracker implementations (#121585)
parent
9ca398ef82
commit
ba0cd595ff
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue