Add stop tilt support to KNX (#46947)

This commit is contained in:
Philip Allgaier 2021-02-23 16:34:02 +01:00 committed by GitHub
parent 3c35b6558b
commit 7a7147edcf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,6 +13,7 @@ from homeassistant.components.cover import (
SUPPORT_SET_POSITION, SUPPORT_SET_POSITION,
SUPPORT_SET_TILT_POSITION, SUPPORT_SET_TILT_POSITION,
SUPPORT_STOP, SUPPORT_STOP,
SUPPORT_STOP_TILT,
CoverEntity, CoverEntity,
) )
from homeassistant.core import callback from homeassistant.core import callback
@ -64,7 +65,10 @@ class KNXCover(KnxEntity, CoverEntity):
supported_features |= SUPPORT_STOP supported_features |= SUPPORT_STOP
if self._device.supports_angle: if self._device.supports_angle:
supported_features |= ( supported_features |= (
SUPPORT_SET_TILT_POSITION | SUPPORT_OPEN_TILT | SUPPORT_CLOSE_TILT SUPPORT_SET_TILT_POSITION
| SUPPORT_OPEN_TILT
| SUPPORT_CLOSE_TILT
| SUPPORT_STOP_TILT
) )
return supported_features return supported_features
@ -139,6 +143,11 @@ class KNXCover(KnxEntity, CoverEntity):
"""Close the cover tilt.""" """Close the cover tilt."""
await self._device.set_short_down() await self._device.set_short_down()
async def async_stop_cover_tilt(self, **kwargs):
"""Stop the cover tilt."""
await self._device.stop()
self.stop_auto_updater()
def start_auto_updater(self): def start_auto_updater(self):
"""Start the autoupdater to update Home Assistant while cover is moving.""" """Start the autoupdater to update Home Assistant while cover is moving."""
if self._unsubscribe_auto_updater is None: if self._unsubscribe_auto_updater is None: