Add brightness, color, and scenes to ESPHome lights#58
Conversation
|
@svc-finitelabs please review |
There was a problem hiding this comment.
Nice piece of work overall. I pulled this locally and make init && make build passed.
I did find one behavior gap that I think should be fixed before merge:
UPDATE_COLOR_RATE_DEFAULTpersists the user's default color ramp rate, butSET_COLOR_TARGETnever reads it. Right now color changes fall back to0unless the caller explicitly sends a rate, so the Composer default color-rate setting has no effect.
Concretely, this is the path around drivers/esphome_light/driver.lua where SET_COLOR_TARGET uses:
tointeger(Select(tParams, "LIGHT_COLOR_TARGET_RATE") or Select(tParams, "RATE")) or 0
I think this should mirror the brightness path and fall back to the persisted default color rate when no per-command rate is provided.
|
Thanks for the catch — fixed in dfe5812. SET_COLOR_TARGET now falls back to the persisted default color rate (set via UPDATE_COLOR_RATE_DEFAULT) when no per-command rate is provided, matching the brightness path. |
71b189b to
13b052e
Compare
05c81cf to
c128137
Compare
Reimplement esphome_light against the LIGHT_V2 proxy spec so ESPHome bulbs reach feature parity with Control4 dimmers: - Brightness and dimming with smooth ramping (single ESPHome transition cmd plus local interpolation for STOP-mid-ramp), hold-to -dim button control, and preset management - Color and color-temperature support for every ESPHome color mode (white, color-temperature, cold/warm white, RGB, RGBW, and combined RGB + white), including merged off-to-on color cmds for the color_on_mode fade/preset/previous behaviors - Advanced Lighting Scenes so ESPHome bulbs participate alongside other Control4 dimmers - Honor the persisted default color rate in SET_COLOR_TARGET - Daylight-Agent integration: track and echo LIGHT_BRIGHTNESS_CURRENT_PRESET_ID and LIGHT_COLOR_CURRENT_PRESET_ID Propagate disconnection state from the ESPHome parent driver to all sub-drivers: the parent watches the connection and notifies entity handlers on drop, light/fan/lock entities forward UPDATE_DISCONNECT to their bindings, and fan/lock/climate/yale drivers emit ONLINE_CHANGED with a proper boolean STATE.
c128137 to
aff5681
Compare
|
@svc-finitelabs your approval is required |
There was a problem hiding this comment.
Approved. CI green, test plan thoroughly exercised (8 dummy lights covering every color mode, real bulb verified, Advanced Lighting Scenes agent chain confirmed). Disconnect-notification pattern extends cleanly to climate/fan drivers, and the ONLINE_CHANGED state-type fix (string → bool) is a nice quiet correctness win along the way.
Summary
ESPHome lights are no longer treated as on/off only. The driver now
detects each entity's capabilities at runtime and exposes the appropriate
controls in Composer and Navigator.
mode handling, click and hold ramp rates, and hold-to-dim button
control on virtual buttons and the On/Off/Toggle button-link bindings
color-temperature, cold/warm white, RGB, RGBW, RGB+white,
RGB+color-temperature, RGB+cold/warm white)
brightness and color steps, ramp/stop, and flash mode
The parent ESPHome driver also notifies entity sub-drivers when the
device disconnects so they reset state correctly on reconnect.
Test plan
test/dummy_lights.yaml)