Adjust hvac_modes type hint in ClimateEntity (#70657)

* Adjust hvac_modes type hint in ClimateEntity

* Adjust tuya
This commit is contained in:
epenet 2022-04-25 13:15:08 +02:00 committed by GitHub
parent 28ebab9c5a
commit d22a679262
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -191,7 +191,7 @@ class ClimateEntity(Entity):
_attr_fan_modes: list[str] | None
_attr_hvac_action: HVACAction | str | None = None
_attr_hvac_mode: HVACMode | str | None
_attr_hvac_modes: list[HVACMode | str]
_attr_hvac_modes: list[HVACMode] | list[str]
_attr_is_aux_heat: bool | None
_attr_max_humidity: int = DEFAULT_MAX_HUMIDITY
_attr_max_temp: float
@ -341,7 +341,7 @@ class ClimateEntity(Entity):
return self._attr_hvac_mode
@property
def hvac_modes(self) -> list[HVACMode | str]:
def hvac_modes(self) -> list[HVACMode] | list[str]:
"""Return the list of available hvac operation modes."""
return self._attr_hvac_modes

View File

@ -207,7 +207,7 @@ class TuyaClimateEntity(TuyaEntity, ClimateEntity):
self._attr_target_temperature_step = self._set_temperature.step_scaled
# Determine HVAC modes
self._attr_hvac_modes = []
self._attr_hvac_modes: list[str] = []
self._hvac_to_tuya = {}
if enum_type := self.find_dpcode(
DPCode.MODE, dptype=DPType.ENUM, prefer_function=True