mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 09:17:10 +00:00
Fix and add some ScannerEntity property type hints (#49500)
This commit is contained in:
parent
ccda903c17
commit
1c587d2e47
@ -134,29 +134,29 @@ class ScannerEntity(BaseTrackerEntity):
|
|||||||
"""Base class for a tracked device that is on a scanned network."""
|
"""Base class for a tracked device that is on a scanned network."""
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def ip_address(self) -> str:
|
def ip_address(self) -> str | None:
|
||||||
"""Return the primary ip address of the device."""
|
"""Return the primary ip address of the device."""
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def mac_address(self) -> str:
|
def mac_address(self) -> str | None:
|
||||||
"""Return the mac address of the device."""
|
"""Return the mac address of the device."""
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def hostname(self) -> str:
|
def hostname(self) -> str | None:
|
||||||
"""Return hostname of the device."""
|
"""Return hostname of the device."""
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def state(self):
|
def state(self) -> str:
|
||||||
"""Return the state of the device."""
|
"""Return the state of the device."""
|
||||||
if self.is_connected:
|
if self.is_connected:
|
||||||
return STATE_HOME
|
return STATE_HOME
|
||||||
return STATE_NOT_HOME
|
return STATE_NOT_HOME
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def is_connected(self):
|
def is_connected(self) -> bool:
|
||||||
"""Return true if the device is connected to the network."""
|
"""Return true if the device is connected to the network."""
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user