From c71f8f17f566833586d540fd8a730a5280296453 Mon Sep 17 00:00:00 2001 From: Andre Basche Date: Mon, 20 Nov 2023 17:50:28 +0100 Subject: [PATCH] Fix error in wh --- pyhon/appliances/wh.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyhon/appliances/wh.py b/pyhon/appliances/wh.py index 7e92ca8..08033d4 100644 --- a/pyhon/appliances/wh.py +++ b/pyhon/appliances/wh.py @@ -7,7 +7,7 @@ from pyhon.parameter.base import HonParameter class Appliance(ApplianceBase): def attributes(self, data: Dict[str, Any]) -> Dict[str, Any]: data = super().attributes(data) - parameter = data["parameters"]["onOffStatus"] + parameter = data.get("parameters", {}).get("onOffStatus") is_class = isinstance(parameter, HonParameter) data["active"] = parameter.value == 1 if is_class else parameter == 1 return data