Fix error in wh
This commit is contained in:
parent
27d974abba
commit
c71f8f17f5
1 changed files with 1 additions and 1 deletions
|
@ -7,7 +7,7 @@ from pyhon.parameter.base import HonParameter
|
||||||
class Appliance(ApplianceBase):
|
class Appliance(ApplianceBase):
|
||||||
def attributes(self, data: Dict[str, Any]) -> Dict[str, Any]:
|
def attributes(self, data: Dict[str, Any]) -> Dict[str, Any]:
|
||||||
data = super().attributes(data)
|
data = super().attributes(data)
|
||||||
parameter = data["parameters"]["onOffStatus"]
|
parameter = data.get("parameters", {}).get("onOffStatus")
|
||||||
is_class = isinstance(parameter, HonParameter)
|
is_class = isinstance(parameter, HonParameter)
|
||||||
data["active"] = parameter.value == 1 if is_class else parameter == 1
|
data["active"] = parameter.value == 1 if is_class else parameter == 1
|
||||||
return data
|
return data
|
||||||
|
|
Loading…
Reference in a new issue