Fix double pin usage

The first attempt to just allow using the twin twice was not the right
approach.
Now we just define the pins once and use tempalte switches.
This commit is contained in:
Andrej Friesen 2024-02-09 22:35:46 +01:00
parent f359b1c5b5
commit 0b5d6bc0cc
1 changed files with 26 additions and 16 deletions

View File

@ -46,31 +46,41 @@ sensor:
switch:
- platform: gpio
pin:
number: D6
allow_other_uses: true
pin: D6
id: power_pin
internal: true
- platform: template
name: "Power Switch"
id: power_switch
internal: true
on_turn_on:
- delay: 300ms
- switch.turn_off: power_switch
turn_on_action:
- switch.turn_on: power_pin
- delay: 300ms
- switch.turn_off: power_pin
- platform: gpio
pin:
number: D6
allow_other_uses: true
- platform: template
name: "Power Switch Force"
id: power_switch_force
internal: true
on_turn_on:
- delay: 5000ms
- switch.turn_off: power_switch_force
turn_on_action:
- switch.turn_on: power_pin
- delay: 5000ms
- switch.turn_off: power_pin
- platform: gpio
pin: D7
id: reset_pin
internal: true
- platform: template
name: "Reset Switch"
id: reset_switch
on_turn_on:
- delay: 300ms
- switch.turn_off: reset_switch
internal: true
turn_on_action:
- switch.turn_on: reset_pin
- delay: 300ms
- switch.turn_off: reset_pin
binary_sensor:
- platform: gpio