mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Use Irradiance device class in tomorrowio (#83574)
This commit is contained in:
parent
911863ebf4
commit
6c8823fc14
@ -24,9 +24,8 @@ from homeassistant.const import (
|
|||||||
CONCENTRATION_PARTS_PER_MILLION,
|
CONCENTRATION_PARTS_PER_MILLION,
|
||||||
CONF_API_KEY,
|
CONF_API_KEY,
|
||||||
CONF_NAME,
|
CONF_NAME,
|
||||||
IRRADIATION_BTUS_PER_HOUR_SQUARE_FOOT,
|
|
||||||
IRRADIATION_WATTS_PER_SQUARE_METER,
|
|
||||||
PERCENTAGE,
|
PERCENTAGE,
|
||||||
|
UnitOfIrradiance,
|
||||||
UnitOfLength,
|
UnitOfLength,
|
||||||
UnitOfPressure,
|
UnitOfPressure,
|
||||||
UnitOfSpeed,
|
UnitOfSpeed,
|
||||||
@ -122,9 +121,10 @@ SENSOR_TYPES = (
|
|||||||
TomorrowioSensorEntityDescription(
|
TomorrowioSensorEntityDescription(
|
||||||
key=TMRW_ATTR_SOLAR_GHI,
|
key=TMRW_ATTR_SOLAR_GHI,
|
||||||
name="Global Horizontal Irradiance",
|
name="Global Horizontal Irradiance",
|
||||||
unit_imperial=IRRADIATION_BTUS_PER_HOUR_SQUARE_FOOT,
|
unit_imperial=UnitOfIrradiance.BTUS_PER_HOUR_SQUARE_FOOT,
|
||||||
unit_metric=IRRADIATION_WATTS_PER_SQUARE_METER,
|
unit_metric=UnitOfIrradiance.WATTS_PER_SQUARE_METER,
|
||||||
imperial_conversion=(1 / 3.15459),
|
imperial_conversion=(1 / 3.15459),
|
||||||
|
device_class=SensorDeviceClass.IRRADIANCE,
|
||||||
),
|
),
|
||||||
# Data comes in as km, convert to miles for imperial
|
# Data comes in as km, convert to miles for imperial
|
||||||
TomorrowioSensorEntityDescription(
|
TomorrowioSensorEntityDescription(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user