Update ENS160 TVOC device_class and AQI units to match required by HA (#5939)

This commit is contained in:
mrtoy-me 2023-12-15 15:39:05 +10:00 committed by Jesse Hills
parent 6b5eb7e656
commit e030c0fc45
No known key found for this signature in database
GPG key ID: BEAAE804EFD8E83A

View file

@ -9,7 +9,7 @@ from esphome.const import (
CONF_TVOC, CONF_TVOC,
DEVICE_CLASS_AQI, DEVICE_CLASS_AQI,
DEVICE_CLASS_CARBON_DIOXIDE, DEVICE_CLASS_CARBON_DIOXIDE,
DEVICE_CLASS_VOLATILE_ORGANIC_COMPOUNDS, DEVICE_CLASS_VOLATILE_ORGANIC_COMPOUNDS_PARTS,
ICON_CHEMICAL_WEAPON, ICON_CHEMICAL_WEAPON,
ICON_MOLECULE_CO2, ICON_MOLECULE_CO2,
ICON_RADIATOR, ICON_RADIATOR,
@ -45,11 +45,10 @@ CONFIG_SCHEMA = (
unit_of_measurement=UNIT_PARTS_PER_BILLION, unit_of_measurement=UNIT_PARTS_PER_BILLION,
icon=ICON_RADIATOR, icon=ICON_RADIATOR,
accuracy_decimals=0, accuracy_decimals=0,
device_class=DEVICE_CLASS_VOLATILE_ORGANIC_COMPOUNDS, device_class=DEVICE_CLASS_VOLATILE_ORGANIC_COMPOUNDS_PARTS,
state_class=STATE_CLASS_MEASUREMENT, state_class=STATE_CLASS_MEASUREMENT,
), ),
cv.Required(CONF_AQI): sensor.sensor_schema( cv.Required(CONF_AQI): sensor.sensor_schema(
unit_of_measurement=UNIT_INDEX,
icon=ICON_CHEMICAL_WEAPON, icon=ICON_CHEMICAL_WEAPON,
accuracy_decimals=0, accuracy_decimals=0,
device_class=DEVICE_CLASS_AQI, device_class=DEVICE_CLASS_AQI,