mirror of
https://github.com/esphome/esphome.git
synced 2026-09-30 00:10:22 +00:00
[light] Fix LightControlAction trigger args with reference types
`const Ts &...` is ill-formed when Ts is already a reference (e.g. a trigger that passes `std::string &`). Forward Ts by-value so the generated lambda matches ApplyFn for any valid trigger arg type.
This commit is contained in:
@@ -127,6 +127,21 @@ esphome:
|
||||
blue: 0%
|
||||
transition_length: 1s
|
||||
|
||||
# Exercise light actions inside a trigger with non-empty Ts (number on_value
|
||||
# passes float).
|
||||
number:
|
||||
- platform: template
|
||||
id: test_number_brightness
|
||||
optimistic: true
|
||||
min_value: 0
|
||||
max_value: 100
|
||||
step: 1
|
||||
on_value:
|
||||
then:
|
||||
- light.turn_on:
|
||||
id: test_monochromatic_light
|
||||
brightness: !lambda "return x / 100.0;"
|
||||
|
||||
light:
|
||||
- platform: binary
|
||||
id: test_binary_light
|
||||
|
||||
Reference in New Issue
Block a user