Skip to content

Commit 5d2877f

Browse files
authored
Add absolute humidity sensor to Awair integration (home-assistant#150110)
1 parent 2d89c60 commit 5d2877f

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

homeassistant/components/awair/const.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from datetime import timedelta
66
import logging
77

8+
API_ABS_HUMID = "abs_humid"
89
API_CO2 = "carbon_dioxide"
910
API_DEW_POINT = "dew_point"
1011
API_DUST = "dust"

homeassistant/components/awair/sensor.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from homeassistant.const import (
1919
ATTR_CONNECTIONS,
2020
ATTR_SW_VERSION,
21+
CONCENTRATION_GRAMS_PER_CUBIC_METER,
2122
CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
2223
CONCENTRATION_PARTS_PER_BILLION,
2324
CONCENTRATION_PARTS_PER_MILLION,
@@ -33,6 +34,7 @@
3334
from homeassistant.helpers.update_coordinator import CoordinatorEntity
3435

3536
from .const import (
37+
API_ABS_HUMID,
3638
API_CO2,
3739
API_DEW_POINT,
3840
API_DUST,
@@ -120,6 +122,14 @@ class AwairSensorEntityDescription(SensorEntityDescription):
120122
state_class=SensorStateClass.MEASUREMENT,
121123
entity_registry_enabled_default=False,
122124
),
125+
AwairSensorEntityDescription(
126+
key=API_ABS_HUMID,
127+
device_class=SensorDeviceClass.ABSOLUTE_HUMIDITY,
128+
native_unit_of_measurement=CONCENTRATION_GRAMS_PER_CUBIC_METER,
129+
unique_id_tag="absolute_humidity",
130+
state_class=SensorStateClass.MEASUREMENT,
131+
entity_registry_enabled_default=False,
132+
),
123133
)
124134

125135
SENSOR_TYPES_DUST: tuple[AwairSensorEntityDescription, ...] = (

0 commit comments

Comments
 (0)