Replaced SUPPORT_* with enums, set minimum HA version in HACS configuration to 2024.1.0
This commit is contained in:
@@ -8,11 +8,7 @@ import voluptuous as vol
|
||||
from homeassistant.components.cover import (
|
||||
ATTR_POSITION,
|
||||
DOMAIN,
|
||||
SUPPORT_CLOSE,
|
||||
SUPPORT_OPEN,
|
||||
SUPPORT_SET_POSITION,
|
||||
SUPPORT_STOP,
|
||||
CoverEntity,
|
||||
CoverEntity, CoverEntityFeature,
|
||||
)
|
||||
|
||||
from .common import LocalTuyaEntity, async_setup_entry
|
||||
@@ -80,9 +76,9 @@ class LocaltuyaCover(LocalTuyaEntity, CoverEntity):
|
||||
@property
|
||||
def supported_features(self):
|
||||
"""Flag supported features."""
|
||||
supported_features = SUPPORT_OPEN | SUPPORT_CLOSE | SUPPORT_STOP
|
||||
supported_features = CoverEntityFeature.OPEN | CoverEntityFeature.CLOSE | CoverEntityFeature.STOP
|
||||
if self._config[CONF_POSITIONING_MODE] != COVER_MODE_NONE:
|
||||
supported_features = supported_features | SUPPORT_SET_POSITION
|
||||
supported_features = supported_features | CoverEntityFeature.SET_POSITION
|
||||
return supported_features
|
||||
|
||||
@property
|
||||
|
Reference in New Issue
Block a user