forked from Andre0512/pyhOn
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Water Heater. Ability to send only mandatory parameters (Andre0512#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 <[email protected]>
- Loading branch information
1 parent
5a77837
commit 4f7d486
Showing
2 changed files
with
34 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters