From 667ed94e294bd17e1453ef322205dc00a6b4c9f6 Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Tue, 28 May 2019 22:27:39 +0200 Subject: [PATCH] Fix NTC steinhart-hart issue --- esphome/components/ntc/sensor.py | 2 +- tests/test3.yaml | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/esphome/components/ntc/sensor.py b/esphome/components/ntc/sensor.py index db7d7f9b99..a528183ac8 100644 --- a/esphome/components/ntc/sensor.py +++ b/esphome/components/ntc/sensor.py @@ -24,7 +24,7 @@ def validate_calibration_parameter(value): return cv.Schema({ cv.Required(CONF_TEMPERATURE): cv.float_, cv.Required(CONF_VALUE): cv.float_, - }) + })(value) value = cv.string(value) parts = value.split('->') diff --git a/tests/test3.yaml b/tests/test3.yaml index fb46043f34..d35df89ee2 100644 --- a/tests/test3.yaml +++ b/tests/test3.yaml @@ -129,6 +129,13 @@ sensor: b_constant: 3950 reference_resistance: 10k reference_temperature: 25°C + - platform: ntc + sensor: resist + name: NTC Sensor2 + calibration: + - 10.0kOhm -> 25°C + - 27.219kOhm -> 0°C + - 14.674kOhm -> 15°C - platform: tcs34725 red_channel: name: Red Channel