mirror of
https://github.com/esphome/esphome.git
synced 2025-10-30 06:33:51 +00:00
Convert components to async-def syntax (#1821)
This commit is contained in:
@@ -16,13 +16,13 @@ CONFIG_SCHEMA = light.RGB_LIGHT_SCHEMA.extend(
|
||||
)
|
||||
|
||||
|
||||
def to_code(config):
|
||||
async def to_code(config):
|
||||
var = cg.new_Pvariable(config[CONF_OUTPUT_ID])
|
||||
yield light.register_light(var, config)
|
||||
await light.register_light(var, config)
|
||||
|
||||
red = yield cg.get_variable(config[CONF_RED])
|
||||
red = await cg.get_variable(config[CONF_RED])
|
||||
cg.add(var.set_red(red))
|
||||
green = yield cg.get_variable(config[CONF_GREEN])
|
||||
green = await cg.get_variable(config[CONF_GREEN])
|
||||
cg.add(var.set_green(green))
|
||||
blue = yield cg.get_variable(config[CONF_BLUE])
|
||||
blue = await cg.get_variable(config[CONF_BLUE])
|
||||
cg.add(var.set_blue(blue))
|
||||
|
||||
Reference in New Issue
Block a user