diff --git a/homeassistant/components/elkm1/__init__.py b/homeassistant/components/elkm1/__init__.py index 7b14c7e85ed..3047cf32479 100644 --- a/homeassistant/components/elkm1/__init__.py +++ b/homeassistant/components/elkm1/__init__.py @@ -25,9 +25,8 @@ from homeassistant.const import ( CONF_TEMPERATURE_UNIT, CONF_USERNAME, CONF_ZONE, - TEMP_CELSIUS, - TEMP_FAHRENHEIT, Platform, + UnitOfTemperature, ) from homeassistant.core import HomeAssistant, ServiceCall, callback from homeassistant.exceptions import ConfigEntryNotReady, HomeAssistantError @@ -298,7 +297,10 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: raise ConfigEntryNotReady(f"Timed out connecting to {conf[CONF_HOST]}") from exc elk_temp_unit = elk.panel.temperature_units - temperature_unit = TEMP_CELSIUS if elk_temp_unit == "C" else TEMP_FAHRENHEIT + if elk_temp_unit == "C": + temperature_unit = UnitOfTemperature.CELSIUS + else: + temperature_unit = UnitOfTemperature.FAHRENHEIT config["temperature_unit"] = temperature_unit hass.data[DOMAIN][entry.entry_id] = { "elk": elk,