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:
@@ -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,
|
||||
}
|
||||
)
|
||||
|
Reference in New Issue
Block a user