1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-21 04:32:23 +01:00

Add resistance_sampler interface for config validation (#5718)

This commit is contained in:
Jesse Hills
2023-11-10 11:40:07 +13:00
committed by GitHub
parent bc7519f645
commit 01d28ce3fc
6 changed files with 33 additions and 6 deletions

View File

@@ -2,7 +2,7 @@ from math import log
import esphome.config_validation as cv
import esphome.codegen as cg
from esphome.components import sensor
from esphome.components import sensor, resistance_sampler
from esphome.const import (
CONF_CALIBRATION,
CONF_REFERENCE_RESISTANCE,
@@ -15,6 +15,8 @@ from esphome.const import (
UNIT_CELSIUS,
)
AUTO_LOAD = ["resistance_sampler"]
ntc_ns = cg.esphome_ns.namespace("ntc")
NTC = ntc_ns.class_("NTC", cg.Component, sensor.Sensor)
@@ -124,7 +126,7 @@ CONFIG_SCHEMA = (
)
.extend(
{
cv.Required(CONF_SENSOR): cv.use_id(sensor.Sensor),
cv.Required(CONF_SENSOR): cv.use_id(resistance_sampler.ResistanceSampler),
cv.Required(CONF_CALIBRATION): process_calibration,
}
)