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

@ -19,8 +19,7 @@ from homeassistant.const import (
CONF_ENTITIES,
CONF_SOURCE,
CONF_UNIT_OF_MEASUREMENT,
TEMP_CELSIUS,
TEMP_FAHRENHEIT,
UnitOfTemperature,
)
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback
@ -114,10 +113,10 @@ class LcnClimate(LcnEntity, ClimateEntity):
@property
def temperature_unit(self) -> str:
"""Return the unit of measurement."""
# Config schema only allows for: TEMP_CELSIUS and TEMP_FAHRENHEIT
# Config schema only allows for: UnitOfTemperature.CELSIUS and UnitOfTemperature.FAHRENHEIT
if self.unit == pypck.lcn_defs.VarUnit.FAHRENHEIT:
return TEMP_FAHRENHEIT
return TEMP_CELSIUS
return UnitOfTemperature.FAHRENHEIT
return UnitOfTemperature.CELSIUS
@property
def current_temperature(self) -> float | None: