From 1ebd83b70d8520f6efe3004ff893ec701465bee2 Mon Sep 17 00:00:00 2001 From: Vadym Melnychuk Date: Thu, 12 Oct 2023 16:33:28 +0300 Subject: [PATCH] Reverted back sync_command, send mandatory parameters beside with specified --- pyhon/appliance.py | 4 ++++ pyhon/commands.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/pyhon/appliance.py b/pyhon/appliance.py index a75bfcd..4a2d07c 100644 --- a/pyhon/appliance.py +++ b/pyhon/appliance.py @@ -307,6 +307,10 @@ class HonAppliance: target.max = main.max target.min = main.min 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): target.values = main.values target.value = main.value diff --git a/pyhon/commands.py b/pyhon/commands.py index 68df63a..8c0275a 100644 --- a/pyhon/commands.py +++ b/pyhon/commands.py @@ -132,7 +132,7 @@ class HonCommand: async def send_specific(self, param_names: List[str]) -> bool: params: Dict[str, str | float] = {} for key, parameter in self._parameters.items(): - if key in param_names: + if key in param_names or parameter.mandatory: params[key] = parameter.value return await self.send_parameters(params)