mirror of
https://github.com/esphome/esphome.git
synced 2025-10-02 18:12:20 +01:00
Convert components to async-def syntax (#1821)
This commit is contained in:
@@ -19,8 +19,8 @@ CONFIG_SCHEMA = cv.Schema(
|
||||
)
|
||||
|
||||
|
||||
def to_code(config):
|
||||
template_ = yield cg.process_lambda(
|
||||
async def to_code(config):
|
||||
template_ = await cg.process_lambda(
|
||||
config[CONF_LAMBDA], [], return_type=cg.std_vector.template(cg.ComponentPtr)
|
||||
)
|
||||
|
||||
@@ -28,4 +28,4 @@ def to_code(config):
|
||||
var = cg.variable(config[CONF_ID], rhs)
|
||||
for i, conf in enumerate(config.get(CONF_COMPONENTS, [])):
|
||||
comp = cg.Pvariable(conf[CONF_ID], var.get_component(i))
|
||||
yield cg.register_component(comp, conf)
|
||||
await cg.register_component(comp, conf)
|
||||
|
Reference in New Issue
Block a user