Use UnitOfTemperature in water_heater entities (#83132)

This commit is contained in:
epenet 2022-12-05 11:42:15 +01:00 committed by GitHub
parent 1c86a543b7
commit 63e8dd58ef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 14 additions and 14 deletions

View file

@ -7,7 +7,7 @@ from homeassistant.components.water_heater import (
WaterHeaterEntity,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import ATTR_TEMPERATURE, STATE_OFF, TEMP_CELSIUS, Platform
from homeassistant.const import ATTR_TEMPERATURE, STATE_OFF, Platform, UnitOfTemperature
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback
@ -30,7 +30,7 @@ class AtagWaterHeater(AtagEntity, WaterHeaterEntity):
"""Representation of an ATAG water heater."""
_attr_operation_list = OPERATION_LIST
_attr_temperature_unit = TEMP_CELSIUS
_attr_temperature_unit = UnitOfTemperature.CELSIUS
@property
def current_temperature(self):

View file

@ -12,7 +12,7 @@ from homeassistant.const import (
PRECISION_WHOLE,
STATE_OFF,
STATE_ON,
TEMP_CELSIUS,
UnitOfTemperature,
)
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback
@ -60,7 +60,7 @@ class EvoDHW(EvoChild, WaterHeaterEntity):
_attr_name = "DHW controller"
_attr_icon = "mdi:thermometer-lines"
_attr_operation_list = list(HA_STATE_TO_EVO)
_attr_temperature_unit = TEMP_CELSIUS
_attr_temperature_unit = UnitOfTemperature.CELSIUS
def __init__(self, evo_broker, evo_device) -> None:
"""Initialize an evohome DHW controller."""

View file

@ -9,7 +9,7 @@ from homeassistant.components.water_heater import (
WaterHeaterEntityFeature,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import STATE_OFF, STATE_ON, TEMP_CELSIUS
from homeassistant.const import STATE_OFF, STATE_ON, UnitOfTemperature
from homeassistant.core import HomeAssistant
from homeassistant.helpers import config_validation as cv, entity_platform
from homeassistant.helpers.entity_platform import AddEntitiesCallback
@ -74,7 +74,7 @@ class HiveWaterHeater(HiveEntity, WaterHeaterEntity):
"""Hive Water Heater Device."""
_attr_supported_features = WaterHeaterEntityFeature.OPERATION_MODE
_attr_temperature_unit = TEMP_CELSIUS
_attr_temperature_unit = UnitOfTemperature.CELSIUS
_attr_operation_list = SUPPORT_WATER_HEATER
@refresh_system

View file

@ -11,7 +11,7 @@ from homeassistant.components.water_heater import (
DOMAIN as WATER_HEATER_DOMAIN,
WaterHeaterEntity,
)
from homeassistant.const import TEMP_CELSIUS
from homeassistant.const import UnitOfTemperature
from homeassistant.core import HomeAssistant
from homeassistant.helpers.dispatcher import async_dispatcher_send
from homeassistant.helpers.entity_platform import AddEntitiesCallback
@ -86,7 +86,7 @@ class IncomfortWaterHeater(IncomfortEntity, WaterHeaterEntity):
@property
def temperature_unit(self) -> str:
"""Return the unit of measurement."""
return TEMP_CELSIUS
return UnitOfTemperature.CELSIUS
@property
def current_operation(self) -> str:

View file

@ -17,7 +17,7 @@ from homeassistant.components.water_heater import (
WaterHeaterEntityFeature,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import TEMP_CELSIUS
from homeassistant.const import UnitOfTemperature
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback
@ -89,7 +89,7 @@ class AtwWaterHeater(WaterHeaterEntity):
@property
def temperature_unit(self) -> str:
"""Return the unit of measurement used by the platform."""
return TEMP_CELSIUS
return UnitOfTemperature.CELSIUS
@property
def current_operation(self) -> str | None:

View file

@ -9,7 +9,7 @@ from homeassistant.components.water_heater import (
WaterHeaterEntityFeature,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import ATTR_TEMPERATURE, TEMP_CELSIUS
from homeassistant.const import ATTR_TEMPERATURE, UnitOfTemperature
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers import config_validation as cv, entity_platform
from homeassistant.helpers.dispatcher import async_dispatcher_connect
@ -199,7 +199,7 @@ class TadoWaterHeater(TadoZoneEntity, WaterHeaterEntity):
@property
def temperature_unit(self):
"""Return the unit of measurement used by the platform."""
return TEMP_CELSIUS
return UnitOfTemperature.CELSIUS
@property
def min_temp(self):

View file

@ -19,7 +19,7 @@ from homeassistant.const import (
ATTR_TEMPERATURE,
PRECISION_TENTHS,
PRECISION_WHOLE,
TEMP_CELSIUS,
UnitOfTemperature,
)
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity import DeviceInfo
@ -166,7 +166,7 @@ class ViCareWater(WaterHeaterEntity):
@property
def temperature_unit(self):
"""Return the unit of measurement."""
return TEMP_CELSIUS
return UnitOfTemperature.CELSIUS
@property
def current_temperature(self):