File tree Expand file tree Collapse file tree 2 files changed +25
-5
lines changed
Expand file tree Collapse file tree 2 files changed +25
-5
lines changed Original file line number Diff line number Diff line change @@ -220,10 +220,16 @@ switch:
220220 restore_mode : RESTORE_DEFAULT_OFF
221221 entity_category : config
222222 turn_on_action :
223+ # Shutdown active operations on controllers if any
224+ - lambda : !include
225+ file : script_reset_controller.yaml
226+ vars :
227+ sprinkler : lawn_sprinklers
228+ - lambda : !include
229+ file : script_reset_controller.yaml
230+ vars :
231+ sprinkler : flowerbed_sprinklers
223232 - lambda : |-
224- // Shutdown active operations on controllers if any
225- id(lawn_sprinklers).shutdown();
226- id(flowerbed_sprinklers).shutdown();
227233 // Put controllers into standby
228234 id(lawn_sprinklers_standby_switch).turn_on();
229235 id(flowerbed_sprinklers_standby_switch).turn_on();
@@ -263,8 +269,15 @@ button:
263269 - platform : template
264270 name : " Lawn sprinklers: shutdown"
265271 on_press :
266- - sprinkler.shutdown : lawn_sprinklers
272+ - lambda : !include
273+ file : script_reset_controller.yaml
274+ vars :
275+ sprinkler : lawn_sprinklers
276+
267277 - platform : template
268278 name : " Flowerbed sprinklers: shutdown"
269279 on_press :
270- - sprinkler.shutdown : flowerbed_sprinklers
280+ - lambda : !include
281+ file : script_reset_controller.yaml
282+ vars :
283+ sprinkler : flowerbed_sprinklers
Original file line number Diff line number Diff line change 1+ # SPDX-License-Identifier: Apache-2.0
2+ # Copyright (c) 2025 Ilia Sotnikov
3+ ---
4+ !lambda |-
5+ // `true` parameter clears any queued values as well
6+ id(${sprinkler}).shutdown(true);
7+ id(${sprinkler}).reset_resume();
You can’t perform that action at this time.
0 commit comments