Add support for Tuya Wireless Switch entity
Proposed change
This change adds support for for Tuya wireless switches such as the one depicted below with which this change has been tested.
This required a change in tuya-device-sharing-sdk. The relevant pull request has been merged and released in a new version. Here's the changelog for tuya-device-sharing-sdk on PyPI and here's a diff of all the code changes between the two versions
Type of change
- [x] Dependency upgrade
- [ ] Bugfix (non-breaking change which fixes an issue)
- [ ] New integration (thank you!)
- [X] 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 #120460
- fixes #120458
- fixes #120020
- This PR is related to issue:
- Link to documentation pull request: https://github.com/home-assistant/home-assistant.io/pull/34174
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:
- [x] Documentation added/updated for www.home-assistant.io
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 runningpython3 -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:
- [ ] I have reviewed two other open pull requests in this repository.
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks :+1:
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 closeCloses the pull request.@home-assistant rename Awesome new titleRenames the pull request.@home-assistant reopenReopen the pull request.@home-assistant unassign tuyaRemoves the current integration label and assignees on the pull request, add the integration domain after the command.@home-assistant add-label needs-more-informationAdd a label (needs-more-information, problem in dependency, problem in custom component) to the pull request.@home-assistant remove-label needs-more-informationRemove a label (needs-more-information, problem in dependency, problem in custom component) on the pull request.
The built-in Home Assistant Event component doesn't configure any device triggers itself as it doesn't understand the semantics of the events unfortunately in the current form.
That is not in scope for the integration, you are trying to work around a limitation in Home Assistant on the integration level.
Please remove them.
OK, I removed the device triggers.
Converted to draft yet again, as there are unresolved reviews.
@frenck I just rebased the PR onto the current dev. The patch of the Tuya library has also been removed as the changes landed upstream. Let me know if anything else needs to be changed.
Would be great if this could land in the next HA release :-)
Friendly ping.
Please let me know if anything else is needed @frenck
Thanks for putting this together @lanthaler. I have successfully been using this with two 'ja5osu5g' buttons (solving https://github.com/home-assistant/core/issues/120460) with no issues.
Let me know if I can help if any additional testing is required.
Cool, thanks for confirming that this work as expected for you @danVnest
@frenck anything else that's needed here or can it be merged now?
@joostlek I see you approved #126180 which introduced a conflict with this PR.
I just rebased and resolved the merge conflict. Would you be able to review these changes? This PR has been sitting here for over a month now
I addressed all issues. All checks apart codecov/patch pass now. There seems to be more work required to properly set up tests for this integration. That should be done in a separate PR IMO.
I also squashed and rebased the changes for easier merging.
Thanks for the review @frenck. I addressed all feedback, squashed and rebased the branch onto dev.
@frenck anything else that needs to change here or can this be merged now?
Adapted to upstream changes and rebased once more @frenck
@frenck sorry for the ping but it has been almost 8 months by now since I opened this PR.
Any chance this could be merged now so that it makes it into the next release?
Thanks
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!
We are past the 9 month mark on this now and I'm getting staleness pings.
@frenck I just rebased this once more and would really appreciate if we could merge this now