Convert components to async-def syntax (#1821)

This commit is contained in:
Otto Winter
2021-05-24 10:58:29 +02:00
committed by GitHub
parent b92702a312
commit 2376a2c941
296 changed files with 1423 additions and 1424 deletions
+3 -3
View File
@@ -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]))