mirror of
https://github.com/Andre0512/pyhOn.git
synced 2024-11-28 00:10:50 +01:00
Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
c0aab8b99d
@ -62,11 +62,10 @@ class HonCommand:
|
||||
return self._ancillary_parameters
|
||||
|
||||
async def send(self) -> bool:
|
||||
parameters = {
|
||||
name: parameter.value for name, parameter in self._parameters.items()
|
||||
}
|
||||
params = {k: v.value for k, v in self._parameters.items()}
|
||||
ancillary_params = {k: v.value for k, v in self._ancillary_parameters.items()}
|
||||
return await self._api.send_command(
|
||||
self._appliance, self._name, parameters, self.ancillary_parameters
|
||||
self._appliance, self._name, params, ancillary_params
|
||||
)
|
||||
|
||||
@property
|
||||
|
@ -1,4 +1,4 @@
|
||||
from typing import List, TYPE_CHECKING
|
||||
from typing import List, TYPE_CHECKING, Dict
|
||||
|
||||
from pyhon.parameter.enum import HonParameterEnum
|
||||
|
||||
@ -13,7 +13,7 @@ class HonParameterProgram(HonParameterEnum):
|
||||
super().__init__(key, {})
|
||||
self._command = command
|
||||
self._value: str = command.program
|
||||
self._values: List[str] = list(command.programs)
|
||||
self._programs: Dict[str, "HonCommand"] = command.programs
|
||||
self._typology: str = "enum"
|
||||
|
||||
@property
|
||||
@ -25,9 +25,9 @@ class HonParameterProgram(HonParameterEnum):
|
||||
if value in self.values:
|
||||
self._command.program = value
|
||||
else:
|
||||
raise ValueError(f"Allowed values {self._values}")
|
||||
raise ValueError(f"Allowed values {self.values}")
|
||||
|
||||
@property
|
||||
def values(self) -> List[str]:
|
||||
values = [v for v in self._values if all(f not in v for f in self._FILTER)]
|
||||
values = [v for v in self._programs if all(f not in v for f in self._FILTER)]
|
||||
return sorted(values)
|
||||
|
Loading…
Reference in New Issue
Block a user