mirror of
https://github.com/esphome/esphome.git
synced 2026-09-14 00:28:39 +00:00
[fan] Fix TurnOnAction 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:
@@ -88,3 +88,18 @@ button:
|
||||
- fan.turn_on:
|
||||
id: test_fan
|
||||
speed: !lambda 'return 1;'
|
||||
|
||||
# Exercise fan.turn_on inside a trigger with non-empty Ts (number on_value
|
||||
# passes float).
|
||||
number:
|
||||
- platform: template
|
||||
id: fan_speed_number
|
||||
optimistic: true
|
||||
min_value: 1
|
||||
max_value: 3
|
||||
step: 1
|
||||
on_value:
|
||||
then:
|
||||
- fan.turn_on:
|
||||
id: test_fan
|
||||
speed: !lambda "return (int) x;"
|
||||
|
||||
Reference in New Issue
Block a user