Fix HLW8012 Voltage Divider option not being added to source (#224)

This commit is contained in:
Otto Winter 2018-11-07 23:27:06 +01:00 committed by GitHub
parent 415e12309b
commit 94978d0063
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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]))