Skip to content

Commit

Permalink
Migrate VOC sensors that use ppb to use volatile_organic_compounds_pa…
Browse files Browse the repository at this point in the history
…rts device class (#4982)
  • Loading branch information
bdraco authored and jesserockz committed Jun 21, 2023
1 parent 244a212 commit cd773a1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions esphome/components/airthings_wave_base/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
CONF_TVOC,
CONF_PRESSURE,
CONF_TEMPERATURE,
DEVICE_CLASS_VOLATILE_ORGANIC_COMPOUNDS_PARTS,
UNIT_PARTS_PER_BILLION,
ICON_RADIATOR,
)
Expand Down Expand Up @@ -53,6 +54,7 @@
unit_of_measurement=UNIT_PARTS_PER_BILLION,
icon=ICON_RADIATOR,
accuracy_decimals=0,
device_class=DEVICE_CLASS_VOLATILE_ORGANIC_COMPOUNDS_PARTS,
state_class=STATE_CLASS_MEASUREMENT,
),
}
Expand Down
4 changes: 2 additions & 2 deletions esphome/components/ccs811/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
ICON_RADIATOR,
ICON_RESTART,
DEVICE_CLASS_CARBON_DIOXIDE,
DEVICE_CLASS_VOLATILE_ORGANIC_COMPOUNDS,
DEVICE_CLASS_VOLATILE_ORGANIC_COMPOUNDS_PARTS,
STATE_CLASS_MEASUREMENT,
UNIT_PARTS_PER_MILLION,
UNIT_PARTS_PER_BILLION,
Expand Down Expand Up @@ -43,7 +43,7 @@
unit_of_measurement=UNIT_PARTS_PER_BILLION,
icon=ICON_RADIATOR,
accuracy_decimals=0,
device_class=DEVICE_CLASS_VOLATILE_ORGANIC_COMPOUNDS,
device_class=DEVICE_CLASS_VOLATILE_ORGANIC_COMPOUNDS_PARTS,
state_class=STATE_CLASS_MEASUREMENT,
),
cv.Optional(CONF_VERSION): text_sensor.text_sensor_schema(
Expand Down
4 changes: 2 additions & 2 deletions esphome/components/sgp30/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
CONF_TVOC,
ICON_RADIATOR,
DEVICE_CLASS_CARBON_DIOXIDE,
DEVICE_CLASS_VOLATILE_ORGANIC_COMPOUNDS,
DEVICE_CLASS_VOLATILE_ORGANIC_COMPOUNDS_PARTS,
STATE_CLASS_MEASUREMENT,
UNIT_PARTS_PER_MILLION,
UNIT_PARTS_PER_BILLION,
Expand Down Expand Up @@ -49,7 +49,7 @@
unit_of_measurement=UNIT_PARTS_PER_BILLION,
icon=ICON_RADIATOR,
accuracy_decimals=0,
device_class=DEVICE_CLASS_VOLATILE_ORGANIC_COMPOUNDS,
device_class=DEVICE_CLASS_VOLATILE_ORGANIC_COMPOUNDS_PARTS,
state_class=STATE_CLASS_MEASUREMENT,
),
cv.Optional(CONF_ECO2_BASELINE): sensor.sensor_schema(
Expand Down

0 comments on commit cd773a1

Please sign in to comment.