From fc94569a0d807885141518e076871ab9b080ef90 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Wed, 21 Dec 2022 10:11:08 +0100 Subject: [PATCH] Use unit enums in honeywell (#84344) --- homeassistant/components/honeywell/sensor.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/honeywell/sensor.py b/homeassistant/components/honeywell/sensor.py index 3a4e8f777b2..ca7320d7c4c 100644 --- a/homeassistant/components/honeywell/sensor.py +++ b/homeassistant/components/honeywell/sensor.py @@ -14,7 +14,7 @@ from homeassistant.components.sensor import ( SensorStateClass, ) from homeassistant.config_entries import ConfigEntry -from homeassistant.const import PERCENTAGE, TEMP_CELSIUS, TEMP_FAHRENHEIT +from homeassistant.const import PERCENTAGE, UnitOfTemperature from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform import AddEntitiesCallback from homeassistant.helpers.typing import StateType @@ -24,7 +24,9 @@ from .const import DOMAIN, HUMIDITY_STATUS_KEY, TEMPERATURE_STATUS_KEY def _get_temperature_sensor_unit(device: Device) -> str: """Get the correct temperature unit for the device.""" - return TEMP_CELSIUS if device.temperature_unit == "C" else TEMP_FAHRENHEIT + if device.temperature_unit == "C": + return UnitOfTemperature.CELSIUS + return UnitOfTemperature.FAHRENHEIT @dataclass