[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:
J. Nick Koston
2026-05-03 16:10:03 -05:00
parent 8046ff7e1e
commit d481d0cb4a
3 changed files with 22 additions and 3 deletions
+15
View File
@@ -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;"