core icon indicating copy to clipboard operation
core copied to clipboard

Add ColorMode.WHITE when Tuya bulbs support white but don't have temp_value

Open wedsa5 opened this issue 1 year ago • 9 comments

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

  • [ ] Dependency upgrade
  • [x] Bugfix (non-breaking change which fixes an issue)
  • [ ] New integration (thank you!)
  • [ ] New feature (which adds functionality to an existing integration)
  • [ ] Deprecation (breaking change to happen in the future)
  • [ ] Breaking change (fix/feature causing existing functionality to break)
  • [ ] Code quality improvements to existing code or addition of tests

Additional information

  • This PR fixes or closes issue: fixes #115056
  • This PR is related to issue:
  • Link to documentation pull request:

Checklist

  • [x] The code change is tested and works locally.
  • [x] Local tests pass. Your PR cannot be merged unless tests pass
  • [x] There is no commented out code in this PR.
  • [x] I have followed the development checklist
  • [x] I have followed the perfect PR recommendations
  • [x] The code has been formatted using Ruff (ruff format homeassistant tests)
  • [ ] Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • [x] The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • [x] New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • [x] For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.

To help with the load of incoming pull requests:

wedsa5 avatar Sep 19 '24 03:09 wedsa5

Hey there @tuya, @zlinoliver, @frenck, mind taking a look at this pull request as it has been labeled with an integration (tuya) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of tuya can trigger bot actions by commenting:

  • @home-assistant close Closes the pull request.
  • @home-assistant rename Awesome new title Renames the pull request.
  • @home-assistant reopen Reopen the pull request.
  • @home-assistant unassign tuya Removes the current integration label and assignees on the pull request, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the pull request.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the pull request.

home-assistant[bot] avatar Sep 19 '24 03:09 home-assistant[bot]

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.

wedsa5 avatar Sep 19 '24 03:09 wedsa5

Functional testing has been completed by myself and @bartplessers.

wedsa5 avatar Sep 19 '24 22:09 wedsa5

@MartinHjelmare @frenck , I cannot add the bugfix label to the PR (or I don't know how). Can you please add it so that the required-labels check passes?

wedsa5 avatar Sep 19 '24 22:09 wedsa5

@MartinHjelmare @frenck, the @homeassistant bot is still marked as requesting changes related to the cla signature which i've fixed. I tried "Re-request review", but it didn't seem to do anything. Please advise! Thanks.

wedsa5 avatar Sep 24 '24 21:09 wedsa5

@MartinHjelmare @frenck, the @homeassistant bot is still marked as requesting changes related to the cla signature which i've fixed. I tried "Re-request review", but it didn't seem to do anything. Please advise! Thanks.

It doesn't...

CleanShot 2024-09-24 at 23 19 49@2x

frenck avatar Sep 24 '24 21:09 frenck

It doesn't...

@frenck I thought there was an issue due to this: image This is my first PR, so not really sure if everything is in order or not.

wedsa5 avatar Sep 25 '24 05:09 wedsa5

@frenck Can you review and accept the changes so we can wrap this bug fix up?

klier avatar Oct 01 '24 23:10 klier

I will give this a review as well but we need an approval from a maintainer. Can anyone give me an outline on how to test this locally?

jbusuttil83 avatar Oct 13 '24 03:10 jbusuttil83

Can you guide on on how I would test this on my local installation?

jbusuttil83 avatar Oct 21 '24 18:10 jbusuttil83

Can you guide on on how I would test this on my local installation?

See the bottom of my comment And this comment

wedsa5 avatar Oct 21 '24 18:10 wedsa5

What is required to get this merged? I'm willing to help... but it seems like it might have just gotten stalled. Is it just waiting on a review from @frenck?

jkrall avatar Nov 04 '24 10:11 jkrall

What is required to get this merged? I'm willing to help... but it seems like it might have just gotten stalled. Is it just waiting on a review from @frenck?

Patience. Thanks 👍

frenck avatar Nov 04 '24 10:11 frenck

What is required to get this merged? I'm willing to help... but it seems like it might have just gotten stalled. Is it just waiting on a review from @frenck?

Patience. Thanks 👍

two weeks later, still no progress on this one?

talondnb avatar Nov 15 '24 01:11 talondnb

On Thu, 14 Nov 2024, talondnb wrote:

What is required to get this merged? I'm willing to help... but it seems like it might have just gotten stalled. Is it just waiting on a review from @frenck?

Patience. Thanks 👍

two weeks later, still no progress on this one?

It took 4 months for the last Tuya patches to migrate from the author's tree to HEAD. Please be patient. They're in the queue.

-- Tim Connors

spacelama avatar Nov 15 '24 01:11 spacelama

There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. If you are the author of this PR, please leave a comment if you want to keep it open. Also, please rebase your PR onto the latest dev branch to ensure that it's up to date with the latest changes. Thank you for your contribution!

github-actions[bot] avatar Jan 14 '25 16:01 github-actions[bot]

I know Home Assistant is a large project, but boy do I miss the days of just working with a small team on things like this. Way more compassionate, way less red tape, more development.

The revised code has been working perfectly for my here for the past 2 months. wedsa5's work is perfect. Tuya has about 15% market share worldwide for IoT-related home automation devices, constituting a major problem when we can't get timely, prioritized updates from the head development team. Can somebody please push the button to merge these changes?

klier avatar Jan 14 '25 16:01 klier

wedsa5's work is perfect

;)

Also rebasing to keep ticket non-stale

wedsa5 avatar Jan 14 '25 17:01 wedsa5

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks :+1:

Learn more about our pull request process.

home-assistant[bot] avatar Jan 14 '25 17:01 home-assistant[bot]

The sooner the better...

crayner avatar Jan 24 '25 00:01 crayner

Only 1 review to go! I am really looking forward to this update when it comes. Life in dim lights is miserable...

reinikainen avatar Jan 24 '25 11:01 reinikainen

Only 1 review to go!

I has only needed the 1 review the whole time.

wedsa5 avatar Jan 24 '25 16:01 wedsa5

@frenck can you please take a moment to review this?

talondnb avatar Feb 02 '25 01:02 talondnb

After seeing this discussion and this PR https://github.com/home-assistant/core/pull/133921 from Frenck removing himself from the Tuya project (after I opened this PR, mind you), I'm now pretty sure this will never get merged. The remaining code owners for the Tuya integration are now just @Tuya and @zlinoliver.

Hopefully they will see this and review it. If not, HA should remove Tuya as an "official" integration if they no longer plan on supporting it. This is quite frustrating. I understand @frenck 's frustration with Tuya's API, but to simply abandon it is unfair to the people who saw and relied on HA's official support for it. I think if Tuya is to be abandoned by HA (which could be a fair decision) it should be moved to a community supported integration so that it can be maintained at least without having unresponsive HA code owners blocking PRs from merging.

In my case, I am only using Tuya bulbs due to already having owned them. I did not buy them specifically because HA supported them, but I'm sure others are in that boat.

In the meantime, I am going to look into the possibility of flashing the bulbs I own to a different firmware like esphome with tuya-convert + tasmota. If anyone has good resources for that, please share.

wedsa5 avatar Feb 13 '25 17:02 wedsa5

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.

wedsa5 avatar Feb 13 '25 17:02 wedsa5

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.

wedsa5 avatar Feb 13 '25 17:02 wedsa5

👏👏👏👏👏

I'll only add that dismissive comments like "Patience" from @frenck lead code developers to believe that he is actually just backlogged and is actively working on merging it, "just give him time". But that's clearly not the case at all.

I can respect that @frenck does a ton for Home Assistant, and wears many hats. However, in the future, I would suggest that he be more forthcoming as to his intentions, or, at least have the due diligence to forward merge requests so they can be addressed in a timely fashion.

Developers should never run into these kind of roadblocks developing. It's how applications die show deaths.

Brian

On Thu, Feb 13, 2025, 11:03 AM wedsa5 @.***> wrote:

