Override Oven attributes when is disconnected
This commit is contained in:
parent
f2aa3dc8fd
commit
40cc0013a5
@ -1,22 +1,15 @@
|
|||||||
from pyhon.parameter import HonParameterEnum
|
|
||||||
|
|
||||||
|
|
||||||
class Appliance:
|
class Appliance:
|
||||||
def __init__(self):
|
|
||||||
filters = ["receipt", "standard, special"]
|
|
||||||
data = {'defaultValue': filters[0], 'enumValues': filters}
|
|
||||||
self._program_filter = HonParameterEnum("program_filter", data)
|
|
||||||
|
|
||||||
def data(self, data):
|
def data(self, data):
|
||||||
if data["attributes"]["lastConnEvent"]["category"] == "DISCONNECTED":
|
if data["attributes"]["lastConnEvent"]["category"] == "DISCONNECTED":
|
||||||
data["attributes"]["activity"]["attributes"]["temp"] = "0"
|
data["attributes"]["parameters"]["temp"] = "0"
|
||||||
data["attributes"]["activity"]["attributes"]["onOffStatus"] = "0"
|
data["attributes"]["parameters"]["onOffStatus"] = "0"
|
||||||
data["attributes"]["activity"]["attributes"]["remoteCtrValid"] = "0"
|
data["attributes"]["parameters"]["remoteCtrValid"] = "0"
|
||||||
data["attributes"]["activity"]["attributes"]["remainingTimeMM"] = "0"
|
data["attributes"]["parameters"]["remainingTimeMM"] = "0"
|
||||||
|
|
||||||
|
data["active"] = data["attributes"]["parameters"]["onOffStatus"] == "1"
|
||||||
|
|
||||||
return data
|
return data
|
||||||
|
|
||||||
def settings(self, settings):
|
def settings(self, settings):
|
||||||
settings["program_filter"] = self._program_filter
|
|
||||||
settings["startProgram.program"].filter = self._program_filter.value
|
|
||||||
return settings
|
return settings
|
||||||
|
Loading…
Reference in New Issue
Block a user