Use UnitOfTemperature in climate entities [m-s] (#83131)

This commit is contained in:
epenet 2022-12-02 19:56:18 +01:00 committed by GitHub
parent d3b35ca2a7
commit 8b867d612f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 82 additions and 74 deletions

View file

@ -12,7 +12,7 @@ from homeassistant.components.climate import (
HVACMode,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import ATTR_TEMPERATURE, PRECISION_TENTHS, TEMP_CELSIUS
from homeassistant.const import ATTR_TEMPERATURE, PRECISION_TENTHS, UnitOfTemperature
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.entity import DeviceInfo
from homeassistant.helpers.entity_platform import AddEntitiesCallback
@ -37,7 +37,7 @@ async def async_setup_entry(
class SENZClimate(CoordinatorEntity, ClimateEntity):
"""Representation of a SENZ climate entity."""
_attr_temperature_unit = TEMP_CELSIUS
_attr_temperature_unit = UnitOfTemperature.CELSIUS
_attr_precision = PRECISION_TENTHS
_attr_hvac_modes = [HVACMode.HEAT, HVACMode.AUTO]
_attr_supported_features = ClimateEntityFeature.TARGET_TEMPERATURE