pyh0n/pyhon/appliances/ref.py

26 lines
832 B
Python
Raw Normal View History

2023-06-28 22:32:11 +05:30
from typing import Dict, Any
2023-05-29 22:28:50 +05:30
from pyhon.appliances.base import ApplianceBase
2023-05-28 09:47:43 +05:30
2023-05-29 22:28:50 +05:30
class Appliance(ApplianceBase):
2023-06-28 22:32:11 +05:30
def attributes(self, data: Dict[str, Any]) -> Dict[str, Any]:
2023-06-08 23:20:56 +05:30
data = super().attributes(data)
if data["parameters"]["holidayMode"] == "1":
2023-05-28 09:47:43 +05:30
data["modeZ1"] = "holiday"
2023-06-08 23:20:56 +05:30
elif data["parameters"]["intelligenceMode"] == "1":
2023-05-28 09:47:43 +05:30
data["modeZ1"] = "auto_set"
2023-06-08 23:20:56 +05:30
elif data["parameters"]["quickModeZ1"] == "1":
2023-05-28 09:47:43 +05:30
data["modeZ1"] = "super_cool"
else:
data["modeZ1"] = "no_mode"
2023-06-08 23:20:56 +05:30
if data["parameters"]["quickModeZ2"] == "1":
2023-05-28 09:47:43 +05:30
data["modeZ2"] = "super_freeze"
2023-06-08 23:20:56 +05:30
elif data["parameters"]["intelligenceMode"] == "1":
2023-05-28 09:47:43 +05:30
data["modeZ2"] = "auto_set"
else:
data["modeZ2"] = "no_mode"
return data