Skip to content

Commit

Permalink
Small fix in velbus cover for the assumed states (#121656)
Browse files Browse the repository at this point in the history
  • Loading branch information
cereal2nd authored and frenck committed Jul 10, 2024
1 parent a4c5dee commit fd0c26c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions homeassistant/components/velbus/cover.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,16 @@ def is_closed(self) -> bool | None:
@property
def is_opening(self) -> bool:
"""Return if the cover is opening."""
return self._channel.is_opening()
if opening := self._channel.is_opening():
self._assumed_closed = False
return opening

@property
def is_closing(self) -> bool:
"""Return if the cover is closing."""
return self._channel.is_closing()
if closing := self._channel.is_closing():
self._assumed_closed = True
return closing

@property
def current_cover_position(self) -> int | None:
Expand All @@ -89,13 +93,11 @@ def current_cover_position(self) -> int | None:
async def async_open_cover(self, **kwargs: Any) -> None:
"""Open the cover."""
await self._channel.open()
self._assumed_closed = False

@api_call
async def async_close_cover(self, **kwargs: Any) -> None:
"""Close the cover."""
await self._channel.close()
self._assumed_closed = True

@api_call
async def async_stop_cover(self, **kwargs: Any) -> None:
Expand Down

0 comments on commit fd0c26c

Please sign in to comment.