mirror of
https://github.com/Andre0512/pyhOn.git
synced 2025-05-14 15:14:28 -04:00
Reduce complexity and line length for flake8
This commit is contained in:
parent
442e7a07dd
commit
e1c8bc5835
8 changed files with 89 additions and 77 deletions
|
@ -41,13 +41,15 @@ class HonParameterProgram(HonParameterEnum):
|
|||
|
||||
@property
|
||||
def ids(self) -> Dict[int, str]:
|
||||
values = {
|
||||
int(p.parameters["prCode"].value): n
|
||||
for i, (n, p) in enumerate(self._programs.items())
|
||||
if "iot_" not in n
|
||||
and p.parameters.get("prCode")
|
||||
and not ((fav := p.parameters.get("favourite")) and fav.value == "1")
|
||||
}
|
||||
values: Dict[int, str] = {}
|
||||
for name, parameter in self._programs.items():
|
||||
if "iot_" in name:
|
||||
continue
|
||||
if parameter.parameters.get("prCode"):
|
||||
continue
|
||||
if (fav := parameter.parameters.get("favourite")) and fav.value == "1":
|
||||
continue
|
||||
values[int(parameter.parameters["prCode"].value)] = name
|
||||
return dict(sorted(values.items()))
|
||||
|
||||
def set_value(self, value: str) -> None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue