ESPHome-Devices/common/binary_sensor/gosund_dimmer_button.yaml

29 lines
697 B
YAML
Raw Normal View History

2020-03-22 14:04:38 +00:00
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