mirror of
https://github.com/Andre0512/pyhOn.git
synced 2025-05-21 18:35:20 -04:00
Add oven and program filter
This commit is contained in:
parent
6d40e73881
commit
36079c3c77
7 changed files with 59 additions and 28 deletions
|
@ -1,10 +1,10 @@
|
|||
class Appliance:
|
||||
def __init__(self, data):
|
||||
self._data = data
|
||||
def data(self, data):
|
||||
if data["attributes"]["lastConnEvent"]["category"] == "DISCONNECTED":
|
||||
data["attributes"]["parameters"]["machMode"] = "0"
|
||||
data["active"] = bool(data.get("attributes", {}).get("activity"))
|
||||
data["pause"] = data["attributes"]["parameters"]["machMode"] == "3"
|
||||
return 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
|
||||
def settings(self, settings):
|
||||
return settings
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue