esphome / esphome/feature-requests

Allow overriding the `LightOutput.write_state` with an lambda.

Open
#2,579 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
450
Forks
29
PR merge metrics
No merged PRs in 30d

Description

**Describe the problem you have/What new integration you would like**

I want to use an color interlocked `RGBCTLight` to drive an RGBW led.
This requires me to map either the color temperature or the RGB data to the RGBW color space and set outputs accordingly.
In order to do that, I need to override the `write_state` method with some custom code.

**Please describe your use case for this integration and alternatives you've tried:**

(Use case described above.)
Alternatively, one could regularly check dedicated outputs and compute new ones based on the data. But this is less efficient and a bit of a hack.

**Additional context**

I've already solved my use case by using [this](https://github.com/fischerscode/esphome/tree/rgbct_virtual/esphome/components/rgbct_virtual) external component. But that's primary for testing stuff out.

Might you consider merging a PR that adds the ability to provide a lambda instead of the outputs for all lights?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.