mirror of
https://github.com/brianhanifin/esphome-config.git
synced 2026-07-27 19:55:41 +00:00
refactoring shelly1 code
This commit is contained in:
@@ -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
@@ -1,3 +1,3 @@
|
||||
---
|
||||
logger:
|
||||
level: INFO
|
||||
#level: INFO
|
||||
|
||||
+2
-5
@@ -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
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user