Skip to content

Commit 5476ee9

Browse files
committed
Open/Close threshold now 10%
More debug on open and close
1 parent a1b2593 commit 5476ee9

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

custom_components/zimi/cover.py

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -66,37 +66,39 @@ async def async_close_cover(self, **kwargs: Any) -> None:
6666
@property
6767
def current_cover_position(self) -> int | None:
6868
"""Return the current cover/door position."""
69-
_LOGGER.debug("current_cover_position(%d) for %s",
69+
_LOGGER.debug("current_cover_position() = %d for %s",
7070
self._entity.percentage, self.name)
7171
return self._entity.percentage
7272

7373
@property
7474
def is_closed(self) -> bool | None:
7575
"""Return true if cover is closed."""
76-
_LOGGER.debug("is_closed(%d) for %s",
77-
self._entity.percentage, self.name)
78-
return self._entity.is_closed
76+
result = self._entity.is_closed or self._entity.percentage < 10
77+
_LOGGER.debug("is_closed() = %d (%d) for %s",
78+
result, self._entity.percentage, self.name)
79+
return result
7980

8081
@property
8182
def is_closing(self) -> bool | None:
8283
"""Return true if cover is closing."""
83-
_LOGGER.debug("is_closing(%d) for %s",
84-
self._entity.percentage, self.name)
84+
_LOGGER.debug("is_closing() = %d (%d) for %s",
85+
self._entity.is_closing, self._entity.percentage, self.name)
8586
return self._entity.is_closing
8687

8788
@property
8889
def is_opening(self) -> bool | None:
8990
"""Return true if cover is opening."""
90-
_LOGGER.debug("is_opening(%d) for %s",
91-
self._entity.percentage, self.name)
91+
_LOGGER.debug("is_opening() = %d (%d) for %s",
92+
self._entity.is_opening, self._entity.percentage, self.name)
9293
return self._entity.is_opening
9394

9495
@property
9596
def is_open(self) -> bool | None:
9697
"""Return true if cover is open."""
97-
_LOGGER.debug("is_open(%d) for %s",
98-
self._entity.percentage, self.name)
99-
return self._entity.is_open
98+
result = self._entity.is_open or self._entity.percentage > 90
99+
_LOGGER.debug("is_open() = %d (%d) for %s",
100+
result, self._entity.percentage, self.name)
101+
return result
100102

101103
async def async_open_cover(self, **kwargs: Any) -> None:
102104
"""Open the cover/door."""

custom_components/zimi/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"codeowners": [
55
"@markhannon"
66
],
7-
"version": "2.0.2-dev3",
7+
"version": "2.0.2-dev4",
88
"config_flow": true,
99
"documentation": "https://www.home-assistant.io/integrations/zimi",
1010
"iot_class": "local_push",

0 commit comments

Comments
 (0)