From 94978d0063f99fedc049908347e8fa7948fa833f Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Wed, 7 Nov 2018 23:27:06 +0100 Subject: [PATCH] Fix HLW8012 Voltage Divider option not being added to source (#224) --- esphomeyaml/components/sensor/hlw8012.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/esphomeyaml/components/sensor/hlw8012.py b/esphomeyaml/components/sensor/hlw8012.py index 65bafbb69f..818e2802c6 100644 --- a/esphomeyaml/components/sensor/hlw8012.py +++ b/esphomeyaml/components/sensor/hlw8012.py @@ -50,6 +50,8 @@ def to_code(config): sensor.register_sensor(hlw.make_power_sensor(conf[CONF_NAME]), conf) if CONF_CURRENT_RESISTOR in config: add(hlw.set_current_resistor(config[CONF_CURRENT_RESISTOR])) + if CONF_VOLTAGE_DIVIDER in config: + add(hlw.set_voltage_divider(config[CONF_VOLTAGE_DIVIDER])) if CONF_CHANGE_MODE_EVERY in config: add(hlw.set_change_mode_every(config[CONF_CHANGE_MODE_EVERY]))