Improve climate type hints for supported_features (#82223)
This commit is contained in:
parent
9d8dfc2d71
commit
e85e79052b
6 changed files with 8 additions and 8 deletions
|
@ -197,7 +197,7 @@ class EsphomeClimateEntity(EsphomeEntity[ClimateInfo, ClimateState], ClimateEnti
|
|||
return self._static_info.visual_max_temperature
|
||||
|
||||
@property
|
||||
def supported_features(self) -> int:
|
||||
def supported_features(self) -> ClimateEntityFeature | int:
|
||||
"""Return the list of supported features."""
|
||||
features = 0
|
||||
if self._static_info.supports_two_point_target_temperature:
|
||||
|
|
|
@ -148,7 +148,7 @@ class HomeKitBaseClimateEntity(HomeKitEntity, ClimateEntity):
|
|||
)
|
||||
|
||||
@property
|
||||
def supported_features(self) -> int:
|
||||
def supported_features(self) -> ClimateEntityFeature | int:
|
||||
"""Return the list of supported features."""
|
||||
features = 0
|
||||
|
||||
|
@ -368,7 +368,7 @@ class HomeKitHeaterCoolerEntity(HomeKitBaseClimateEntity):
|
|||
)
|
||||
|
||||
@property
|
||||
def supported_features(self) -> int:
|
||||
def supported_features(self) -> ClimateEntityFeature | int:
|
||||
"""Return the list of supported features."""
|
||||
features = super().supported_features
|
||||
|
||||
|
@ -602,7 +602,7 @@ class HomeKitClimateEntity(HomeKitBaseClimateEntity):
|
|||
return [MODE_HOMEKIT_TO_HASS[mode] for mode in valid_values]
|
||||
|
||||
@property
|
||||
def supported_features(self) -> int:
|
||||
def supported_features(self) -> ClimateEntityFeature | int:
|
||||
"""Return the list of supported features."""
|
||||
features = super().supported_features
|
||||
|
||||
|
|
|
@ -518,7 +518,7 @@ class ZoneDevice(ClimateEntity):
|
|||
|
||||
@property
|
||||
@_return_on_connection_error(0)
|
||||
def supported_features(self) -> int:
|
||||
def supported_features(self) -> ClimateEntityFeature | int:
|
||||
"""Return the list of supported features."""
|
||||
if self._zone.mode == Zone.Mode.AUTO:
|
||||
return self._attr_supported_features
|
||||
|
|
|
@ -475,7 +475,7 @@ class MqttClimate(MqttEntity, ClimateEntity):
|
|||
config.get(key), entity=self
|
||||
).async_render
|
||||
|
||||
support: int = 0
|
||||
support: ClimateEntityFeature | int = 0
|
||||
if (self._topic[CONF_TEMP_STATE_TOPIC] is not None) or (
|
||||
self._topic[CONF_TEMP_COMMAND_TOPIC] is not None
|
||||
):
|
||||
|
|
|
@ -77,7 +77,7 @@ class MySensorsHVAC(mysensors.device.MySensorsEntity, ClimateEntity):
|
|||
_attr_hvac_modes = OPERATION_LIST
|
||||
|
||||
@property
|
||||
def supported_features(self) -> int:
|
||||
def supported_features(self) -> ClimateEntityFeature | int:
|
||||
"""Return the list of supported features."""
|
||||
features = 0
|
||||
set_req = self.gateway.const.SetReq
|
||||
|
|
|
@ -176,7 +176,7 @@ class SensiboClimate(SensiboDeviceBaseEntity, ClimateEntity):
|
|||
self._attr_supported_features = self.get_features()
|
||||
self._attr_precision = PRECISION_TENTHS
|
||||
|
||||
def get_features(self) -> int:
|
||||
def get_features(self) -> ClimateEntityFeature | int:
|
||||
"""Get supported features."""
|
||||
features = 0
|
||||
for key in self.device_data.full_features:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue