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:
@@ -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)
|
||||
|
Reference in New Issue
Block a user