Use UnitOfTemperature in climate entities [g-l] (#83127)
* Use UnitOfTemperature in climate entities [g-l] * Adjust gree * Adjust honeywell
This commit is contained in:
parent
40d337479e
commit
68e454712d
19 changed files with 60 additions and 71 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue