From 5867657048f7bd40a2e173145bac3abece3fe7dc Mon Sep 17 00:00:00 2001 From: Maurice Makaay Date: Sat, 22 May 2021 17:55:10 +0200 Subject: [PATCH] Made to_code() fully async-compatible. --- components/xiaomi_bslamp2/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/xiaomi_bslamp2/__init__.py b/components/xiaomi_bslamp2/__init__.py index 16f0dbc..a804686 100644 --- a/components/xiaomi_bslamp2/__init__.py +++ b/components/xiaomi_bslamp2/__init__.py @@ -111,12 +111,12 @@ async def make_front_panel_hal(config): cg.add(fp_hal.set_i2c_parent(fp_i2c_var)) cg.add(fp_hal.set_i2c_address(config[CONF_ADDRESS])) -def to_code(config): +async def to_code(config): # Dirty little hack to make the ESPHome component loader include # the code for the "gpio" platform for the "output" domain. # Loading specific platform components is not possible using # the AUTO_LOAD feature unfortunately. CORE.config["output"].append({ CONF_PLATFORM: "gpio" }) - yield make_light_hal(config) - yield make_front_panel_hal(config) + await make_light_hal(config) + await make_front_panel_hal(config)