Use AQI device class (#6376)

This commit is contained in:
Federico G. Schwindt 2024-03-16 01:21:44 +00:00 committed by Jesse Hills
parent 4180eae68f
commit a5553827f1
No known key found for this signature in database
GPG key ID: BEAAE804EFD8E83A

View file

@ -14,13 +14,12 @@ from esphome.const import (
CONF_PM_4_0, CONF_PM_4_0,
CONF_STORE_BASELINE, CONF_STORE_BASELINE,
CONF_TEMPERATURE, CONF_TEMPERATURE,
DEVICE_CLASS_AQI,
DEVICE_CLASS_HUMIDITY, DEVICE_CLASS_HUMIDITY,
DEVICE_CLASS_NITROUS_OXIDE,
DEVICE_CLASS_PM1, DEVICE_CLASS_PM1,
DEVICE_CLASS_PM10, DEVICE_CLASS_PM10,
DEVICE_CLASS_PM25, DEVICE_CLASS_PM25,
DEVICE_CLASS_TEMPERATURE, DEVICE_CLASS_TEMPERATURE,
DEVICE_CLASS_VOLATILE_ORGANIC_COMPOUNDS,
ICON_CHEMICAL_WEAPON, ICON_CHEMICAL_WEAPON,
ICON_RADIATOR, ICON_RADIATOR,
ICON_THERMOMETER, ICON_THERMOMETER,
@ -132,13 +131,13 @@ CONFIG_SCHEMA = (
cv.Optional(CONF_VOC): sensor.sensor_schema( cv.Optional(CONF_VOC): sensor.sensor_schema(
icon=ICON_RADIATOR, icon=ICON_RADIATOR,
accuracy_decimals=0, accuracy_decimals=0,
device_class=DEVICE_CLASS_VOLATILE_ORGANIC_COMPOUNDS, device_class=DEVICE_CLASS_AQI,
state_class=STATE_CLASS_MEASUREMENT, state_class=STATE_CLASS_MEASUREMENT,
).extend(GAS_SENSOR), ).extend(GAS_SENSOR),
cv.Optional(CONF_NOX): sensor.sensor_schema( cv.Optional(CONF_NOX): sensor.sensor_schema(
icon=ICON_RADIATOR, icon=ICON_RADIATOR,
accuracy_decimals=0, accuracy_decimals=0,
device_class=DEVICE_CLASS_NITROUS_OXIDE, device_class=DEVICE_CLASS_AQI,
state_class=STATE_CLASS_MEASUREMENT, state_class=STATE_CLASS_MEASUREMENT,
).extend(GAS_SENSOR), ).extend(GAS_SENSOR),
cv.Optional(CONF_STORE_BASELINE, default=True): cv.boolean, cv.Optional(CONF_STORE_BASELINE, default=True): cv.boolean,