diff --git a/CHANGELOG.md b/CHANGELOG.md index 3bf702e..78e2d8d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 2.1.1 (2024-03-15) + +### Bug Fixes + +- Fix an issue where the integration would not load when the tilting entities were not present + ## 2.1.0 (2024-03-14) ### Features diff --git a/custom_components/cover_time_based/cover.py b/custom_components/cover_time_based/cover.py index 105b8d1..ebb6999 100644 --- a/custom_components/cover_time_based/cover.py +++ b/custom_components/cover_time_based/cover.py @@ -110,6 +110,7 @@ def devices_from_config(domain_config): open_switch_entity_id = config.pop(CONF_OPEN_SWITCH_ENTITY_ID) close_switch_entity_id = config.pop(CONF_CLOSE_SWITCH_ENTITY_ID) stop_switch_entity_id = config.pop(CONF_STOP_SWITCH_ENTITY_ID) + device = CoverTimeBased( device_id, name, @@ -252,7 +253,9 @@ def current_cover_position(self) -> int | None: @property def current_cover_tilt_position(self) -> int | None: """Return the current tilt of the cover.""" - return self.tilt_calc.current_position() + if self._has_tilt_support(): + return self.tilt_calc.current_position() + return None @property def is_opening(self): @@ -442,6 +445,7 @@ def position_reached(self): def _has_tilt_support(self): """Return if cover has tilt support.""" + return self._tilting_time_down is not None and self._tilting_time_up is not None def _update_tilt_before_travel(self, command): diff --git a/custom_components/cover_time_based/manifest.json b/custom_components/cover_time_based/manifest.json index 03e5362..3b4ad4c 100644 --- a/custom_components/cover_time_based/manifest.json +++ b/custom_components/cover_time_based/manifest.json @@ -9,5 +9,5 @@ "requirements": [ "xknx==0.9.4" ], - "version": "2.1.0" + "version": "2.1.1" }