Skip to content

Commit

Permalink
Fix integration not loading when the tilting entities not present
Browse files Browse the repository at this point in the history
  • Loading branch information
Sese-Schneider committed Mar 15, 2024
1 parent 43a09df commit 496e1e3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 5 additions & 1 deletion custom_components/cover_time_based/cover.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion custom_components/cover_time_based/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
"requirements": [
"xknx==0.9.4"
],
"version": "2.1.0"
"version": "2.1.1"
}

0 comments on commit 496e1e3

Please sign in to comment.