mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Set AsusWRT mac_address and ip_address properties (#48764)
This commit is contained in:
parent
ab190f36ac
commit
5be1eacde9
@ -81,16 +81,23 @@ class AsusWrtDevice(ScannerEntity):
|
|||||||
@property
|
@property
|
||||||
def extra_state_attributes(self) -> dict[str, any]:
|
def extra_state_attributes(self) -> dict[str, any]:
|
||||||
"""Return the attributes."""
|
"""Return the attributes."""
|
||||||
attrs = {
|
attrs = {}
|
||||||
"mac": self._device.mac,
|
|
||||||
"ip_address": self._device.ip_address,
|
|
||||||
}
|
|
||||||
if self._device.last_activity:
|
if self._device.last_activity:
|
||||||
attrs["last_time_reachable"] = self._device.last_activity.isoformat(
|
attrs["last_time_reachable"] = self._device.last_activity.isoformat(
|
||||||
timespec="seconds"
|
timespec="seconds"
|
||||||
)
|
)
|
||||||
return attrs
|
return attrs
|
||||||
|
|
||||||
|
@property
|
||||||
|
def ip_address(self) -> str:
|
||||||
|
"""Return the primary ip address of the device."""
|
||||||
|
return self._device.ip_address
|
||||||
|
|
||||||
|
@property
|
||||||
|
def mac_address(self) -> str:
|
||||||
|
"""Return the mac address of the device."""
|
||||||
|
return self._device.mac
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_info(self) -> dict[str, any]:
|
def device_info(self) -> dict[str, any]:
|
||||||
"""Return the device information."""
|
"""Return the device information."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user