Use UnitOfTemperature in devolo Home Control (#81923)

This commit is contained in:
Guido Schmitz 2022-11-10 19:33:10 +01:00 committed by GitHub
parent e6d1a4a422
commit 97ebe59584
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -8,13 +8,12 @@ from devolo_home_control_api.homecontrol import HomeControl
from homeassistant.components.climate import ( from homeassistant.components.climate import (
ATTR_TEMPERATURE, ATTR_TEMPERATURE,
TEMP_CELSIUS,
ClimateEntity, ClimateEntity,
ClimateEntityFeature, ClimateEntityFeature,
HVACMode, HVACMode,
) )
from homeassistant.config_entries import ConfigEntry from homeassistant.config_entries import ConfigEntry
from homeassistant.const import PRECISION_HALVES, PRECISION_TENTHS from homeassistant.const import PRECISION_HALVES, PRECISION_TENTHS, UnitOfTemperature
from homeassistant.core import HomeAssistant from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback from homeassistant.helpers.entity_platform import AddEntitiesCallback
@ -68,7 +67,7 @@ class DevoloClimateDeviceEntity(DevoloMultiLevelSwitchDeviceEntity, ClimateEntit
self._attr_precision = PRECISION_TENTHS self._attr_precision = PRECISION_TENTHS
self._attr_supported_features = ClimateEntityFeature.TARGET_TEMPERATURE self._attr_supported_features = ClimateEntityFeature.TARGET_TEMPERATURE
self._attr_target_temperature_step = PRECISION_HALVES self._attr_target_temperature_step = PRECISION_HALVES
self._attr_temperature_unit = TEMP_CELSIUS self._attr_temperature_unit = UnitOfTemperature.CELSIUS
@property @property
def current_temperature(self) -> float | None: def current_temperature(self) -> float | None: