Replaced SUPPORT_* with enums, set minimum HA version in HACS configuration to 2024.1.0

This commit is contained in:
Elad Bar
2024-01-05 13:29:06 +02:00
parent e5009fd3f8
commit 9c0e733804
5 changed files with 27 additions and 46 deletions

View File

@@ -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