mirror of
https://github.com/tomaae/homeassistant-mikrotik_router.git
synced 2025-07-20 18:54:37 +02:00
Changed last seen to datetime to improve DB size usage #203
This commit is contained in:
parent
6b6a240412
commit
263b38b301
1 changed files with 0 additions and 11 deletions
|
@ -145,14 +145,3 @@ class MikrotikHostDeviceTracker(MikrotikDeviceTracker):
|
||||||
def state(self) -> str:
|
def state(self) -> str:
|
||||||
"""Return the state of the device."""
|
"""Return the state of the device."""
|
||||||
return self._ctrl.option_zone if self.is_connected else STATE_NOT_HOME
|
return self._ctrl.option_zone if self.is_connected else STATE_NOT_HOME
|
||||||
|
|
||||||
@property
|
|
||||||
def extra_state_attributes(self) -> Mapping[str, Any]:
|
|
||||||
"""Return the state attributes."""
|
|
||||||
attributes = super().extra_state_attributes
|
|
||||||
if self._data["last-seen"]:
|
|
||||||
attributes[format_attribute("last-seen")] = get_age(self._data["last-seen"])
|
|
||||||
else:
|
|
||||||
attributes[format_attribute("last-seen")] = "unknown"
|
|
||||||
|
|
||||||
return attributes
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue