Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow switching between modes using the effect field #292

Merged
merged 6 commits into from
Jul 1, 2024

Conversation

Lurker00
Copy link

In general, Light entity model in HA has a design defect in both UI and automations: unlike Tuya, it does not allow to switch between modes (white, color, scene, music), keeping previous settings for the modes. It only allows to switch to a particular scene, a particular white temperature, a particular color. It is not a huge problem for a particular bulb, though it makes automations complicated. But, in case of a Light group, which consists of different bulbs, or bulbs with different settings (e.g. different colors) it makes impossible to group control switch between color/scene/white modes with pre-configured values for each bulb.

LocalTuya has a workaround for Music mode only.

This change allows to use "white", "color", "scene", "music" in Effect field of "Light 'Turn on'" action.

I also have a fix for UI, but I prefer to submit possibly arguable changes one by one.

Lurker00 and others added 5 commits June 24, 2024 12:07
The minimum brightness value does not create a "range": it is only a limitation, e.g. by device capabilities. The range to be mapped is still (0, maximum). This also maps percentages to equal values between ranges.
Fix LocalTuyaLight brightness mapping
Co-authored-by: Bander <46300268+xZetsubou@users.noreply.github.com>
@xZetsubou xZetsubou changed the title Switch light modes Allow switching between modes using the effect field Jul 1, 2024
@xZetsubou xZetsubou merged commit 0c35d63 into xZetsubou:master Jul 1, 2024
2 checks passed
@Lurker00 Lurker00 deleted the switch_light_modes branch July 1, 2024 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants