mirror of
https://github.com/Andre0512/pyhOn.git
synced 2024-01-19 02:50:44 +00:00
Improve set parameters
This commit is contained in:
parent
22a98e1781
commit
b5af81b744
|
@ -169,7 +169,9 @@ 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())[-1]]
|
if "setParameters" in categories:
|
||||||
|
return [categories["setParameters"]]
|
||||||
|
return [list(categories.values())[0]]
|
||||||
return []
|
return []
|
||||||
|
|
||||||
def _get_commands(self, data):
|
def _get_commands(self, data):
|
||||||
|
|
|
@ -9,6 +9,8 @@ class HonParameterEnum(HonParameter):
|
||||||
self._default = attributes.get("defaultValue")
|
self._default = attributes.get("defaultValue")
|
||||||
self._value = self._default or "0"
|
self._value = self._default or "0"
|
||||||
self._values: List[str] = attributes.get("enumValues", [])
|
self._values: List[str] = attributes.get("enumValues", [])
|
||||||
|
if self._default and self._default not in self._values:
|
||||||
|
self._values.append(self._default)
|
||||||
|
|
||||||
def __repr__(self) -> str:
|
def __repr__(self) -> str:
|
||||||
return f"{self.__class__} (<{self.key}> {self.values})"
|
return f"{self.__class__} (<{self.key}> {self.values})"
|
||||||
|
|
Loading…
Reference in a new issue