mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-06-03 19:38:30 +02:00
Convert components to async-def syntax (#1821)
This commit is contained in:
@@ -46,8 +46,8 @@ CONFIG_SCHEMA = cv.Schema(
|
||||
)
|
||||
|
||||
|
||||
def to_code(config):
|
||||
hub = yield cg.get_variable(config[CONF_FINGERPRINT_GROW_ID])
|
||||
async def to_code(config):
|
||||
hub = await cg.get_variable(config[CONF_FINGERPRINT_GROW_ID])
|
||||
|
||||
for key in [
|
||||
CONF_FINGERPRINT_COUNT,
|
||||
@@ -60,5 +60,5 @@ def to_code(config):
|
||||
if key not in config:
|
||||
continue
|
||||
conf = config[key]
|
||||
sens = yield sensor.new_sensor(conf)
|
||||
sens = await sensor.new_sensor(conf)
|
||||
cg.add(getattr(hub, f"set_{key}_sensor")(sens))
|
||||
|
||||
Reference in New Issue
Block a user