mirror of
https://github.com/nuttytree/ESPHome-Devices.git
synced 2024-08-30 18:12:19 +00:00
29 lines
697 B
YAML
29 lines
697 B
YAML
|
platform: gpio
|
||
|
pin:
|
||
|
number: GPIO4
|
||
|
inverted: true
|
||
|
id: gosund_button
|
||
|
on_multi_click:
|
||
|
- timing:
|
||
|
- ON for at most 1s
|
||
|
- OFF for at most .4s
|
||
|
- ON for at most 1s
|
||
|
- OFF for at least 0.1s
|
||
|
then:
|
||
|
- script.execute: double_tap
|
||
|
- timing:
|
||
|
- ON for at most 1s
|
||
|
- OFF for at least 0.4s
|
||
|
then:
|
||
|
- if:
|
||
|
condition:
|
||
|
light.is_off: gosund_light
|
||
|
then:
|
||
|
- light.turn_on:
|
||
|
id: gosund_light
|
||
|
brightness: !lambda |-
|
||
|
return (id(day_night) ? ${day_level} : ${night_level}) / 100.0;
|
||
|
else:
|
||
|
- light.turn_off: gosund_light
|
||
|
- script.execute: single_tap
|