mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-06-04 03:48:29 +02:00
Convert core components to async-def coroutine syntax (#1658)
Co-authored-by: Guillermo Ruffino <glm.net@gmail.com> Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
@@ -16,10 +16,10 @@ CONFIG_SCHEMA = cv.Schema(
|
||||
|
||||
|
||||
@coroutine_with_priority(80.0)
|
||||
def to_code(config):
|
||||
pin = yield cg.gpio_pin_expression(config[CONF_PIN])
|
||||
async def to_code(config):
|
||||
pin = await cg.gpio_pin_expression(config[CONF_PIN])
|
||||
rhs = StatusLED.new(pin)
|
||||
var = cg.Pvariable(config[CONF_ID], rhs)
|
||||
yield cg.register_component(var, config)
|
||||
await cg.register_component(var, config)
|
||||
cg.add(var.pre_setup())
|
||||
cg.add_define("USE_STATUS_LED")
|
||||
|
||||
Reference in New Issue
Block a user