mirror of
https://github.com/esphome/esphome.git
synced 2025-10-30 14:43:51 +00:00
Fix docker build
This commit is contained in:
@@ -43,10 +43,10 @@ def to_code(config):
|
||||
conf = config[CONF_VOLTAGE]
|
||||
sensor.register_sensor(hlw.make_voltage_sensor(conf[CONF_NAME]), conf)
|
||||
if CONF_CURRENT in config:
|
||||
conf = config[CONF_VOLTAGE]
|
||||
conf = config[CONF_CURRENT]
|
||||
sensor.register_sensor(hlw.make_current_sensor(conf[CONF_NAME]), conf)
|
||||
if CONF_POWER in config:
|
||||
conf = config[CONF_VOLTAGE]
|
||||
conf = config[CONF_POWER]
|
||||
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]))
|
||||
|
||||
@@ -33,7 +33,7 @@ def validate_range(value):
|
||||
value = cv.string(value)
|
||||
if value.endswith(u'µT') or value.endswith('uT'):
|
||||
value = value[:-2]
|
||||
return cv.one_of(*HMC5883L_RANGES)(value)
|
||||
return cv.one_of(*HMC5883L_RANGES)(int(value))
|
||||
|
||||
|
||||
PLATFORM_SCHEMA = vol.All(sensor.PLATFORM_SCHEMA.extend({
|
||||
|
||||
@@ -38,7 +38,7 @@ def to_code(config):
|
||||
make = variable(config[CONF_MAKE_ID], rhs)
|
||||
|
||||
if CONF_GAIN in config:
|
||||
add(make.Phx711.set_gain(GAINS[CONF_GAIN]))
|
||||
add(make.Phx711.set_gain(GAINS[config[CONF_GAIN]]))
|
||||
|
||||
sensor.setup_sensor(make.Phx711, make.Pmqtt, config)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user