mirror of
https://github.com/esphome/esphome.git
synced 2025-03-15 15:18:16 +00:00
fixes remove duplicate line
remove threshold settings
This commit is contained in:
parent
b15fbae7f2
commit
81d4988ca6
@ -20,16 +20,12 @@ CONFIG_SCHEMA = binary_sensor.BINARY_SENSOR_SCHEMA.extend({
|
||||
def to_code(config):
|
||||
var = cg.new_Pvariable(config[CONF_ID])
|
||||
yield binary_sensor.register_binary_sensor(var, config)
|
||||
hub = yield cg.get_variable(config[CONF_MPR121_ID])
|
||||
|
||||
hub = yield cg.get_variable(config[CONF_MPR121_ID])
|
||||
cg.add(var.set_channel(config[CONF_CHANNEL]))
|
||||
|
||||
if CONF_TOUCH_THRESHOLD in config:
|
||||
cg.add(var.set_touch_threshold(config[CONF_TOUCH_THRESHOLD]))
|
||||
else:
|
||||
cg.add(var.set_touch_threshold(hub.get_touch_threshold()))
|
||||
if CONF_RELEASE_THRESHOLD in config:
|
||||
cg.add(var.set_release_threshold(config[CONF_RELEASE_THRESHOLD]))
|
||||
else:
|
||||
cg.add(var.set_release_threshold(hub.get_release_threshold()))
|
||||
|
||||
cg.add(hub.register_channel(var))
|
||||
|
Loading…
x
Reference in New Issue
Block a user