mirror of
https://github.com/home-assistant/core.git
synced 2025-07-10 06:47:09 +00:00
Add open/close tilt support to KNX cover (#46583)
This commit is contained in:
parent
194c0d2b08
commit
6bb848455f
@ -7,7 +7,9 @@ from homeassistant.components.cover import (
|
|||||||
DEVICE_CLASS_BLIND,
|
DEVICE_CLASS_BLIND,
|
||||||
DEVICE_CLASSES,
|
DEVICE_CLASSES,
|
||||||
SUPPORT_CLOSE,
|
SUPPORT_CLOSE,
|
||||||
|
SUPPORT_CLOSE_TILT,
|
||||||
SUPPORT_OPEN,
|
SUPPORT_OPEN,
|
||||||
|
SUPPORT_OPEN_TILT,
|
||||||
SUPPORT_SET_POSITION,
|
SUPPORT_SET_POSITION,
|
||||||
SUPPORT_SET_TILT_POSITION,
|
SUPPORT_SET_TILT_POSITION,
|
||||||
SUPPORT_STOP,
|
SUPPORT_STOP,
|
||||||
@ -61,7 +63,9 @@ class KNXCover(KnxEntity, CoverEntity):
|
|||||||
if self._device.supports_stop:
|
if self._device.supports_stop:
|
||||||
supported_features |= SUPPORT_STOP
|
supported_features |= SUPPORT_STOP
|
||||||
if self._device.supports_angle:
|
if self._device.supports_angle:
|
||||||
supported_features |= SUPPORT_SET_TILT_POSITION
|
supported_features |= (
|
||||||
|
SUPPORT_SET_TILT_POSITION | SUPPORT_OPEN_TILT | SUPPORT_CLOSE_TILT
|
||||||
|
)
|
||||||
return supported_features
|
return supported_features
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -127,6 +131,14 @@ class KNXCover(KnxEntity, CoverEntity):
|
|||||||
knx_tilt_position = 100 - kwargs[ATTR_TILT_POSITION]
|
knx_tilt_position = 100 - kwargs[ATTR_TILT_POSITION]
|
||||||
await self._device.set_angle(knx_tilt_position)
|
await self._device.set_angle(knx_tilt_position)
|
||||||
|
|
||||||
|
async def async_open_cover_tilt(self, **kwargs):
|
||||||
|
"""Open the cover tilt."""
|
||||||
|
await self._device.set_short_up()
|
||||||
|
|
||||||
|
async def async_close_cover_tilt(self, **kwargs):
|
||||||
|
"""Close the cover tilt."""
|
||||||
|
await self._device.set_short_down()
|
||||||
|
|
||||||
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:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user