mirror of
https://github.com/Andre0512/pyhOn.git
synced 2024-11-28 00:10:50 +01:00
Fix disappearing programs
This commit is contained in:
parent
04f19c4609
commit
411effd814
@ -1,4 +1,4 @@
|
|||||||
from typing import List, TYPE_CHECKING
|
from typing import List, TYPE_CHECKING, Dict
|
||||||
|
|
||||||
from pyhon.parameter.enum import HonParameterEnum
|
from pyhon.parameter.enum import HonParameterEnum
|
||||||
|
|
||||||
@ -13,7 +13,7 @@ class HonParameterProgram(HonParameterEnum):
|
|||||||
super().__init__(key, {})
|
super().__init__(key, {})
|
||||||
self._command = command
|
self._command = command
|
||||||
self._value: str = command.program
|
self._value: str = command.program
|
||||||
self._values: List[str] = list(command.programs)
|
self._programs: Dict[str, "HonCommand"] = command.programs
|
||||||
self._typology: str = "enum"
|
self._typology: str = "enum"
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -25,9 +25,9 @@ class HonParameterProgram(HonParameterEnum):
|
|||||||
if value in self.values:
|
if value in self.values:
|
||||||
self._command.program = value
|
self._command.program = value
|
||||||
else:
|
else:
|
||||||
raise ValueError(f"Allowed values {self._values}")
|
raise ValueError(f"Allowed values {self.values}")
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def values(self) -> List[str]:
|
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)
|
return sorted(values)
|
||||||
|
2
setup.py
2
setup.py
@ -7,7 +7,7 @@ with open("README.md", "r") as f:
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="pyhOn",
|
name="pyhOn",
|
||||||
version="0.8.0b6",
|
version="0.8.0b7",
|
||||||
author="Andre Basche",
|
author="Andre Basche",
|
||||||
description="Control hOn devices with python",
|
description="Control hOn devices with python",
|
||||||
long_description=long_description,
|
long_description=long_description,
|
||||||
|
Loading…
Reference in New Issue
Block a user