Replace broken "Copy Switch" example (#36627)

This commit is contained in:
Didgeridrew 2025-01-08 13:09:36 -05:00 committed by GitHub
parent 9d85d1ac18
commit 1ec5490df6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -116,9 +116,9 @@ If you are using the state of a platform that takes extra time to load, the Temp
In this section you find some real-life examples of how to use this switch.
### Copy Switch
### Invert a Switch
This example shows a switch that copies another switch.
This example shows a switch that is the inverse of another switch.
{% raw %}
@ -126,14 +126,15 @@ This example shows a switch that copies another switch.
switch:
- platform: template
switches:
copy:
value_template: "{{ is_state('switch.source', 'on') }}"
invert:
value_template: "{{ not is_state('switch.target', 'on') }}"
availability_template: "{{ has_value('switch.target') }}"
turn_on:
action: switch.turn_on
action: switch.turn_off
target:
entity_id: switch.target
turn_off:
action: switch.turn_off
action: switch.turn_on
target:
entity_id: switch.target
```