From ae3cade531e82aa606187de02fb69c6b8659943e Mon Sep 17 00:00:00 2001 From: Maurice Makaay Date: Tue, 13 Apr 2021 02:21:16 +0200 Subject: [PATCH] Updated examples with the new binary_sensor feature. --- doc/example-full.yaml | 11 +++++++++++ doc/example.yaml | 8 ++++++++ 2 files changed, 19 insertions(+) diff --git a/doc/example-full.yaml b/doc/example-full.yaml index 02b0890..383a72f 100644 --- a/doc/example-full.yaml +++ b/doc/example-full.yaml @@ -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} + diff --git a/doc/example.yaml b/doc/example.yaml index 04e09b3..12f37f6 100644 --- a/doc/example.yaml +++ b/doc/example.yaml @@ -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} +