From 022da718001d3af88f35822d07d2e4baf5f3ee99 Mon Sep 17 00:00:00 2001 From: Andre Basche Date: Mon, 8 May 2023 02:23:48 +0200 Subject: [PATCH] Fix none-type attributes --- pyhon/appliance.py | 4 +++- setup.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pyhon/appliance.py b/pyhon/appliance.py index 29e95f2..4c75100 100644 --- a/pyhon/appliance.py +++ b/pyhon/appliance.py @@ -7,6 +7,7 @@ from typing import TYPE_CHECKING from pyhon import helper, exceptions from pyhon.commands import HonCommand +from pyhon.parameter.base import HonParameter from pyhon.parameter.fixed import HonParameterFixed if TYPE_CHECKING: @@ -33,6 +34,7 @@ class HonAppliance: self._zone: int = zone self._additional_data: Dict[str, Any] = {} self._last_update = None + self._default_setting = HonParameter("", {}, "") try: self._extra = importlib.import_module( @@ -229,7 +231,7 @@ class HonAppliance: result = {} for name, command in self._commands.items(): for key in command.setting_keys: - setting = command.settings.get(key) + setting = command.settings.get(key, self._default_setting) result[f"{name}.{key}"] = setting if self._extra: return self._extra.settings(result) diff --git a/setup.py b/setup.py index b72ffe3..f02e547 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ with open("README.md", "r") as f: setup( name="pyhOn", - version="0.10.5", + version="0.10.6", author="Andre Basche", description="Control hOn devices with python", long_description=long_description,