From ee4f91cea293fdfe6431efc2a252821c9cbd9db6 Mon Sep 17 00:00:00 2001 From: Maurice Makaay Date: Sat, 22 May 2021 16:08:57 +0200 Subject: [PATCH] Compatiblity fix for new coroutine setup in ESPHome. --- 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 ca71f2e..0799972 100644 --- a/components/xiaomi_bslamp2/__init__.py +++ b/components/xiaomi_bslamp2/__init__.py @@ -65,14 +65,14 @@ CONFIG_SCHEMA = cv.COMPONENT_SCHEMA.extend({ @coroutine def make_gpio(number, mode="OUTPUT"): - yield from cg.gpio_pin_expression({ "number": number, "mode": mode }); + yield cg.gpio_pin_expression({ "number": number, "mode": mode }); @coroutine def make_gpio_binary_output(id_, number): gpio_var = yield make_gpio(number) output_var = cg.new_Pvariable(id_) cg.add(output_var.set_pin(gpio_var)) - yield from cg.register_component(output_var, {}) + yield cg.register_component(output_var, {}) @coroutine def make_ledc_output(id_, number, frequency, channel): @@ -80,7 +80,7 @@ def make_ledc_output(id_, number, frequency, channel): ledc_var = cg.new_Pvariable(id_, gpio_var) cg.add(ledc_var.set_frequency(frequency)); cg.add(ledc_var.set_channel(channel)); - yield from cg.register_component(ledc_var, {}) + yield cg.register_component(ledc_var, {}) @coroutine def make_light_hal(config):