refactoring shelly1 code

This commit is contained in:
brianhanifin
2019-12-13 13:30:35 -08:00
parent 7eb29ae7ec
commit fd60737282
5 changed files with 16 additions and 11 deletions
-1
View File
@@ -3,7 +3,6 @@ platform: gpio
pin:
number: $button_gpio
mode: INPUT_PULLUP
inverted: True
id: ${id}_button
internal: true
on_press:
@@ -0,0 +1,12 @@
---
platform: gpio
pin:
number: $button_gpio
mode: INPUT_PULLUP
inverted: True
id: ${id}_button
internal: true
on_press:
- switch.toggle: relay
filters:
- delayed_on: 10ms
+1 -1
View File
@@ -1,3 +1,3 @@
---
logger:
level: INFO
#level: INFO
+2 -5
View File
@@ -45,15 +45,12 @@ binary_sensor:
- platform: gpio
pin:
number: $button_gpio
inverted: True
name: $project Button
name: $project Wall Switch
id: button
filters:
- delayed_on: 10ms
- delayed_off: 10ms
on_press:
- script.execute: hass_light_toggle
on_release:
on_state:
- script.execute: hass_light_toggle
switch:
+1 -4
View File
@@ -56,15 +56,12 @@ binary_sensor:
- platform: gpio
pin:
number: $button_gpio
inverted: True
#name: $project Button
id: button
filters:
- delayed_on: 10ms
- delayed_off: 10ms
on_press:
- script.execute: relay_toggle
on_release:
on_state:
- script.execute: relay_toggle
sensor: