1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-29 22:24:26 +00:00

Convert components to async-def syntax (#1823)

* Convert components to async-def syntax

* Remove stray @coroutine

* Manual part

* Convert complexer components code to async-def

* Manual cleanup

* More manual cleanup
This commit is contained in:
Otto Winter
2021-05-24 21:45:31 +02:00
committed by GitHub
parent 93d9d4b50a
commit a33bb32874
60 changed files with 592 additions and 633 deletions

View File

@@ -9,7 +9,6 @@ from esphome.const import (
CONF_ON_DISCONNECT,
CONF_TRIGGER_ID,
)
from esphome.core import coroutine
from esphome import automation
CODEOWNERS = ["@buxtronix"]
@@ -68,9 +67,8 @@ BLE_CLIENT_SCHEMA = cv.Schema(
)
@coroutine
def register_ble_node(var, config):
parent = yield cg.get_variable(config[CONF_BLE_CLIENT_ID])
async def register_ble_node(var, config):
parent = await cg.get_variable(config[CONF_BLE_CLIENT_ID])
cg.add(parent.register_ble_node(var))