mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-06-03 19:38:30 +02: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:
@@ -8,7 +8,6 @@ from esphome.const import (
|
||||
CONF_SSID,
|
||||
CONF_MAC_ADDRESS,
|
||||
)
|
||||
from esphome.core import coroutine
|
||||
|
||||
DEPENDENCIES = ["wifi"]
|
||||
|
||||
@@ -50,13 +49,12 @@ CONFIG_SCHEMA = cv.Schema(
|
||||
)
|
||||
|
||||
|
||||
@coroutine
|
||||
def setup_conf(config, key):
|
||||
async def setup_conf(config, key):
|
||||
if key in config:
|
||||
conf = config[key]
|
||||
var = cg.new_Pvariable(conf[CONF_ID])
|
||||
yield cg.register_component(var, conf)
|
||||
yield text_sensor.register_text_sensor(var, conf)
|
||||
await cg.register_component(var, conf)
|
||||
await text_sensor.register_text_sensor(var, conf)
|
||||
|
||||
|
||||
async def to_code(config):
|
||||
|
||||
Reference in New Issue
Block a user