mirror of
https://github.com/Andre0512/pyhOn.git
synced 2025-05-23 03:06:54 -04:00
Water Heater. Ability to send only mandatory parameters (#14)
* Added water heater appliance. Added ability to send only mandatory parameters * fixed build * formatting * cleanup * cleanup * reformatting * Added ability to send specific parameters. Useful in case the command has many not mandatory parameters and you want to send only one/few * cleanup * Fixed code style --------- Co-authored-by: Vadym Melnychuk <vme@primexm.com>
This commit is contained in:
parent
5a778373b6
commit
4f7d4860db
2 changed files with 34 additions and 2 deletions
11
pyhon/appliances/wh.py
Normal file
11
pyhon/appliances/wh.py
Normal file
|
@ -0,0 +1,11 @@
|
|||
from typing import Any, Dict
|
||||
|
||||
from pyhon.appliances.base import ApplianceBase
|
||||
|
||||
|
||||
class Appliance(ApplianceBase):
|
||||
def attributes(self, data: Dict[str, Any]) -> Dict[str, Any]:
|
||||
data = super().attributes(data)
|
||||
data["active"] = data["parameters"]["onOffStatus"] == "1"
|
||||
|
||||
return data
|
Loading…
Add table
Add a link
Reference in a new issue