After seeing this discussion https://community.home-assistant.io/t/why-is-a-pull-request-for-a-fix-taking-so-long/846547 and this PR #133921 https://github.com/home-assistant/core/pull/133921 from Frenck removing himself from the Tuya project (after I opened this PR, mind you), I'm now pretty sure this will never get merged. The remaining code owners for the Tuya integration are now just @tuya https://github.com/tuya and @zlinoliver https://github.com/zlinoliver.

Hopefully they will see this and review it. If not, HA should remove Tuya as an "official" integration if they no longer plan on supporting it. This is quite frustrating. I understand @frenck https://github.com/frenck 's frustration with Tuya's API, but to simply abandon it is unfair to the people who saw and relied on HA's official support for it. I think if Tuya is to be abandoned by HA (which could be a fair decision) it should be moved to a community supported integration so that it can be maintained at least without having unresponsive HA code owners blocking PRs from merging.

In my case, I am only using Tuya bulbs due to already having owned them. I did not buy them specifically because HA supported them, but I'm sure others are in that boat.

In the meantime, I am going to look into the possibility of flashing the bulbs I own to a different firmware like esphome with tuya-convert + tasmota. If anyone has good resources for that, please share.

— Reply to this email directly, view it on GitHub https://github.com/home-assistant/core/pull/126242#issuecomment-2657227990, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB7GEOLRWPNOS22E3GIXKCL2PTF7DAVCNFSM6AAAAABOO7D5ZWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNJXGIZDOOJZGA . You are receiving this because you are subscribed to this thread.Message ID: @.***> [image: wedsa5]wedsa5 left a comment (home-assistant/core#126242) https://github.com/home-assistant/core/pull/126242#issuecomment-2657227990

After seeing this discussion https://community.home-assistant.io/t/why-is-a-pull-request-for-a-fix-taking-so-long/846547 and this PR #133921 https://github.com/home-assistant/core/pull/133921 from Frenck removing himself from the Tuya project (after I opened this PR, mind you), I'm now pretty sure this will never get merged. The remaining code owners for the Tuya integration are now just @tuya https://github.com/tuya and @zlinoliver https://github.com/zlinoliver.

Hopefully they will see this and review it. If not, HA should remove Tuya as an "official" integration if they no longer plan on supporting it. This is quite frustrating. I understand @frenck https://github.com/frenck 's frustration with Tuya's API, but to simply abandon it is unfair to the people who saw and relied on HA's official support for it. I think if Tuya is to be abandoned by HA (which could be a fair decision) it should be moved to a community supported integration so that it can be maintained at least without having unresponsive HA code owners blocking PRs from merging.

In my case, I am only using Tuya bulbs due to already having owned them. I did not buy them specifically because HA supported them, but I'm sure others are in that boat.

In the meantime, I am going to look into the possibility of flashing the bulbs I own to a different firmware like esphome with tuya-convert + tasmota. If anyone has good resources for that, please share.

— Reply to this email directly, view it on GitHub https://github.com/home-assistant/core/pull/126242#issuecomment-2657227990, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB7GEOLRWPNOS22E3GIXKCL2PTF7DAVCNFSM6AAAAABOO7D5ZWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNJXGIZDOOJZGA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

klier avatar Feb 13 '25 17:02 klier

👏👏👏👏👏 I'll only add that dismissive comments like "Patience" from @frenck lead code developers to believe that he is actually just backlogged and is actively working on merging it, "just give him time". But that's clearly not the case at all. I can respect that @frenck does a ton for Home Assistant, and wears many hats. However, in the future, I would suggest that he be more forthcoming as to his intentions, or, at least have the due diligence to forward merge requests so they can be addressed in a timely fashion. Developers should never run into these kind of roadblocks developing. It's how applications die show deaths. Brian

Especially PRs that are completely tested and functional. There's no reason this couldn't have been merged months ago apart from bureaucracy.

opiper avatar Feb 13 '25 17:02 opiper

@Tuya @zlinoliver Is there anyone even reviewing the merge requests that Frenek was responsible for? He's been gone since the end of December. Because if not, that's pretty disappointing, and extremely frustrating that a simple fix is taking so long.

Soarnoa avatar Mar 03 '25 19:03 Soarnoa

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

frenck avatar Mar 03 '25 19:03 frenck