Use new CoverDeviceClass in knx (#61868)
Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
parent
f17164fa47
commit
a1abcad0ca
1 changed files with 2 additions and 2 deletions
|
@ -12,7 +12,6 @@ from homeassistant import config_entries
|
||||||
from homeassistant.components.cover import (
|
from homeassistant.components.cover import (
|
||||||
ATTR_POSITION,
|
ATTR_POSITION,
|
||||||
ATTR_TILT_POSITION,
|
ATTR_TILT_POSITION,
|
||||||
DEVICE_CLASS_BLIND,
|
|
||||||
SUPPORT_CLOSE,
|
SUPPORT_CLOSE,
|
||||||
SUPPORT_CLOSE_TILT,
|
SUPPORT_CLOSE_TILT,
|
||||||
SUPPORT_OPEN,
|
SUPPORT_OPEN,
|
||||||
|
@ -21,6 +20,7 @@ from homeassistant.components.cover import (
|
||||||
SUPPORT_SET_TILT_POSITION,
|
SUPPORT_SET_TILT_POSITION,
|
||||||
SUPPORT_STOP,
|
SUPPORT_STOP,
|
||||||
SUPPORT_STOP_TILT,
|
SUPPORT_STOP_TILT,
|
||||||
|
CoverDeviceClass,
|
||||||
CoverEntity,
|
CoverEntity,
|
||||||
)
|
)
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
|
@ -83,7 +83,7 @@ class KNXCover(KnxEntity, CoverEntity):
|
||||||
self._attr_entity_category = config.get(CONF_ENTITY_CATEGORY)
|
self._attr_entity_category = config.get(CONF_ENTITY_CATEGORY)
|
||||||
|
|
||||||
self._attr_device_class = config.get(CONF_DEVICE_CLASS) or (
|
self._attr_device_class = config.get(CONF_DEVICE_CLASS) or (
|
||||||
DEVICE_CLASS_BLIND if self._device.supports_angle else None
|
CoverDeviceClass.BLIND if self._device.supports_angle else None
|
||||||
)
|
)
|
||||||
self._attr_supported_features = (
|
self._attr_supported_features = (
|
||||||
SUPPORT_CLOSE | SUPPORT_OPEN | SUPPORT_SET_POSITION
|
SUPPORT_CLOSE | SUPPORT_OPEN | SUPPORT_SET_POSITION
|
||||||
|
|
Loading…
Add table
Reference in a new issue