1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-23 21:52:23 +01: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:
Otto Winter
2021-05-23 22:10:30 +02:00
committed by GitHub
parent 514d11d46f
commit aebad04c0b
29 changed files with 313 additions and 359 deletions

View File

@@ -46,11 +46,11 @@ CONFIG_SCHEMA = cv.Schema(
@coroutine_with_priority(40.0)
def to_code(config):
paren = yield cg.get_variable(config[CONF_WEB_SERVER_BASE_ID])
async def to_code(config):
paren = await cg.get_variable(config[CONF_WEB_SERVER_BASE_ID])
var = cg.new_Pvariable(config[CONF_ID], paren)
yield cg.register_component(var, config)
await cg.register_component(var, config)
cg.add(paren.set_port(config[CONF_PORT]))
cg.add_define("WEBSERVER_PORT", config[CONF_PORT])