From 6c3da96a03ec06e7960c7e67e2a1bac792a5fd99 Mon Sep 17 00:00:00 2001 From: Andre Basche Date: Wed, 22 Mar 2023 22:42:40 +0100 Subject: [PATCH] Fix not showing device active when running --- pyhon/appliances/td.py | 2 +- pyhon/appliances/wd.py | 2 +- pyhon/appliances/wm.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pyhon/appliances/td.py b/pyhon/appliances/td.py index 8664484..be2ce18 100644 --- a/pyhon/appliances/td.py +++ b/pyhon/appliances/td.py @@ -5,6 +5,6 @@ class Appliance: def get(self): if self._data["attributes"]["lastConnEvent"]["category"] == "DISCONNECTED": self._data["attributes"]["parameters"]["machMode"] = "0" - self._data["active"] = bool(self._data.get("activity")) + self._data["active"] = bool(self._data.get("attributes", {}).get("activity")) self._data["pause"] = self._data["attributes"]["parameters"]["machMode"] == "3" return self._data diff --git a/pyhon/appliances/wd.py b/pyhon/appliances/wd.py index 8664484..be2ce18 100644 --- a/pyhon/appliances/wd.py +++ b/pyhon/appliances/wd.py @@ -5,6 +5,6 @@ class Appliance: def get(self): if self._data["attributes"]["lastConnEvent"]["category"] == "DISCONNECTED": self._data["attributes"]["parameters"]["machMode"] = "0" - self._data["active"] = bool(self._data.get("activity")) + self._data["active"] = bool(self._data.get("attributes", {}).get("activity")) self._data["pause"] = self._data["attributes"]["parameters"]["machMode"] == "3" return self._data diff --git a/pyhon/appliances/wm.py b/pyhon/appliances/wm.py index 8664484..be2ce18 100644 --- a/pyhon/appliances/wm.py +++ b/pyhon/appliances/wm.py @@ -5,6 +5,6 @@ class Appliance: def get(self): if self._data["attributes"]["lastConnEvent"]["category"] == "DISCONNECTED": self._data["attributes"]["parameters"]["machMode"] = "0" - self._data["active"] = bool(self._data.get("activity")) + self._data["active"] = bool(self._data.get("attributes", {}).get("activity")) self._data["pause"] = self._data["attributes"]["parameters"]["machMode"] == "3" return self._data