Switch Mill to ClimateEntityFeature (#69293)

This commit is contained in:
Daniel Hjelseth Høyer 2022-04-04 20:46:46 +02:00 committed by GitHub
parent 95a97d99dd
commit 396fddfbfa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9,8 +9,7 @@ from homeassistant.components.climate.const import (
FAN_ON, FAN_ON,
HVAC_MODE_HEAT, HVAC_MODE_HEAT,
HVAC_MODE_OFF, HVAC_MODE_OFF,
SUPPORT_FAN_MODE, ClimateEntityFeature,
SUPPORT_TARGET_TEMPERATURE,
) )
from homeassistant.config_entries import ConfigEntry from homeassistant.config_entries import ConfigEntry
from homeassistant.const import ( from homeassistant.const import (
@ -117,10 +116,10 @@ class MillHeater(CoordinatorEntity, ClimateEntity):
if heater.generation < 3: if heater.generation < 3:
self._attr_supported_features = ( self._attr_supported_features = (
SUPPORT_TARGET_TEMPERATURE | SUPPORT_FAN_MODE ClimateEntityFeature.TARGET_TEMPERATURE | ClimateEntityFeature.FAN_MODE
) )
else: else:
self._attr_supported_features = SUPPORT_TARGET_TEMPERATURE self._attr_supported_features = ClimateEntityFeature.TARGET_TEMPERATURE
self._update_attr(heater) self._update_attr(heater)
@ -201,7 +200,7 @@ class LocalMillHeater(CoordinatorEntity, ClimateEntity):
_attr_hvac_modes = [HVAC_MODE_HEAT] _attr_hvac_modes = [HVAC_MODE_HEAT]
_attr_max_temp = MAX_TEMP _attr_max_temp = MAX_TEMP
_attr_min_temp = MIN_TEMP _attr_min_temp = MIN_TEMP
_attr_supported_features = SUPPORT_TARGET_TEMPERATURE _attr_supported_features = ClimateEntityFeature.TARGET_TEMPERATURE
_attr_target_temperature_step = PRECISION_WHOLE _attr_target_temperature_step = PRECISION_WHOLE
_attr_temperature_unit = TEMP_CELSIUS _attr_temperature_unit = TEMP_CELSIUS