pyh0n/pyhon/appliances/wm.py
2023-03-22 22:42:40 +01:00

11 lines
446 B
Python

class Appliance:
def __init__(self, data):
self._data = data
def get(self):
if self._data["attributes"]["lastConnEvent"]["category"] == "DISCONNECTED":
self._data["attributes"]["parameters"]["machMode"] = "0"
self._data["active"] = bool(self._data.get("attributes", {}).get("activity"))
self._data["pause"] = self._data["attributes"]["parameters"]["machMode"] == "3"
return self._data