mirror of
https://github.com/Andre0512/pyhOn.git
synced 2024-11-23 22:30:57 +01: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 New Issue
Block a user