mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-05-28 08:48:27 +02:00
Convert components to async-def syntax (#1821)
This commit is contained in:
@@ -19,10 +19,10 @@ CONFIG_SCHEMA = automation.validate_automation(
|
||||
)
|
||||
|
||||
|
||||
def to_code(config):
|
||||
async def to_code(config):
|
||||
for conf in config:
|
||||
var = cg.new_Pvariable(conf[CONF_ID])
|
||||
yield cg.register_component(var, conf)
|
||||
yield automation.build_automation(var, [], conf)
|
||||
await cg.register_component(var, conf)
|
||||
await automation.build_automation(var, [], conf)
|
||||
|
||||
cg.add(var.set_update_interval(conf[CONF_INTERVAL]))
|
||||
|
||||
Reference in New Issue
Block a user