Enforce HumidifierEntityFeature (#82459)

This commit is contained in:
epenet 2022-11-22 07:14:19 +01:00 committed by GitHub
parent 12cb17620e
commit d4bd9a0f7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -13,7 +13,7 @@ from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
SUPPORT_FLAGS = 0
SUPPORT_FLAGS = HumidifierEntityFeature(0)
async def async_setup_platform(

View File

@ -137,7 +137,7 @@ class HumidifierEntity(ToggleEntity):
_attr_max_humidity: int = DEFAULT_MAX_HUMIDITY
_attr_min_humidity: int = DEFAULT_MIN_HUMIDITY
_attr_mode: str | None
_attr_supported_features: HumidifierEntityFeature | int = 0
_attr_supported_features: HumidifierEntityFeature = HumidifierEntityFeature(0)
_attr_target_humidity: int | None = None
@property
@ -224,6 +224,6 @@ class HumidifierEntity(ToggleEntity):
return self._attr_max_humidity
@property
def supported_features(self) -> HumidifierEntityFeature | int:
def supported_features(self) -> HumidifierEntityFeature:
"""Return the list of supported features."""
return self._attr_supported_features

View File

@ -1429,7 +1429,7 @@ _INHERITANCE_MATCH: dict[str, list[ClassTypeHintMatch]] = {
),
TypeHintMatch(
function_name="supported_features",
return_type=["HumidifierEntityFeature", "int"],
return_type="HumidifierEntityFeature",
),
TypeHintMatch(
function_name="target_humidity",