Browse Source

Updated examples with the new binary_sensor feature.

pull/4/head
Maurice Makaay 3 years ago
parent
commit
ae3cade531
2 changed files with 19 additions and 0 deletions
  1. +11
    -0
      doc/example-full.yaml
  2. +8
    -0
      doc/example.yaml

+ 11
- 0
doc/example-full.yaml View File

@ -32,6 +32,8 @@ esphome:
platform_packages: |-4
framework-arduinoespressif32 @ https://github.com/pauln/arduino-esp32.git#solo-no-mac-crc/1.0.6
# NOTE: HIGHLY OPTIONAL BLOCK
#
# This yeelight_bs2 comopnent acts as the hub for the device. Other
# components talk to the hardware via this component. Normally, you
# wouldn't need to change anything in the default implementation. You
@ -71,3 +73,12 @@ light:
transition_length: 3s
update_interval: 3s
# An implementation for the power button: touch to toggle the light.
binary_sensor:
- platform: yeelight_bs2
id: ${name}_power_button
part: POWER_BUTTON
on_press:
then:
- light.toggle: ${name}

+ 8
- 0
doc/example.yaml View File

@ -48,3 +48,11 @@ light:
transition_length: 3s
update_interval: 3s
binary_sensor:
- platform: yeelight_bs2
id: ${name}_power_button
part: POWER_BUTTON
on_press:
then:
- light.toggle: ${name}

Loading…
Cancel
Save