[sgp30][sgp4x] Migrate CONF_HUMIDITY_SOURCE to const.py (#19436)

This commit is contained in:
Jeff Brown
2026-09-24 17:54:58 -04:00
committed by GitHub
parent 73ca04579c
commit 3ef0acd4b2
3 changed files with 7 additions and 4 deletions
+1
View File
@@ -23,6 +23,7 @@ CONF_ENABLE_OTA_DOWNGRADE_PROTECTION = "enable_ota_downgrade_protection"
CONF_ENABLED = "enabled"
CONF_GYROSCOPE_ODR = "gyroscope_odr"
CONF_GYROSCOPE_RANGE = "gyroscope_range"
CONF_HUMIDITY_SOURCE = "humidity_source"
CONF_IAQ = "iaq"
CONF_IGNORE_NOT_FOUND = "ignore_not_found"
CONF_IS_WRGB = "is_wrgb"
+1 -1
View File
@@ -1,5 +1,6 @@
import esphome.codegen as cg
from esphome.components import i2c, sensirion_common, sensor
from esphome.components.const import CONF_HUMIDITY_SOURCE
import esphome.config_validation as cv
from esphome.const import (
CONF_BASELINE,
@@ -31,7 +32,6 @@ SGP30Component = sgp30_ns.class_(
CONF_ECO2_BASELINE = "eco2_baseline"
CONF_TVOC_BASELINE = "tvoc_baseline"
CONF_UPTIME = "uptime"
CONF_HUMIDITY_SOURCE = "humidity_source"
CONFIG_SCHEMA = (
+5 -3
View File
@@ -1,6 +1,10 @@
import esphome.codegen as cg
from esphome.components import i2c, sensirion_common, sensor
from esphome.components.const import CONF_NOX_INDEX, CONF_VOC_INDEX
from esphome.components.const import (
CONF_HUMIDITY_SOURCE,
CONF_NOX_INDEX,
CONF_VOC_INDEX,
)
import esphome.config_validation as cv
from esphome.const import (
CONF_ALGORITHM_TUNING,
@@ -33,8 +37,6 @@ SGP4xComponent = sgp4x_ns.class_(
sensirion_common.SensirionI2CDevice,
)
CONF_HUMIDITY_SOURCE = "humidity_source"
def validate_sensors(config: ConfigType) -> ConfigType:
if CONF_VOC_INDEX not in config and CONF_NOX_INDEX not in config: