Skip to content

Commit

Permalink
Fixed cover position handling (#77)
Browse files Browse the repository at this point in the history
Fixed position=None handling (was causing closed covers to be misreported as open)
  • Loading branch information
optiluca authored May 6, 2024
1 parent 40af6ab commit b62007f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions custom_components/comelit/cover.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ def is_closing(self):

@property
def current_cover_position(self): # -> int | None:
if self._position: # if not None:
return 100 - self._position
if self._position is None:
return None
else:
return self._position
return 100 - self._position

def set_cover_position(self, position, **kwargs):
_LOGGER.debug(f"Trying to SET POSITION {position} cover {self.name}! _state={self._state}")
Expand Down

0 comments on commit b62007f

Please # to comment.