Skip to content

Commit

Permalink
Improve set parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
Andre0512 committed May 15, 2023
1 parent 22a98e1 commit b5af81b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pyhon/appliance.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 2 additions & 0 deletions pyhon/parameter/enum.py
Original file line number Diff line number Diff line change
Expand Up @@ -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})"
Expand Down

0 comments on commit b5af81b

Please sign in to comment.