-
Notifications
You must be signed in to change notification settings - Fork 727
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 TuyaNoBindPowerConfigurationCluster
for Tuya remotes to stop battery drain
#2288
Add TuyaNoBindPowerConfigurationCluster
for Tuya remotes to stop battery drain
#2288
Conversation
Pull Request Test Coverage Report for Build 4514449044
💛 - Coveralls |
About unused / not function cluster #973. |
Codecov ReportPatch coverage:
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more Additional details and impacted files@@ Coverage Diff @@
## dev #2288 +/- ##
=======================================
Coverage 83.92% 83.93%
=======================================
Files 260 260
Lines 8219 8224 +5
=======================================
+ Hits 6898 6903 +5
Misses 1321 1321
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
Should fix the battery drain issue. Hoping for someone in #2227 to confirm. (Will merge if ready) Can already confirm that the remote still works as expected. |
I can confirm from logs and tests that I can not yet confirm if battery drain is gone or not. Actually, battery drain seems to have stopped already with Is there any more tests I/we should do? |
|
||
async def _configure_reporting(self, *args, **kwargs): # pylint: disable=W0221 | ||
"""Prevent remote configure reporting.""" | ||
return (foundation.ConfigureReportingResponse.deserialize(b"\x00")[0],) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just guessing, would it be the same that ConfigureReportingResponseRecord(status=Status.SUCCESS).serialize()
?`
https://github.com/zigpy/zigpy/blob/1f81b162f84328eb96db18add3104d889fa6c923/zigpy/zcl/foundation.py#L438
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, probably. I think we should also change it in LocalDataCluster
then. Didn't want to do that in this PR though.
I think I'd leave it like this and then change both (and some other similar stuff) in a future PR(?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, for sure. 👍🏻 (just doing a quick issues review, not trying to criticize nobodies work)
dccceb9
to
62d3f28
Compare
Merging now, so we can move forward with #2287. I tested it on one of my Zemismart remotes and it doesn't break anything and correctly blocks binding of the power configuration cluster (which is likely enough to stop the excessive battery drain). |
TuyaNoBindPowerConfigurationCluster
for Tuya remotesTuyaNoBindPowerConfigurationCluster
for Tuya remotes to stop battery drain
Untested at the moment.
This PR prevents the binding of the
PowerConfiguration
cluster (and setting up attribute reports).In return, this prevents battery drain on Tuya remotes.
Fixes #2227 (if it works)
Also, why do some Tuya remotes have multiple PowerConfiguration clusters? Should we "remove" all of them except one?
Note: The
bind()
and_configure_reporting()
code is taken out of theLocalDataCluster