Use EntityFeature enum in components (d**) (#69358)
This commit is contained in:
parent
9e2198fa47
commit
c8df2656b1
15 changed files with 114 additions and 170 deletions
|
@ -25,7 +25,7 @@ from pydeconz.sensor import (
|
|||
Thermostat,
|
||||
)
|
||||
|
||||
from homeassistant.components.climate import DOMAIN, ClimateEntity
|
||||
from homeassistant.components.climate import DOMAIN, ClimateEntity, ClimateEntityFeature
|
||||
from homeassistant.components.climate.const import (
|
||||
FAN_AUTO,
|
||||
FAN_HIGH,
|
||||
|
@ -40,9 +40,6 @@ from homeassistant.components.climate.const import (
|
|||
PRESET_BOOST,
|
||||
PRESET_COMFORT,
|
||||
PRESET_ECO,
|
||||
SUPPORT_FAN_MODE,
|
||||
SUPPORT_PRESET_MODE,
|
||||
SUPPORT_TARGET_TEMPERATURE,
|
||||
)
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import ATTR_TEMPERATURE, TEMP_CELSIUS
|
||||
|
@ -162,13 +159,13 @@ class DeconzThermostat(DeconzDevice, ClimateEntity):
|
|||
value: key for key, value in self._hvac_mode_to_deconz.items()
|
||||
}
|
||||
|
||||
self._attr_supported_features = SUPPORT_TARGET_TEMPERATURE
|
||||
self._attr_supported_features = ClimateEntityFeature.TARGET_TEMPERATURE
|
||||
|
||||
if device.fan_mode:
|
||||
self._attr_supported_features |= SUPPORT_FAN_MODE
|
||||
self._attr_supported_features |= ClimateEntityFeature.FAN_MODE
|
||||
|
||||
if device.preset:
|
||||
self._attr_supported_features |= SUPPORT_PRESET_MODE
|
||||
self._attr_supported_features |= ClimateEntityFeature.PRESET_MODE
|
||||
|
||||
# Fan control
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue