mirror of
https://github.com/Andre0512/pyhOn.git
synced 2024-12-22 18:55:32 +00:00
Fix typeerror hon#77
This commit is contained in:
parent
310d1bafd7
commit
55966dd52f
|
@ -4,7 +4,7 @@ from pyhon.appliances.base import ApplianceBase
|
||||||
class Appliance(ApplianceBase):
|
class Appliance(ApplianceBase):
|
||||||
def attributes(self, data):
|
def attributes(self, data):
|
||||||
data = super().attributes(data)
|
data = super().attributes(data)
|
||||||
if data["lastConnEvent"]["category"] == "DISCONNECTED":
|
if data.get("lastConnEvent", {}).get("category", "") == "DISCONNECTED":
|
||||||
data["parameters"]["machMode"] = "0"
|
data["parameters"]["machMode"] = "0"
|
||||||
data["active"] = bool(data.get("activity"))
|
data["active"] = bool(data.get("activity"))
|
||||||
return data
|
return data
|
||||||
|
|
|
@ -4,7 +4,7 @@ from pyhon.appliances.base import ApplianceBase
|
||||||
class Appliance(ApplianceBase):
|
class Appliance(ApplianceBase):
|
||||||
def attributes(self, data):
|
def attributes(self, data):
|
||||||
data = super().attributes(data)
|
data = super().attributes(data)
|
||||||
if data["lastConnEvent"]["category"] == "DISCONNECTED":
|
if data.get("lastConnEvent", {}).get("category", "") == "DISCONNECTED":
|
||||||
data["parameters"]["temp"] = "0"
|
data["parameters"]["temp"] = "0"
|
||||||
data["parameters"]["onOffStatus"] = "0"
|
data["parameters"]["onOffStatus"] = "0"
|
||||||
data["parameters"]["remoteCtrValid"] = "0"
|
data["parameters"]["remoteCtrValid"] = "0"
|
||||||
|
|
|
@ -5,7 +5,7 @@ from pyhon.parameter.fixed import HonParameterFixed
|
||||||
class Appliance(ApplianceBase):
|
class Appliance(ApplianceBase):
|
||||||
def attributes(self, data):
|
def attributes(self, data):
|
||||||
data = super().attributes(data)
|
data = super().attributes(data)
|
||||||
if data["lastConnEvent"]["category"] == "DISCONNECTED":
|
if data.get("lastConnEvent", {}).get("category", "") == "DISCONNECTED":
|
||||||
data["parameters"]["machMode"] = "0"
|
data["parameters"]["machMode"] = "0"
|
||||||
data["active"] = bool(data.get("activity"))
|
data["active"] = bool(data.get("activity"))
|
||||||
data["pause"] = data["parameters"]["machMode"] == "3"
|
data["pause"] = data["parameters"]["machMode"] == "3"
|
||||||
|
|
|
@ -4,7 +4,7 @@ from pyhon.appliances.base import ApplianceBase
|
||||||
class Appliance(ApplianceBase):
|
class Appliance(ApplianceBase):
|
||||||
def attributes(self, data):
|
def attributes(self, data):
|
||||||
data = super().attributes(data)
|
data = super().attributes(data)
|
||||||
if data["lastConnEvent"]["category"] == "DISCONNECTED":
|
if data.get("lastConnEvent", {}).get("category", "") == "DISCONNECTED":
|
||||||
data["parameters"]["machMode"] = "0"
|
data["parameters"]["machMode"] = "0"
|
||||||
data["active"] = bool(data.get("activity"))
|
data["active"] = bool(data.get("activity"))
|
||||||
data["pause"] = data["parameters"]["machMode"] == "3"
|
data["pause"] = data["parameters"]["machMode"] == "3"
|
||||||
|
|
|
@ -4,7 +4,7 @@ from pyhon.appliances.base import ApplianceBase
|
||||||
class Appliance(ApplianceBase):
|
class Appliance(ApplianceBase):
|
||||||
def attributes(self, data):
|
def attributes(self, data):
|
||||||
data = super().attributes(data)
|
data = super().attributes(data)
|
||||||
if data["lastConnEvent"]["category"] == "DISCONNECTED":
|
if data.get("lastConnEvent", {}).get("category", "") == "DISCONNECTED":
|
||||||
data["parameters"]["machMode"] = "0"
|
data["parameters"]["machMode"] = "0"
|
||||||
data["active"] = bool(data.get("activity"))
|
data["active"] = bool(data.get("activity"))
|
||||||
data["pause"] = data["parameters"]["machMode"] == "3"
|
data["pause"] = data["parameters"]["machMode"] == "3"
|
||||||
|
|
Loading…
Reference in a new issue