From c470ec171ae1f44371acd76a4395d4a2b6a1c91e Mon Sep 17 00:00:00 2001 From: Maurice Makaay Date: Sun, 18 Apr 2021 22:13:07 +0200 Subject: [PATCH] Small configuration updates in line with new documentation. --- __init__.py | 2 +- binary_sensor/__init__.py | 4 +++- doc/example.yaml | 14 ++++++++++---- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/__init__.py b/__init__.py index f14cc63..7c3b156 100644 --- a/__init__.py +++ b/__init__.py @@ -23,7 +23,7 @@ CONF_MASTER1_ID = "master1_id" CONF_MASTER2 = "master2" CONF_MASTER2_ID = "master2_id" CONF_FP_I2C_ID = "front_panel_i2c_id" -CONF_LIGHT_HAL_ID = "light_hal" +CONF_LIGHT_HAL_ID = "light_hal_id" CONF_FRONT_PANEL_HAL_ID = "front_panel_hal_id" CONF_ON_BRIGHTNESS = "on_brightness" diff --git a/binary_sensor/__init__.py b/binary_sensor/__init__.py index abe9fcb..45ada32 100644 --- a/binary_sensor/__init__.py +++ b/binary_sensor/__init__.py @@ -14,8 +14,10 @@ CONF_PART = "part" PARTS = { "ANY" : 0, "POWER_BUTTON" : 1, + "POWER" : 1, "COLOR_BUTTON" : 2, - "SLIDER" : 3. + "COLOR" : 2, + "SLIDER" : 3, } def validate_part(value): diff --git a/doc/example.yaml b/doc/example.yaml index 2e91cb1..05959b1 100644 --- a/doc/example.yaml +++ b/doc/example.yaml @@ -32,6 +32,12 @@ captive_portal: api: password: "Password-To-Link-HomeAssistant-To-This-Device" + # Disable the reboot timeout. By default, the lamp reboots + # after 15 minutes without any client connections (e.g. when + # home assistant is off line, or when the WiFi is broken). + # Reboots are annoying though, because the RGBWW LEDs will turn + # off during the reboot, causing the light to flicker. + reboot_timeout: 0s ota: password: "Password-For-Flashing-This-Device-Over-The-Air" @@ -134,14 +140,14 @@ output: # Binary sensors can be created for handling front panel touch / release # events. To specify what part of the front panel to look at, the "part" -# parameter can be set to: "any" (i.e. the default), "power button", -# "color button" or "slider". +# parameter can be set to: "any" (i.e. the default), "POWER_BUTTON", +# "COLOR_BUTTON" or "SLIDER". binary_sensor: # When tapping the power button, toggle the light. # When holding the power button, turn on night light mode. - platform: xiaomi_bslamp2 id: ${id_power_button} - part: power button + part: POWER_BUTTON on_multi_click: - timing: - ON for at most 0.8s @@ -161,7 +167,7 @@ binary_sensor: # When holding the color button, activate the next preset group. - platform: xiaomi_bslamp2 id: ${id_color_button} - part: color button + part: COLOR_BUTTON on_multi_click: - timing: - ON for at most 0.6s