1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-06 03:43:49 +01:00

Convert components to async-def syntax (#1823)

* Convert components to async-def syntax

* Remove stray @coroutine

* Manual part

* Convert complexer components code to async-def

* Manual cleanup

* More manual cleanup
This commit is contained in:
Otto Winter
2021-05-24 21:45:31 +02:00
committed by GitHub
parent 93d9d4b50a
commit a33bb32874
60 changed files with 592 additions and 633 deletions

View File

@@ -29,10 +29,10 @@ CONFIG_SCHEMA = time.TIME_SCHEMA.extend(
}
),
)
def ds1307_write_time_to_code(config, action_id, template_arg, args):
async def ds1307_write_time_to_code(config, action_id, template_arg, args):
var = cg.new_Pvariable(action_id, template_arg)
yield cg.register_parented(var, config[CONF_ID])
yield var
await cg.register_parented(var, config[CONF_ID])
return var
@automation.register_action(
@@ -44,10 +44,10 @@ def ds1307_write_time_to_code(config, action_id, template_arg, args):
}
),
)
def ds1307_read_time_to_code(config, action_id, template_arg, args):
async def ds1307_read_time_to_code(config, action_id, template_arg, args):
var = cg.new_Pvariable(action_id, template_arg)
yield cg.register_parented(var, config[CONF_ID])
yield var
await cg.register_parented(var, config[CONF_ID])
return var
async def to_code(config):