diff --git a/homeassistant/components/climate/__init__.py b/homeassistant/components/climate/__init__.py index be5f33f8cd5..d19637a9be0 100644 --- a/homeassistant/components/climate/__init__.py +++ b/homeassistant/components/climate/__init__.py @@ -225,7 +225,7 @@ class ClimateEntity(Entity): _attr_precision: float _attr_preset_mode: str | None _attr_preset_modes: list[str] | None - _attr_supported_features: int + _attr_supported_features: ClimateEntityFeature | int _attr_swing_mode: str | None _attr_swing_modes: list[str] | None _attr_target_humidity: int | None = None @@ -552,7 +552,7 @@ class ClimateEntity(Entity): await self.async_set_hvac_mode(HVACMode.OFF) @property - def supported_features(self) -> int: + def supported_features(self) -> ClimateEntityFeature | int: """Return the list of supported features.""" return self._attr_supported_features diff --git a/homeassistant/components/ecobee/climate.py b/homeassistant/components/ecobee/climate.py index 16870d76902..028979b2a85 100644 --- a/homeassistant/components/ecobee/climate.py +++ b/homeassistant/components/ecobee/climate.py @@ -351,7 +351,7 @@ class Thermostat(ClimateEntity): return self.thermostat["runtime"]["connected"] @property - def supported_features(self) -> int: + def supported_features(self) -> ClimateEntityFeature: """Return the list of supported features.""" if self.has_humidifier_control: return SUPPORT_FLAGS | ClimateEntityFeature.TARGET_HUMIDITY diff --git a/homeassistant/components/econet/climate.py b/homeassistant/components/econet/climate.py index bda462285fc..cf950a3c38c 100644 --- a/homeassistant/components/econet/climate.py +++ b/homeassistant/components/econet/climate.py @@ -81,7 +81,7 @@ class EcoNetThermostat(EcoNetEntity, ClimateEntity): self.op_list.append(ha_mode) @property - def supported_features(self) -> int: + def supported_features(self) -> ClimateEntityFeature: """Return the list of supported features.""" if self._econet.supports_humidifier: return SUPPORT_FLAGS_THERMOSTAT | ClimateEntityFeature.TARGET_HUMIDITY diff --git a/homeassistant/components/lookin/climate.py b/homeassistant/components/lookin/climate.py index 5b3ecefa4ff..aa3ba0c3614 100644 --- a/homeassistant/components/lookin/climate.py +++ b/homeassistant/components/lookin/climate.py @@ -93,7 +93,7 @@ class ConditionerEntity(LookinCoordinatorEntity, ClimateEntity): _attr_current_humidity: float | None = None # type: ignore[assignment] _attr_temperature_unit = TEMP_CELSIUS - _attr_supported_features: int = ( + _attr_supported_features = ( ClimateEntityFeature.TARGET_TEMPERATURE | ClimateEntityFeature.FAN_MODE | ClimateEntityFeature.SWING_MODE diff --git a/homeassistant/components/lyric/climate.py b/homeassistant/components/lyric/climate.py index ae4afa0b0c6..8339c4dad45 100644 --- a/homeassistant/components/lyric/climate.py +++ b/homeassistant/components/lyric/climate.py @@ -169,13 +169,11 @@ class LyricClimate(LyricDeviceEntity, ClimateEntity): self.entity_description = description @property - def supported_features(self) -> int: + def supported_features(self) -> ClimateEntityFeature: """Return the list of supported features.""" if self.device.changeableValues.thermostatSetpointStatus: - support_flags = SUPPORT_FLAGS_LCC - else: - support_flags = SUPPORT_FLAGS_TCC - return support_flags + return SUPPORT_FLAGS_LCC + return SUPPORT_FLAGS_TCC @property def temperature_unit(self) -> str: diff --git a/homeassistant/components/shelly/climate.py b/homeassistant/components/shelly/climate.py index 38ba4a51c9f..c55c0261839 100644 --- a/homeassistant/components/shelly/climate.py +++ b/homeassistant/components/shelly/climate.py @@ -109,7 +109,7 @@ class BlockSleepingClimate( _attr_icon = "mdi:thermostat" _attr_max_temp = SHTRV_01_TEMPERATURE_SETTINGS["max"] _attr_min_temp = SHTRV_01_TEMPERATURE_SETTINGS["min"] - _attr_supported_features: int = ( + _attr_supported_features = ( ClimateEntityFeature.TARGET_TEMPERATURE | ClimateEntityFeature.PRESET_MODE ) _attr_target_temperature_step = SHTRV_01_TEMPERATURE_SETTINGS["step"] diff --git a/homeassistant/components/spider/climate.py b/homeassistant/components/spider/climate.py index 6c02e8485c4..111c1e377cf 100644 --- a/homeassistant/components/spider/climate.py +++ b/homeassistant/components/spider/climate.py @@ -64,7 +64,7 @@ class SpiderThermostat(ClimateEntity): ) @property - def supported_features(self) -> int: + def supported_features(self) -> ClimateEntityFeature: """Return the list of supported features.""" if self.thermostat.has_fan_mode: return ( diff --git a/homeassistant/components/venstar/climate.py b/homeassistant/components/venstar/climate.py index 2fb0595788f..2a921fe3731 100644 --- a/homeassistant/components/venstar/climate.py +++ b/homeassistant/components/venstar/climate.py @@ -125,7 +125,7 @@ class VenstarThermostat(VenstarEntity, ClimateEntity): self._attr_name = self._client.name @property - def supported_features(self) -> int: + def supported_features(self) -> ClimateEntityFeature: """Return the list of supported features.""" features = ( ClimateEntityFeature.TARGET_TEMPERATURE diff --git a/homeassistant/components/zha/climate.py b/homeassistant/components/zha/climate.py index 155a254217e..4de07bf0d74 100644 --- a/homeassistant/components/zha/climate.py +++ b/homeassistant/components/zha/climate.py @@ -277,7 +277,7 @@ class Thermostat(ZhaEntity, ClimateEntity): return self._presets @property - def supported_features(self) -> int: + def supported_features(self) -> ClimateEntityFeature: """Return the list of supported features.""" features = self._supported_flags if HVACMode.HEAT_COOL in self.hvac_modes: diff --git a/pylint/plugins/hass_enforce_type_hints.py b/pylint/plugins/hass_enforce_type_hints.py index ddf3a3a5155..873a783c1ca 100644 --- a/pylint/plugins/hass_enforce_type_hints.py +++ b/pylint/plugins/hass_enforce_type_hints.py @@ -1055,7 +1055,7 @@ _INHERITANCE_MATCH: dict[str, list[ClassTypeHintMatch]] = { ), TypeHintMatch( function_name="supported_features", - return_type="int", + return_type=["ClimateEntityFeature", "int"], ), TypeHintMatch( function_name="min_temp",