From 6c8823fc149a517304b36f4a3f3ead1f7417e30a Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Thu, 8 Dec 2022 23:52:55 +0100 Subject: [PATCH] Use Irradiance device class in tomorrowio (#83574) --- homeassistant/components/tomorrowio/sensor.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/tomorrowio/sensor.py b/homeassistant/components/tomorrowio/sensor.py index 260ce7390eb..2b7d466d2f0 100644 --- a/homeassistant/components/tomorrowio/sensor.py +++ b/homeassistant/components/tomorrowio/sensor.py @@ -24,9 +24,8 @@ from homeassistant.const import ( CONCENTRATION_PARTS_PER_MILLION, CONF_API_KEY, CONF_NAME, - IRRADIATION_BTUS_PER_HOUR_SQUARE_FOOT, - IRRADIATION_WATTS_PER_SQUARE_METER, PERCENTAGE, + UnitOfIrradiance, UnitOfLength, UnitOfPressure, UnitOfSpeed, @@ -122,9 +121,10 @@ SENSOR_TYPES = ( TomorrowioSensorEntityDescription( key=TMRW_ATTR_SOLAR_GHI, name="Global Horizontal Irradiance", - unit_imperial=IRRADIATION_BTUS_PER_HOUR_SQUARE_FOOT, - unit_metric=IRRADIATION_WATTS_PER_SQUARE_METER, + unit_imperial=UnitOfIrradiance.BTUS_PER_HOUR_SQUARE_FOOT, + unit_metric=UnitOfIrradiance.WATTS_PER_SQUARE_METER, imperial_conversion=(1 / 3.15459), + device_class=SensorDeviceClass.IRRADIANCE, ), # Data comes in as km, convert to miles for imperial TomorrowioSensorEntityDescription(