mirror of
https://github.com/Andre0512/pyhOn.git
synced 2024-01-19 02:50:44 +00:00
Fix some dw bugs
This commit is contained in:
parent
d350d639cc
commit
2feb3295e1
|
@ -169,7 +169,7 @@ class HonAppliance:
|
||||||
category = category.split(".")[-1].lower()
|
category = category.split(".")[-1].lower()
|
||||||
categories[category] = result[0]
|
categories[category] = result[0]
|
||||||
if categories:
|
if categories:
|
||||||
return [list(categories.values())[0]]
|
return [list(categories.values())[-1]]
|
||||||
return []
|
return []
|
||||||
|
|
||||||
def _get_commands(self, data):
|
def _get_commands(self, data):
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
from typing import Optional, Dict, Any, List, TYPE_CHECKING, Union
|
from typing import Optional, Dict, Any, List, TYPE_CHECKING, Union
|
||||||
|
|
||||||
|
from pyhon import exceptions
|
||||||
from pyhon.parameter.base import HonParameter
|
from pyhon.parameter.base import HonParameter
|
||||||
from pyhon.parameter.enum import HonParameterEnum
|
from pyhon.parameter.enum import HonParameterEnum
|
||||||
from pyhon.parameter.fixed import HonParameterFixed
|
from pyhon.parameter.fixed import HonParameterFixed
|
||||||
|
@ -7,7 +8,7 @@ from pyhon.parameter.program import HonParameterProgram
|
||||||
from pyhon.parameter.range import HonParameterRange
|
from pyhon.parameter.range import HonParameterRange
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from pyhon import HonAPI, exceptions
|
from pyhon import HonAPI
|
||||||
from pyhon.appliance import HonAppliance
|
from pyhon.appliance import HonAppliance
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ class HonParameterRange(HonParameter):
|
||||||
@value.setter
|
@value.setter
|
||||||
def value(self, value: float) -> None:
|
def value(self, value: float) -> None:
|
||||||
value = str_to_float(value)
|
value = str_to_float(value)
|
||||||
if self._min <= value <= self._max and not value % self._step:
|
if self._min <= value <= self._max and not (value - self._min) % self._step:
|
||||||
self._value = value
|
self._value = value
|
||||||
else:
|
else:
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
|
|
Loading…
Reference in a new issue