1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-29 16:42:19 +01:00

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

View File

@@ -45,10 +45,10 @@ CONFIG_SCHEMA = light.ADDRESSABLE_LIGHT_SCHEMA.extend(
)
def to_code(config):
async def to_code(config):
segments = []
for conf in config[CONF_SEGMENTS]:
var = yield cg.get_variable(conf[CONF_ID])
var = await cg.get_variable(conf[CONF_ID])
segments.append(
AddressableSegment(
var,
@@ -59,5 +59,5 @@ def to_code(config):
)
var = cg.new_Pvariable(config[CONF_OUTPUT_ID], segments)
yield cg.register_component(var, config)
yield light.register_light(var, config)
await cg.register_component(var, config)
await light.register_light(var, config)