Skip to content

Instantly share code, notes, and snippets.

@pauly7300
Created March 19, 2019 20:46
Show Gist options
  • Save pauly7300/cdd112e310e4be22cd3d9cf6dbc1362b to your computer and use it in GitHub Desktop.
Save pauly7300/cdd112e310e4be22cd3d9cf6dbc1362b to your computer and use it in GitHub Desktop.
example
switch:
- platform: gpio
name: "printer_onboard_light"
id: printer_onboard_light
inverted: ON
pin: 2
- platform: gpio
name: "dummy_click"
retain: false
id: dummy_click
pin: 25
output:
- platform: ledc
pin: 16
frequency: 40000Hz
bit_depth: 10
id: LED_gpio_16
- platform: ledc
pin: 17
frequency: 40000Hz
bit_depth: 10
inverted: OFF
id: LED_gpio_17
light:
- platform: monochromatic
name: "printer_led_light"
default_transition_length: 2s
id: printer_led
output: LED_gpio_16
- platform: monochromatic
name: "printer_button_light"
default_transition_length: 2s
id: button_led
output: LED_gpio_17
binary_sensor:
- platform: gpio
pin:
number: 22
mode: INPUT_PULLUP
inverted: True
name: button1
retain: false
on_click:
min_length: 50ms
max_length: 350ms
then:
- switch.toggle:
id: printer_onboard_light
- light.toggle:
id: printer_led
on_double_click:
min_length: 50ms
max_length: 350ms
then:
- switch.toggle: dummy_click
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment