[mpr121] await register parented (#7014)

fixes https://github.com/esphome/issues/issues/5913
This commit is contained in:
Jesse Hills 2024-06-29 14:12:59 +12:00
parent 7b3d6747d5
commit 12f00a9d3d
No known key found for this signature in database
GPG Key ID: BEAAE804EFD8E83A

View File

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