[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 committed by GitHub
parent 1f5442f1ba
commit d0ab2a16a6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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