mirror of
https://github.com/esphome/esphome.git
synced 2024-12-27 17:28:01 +01:00
modify SGP4X integration to report device_class as air quality index (#4327)
This commit is contained in:
parent
3facfa5c21
commit
9494c27ad8
@ -6,8 +6,7 @@ from esphome.const import (
|
|||||||
CONF_STORE_BASELINE,
|
CONF_STORE_BASELINE,
|
||||||
CONF_TEMPERATURE_SOURCE,
|
CONF_TEMPERATURE_SOURCE,
|
||||||
ICON_RADIATOR,
|
ICON_RADIATOR,
|
||||||
DEVICE_CLASS_NITROUS_OXIDE,
|
DEVICE_CLASS_AQI,
|
||||||
DEVICE_CLASS_VOLATILE_ORGANIC_COMPOUNDS,
|
|
||||||
STATE_CLASS_MEASUREMENT,
|
STATE_CLASS_MEASUREMENT,
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -67,13 +66,13 @@ CONFIG_SCHEMA = cv.All(
|
|||||||
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,
|
||||||
|
Loading…
Reference in New Issue
Block a user