mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 12:47:08 +00:00
Mark climate methods and properties as mandatory in pylint plugin (#145280)
* Mark climate methods and properties as mandatory in pylint plugin * One more
This commit is contained in:
parent
64d6101fb7
commit
258c91d483
@ -142,7 +142,7 @@ class AirtouchAC(CoordinatorEntity, ClimateEntity):
|
|||||||
return AT_TO_HA_STATE[self._airtouch.acs[self._ac_number].AcMode]
|
return AT_TO_HA_STATE[self._airtouch.acs[self._ac_number].AcMode]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def hvac_modes(self):
|
def hvac_modes(self) -> list[HVACMode]:
|
||||||
"""Return the list of available operation modes."""
|
"""Return the list of available operation modes."""
|
||||||
airtouch_modes = self._airtouch.GetSupportedCoolingModesForAc(self._ac_number)
|
airtouch_modes = self._airtouch.GetSupportedCoolingModesForAc(self._ac_number)
|
||||||
modes = [AT_TO_HA_STATE[mode] for mode in airtouch_modes]
|
modes = [AT_TO_HA_STATE[mode] for mode in airtouch_modes]
|
||||||
@ -226,12 +226,12 @@ class AirtouchGroup(CoordinatorEntity, ClimateEntity):
|
|||||||
return super()._handle_coordinator_update()
|
return super()._handle_coordinator_update()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def min_temp(self):
|
def min_temp(self) -> float:
|
||||||
"""Return Minimum Temperature for AC of this group."""
|
"""Return Minimum Temperature for AC of this group."""
|
||||||
return self._airtouch.acs[self._unit.BelongsToAc].MinSetpoint
|
return self._airtouch.acs[self._unit.BelongsToAc].MinSetpoint
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def max_temp(self):
|
def max_temp(self) -> float:
|
||||||
"""Return Max Temperature for AC of this group."""
|
"""Return Max Temperature for AC of this group."""
|
||||||
return self._airtouch.acs[self._unit.BelongsToAc].MaxSetpoint
|
return self._airtouch.acs[self._unit.BelongsToAc].MaxSetpoint
|
||||||
|
|
||||||
|
@ -206,12 +206,12 @@ class EcoNetThermostat(EcoNetEntity[Thermostat], ClimateEntity):
|
|||||||
self._econet.set_fan_mode(HA_FAN_STATE_TO_ECONET[fan_mode])
|
self._econet.set_fan_mode(HA_FAN_STATE_TO_ECONET[fan_mode])
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def min_temp(self):
|
def min_temp(self) -> float:
|
||||||
"""Return the minimum temperature."""
|
"""Return the minimum temperature."""
|
||||||
return self._econet.set_point_limits[0]
|
return self._econet.set_point_limits[0]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def max_temp(self):
|
def max_temp(self) -> float:
|
||||||
"""Return the maximum temperature."""
|
"""Return the maximum temperature."""
|
||||||
return self._econet.set_point_limits[1]
|
return self._econet.set_point_limits[1]
|
||||||
|
|
||||||
|
@ -159,7 +159,7 @@ class EphEmberThermostat(ClimateEntity):
|
|||||||
self._ember.set_zone_target_temperature(self._zone["zoneid"], temperature)
|
self._ember.set_zone_target_temperature(self._zone["zoneid"], temperature)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def min_temp(self):
|
def min_temp(self) -> float:
|
||||||
"""Return the minimum temperature."""
|
"""Return the minimum temperature."""
|
||||||
# Hot water temp doesn't support being changed
|
# Hot water temp doesn't support being changed
|
||||||
if self._hot_water:
|
if self._hot_water:
|
||||||
@ -168,7 +168,7 @@ class EphEmberThermostat(ClimateEntity):
|
|||||||
return 5.0
|
return 5.0
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def max_temp(self):
|
def max_temp(self) -> float:
|
||||||
"""Return the maximum temperature."""
|
"""Return the maximum temperature."""
|
||||||
if self._hot_water:
|
if self._hot_water:
|
||||||
return zone_target_temperature(self._zone)
|
return zone_target_temperature(self._zone)
|
||||||
|
@ -93,7 +93,7 @@ class MaxCubeClimate(ClimateEntity):
|
|||||||
]
|
]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def min_temp(self):
|
def min_temp(self) -> float:
|
||||||
"""Return the minimum temperature."""
|
"""Return the minimum temperature."""
|
||||||
temp = self._device.min_temperature or MIN_TEMPERATURE
|
temp = self._device.min_temperature or MIN_TEMPERATURE
|
||||||
# OFF_TEMPERATURE (always off) a is valid temperature to maxcube but not to Home Assistant.
|
# OFF_TEMPERATURE (always off) a is valid temperature to maxcube but not to Home Assistant.
|
||||||
@ -101,7 +101,7 @@ class MaxCubeClimate(ClimateEntity):
|
|||||||
return max(temp, MIN_TEMPERATURE)
|
return max(temp, MIN_TEMPERATURE)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def max_temp(self):
|
def max_temp(self) -> float:
|
||||||
"""Return the maximum temperature."""
|
"""Return the maximum temperature."""
|
||||||
return self._device.max_temperature or MAX_TEMPERATURE
|
return self._device.max_temperature or MAX_TEMPERATURE
|
||||||
|
|
||||||
|
@ -130,7 +130,7 @@ class NuHeatThermostat(CoordinatorEntity, ClimateEntity):
|
|||||||
return HVACAction.HEATING if self._thermostat.heating else HVACAction.IDLE
|
return HVACAction.HEATING if self._thermostat.heating else HVACAction.IDLE
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def min_temp(self):
|
def min_temp(self) -> float:
|
||||||
"""Return the minimum supported temperature for the thermostat."""
|
"""Return the minimum supported temperature for the thermostat."""
|
||||||
if self._temperature_unit == "C":
|
if self._temperature_unit == "C":
|
||||||
return self._thermostat.min_celsius
|
return self._thermostat.min_celsius
|
||||||
@ -138,7 +138,7 @@ class NuHeatThermostat(CoordinatorEntity, ClimateEntity):
|
|||||||
return self._thermostat.min_fahrenheit
|
return self._thermostat.min_fahrenheit
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def max_temp(self):
|
def max_temp(self) -> float:
|
||||||
"""Return the maximum supported temperature for the thermostat."""
|
"""Return the maximum supported temperature for the thermostat."""
|
||||||
if self._temperature_unit == "C":
|
if self._temperature_unit == "C":
|
||||||
return self._thermostat.max_celsius
|
return self._thermostat.max_celsius
|
||||||
|
@ -118,12 +118,12 @@ class SchluterThermostat(CoordinatorEntity, ClimateEntity):
|
|||||||
return self.coordinator.data[self._serial_number].set_point_temp
|
return self.coordinator.data[self._serial_number].set_point_temp
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def min_temp(self):
|
def min_temp(self) -> float:
|
||||||
"""Identify min_temp in Schluter API."""
|
"""Identify min_temp in Schluter API."""
|
||||||
return self.coordinator.data[self._serial_number].min_temp
|
return self.coordinator.data[self._serial_number].min_temp
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def max_temp(self):
|
def max_temp(self) -> float:
|
||||||
"""Identify max_temp in Schluter API."""
|
"""Identify max_temp in Schluter API."""
|
||||||
return self.coordinator.data[self._serial_number].max_temp
|
return self.coordinator.data[self._serial_number].max_temp
|
||||||
|
|
||||||
|
@ -293,7 +293,7 @@ class TuyaClimateEntity(TuyaEntity, ClimateEntity):
|
|||||||
)
|
)
|
||||||
self._send_command(commands)
|
self._send_command(commands)
|
||||||
|
|
||||||
def set_preset_mode(self, preset_mode):
|
def set_preset_mode(self, preset_mode: str) -> None:
|
||||||
"""Set new target preset mode."""
|
"""Set new target preset mode."""
|
||||||
commands = [{"code": DPCode.MODE, "value": preset_mode}]
|
commands = [{"code": DPCode.MODE, "value": preset_mode}]
|
||||||
self._send_command(commands)
|
self._send_command(commands)
|
||||||
|
@ -216,12 +216,12 @@ class ZhongHongClimate(ClimateEntity):
|
|||||||
return self._device.fan_list
|
return self._device.fan_list
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def min_temp(self):
|
def min_temp(self) -> float:
|
||||||
"""Return the minimum temperature."""
|
"""Return the minimum temperature."""
|
||||||
return self._device.min_temp
|
return self._device.min_temp
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def max_temp(self):
|
def max_temp(self) -> float:
|
||||||
"""Return the maximum temperature."""
|
"""Return the maximum temperature."""
|
||||||
return self._device.max_temp
|
return self._device.max_temp
|
||||||
|
|
||||||
|
@ -1171,10 +1171,12 @@ _INHERITANCE_MATCH: dict[str, list[ClassTypeHintMatch]] = {
|
|||||||
TypeHintMatch(
|
TypeHintMatch(
|
||||||
function_name="precision",
|
function_name="precision",
|
||||||
return_type="float",
|
return_type="float",
|
||||||
|
mandatory=True,
|
||||||
),
|
),
|
||||||
TypeHintMatch(
|
TypeHintMatch(
|
||||||
function_name="temperature_unit",
|
function_name="temperature_unit",
|
||||||
return_type="str",
|
return_type="str",
|
||||||
|
mandatory=True,
|
||||||
),
|
),
|
||||||
TypeHintMatch(
|
TypeHintMatch(
|
||||||
function_name="current_humidity",
|
function_name="current_humidity",
|
||||||
@ -1191,6 +1193,7 @@ _INHERITANCE_MATCH: dict[str, list[ClassTypeHintMatch]] = {
|
|||||||
TypeHintMatch(
|
TypeHintMatch(
|
||||||
function_name="hvac_modes",
|
function_name="hvac_modes",
|
||||||
return_type="list[HVACMode]",
|
return_type="list[HVACMode]",
|
||||||
|
mandatory=True,
|
||||||
),
|
),
|
||||||
TypeHintMatch(
|
TypeHintMatch(
|
||||||
function_name="hvac_action",
|
function_name="hvac_action",
|
||||||
@ -1249,6 +1252,7 @@ _INHERITANCE_MATCH: dict[str, list[ClassTypeHintMatch]] = {
|
|||||||
kwargs_type="Any",
|
kwargs_type="Any",
|
||||||
return_type="None",
|
return_type="None",
|
||||||
has_async_counterpart=True,
|
has_async_counterpart=True,
|
||||||
|
mandatory=True,
|
||||||
),
|
),
|
||||||
TypeHintMatch(
|
TypeHintMatch(
|
||||||
function_name="set_humidity",
|
function_name="set_humidity",
|
||||||
@ -1257,6 +1261,7 @@ _INHERITANCE_MATCH: dict[str, list[ClassTypeHintMatch]] = {
|
|||||||
},
|
},
|
||||||
return_type="None",
|
return_type="None",
|
||||||
has_async_counterpart=True,
|
has_async_counterpart=True,
|
||||||
|
mandatory=True,
|
||||||
),
|
),
|
||||||
TypeHintMatch(
|
TypeHintMatch(
|
||||||
function_name="set_fan_mode",
|
function_name="set_fan_mode",
|
||||||
@ -1265,6 +1270,7 @@ _INHERITANCE_MATCH: dict[str, list[ClassTypeHintMatch]] = {
|
|||||||
},
|
},
|
||||||
return_type="None",
|
return_type="None",
|
||||||
has_async_counterpart=True,
|
has_async_counterpart=True,
|
||||||
|
mandatory=True,
|
||||||
),
|
),
|
||||||
TypeHintMatch(
|
TypeHintMatch(
|
||||||
function_name="set_hvac_mode",
|
function_name="set_hvac_mode",
|
||||||
@ -1273,6 +1279,7 @@ _INHERITANCE_MATCH: dict[str, list[ClassTypeHintMatch]] = {
|
|||||||
},
|
},
|
||||||
return_type="None",
|
return_type="None",
|
||||||
has_async_counterpart=True,
|
has_async_counterpart=True,
|
||||||
|
mandatory=True,
|
||||||
),
|
),
|
||||||
TypeHintMatch(
|
TypeHintMatch(
|
||||||
function_name="set_swing_mode",
|
function_name="set_swing_mode",
|
||||||
@ -1281,6 +1288,7 @@ _INHERITANCE_MATCH: dict[str, list[ClassTypeHintMatch]] = {
|
|||||||
},
|
},
|
||||||
return_type="None",
|
return_type="None",
|
||||||
has_async_counterpart=True,
|
has_async_counterpart=True,
|
||||||
|
mandatory=True,
|
||||||
),
|
),
|
||||||
TypeHintMatch(
|
TypeHintMatch(
|
||||||
function_name="set_preset_mode",
|
function_name="set_preset_mode",
|
||||||
@ -1289,46 +1297,56 @@ _INHERITANCE_MATCH: dict[str, list[ClassTypeHintMatch]] = {
|
|||||||
},
|
},
|
||||||
return_type="None",
|
return_type="None",
|
||||||
has_async_counterpart=True,
|
has_async_counterpart=True,
|
||||||
|
mandatory=True,
|
||||||
),
|
),
|
||||||
TypeHintMatch(
|
TypeHintMatch(
|
||||||
function_name="turn_aux_heat_on",
|
function_name="turn_aux_heat_on",
|
||||||
return_type="None",
|
return_type="None",
|
||||||
has_async_counterpart=True,
|
has_async_counterpart=True,
|
||||||
|
mandatory=True,
|
||||||
),
|
),
|
||||||
TypeHintMatch(
|
TypeHintMatch(
|
||||||
function_name="turn_aux_heat_off",
|
function_name="turn_aux_heat_off",
|
||||||
return_type="None",
|
return_type="None",
|
||||||
has_async_counterpart=True,
|
has_async_counterpart=True,
|
||||||
|
mandatory=True,
|
||||||
),
|
),
|
||||||
TypeHintMatch(
|
TypeHintMatch(
|
||||||
function_name="turn_on",
|
function_name="turn_on",
|
||||||
return_type="None",
|
return_type="None",
|
||||||
has_async_counterpart=True,
|
has_async_counterpart=True,
|
||||||
|
mandatory=True,
|
||||||
),
|
),
|
||||||
TypeHintMatch(
|
TypeHintMatch(
|
||||||
function_name="turn_off",
|
function_name="turn_off",
|
||||||
return_type="None",
|
return_type="None",
|
||||||
has_async_counterpart=True,
|
has_async_counterpart=True,
|
||||||
|
mandatory=True,
|
||||||
),
|
),
|
||||||
TypeHintMatch(
|
TypeHintMatch(
|
||||||
function_name="supported_features",
|
function_name="supported_features",
|
||||||
return_type="ClimateEntityFeature",
|
return_type="ClimateEntityFeature",
|
||||||
|
mandatory=True,
|
||||||
),
|
),
|
||||||
TypeHintMatch(
|
TypeHintMatch(
|
||||||
function_name="min_temp",
|
function_name="min_temp",
|
||||||
return_type="float",
|
return_type="float",
|
||||||
|
mandatory=True,
|
||||||
),
|
),
|
||||||
TypeHintMatch(
|
TypeHintMatch(
|
||||||
function_name="max_temp",
|
function_name="max_temp",
|
||||||
return_type="float",
|
return_type="float",
|
||||||
|
mandatory=True,
|
||||||
),
|
),
|
||||||
TypeHintMatch(
|
TypeHintMatch(
|
||||||
function_name="min_humidity",
|
function_name="min_humidity",
|
||||||
return_type="float",
|
return_type="float",
|
||||||
|
mandatory=True,
|
||||||
),
|
),
|
||||||
TypeHintMatch(
|
TypeHintMatch(
|
||||||
function_name="max_humidity",
|
function_name="max_humidity",
|
||||||
return_type="float",
|
return_type="float",
|
||||||
|
mandatory=True,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user