Reverted back sync_command, send mandatory parameters beside with specified

This commit is contained in:
Vadym Melnychuk 2023-10-12 16:33:28 +03:00
parent 38363420f5
commit 1ebd83b70d
2 changed files with 5 additions and 1 deletions

View File

@ -307,6 +307,10 @@ class HonAppliance:
target.max = main.max target.max = main.max
target.min = main.min target.min = main.min
target.step = main.step target.step = main.step
elif isinstance(target, HonParameterRange):
target.max = int(main.value)
target.min = int(main.value)
target.step = 1
elif isinstance(target, HonParameterEnum): elif isinstance(target, HonParameterEnum):
target.values = main.values target.values = main.values
target.value = main.value target.value = main.value

View File

@ -132,7 +132,7 @@ class HonCommand:
async def send_specific(self, param_names: List[str]) -> bool: async def send_specific(self, param_names: List[str]) -> bool:
params: Dict[str, str | float] = {} params: Dict[str, str | float] = {}
for key, parameter in self._parameters.items(): for key, parameter in self._parameters.items():
if key in param_names: if key in param_names or parameter.mandatory:
params[key] = parameter.value params[key] = parameter.value
return await self.send_parameters(params) return await self.send_parameters(params)