mirror of
https://github.com/esphome/esphome.git
synced 2024-11-12 10:16:02 +01:00
[mpr121] await register parented (#7014)
fixes https://github.com/esphome/issues/issues/5913
This commit is contained in:
parent
7b3d6747d5
commit
12f00a9d3d
@ -27,7 +27,7 @@ async def to_code(config):
|
|||||||
var = await binary_sensor.new_binary_sensor(config)
|
var = await binary_sensor.new_binary_sensor(config)
|
||||||
hub = await cg.get_variable(config[CONF_MPR121_ID])
|
hub = await cg.get_variable(config[CONF_MPR121_ID])
|
||||||
cg.add(var.set_channel(config[CONF_CHANNEL]))
|
cg.add(var.set_channel(config[CONF_CHANNEL]))
|
||||||
cg.register_parented(var, hub)
|
await cg.register_parented(var, hub)
|
||||||
|
|
||||||
if CONF_TOUCH_THRESHOLD in config:
|
if CONF_TOUCH_THRESHOLD in config:
|
||||||
cg.add(var.set_touch_threshold(config[CONF_TOUCH_THRESHOLD]))
|
cg.add(var.set_touch_threshold(config[CONF_TOUCH_THRESHOLD]))
|
||||||
|
Loading…
Reference in New Issue
Block a user