mmakaay / esphome-xiaomi_bslamp2

ESPHome integration for the Xiaomi Mijia Bedside Lamp v2.
Other
213 stars 51 forks source link

Make the preset.activate action work with lambdas. #30

Closed mmakaay closed 3 years ago

mmakaay commented 3 years ago

This allows the use of lambdas, which in turn makes it possible to setup a Home Assistant service endpoint like this:

api:
  services:
    - service: activate_preset
      variables:
        my_group: string
        my_preset: string
      then:
        - preset.activate:
            group: !lambda 'return my_group;'
            preset: !lambda 'return my_preset;'
mmakaay commented 3 years ago

nope, too much in this one. It contains a few future changes for ESPHome compatibility too. I'll create a new one.