mirror of
https://github.com/Andre0512/pyhOn.git
synced 2024-12-22 10:45:31 +00:00
Fix error in wh
This commit is contained in:
parent
27d974abba
commit
c71f8f17f5
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue