mirror of
https://github.com/Andre0512/pyhOn.git
synced 2024-01-19 02:50:44 +00:00
Merge pull request #5 from alexandre-leites/main
Fixing Support for H-WASHER 500
This commit is contained in:
commit
241ee95d5c
|
@ -67,5 +67,5 @@ class HonCommand:
|
|||
@property
|
||||
def settings(self):
|
||||
"""Parameters with typology enum and range"""
|
||||
return {s: self._parameters[s] for s in self.setting_keys}
|
||||
return {s: self._parameters.get(s) for s in self.setting_keys if self._parameters.get(s) is not None}
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import importlib
|
||||
|
||||
from pyhon.commands import HonCommand
|
||||
from pyhon.parameter import HonParameterFixed
|
||||
|
||||
|
||||
class HonDevice:
|
||||
|
@ -93,7 +94,7 @@ class HonDevice:
|
|||
command.set_program(parameters.pop("program").split(".")[-1].lower())
|
||||
command = self.commands[name]
|
||||
for key, data in command.settings.items():
|
||||
if parameters.get(key) is not None:
|
||||
if not isinstance(data, HonParameterFixed) and parameters.get(key) is not None:
|
||||
data.value = parameters.get(key)
|
||||
|
||||
async def load_commands(self):
|
||||
|
|
|
@ -75,6 +75,7 @@ class HonParameterRange(HonParameter):
|
|||
|
||||
@value.setter
|
||||
def value(self, value):
|
||||
value = int(value)
|
||||
if self._min <= value <= self._max and not value % self._step:
|
||||
self._value = value
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue