From b62007fe409a441ec9e19c088f8531cb7ecedad1 Mon Sep 17 00:00:00 2001 From: optiluca Date: Mon, 6 May 2024 09:00:51 +0200 Subject: [PATCH] Fixed cover position handling (#77) Fixed position=None handling (was causing closed covers to be misreported as open) --- custom_components/comelit/cover.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/custom_components/comelit/cover.py b/custom_components/comelit/cover.py index 4a6b732..e609cde 100644 --- a/custom_components/comelit/cover.py +++ b/custom_components/comelit/cover.py @@ -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}")