From 263b38b3013e8b217c0726c8013ee4727b13d872 Mon Sep 17 00:00:00 2001 From: Tomaae <23486452+tomaae@users.noreply.github.com> Date: Thu, 26 May 2022 10:00:02 +0200 Subject: [PATCH] Changed last seen to datetime to improve DB size usage #203 --- custom_components/mikrotik_router/device_tracker.py | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/custom_components/mikrotik_router/device_tracker.py b/custom_components/mikrotik_router/device_tracker.py index b2cd055..4e3fe0f 100644 --- a/custom_components/mikrotik_router/device_tracker.py +++ b/custom_components/mikrotik_router/device_tracker.py @@ -145,14 +145,3 @@ class MikrotikHostDeviceTracker(MikrotikDeviceTracker): def state(self) -> str: """Return the state of the device.""" 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