Skip to content

Commit

Permalink
Fix double pin usage
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ajfriesen committed Feb 9, 2024
1 parent f359b1c commit 0b5d6bc
Showing 1 changed file with 26 additions and 16 deletions.
42 changes: 26 additions & 16 deletions pc-switch.yaml
Expand Up @@ -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
Expand Down

0 comments on commit 0b5d6bc

Please sign in to comment.