mirror of
https://github.com/Andre0512/pyhOn.git
synced 2025-05-22 02:45:10 -04:00
Add more type hints
This commit is contained in:
parent
ad0d065b03
commit
9eb99f283b
30 changed files with 392 additions and 243 deletions
|
@ -1,9 +1,11 @@
|
|||
from typing import Any, Dict
|
||||
|
||||
from pyhon.appliances.base import ApplianceBase
|
||||
from pyhon.parameter.fixed import HonParameterFixed
|
||||
|
||||
|
||||
class Appliance(ApplianceBase):
|
||||
def attributes(self, data):
|
||||
def attributes(self, data: Dict[str, Any]) -> Dict[str, Any]:
|
||||
data = super().attributes(data)
|
||||
if data.get("lastConnEvent", {}).get("category", "") == "DISCONNECTED":
|
||||
data["parameters"]["machMode"].value = "0"
|
||||
|
@ -11,7 +13,7 @@ class Appliance(ApplianceBase):
|
|||
data["pause"] = data["parameters"]["machMode"] == "3"
|
||||
return data
|
||||
|
||||
def settings(self, settings):
|
||||
def settings(self, settings: Dict[str, Any]) -> Dict[str, Any]:
|
||||
dry_level = settings.get("startProgram.dryLevel")
|
||||
if isinstance(dry_level, HonParameterFixed) and dry_level.value == "11":
|
||||
settings.pop("startProgram.dryLevel", None)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue