diff --git a/homeassistant/components/ambient_station/sensor.py b/homeassistant/components/ambient_station/sensor.py index af7e163bd6a..a849550a6ee 100644 --- a/homeassistant/components/ambient_station/sensor.py +++ b/homeassistant/components/ambient_station/sensor.py @@ -15,9 +15,9 @@ from homeassistant.const import ( CONCENTRATION_MICROGRAMS_PER_CUBIC_METER, CONCENTRATION_PARTS_PER_MILLION, DEGREE, - IRRADIATION_WATTS_PER_SQUARE_METER, LIGHT_LUX, PERCENTAGE, + UnitOfIrradiance, UnitOfPrecipitationDepth, UnitOfPressure, UnitOfSpeed, @@ -486,8 +486,8 @@ SENSOR_DESCRIPTIONS = ( SensorEntityDescription( key=TYPE_SOLARRADIATION, name="Solar rad", - native_unit_of_measurement=IRRADIATION_WATTS_PER_SQUARE_METER, - device_class=SensorDeviceClass.ILLUMINANCE, + native_unit_of_measurement=UnitOfIrradiance.WATTS_PER_SQUARE_METER, + device_class=SensorDeviceClass.IRRADIANCE, state_class=SensorStateClass.MEASUREMENT, ), SensorEntityDescription( diff --git a/homeassistant/components/buienradar/sensor.py b/homeassistant/components/buienradar/sensor.py index 50a1cea6b0a..1ba51e476d8 100644 --- a/homeassistant/components/buienradar/sensor.py +++ b/homeassistant/components/buienradar/sensor.py @@ -34,8 +34,8 @@ from homeassistant.const import ( CONF_LONGITUDE, CONF_NAME, DEGREE, - IRRADIATION_WATTS_PER_SQUARE_METER, PERCENTAGE, + UnitOfIrradiance, UnitOfLength, UnitOfPrecipitationDepth, UnitOfPressure, @@ -188,8 +188,8 @@ SENSOR_TYPES: tuple[SensorEntityDescription, ...] = ( SensorEntityDescription( key="irradiance", name="Irradiance", - native_unit_of_measurement=IRRADIATION_WATTS_PER_SQUARE_METER, - icon="mdi:sunglasses", + device_class=SensorDeviceClass.IRRADIANCE, + native_unit_of_measurement=UnitOfIrradiance.WATTS_PER_SQUARE_METER, state_class=SensorStateClass.MEASUREMENT, ), SensorEntityDescription( diff --git a/homeassistant/components/ecowitt/sensor.py b/homeassistant/components/ecowitt/sensor.py index 1a62d90d15e..5bbe22b6972 100644 --- a/homeassistant/components/ecowitt/sensor.py +++ b/homeassistant/components/ecowitt/sensor.py @@ -18,11 +18,11 @@ from homeassistant.const import ( CONCENTRATION_MICROGRAMS_PER_CUBIC_METER, CONCENTRATION_PARTS_PER_MILLION, DEGREE, - IRRADIATION_WATTS_PER_SQUARE_METER, LIGHT_LUX, PERCENTAGE, UV_INDEX, UnitOfElectricPotential, + UnitOfIrradiance, UnitOfLength, UnitOfPrecipitationDepth, UnitOfPressure, @@ -68,7 +68,8 @@ ECOWITT_SENSORS_MAPPING: Final = { ), EcoWittSensorTypes.WATT_METERS_SQUARED: SensorEntityDescription( key="WATT_METERS_SQUARED", - native_unit_of_measurement=IRRADIATION_WATTS_PER_SQUARE_METER, + device_class=SensorDeviceClass.IRRADIANCE, + native_unit_of_measurement=UnitOfIrradiance.WATTS_PER_SQUARE_METER, state_class=SensorStateClass.MEASUREMENT, ), EcoWittSensorTypes.UV_INDEX: SensorEntityDescription( diff --git a/homeassistant/components/zwave_js/discovery_data_template.py b/homeassistant/components/zwave_js/discovery_data_template.py index 0ee7c3d758e..1e2ad1df366 100644 --- a/homeassistant/components/zwave_js/discovery_data_template.py +++ b/homeassistant/components/zwave_js/discovery_data_template.py @@ -98,7 +98,6 @@ from homeassistant.const import ( ELECTRIC_POTENTIAL_VOLT, FREQUENCY_HERTZ, FREQUENCY_KILOHERTZ, - IRRADIATION_WATTS_PER_SQUARE_METER, LIGHT_LUX, PERCENTAGE, SIGNAL_STRENGTH_DECIBELS, @@ -107,6 +106,7 @@ from homeassistant.const import ( VOLUME_FLOW_RATE_CUBIC_FEET_PER_MINUTE, VOLUME_FLOW_RATE_CUBIC_METERS_PER_HOUR, UnitOfEnergy, + UnitOfIrradiance, UnitOfLength, UnitOfMass, UnitOfPower, @@ -209,7 +209,7 @@ MULTILEVEL_SENSOR_UNIT_MAP: dict[str, set[MultilevelSensorScaleType]] = { UnitOfPressure.MMHG: UNIT_SYSTOLIC, ELECTRIC_POTENTIAL_VOLT: SENSOR_UNIT_VOLT, UnitOfPower.WATT: SENSOR_UNIT_WATT, - IRRADIATION_WATTS_PER_SQUARE_METER: UNIT_WATT_PER_SQUARE_METER, + UnitOfIrradiance.WATTS_PER_SQUARE_METER: UNIT_WATT_PER_SQUARE_METER, } _LOGGER = logging.getLogger(__name__)