From 36fcf198b1fcb142b88de24e175c7d9b59cfaaf8 Mon Sep 17 00:00:00 2001 From: Nathan Spencer Date: Sun, 15 Oct 2023 11:11:34 -0600 Subject: [PATCH] Adjust WeatherFlow air density sensor device class and unit (#101777) --- homeassistant/components/weatherflow/sensor.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/homeassistant/components/weatherflow/sensor.py b/homeassistant/components/weatherflow/sensor.py index cd648fda360..bc5d38e99e5 100644 --- a/homeassistant/components/weatherflow/sensor.py +++ b/homeassistant/components/weatherflow/sensor.py @@ -21,7 +21,6 @@ from homeassistant.components.sensor import ( ) from homeassistant.config_entries import ConfigEntry from homeassistant.const import ( - CONCENTRATION_MICROGRAMS_PER_CUBIC_METER, DEGREE, LIGHT_LUX, PERCENTAGE, @@ -80,11 +79,10 @@ SENSORS: tuple[WeatherFlowSensorEntityDescription, ...] = ( WeatherFlowSensorEntityDescription( key="air_density", translation_key="air_density", - native_unit_of_measurement=CONCENTRATION_MICROGRAMS_PER_CUBIC_METER, - device_class=SensorDeviceClass.VOLATILE_ORGANIC_COMPOUNDS, + native_unit_of_measurement="kg/m³", state_class=SensorStateClass.MEASUREMENT, - suggested_display_precision=3, - raw_data_conv_fn=lambda raw_data: raw_data.m * 1000000, + suggested_display_precision=5, + raw_data_conv_fn=lambda raw_data: raw_data.magnitude, ), WeatherFlowSensorEntityDescription( key="air_temperature",