Add new unit types for better type checking (#53124)
* Add new unit types * Update helper functions * Update components * Update lcn climate
This commit is contained in:
parent
78f4a49b73
commit
71a8ae3016
15 changed files with 254 additions and 152 deletions
|
@ -19,7 +19,12 @@ from homeassistant.components.climate.const import (
|
|||
)
|
||||
from homeassistant.components.mysensors.const import MYSENSORS_DISCOVERY, DiscoveryInfo
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import ATTR_TEMPERATURE, TEMP_CELSIUS, TEMP_FAHRENHEIT
|
||||
from homeassistant.const import (
|
||||
ATTR_TEMPERATURE,
|
||||
TEMP_CELSIUS,
|
||||
TEMP_FAHRENHEIT,
|
||||
UnitTemperatureT,
|
||||
)
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
|
@ -91,7 +96,7 @@ class MySensorsHVAC(mysensors.device.MySensorsEntity, ClimateEntity):
|
|||
return features
|
||||
|
||||
@property
|
||||
def temperature_unit(self) -> str:
|
||||
def temperature_unit(self) -> UnitTemperatureT:
|
||||
"""Return the unit of measurement."""
|
||||
return TEMP_CELSIUS if self.hass.config.units.is_metric else TEMP_FAHRENHEIT
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue