mirror of
https://github.com/Andre0512/pyhOn.git
synced 2024-11-27 16:00:52 +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):
|
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 New Issue
Block a user