Use UnitOfTemperature in climate entities [g-l] (#83127)

* Use UnitOfTemperature in climate entities [g-l]

* Adjust gree

* Adjust honeywell
This commit is contained in:
epenet 2022-12-05 10:42:24 +01:00 committed by GitHub
parent 40d337479e
commit 68e454712d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 60 additions and 71 deletions

View file

@ -17,7 +17,7 @@ from homeassistant.components.climate import (
HVACMode,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import ATTR_TEMPERATURE, TEMP_CELSIUS, TEMP_FAHRENHEIT
from homeassistant.const import ATTR_TEMPERATURE, UnitOfTemperature
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.helpers.entity_platform import AddEntitiesCallback
@ -89,8 +89,8 @@ class InsteonClimateEntity(InsteonEntity, ClimateEntity):
def temperature_unit(self) -> str:
"""Return the unit of measurement."""
if self._insteon_device.configuration[CELSIUS].value:
return TEMP_CELSIUS
return TEMP_FAHRENHEIT
return UnitOfTemperature.CELSIUS
return UnitOfTemperature.FAHRENHEIT
@property
def current_humidity(self) -> int | None: