From 40cc0013a51698d8a0f51b401f77e2244cedcddc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20=C3=81ngel?= Date: Sun, 16 Apr 2023 11:36:10 +0200 Subject: [PATCH] Override Oven attributes when is disconnected --- pyhon/appliances/ov.py | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/pyhon/appliances/ov.py b/pyhon/appliances/ov.py index 96962cf..75c9a31 100644 --- a/pyhon/appliances/ov.py +++ b/pyhon/appliances/ov.py @@ -1,22 +1,15 @@ -from pyhon.parameter import HonParameterEnum - - 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): if data["attributes"]["lastConnEvent"]["category"] == "DISCONNECTED": - data["attributes"]["activity"]["attributes"]["temp"] = "0" - data["attributes"]["activity"]["attributes"]["onOffStatus"] = "0" - data["attributes"]["activity"]["attributes"]["remoteCtrValid"] = "0" - data["attributes"]["activity"]["attributes"]["remainingTimeMM"] = "0" + data["attributes"]["parameters"]["temp"] = "0" + data["attributes"]["parameters"]["onOffStatus"] = "0" + data["attributes"]["parameters"]["remoteCtrValid"] = "0" + data["attributes"]["parameters"]["remainingTimeMM"] = "0" + + data["active"] = data["attributes"]["parameters"]["onOffStatus"] == "1" return data def settings(self, settings): - settings["program_filter"] = self._program_filter - settings["startProgram.program"].filter = self._program_filter.value return settings