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
|
@property
|
||||||
def settings(self):
|
def settings(self):
|
||||||
"""Parameters with typology enum and range"""
|
"""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
|
import importlib
|
||||||
|
|
||||||
from pyhon.commands import HonCommand
|
from pyhon.commands import HonCommand
|
||||||
|
from pyhon.parameter import HonParameterFixed
|
||||||
|
|
||||||
|
|
||||||
class HonDevice:
|
class HonDevice:
|
||||||
@ -93,7 +94,7 @@ class HonDevice:
|
|||||||
command.set_program(parameters.pop("program").split(".")[-1].lower())
|
command.set_program(parameters.pop("program").split(".")[-1].lower())
|
||||||
command = self.commands[name]
|
command = self.commands[name]
|
||||||
for key, data in command.settings.items():
|
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)
|
data.value = parameters.get(key)
|
||||||
|
|
||||||
async def load_commands(self):
|
async def load_commands(self):
|
||||||
|
@ -75,6 +75,7 @@ class HonParameterRange(HonParameter):
|
|||||||
|
|
||||||
@value.setter
|
@value.setter
|
||||||
def value(self, value):
|
def value(self, value):
|
||||||
|
value = int(value)
|
||||||
if self._min <= value <= self._max and not value % self._step:
|
if self._min <= value <= self._max and not value % self._step:
|
||||||
self._value = value
|
self._value = value
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user