Update components "if x in config" (#5181)

This commit is contained in:
Jesse Hills
2023-08-02 16:25:26 +12:00
committed by GitHub
parent ce8091c14e
commit f81c556b63
44 changed files with 325 additions and 413 deletions
+2 -2
View File
@@ -37,8 +37,8 @@ async def to_code(config):
cg.add(var.set_touch_threshold(config[CONF_TOUCH_THRESHOLD]))
cg.add(var.set_allow_multiple_touches(config[CONF_ALLOW_MULTIPLE_TOUCHES]))
if CONF_RESET_PIN in config:
pin = await cg.gpio_pin_expression(config[CONF_RESET_PIN])
if reset_pin_config := config.get(CONF_RESET_PIN):
pin = await cg.gpio_pin_expression(reset_pin_config)
cg.add(var.set_reset_pin(pin))
await cg.register_component(var, config)