-
-
Notifications
You must be signed in to change notification settings - Fork 33.1k
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
Add ColorMode.WHITE when Tuya bulbs support white but don't have temp_value #126242
base: dev
Are you sure you want to change the base?
Conversation
Hey there @tuya, @zlinoliver, @frenck, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
afc2cc2
to
f8e609d
Compare
This is very much a draft and needs more testing with other bulbs. I have tried to avoid any breaking changes though. I will clean up the logging and comments later. |
ba38808
to
3179b95
Compare
6f30e16
to
5170faf
Compare
62d0f15
to
8f5f868
Compare
Functional testing has been completed by myself and @bartplessers. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
e8df5f5
to
ef1a431
Compare
This comment was marked as off-topic.
This comment was marked as off-topic.
ef1a431
to
3cb0373
Compare
I am going to attempt to reset the reviewers by reverting to draft and possibly re-opening the PR. we'll see how that goes. |
reopening this PR because it has more comments/reactions and is more likely to get reviewed/merged. The other one i tried opening had no reviewers. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
I really, really, really strongly want everybody to stop pinging everyone and asking for reviews and/or complaining. All it does is drive people away. In my personal case, it caused me to fully mute this PR, as the only thing I got was noise in my notifications. Please keep PR comments to review the contents of the pull request. If you want to discuss other things, use our community forums or Discord chat. I've marked every unrelated comment as off-topic; and resolved a few that have been handled at this point. ../Frenck |
73782be
to
21d183c
Compare
…not have temp_value
21d183c
to
328dc7c
Compare
@wedsa5 : HELP! So my current situation is
This behavior does not occur in the official Tuya integration. So I'm a but stuck now :-( Would you mind taking a closer look at this? kind regards, |
Hey, I noticed the same issue on my end. I suspected it was due to some changes with the core Tuya integration that conflicted with my changes that I resolved in my branch a while ago. It seems that was introduced in 2025.3. The solution for me was to re-download and re-install the latest version of my branch as a custom component again since it has changed since I first wrote it (and since you first installed it as a custom component). If you already did this after 2025.3, then it must be another issue. Since you didn't say you re-downloaded and re-installed, when you said you "reloaded" the custom integration I assume you mean the reload button from the UI. -wedsa5 |
Hero! This is what I had to do to get things up and running again... STEP 1 STEP 2 to my home assistant instance STEP 3 STEP 4 and placed file into directory STEP 5 |
@wedsa5 , For lights with white + color, the "presets" (1) work fine However, using a preset on a light with white + colortemp (but no color), this generates an error... On the OOB tuya integration shipped with HA 2025.3.2, this problem does not occur... grtz |
Does this occur with the custom integration prior to 2025.3.x? If it does, then it's something inherently wrong with the fix. If not, then it is something that is incompatible with 2025.3.x combined with the fix. Unfortunately, I don't own a tuya bulb with color temp so I can't test it on my own. You will probably need to upload a diagnostic so I can take a look when I'm able to look. |
Hi @wedsa5 Problem is that the current light.py is NOT compatible with the tuya integration prior to 2025.3.0 So if I:
Then I receive following error:
So, I can you provide me with a light.py-file that is compatible with 2025.2.5? kind regards, |
PS
so I'm a bit stuck now :-( |
Hi @wedsa5 , Went digging into my archives, I found some old "light.py" files. After elaborate testing, I found following:
Also:
So conclusion
For your reference, I add some files here: And If you want to take a closer look, here also the diagnostics of some bulbs
kind regards, |
Tuya: Add ColorMode.WHITE when bulb supports white but doesn't have temp_value
Breaking change
N/A
Proposed change
Tuya bulbs that support a white color mode but don't have adjustable white color temp were broken several versions of HA ago. See this large thread.
I added a check after the check for color temp to check if the bulb supports work_mode white. If the bulb does not support color_temp, but it still supports white work_mode, I will add ColorMode.WHITE to the list of supported color_modes. I also added a new entity value _white_color_mode which will hold the color mode corresponding to how the bulb supports white. It will either be WHITE or COLOR_TEMP.
Modified the turn_on function to check for ATTR_WHITE as well as ATTR_COLOR_TEMP in determining if the command should include setting the work_mode to WHITE. If the _white_color_mode is COLOR_TEMP, it will also set the color temp in the commands.
Modified the color_mode function to return the _white_color_mode when the work_mode is white. Again, this can be either WHITE or COLOR_TEMP.
Type of change
Additional information
Checklist
ruff format homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
.To help with the load of incoming pull requests: