mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-06-04 03:48:29 +02:00
Refactor Sensirion Sensors (#3374)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
@@ -1,25 +1,30 @@
|
||||
import esphome.codegen as cg
|
||||
import esphome.config_validation as cv
|
||||
from esphome.components import i2c, sensor
|
||||
from esphome.components import i2c, sensor, sensirion_common
|
||||
|
||||
from esphome.const import (
|
||||
CONF_STORE_BASELINE,
|
||||
CONF_TEMPERATURE_SOURCE,
|
||||
ICON_RADIATOR,
|
||||
DEVICE_CLASS_VOLATILE_ORGANIC_COMPOUNDS,
|
||||
STATE_CLASS_MEASUREMENT,
|
||||
)
|
||||
|
||||
DEPENDENCIES = ["i2c"]
|
||||
AUTO_LOAD = ["sensirion_common"]
|
||||
|
||||
CODEOWNERS = ["@SenexCrenshaw"]
|
||||
|
||||
sgp40_ns = cg.esphome_ns.namespace("sgp40")
|
||||
SGP40Component = sgp40_ns.class_(
|
||||
"SGP40Component", sensor.Sensor, cg.PollingComponent, i2c.I2CDevice
|
||||
"SGP40Component",
|
||||
sensor.Sensor,
|
||||
cg.PollingComponent,
|
||||
sensirion_common.SensirionI2CDevice,
|
||||
)
|
||||
|
||||
CONF_COMPENSATION = "compensation"
|
||||
CONF_HUMIDITY_SOURCE = "humidity_source"
|
||||
CONF_TEMPERATURE_SOURCE = "temperature_source"
|
||||
CONF_STORE_BASELINE = "store_baseline"
|
||||
CONF_VOC_BASELINE = "voc_baseline"
|
||||
|
||||
CONFIG_SCHEMA = (
|
||||
|
||||
Reference in New Issue
Block a user