mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 02:37:08 +00:00
Enforce HumidifierEntityFeature (#82459)
This commit is contained in:
parent
12cb17620e
commit
d4bd9a0f7e
@ -13,7 +13,7 @@ from homeassistant.core import HomeAssistant
|
|||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
||||||
|
|
||||||
SUPPORT_FLAGS = 0
|
SUPPORT_FLAGS = HumidifierEntityFeature(0)
|
||||||
|
|
||||||
|
|
||||||
async def async_setup_platform(
|
async def async_setup_platform(
|
||||||
|
@ -137,7 +137,7 @@ class HumidifierEntity(ToggleEntity):
|
|||||||
_attr_max_humidity: int = DEFAULT_MAX_HUMIDITY
|
_attr_max_humidity: int = DEFAULT_MAX_HUMIDITY
|
||||||
_attr_min_humidity: int = DEFAULT_MIN_HUMIDITY
|
_attr_min_humidity: int = DEFAULT_MIN_HUMIDITY
|
||||||
_attr_mode: str | None
|
_attr_mode: str | None
|
||||||
_attr_supported_features: HumidifierEntityFeature | int = 0
|
_attr_supported_features: HumidifierEntityFeature = HumidifierEntityFeature(0)
|
||||||
_attr_target_humidity: int | None = None
|
_attr_target_humidity: int | None = None
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -224,6 +224,6 @@ class HumidifierEntity(ToggleEntity):
|
|||||||
return self._attr_max_humidity
|
return self._attr_max_humidity
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def supported_features(self) -> HumidifierEntityFeature | int:
|
def supported_features(self) -> HumidifierEntityFeature:
|
||||||
"""Return the list of supported features."""
|
"""Return the list of supported features."""
|
||||||
return self._attr_supported_features
|
return self._attr_supported_features
|
||||||
|
@ -1429,7 +1429,7 @@ _INHERITANCE_MATCH: dict[str, list[ClassTypeHintMatch]] = {
|
|||||||
),
|
),
|
||||||
TypeHintMatch(
|
TypeHintMatch(
|
||||||
function_name="supported_features",
|
function_name="supported_features",
|
||||||
return_type=["HumidifierEntityFeature", "int"],
|
return_type="HumidifierEntityFeature",
|
||||||
),
|
),
|
||||||
TypeHintMatch(
|
TypeHintMatch(
|
||||||
function_name="target_humidity",
|
function_name="target_humidity",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user