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

Do not double IKEA battery percentage by default #3176

Conversation

TheJulianJES
Copy link
Collaborator

@TheJulianJES TheJulianJES commented May 28, 2024

Proposed change

No longer double the battery percentage for IKEA devices using the "Doubling" clusters.
Instead, the value is left untouched until sw_build_id is read once. If it's confirmed old firmware then, the percentage will be doubled automatically.
Future incoming reports will immediately double the value.

I want to change the default for this, so that we can always use the "Doubling" clusters in v2 quirks.
Newer devices don't briefly see a flash above 100% then.
Related PR quirks v2 PR:

Additional information

Follow-up PR to:

The latter PR linked has a further explanation of this fix. The only thing that's changed is the default.
Previously, we always doubled for unknown firmware if the cluster was used. After checking sw_build_id and then seeing it's new firmware, the value would be "undoubled".
This PR just changes the default, so the value isn't doubled until sw_build_id is read and confirmed it's old firmware.

Checklist

  • The changes are tested and work correctly
  • pre-commit checks pass / the code has been formatted using Black
  • Tests have been added to verify that the new code works

Copy link

codecov bot commented May 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.19%. Comparing base (151970c) to head (8cad8e9).

Additional details and impacted files
@@           Coverage Diff           @@
##              dev    #3176   +/-   ##
=======================================
  Coverage   88.19%   88.19%           
=======================================
  Files         300      300           
  Lines        9400     9400           
=======================================
  Hits         8290     8290           
  Misses       1110     1110           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@TheJulianJES TheJulianJES merged commit 31c51ce into zigpy:dev May 29, 2024
6 checks passed
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

1 participant