Skip to content

Commit

Permalink
corrected covers
Browse files Browse the repository at this point in the history
  • Loading branch information
grimmpp committed Mar 27, 2024
1 parent 07316b3 commit ab6f977
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions custom_components/eltako/cover.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,8 @@ def value_changed(self, msg):
# the initial position.
if self._attr_current_cover_position is None:
self._attr_current_cover_position = 0
else:
self._attr_current_cover_position = min(self._attr_current_cover_position + int(time_in_seconds / self._time_opens * 100.0), 100)

self._attr_current_cover_position = min(self._attr_current_cover_position + int(time_in_seconds / self._time_opens * 100.0), 100)
self._attr_is_opening = True
self._attr_is_closing = False
self._attr_is_closed = None
Expand All @@ -281,8 +281,8 @@ def value_changed(self, msg):
# the initial position.
if self._attr_current_cover_position is None:
self._attr_current_cover_position = 100
else:
self._attr_current_cover_position = max(self._attr_current_cover_position - int(time_in_seconds / self._time_closes * 100.0), 0)

self._attr_current_cover_position = max(self._attr_current_cover_position - int(time_in_seconds / self._time_closes * 100.0), 0)
self._attr_is_opening = False
self._attr_is_closing = True
self._attr_is_closed = None
Expand Down

0 comments on commit ab6f977

Please sign in to comment.