diff --git a/pyhon/appliance.py b/pyhon/appliance.py index 74f0b7c..64e18a5 100644 --- a/pyhon/appliance.py +++ b/pyhon/appliance.py @@ -169,7 +169,9 @@ def _get_categories(self, command, data): category = category.split(".")[-1].lower() categories[category] = result[0] if categories: - return [list(categories.values())[-1]] + if "setParameters" in categories: + return [categories["setParameters"]] + return [list(categories.values())[0]] return [] def _get_commands(self, data): diff --git a/pyhon/parameter/enum.py b/pyhon/parameter/enum.py index 02d01b4..66cfe7e 100644 --- a/pyhon/parameter/enum.py +++ b/pyhon/parameter/enum.py @@ -9,6 +9,8 @@ def __init__(self, key: str, attributes: Dict[str, Any], group: str) -> None: self._default = attributes.get("defaultValue") self._value = self._default or "0" 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: return f"{self.__class__} (<{self.key}> {self.values})"