Browse Source

Updated the changelog + example for using lambdas with preset.activate.

pull/36/head
Maurice Makaay 3 years ago
parent
commit
d0e2e4e842
2 changed files with 19 additions and 0 deletions
  1. +3
    -0
      CHANGELOG.md
  2. +16
    -0
      example.yaml

+ 3
- 0
CHANGELOG.md View File

@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Not yet released] ## [Not yet released]
### Changed ### Changed
- Made it possible to use lambdas with the `preset.activate` automation. This makes it
possible to link the action to an api service, which exposes the preset functionality
to Home Assistant. The `example.yaml` has been updated with an example for this.
- Fixed a rounding error in the slider sensor component. When using custom "range from" / "range to" - Fixed a rounding error in the slider sensor component. When using custom "range from" / "range to"
settings, the maximum value could exceed the "range to" value due to rounding errors. settings, the maximum value could exceed the "range to" value due to rounding errors.
Thanks to Jos for the heads up! Thanks to Jos for the heads up!


+ 16
- 0
example.yaml View File

@ -39,6 +39,22 @@ api:
# flicker. # flicker.
reboot_timeout: 0s reboot_timeout: 0s
api:
password: !secret api_password
# If you want to use light presets (see below) from Home Assistant,
# then you can expose the required functionality as a service here.
# This is an example of how you could expose the activation of a preset.
services:
- service: activate_preset
variables:
my_group: string
my_preset: string
then:
- preset.activate:
group: !lambda 'return my_group;'
preset: !lambda 'return my_preset;'
ota: ota:
password: "Password-For-Flashing-This-Device-Over-The-Air" password: "Password-For-Flashing-This-Device-Over-The-Air"


Loading…
Cancel
Save