mirror of
https://github.com/Andre0512/pyhOn.git
synced 2026-06-24 16:51:51 +02:00
Handle mqtt connection events
This commit is contained in:
@@ -7,7 +7,7 @@ from pyhon.appliances.base import ApplianceBase
|
||||
class Appliance(ApplianceBase):
|
||||
def attributes(self, data: Dict[str, Any]) -> Dict[str, Any]:
|
||||
data = super().attributes(data)
|
||||
if data.get("lastConnEvent", {}).get("category", "") == "DISCONNECTED":
|
||||
if not self.parent.connection:
|
||||
data["parameters"]["machMode"].value = "0"
|
||||
data["active"] = bool(data.get("activity"))
|
||||
return data
|
||||
|
||||
Reference in New Issue
Block a user