Browse Source

Compatiblity fix for new coroutine setup in ESPHome.

pull/30/head
Maurice Makaay 3 years ago
parent
commit
ee4f91cea2
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      components/xiaomi_bslamp2/__init__.py

+ 3
- 3
components/xiaomi_bslamp2/__init__.py View File

@ -65,14 +65,14 @@ CONFIG_SCHEMA = cv.COMPONENT_SCHEMA.extend({
@coroutine @coroutine
def make_gpio(number, mode="OUTPUT"): 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 @coroutine
def make_gpio_binary_output(id_, number): def make_gpio_binary_output(id_, number):
gpio_var = yield make_gpio(number) gpio_var = yield make_gpio(number)
output_var = cg.new_Pvariable(id_) output_var = cg.new_Pvariable(id_)
cg.add(output_var.set_pin(gpio_var)) cg.add(output_var.set_pin(gpio_var))
yield from cg.register_component(output_var, {})
yield cg.register_component(output_var, {})
@coroutine @coroutine
def make_ledc_output(id_, number, frequency, channel): 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) ledc_var = cg.new_Pvariable(id_, gpio_var)
cg.add(ledc_var.set_frequency(frequency)); cg.add(ledc_var.set_frequency(frequency));
cg.add(ledc_var.set_channel(channel)); cg.add(ledc_var.set_channel(channel));
yield from cg.register_component(ledc_var, {})
yield cg.register_component(ledc_var, {})
@coroutine @coroutine
def make_light_hal(config): def make_light_hal(config):


Loading…
Cancel
Save