From 3b73d2340e2e227518e82c409be1caf9bd031719 Mon Sep 17 00:00:00 2001 From: Maurice Makaay Date: Sat, 6 Mar 2021 04:35:25 +0100 Subject: [PATCH] Backup work on I2C --- yeelight_bs2.h | 2 +- yeelight_bs2.yaml | 26 ++++++++++++++++++++++---- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/yeelight_bs2.h b/yeelight_bs2.h index 94ebdf8..f7cefb4 100644 --- a/yeelight_bs2.h +++ b/yeelight_bs2.h @@ -94,7 +94,7 @@ class YeelightBedsideLampV2LightOutput : public Component, public LightOutput // This tunes the power for the red channel a bit, to bring // the red=1, green=1, blue=1 color more towards white. // (on my lamps, there is a faint hint of red in the color) - red = red * 0.95f; + red = red * 0.93f; // Compensate for brightness. red = red * brightness; diff --git a/yeelight_bs2.yaml b/yeelight_bs2.yaml index 3a4182a..e8467c4 100644 --- a/yeelight_bs2.yaml +++ b/yeelight_bs2.yaml @@ -13,11 +13,20 @@ esphome: logger: # The front panel of the device uses I2C for communication -# with the ESP32 main board. The panel uses ID 0x10. +# with the ESP32 main board. The panel uses address 0x2C. +# There are two I2C busses attached to the ESP32: +# SDA 17/SCL 18 and SDA 21/SCL 19. The latter is the +# correct one for the front panel. The former is probably +# an EEPROM of some sorts. i2c: - sda: 17 - scl: 18 - scan: True + - id: eeprom_i2c + sda: 17 + scl: 18 + scan: True + - id: front_panel_i2c + sda: 21 + scl: 19 + scan: True output: - platform: gpio @@ -49,3 +58,12 @@ light: lights: - name: ${friendly_name} RGBW Light default_transition_length: 0s + effects: + - random: + name: "Slow Random" + transition_length: 30s + update_interval: 30s + - random: + name: "Fast Random" + transition_length: 3s + update_interval: 4s