Water Heater. Ability to send only mandatory parameters #14

Merged
VadymMelnychuk merged 11 commits from main into main 2023-07-18 21:26:11 +02:00
2 changed files with 3 additions and 3 deletions
Showing only changes of commit 7ac2908671 - Show all commits

View File

@ -7,4 +7,4 @@ class Appliance(ApplianceBase):
data = super().attributes(data) data = super().attributes(data)
data["active"] = data["parameters"]["onOffStatus"] == "1" data["active"] = data["parameters"]["onOffStatus"] == "1"
return data return data

View File

@ -75,14 +75,14 @@ class HonCommand:
for name, parameter in self._parameters.items(): for name, parameter in self._parameters.items():
result.setdefault(parameter.group, {})[name] = parameter.intern_value result.setdefault(parameter.group, {})[name] = parameter.intern_value
return result return result
@property @property
def mandatory_parameter_groups(self) -> Dict[str, Dict[str, Union[str, float]]]: def mandatory_parameter_groups(self) -> Dict[str, Dict[str, Union[str, float]]]:
result: Dict[str, Dict[str, Union[str, float]]] = {} result: Dict[str, Dict[str, Union[str, float]]] = {}
for name, parameter in self._parameters.items(): for name, parameter in self._parameters.items():
if parameter.mandatory: if parameter.mandatory:
result.setdefault(parameter.group, {})[name] = parameter.intern_value result.setdefault(parameter.group, {})[name] = parameter.intern_value
return result return result
@property @property
def parameter_value(self) -> Dict[str, Union[str, float]]: def parameter_value(self) -> Dict[str, Union[str, float]]: