Browse Source

Small configuration updates in line with new documentation.

pull/17/head
Maurice Makaay 3 years ago
parent
commit
c470ec171a
3 changed files with 14 additions and 6 deletions
  1. +1
    -1
      __init__.py
  2. +3
    -1
      binary_sensor/__init__.py
  3. +10
    -4
      doc/example.yaml

+ 1
- 1
__init__.py View File

@ -23,7 +23,7 @@ CONF_MASTER1_ID = "master1_id"
CONF_MASTER2 = "master2" CONF_MASTER2 = "master2"
CONF_MASTER2_ID = "master2_id" CONF_MASTER2_ID = "master2_id"
CONF_FP_I2C_ID = "front_panel_i2c_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_FRONT_PANEL_HAL_ID = "front_panel_hal_id"
CONF_ON_BRIGHTNESS = "on_brightness" CONF_ON_BRIGHTNESS = "on_brightness"


+ 3
- 1
binary_sensor/__init__.py View File

@ -14,8 +14,10 @@ CONF_PART = "part"
PARTS = { PARTS = {
"ANY" : 0, "ANY" : 0,
"POWER_BUTTON" : 1, "POWER_BUTTON" : 1,
"POWER" : 1,
"COLOR_BUTTON" : 2, "COLOR_BUTTON" : 2,
"SLIDER" : 3.
"COLOR" : 2,
"SLIDER" : 3,
} }
def validate_part(value): def validate_part(value):


+ 10
- 4
doc/example.yaml View File

@ -32,6 +32,12 @@ captive_portal:
api: api:
password: "Password-To-Link-HomeAssistant-To-This-Device" 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: ota:
password: "Password-For-Flashing-This-Device-Over-The-Air" 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 # 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" # 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: binary_sensor:
# When tapping the power button, toggle the light. # When tapping the power button, toggle the light.
# When holding the power button, turn on night light mode. # When holding the power button, turn on night light mode.
- platform: xiaomi_bslamp2 - platform: xiaomi_bslamp2
id: ${id_power_button} id: ${id_power_button}
part: power button
part: POWER_BUTTON
on_multi_click: on_multi_click:
- timing: - timing:
- ON for at most 0.8s - ON for at most 0.8s
@ -161,7 +167,7 @@ binary_sensor:
# When holding the color button, activate the next preset group. # When holding the color button, activate the next preset group.
- platform: xiaomi_bslamp2 - platform: xiaomi_bslamp2
id: ${id_color_button} id: ${id_color_button}
part: color button
part: COLOR_BUTTON
on_multi_click: on_multi_click:
- timing: - timing:
- ON for at most 0.6s - ON for at most 0.6s


Loading…
Cancel
Save