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: switch:
- platform: gpio - platform: gpio
pin: pin: D6
number: D6 id: power_pin
allow_other_uses: true internal: true
- platform: template
name: "Power Switch"
id: power_switch id: power_switch
internal: true internal: true
on_turn_on: turn_on_action:
- delay: 300ms - switch.turn_on: power_pin
- switch.turn_off: power_switch - delay: 300ms
- switch.turn_off: power_pin
- platform: gpio - platform: template
pin: name: "Power Switch Force"
number: D6
allow_other_uses: true
id: power_switch_force id: power_switch_force
internal: true internal: true
on_turn_on: turn_on_action:
- delay: 5000ms - switch.turn_on: power_pin
- switch.turn_off: power_switch_force - delay: 5000ms
- switch.turn_off: power_pin
- platform: gpio - platform: gpio
pin: D7 pin: D7
id: reset_pin
internal: true
- platform: template
name: "Reset Switch"
id: reset_switch id: reset_switch
on_turn_on: internal: true
- delay: 300ms turn_on_action:
- switch.turn_off: reset_switch - switch.turn_on: reset_pin
- delay: 300ms
- switch.turn_off: reset_pin
binary_sensor: binary_sensor:
- platform: gpio - platform: gpio