Add Velbus cover opening/closing (#79851)

* Velbus cover/blind: indicate opening/closing

* Add docstrings because flake8 requirement

Co-authored-by: Niels Laukens <niels@dest-unreach.be>
pull/80994/head
niobos 2022-10-26 08:03:53 +02:00 committed by GitHub
parent 8b119ab5fc
commit 8e196fbe06
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 1 deletions

View File

@ -38,7 +38,7 @@ class VelbusCover(VelbusEntity, CoverEntity):
_channel: VelbusBlind
def __init__(self, channel: VelbusBlind) -> None:
"""Initialize the dimmer."""
"""Initialize the cover."""
super().__init__(channel)
if self._channel.support_position():
self._attr_supported_features = (
@ -59,6 +59,16 @@ class VelbusCover(VelbusEntity, CoverEntity):
"""Return if the cover is closed."""
return self._channel.is_closed()
@property
def is_opening(self) -> bool:
"""Return if the cover is opening."""
return self._channel.is_opening()
@property
def is_closing(self) -> bool:
"""Return if the cover is closing."""
return self._channel.is_closing()
@property
def current_cover_position(self) -> int | None:
"""Return current position of cover.