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

Convert Sonoff buttons to v2 quirk #3050

Merged
merged 7 commits into from
Mar 27, 2024

Conversation

TheJulianJES
Copy link
Collaborator

@TheJulianJES TheJulianJES commented Mar 18, 2024

Proposed change

This converts both existing Sonoff button quirks to a combined v2 quirk. This way we can avoid adding other signature variations.
The "signature match test" is also removed, as it doesn't make much sense with a v2 quirk(?)

Additional information

Also addresses home-assistant/core#104548 (comment)

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 Mar 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.85%. Comparing base (2a41331) to head (55aa0f2).

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #3050      +/-   ##
==========================================
- Coverage   87.87%   87.85%   -0.02%     
==========================================
  Files         301      300       -1     
  Lines        9226     9212      -14     
==========================================
- Hits         8107     8093      -14     
  Misses       1119     1119              

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

@dmulcahey
Copy link
Collaborator

Why not convert these to v2 and forget the sig stuff?

@TheJulianJES
Copy link
Collaborator Author

Right, perfect candidate for that. I'll convert this tomorrow.

@TheJulianJES TheJulianJES marked this pull request as draft March 19, 2024 00:59
@TheJulianJES TheJulianJES changed the title Add Sonoff button SNZB-01P variant Convert Sonoff button SNZB-01P to v2 quirk Mar 19, 2024
@TheJulianJES TheJulianJES changed the title Convert Sonoff button SNZB-01P to v2 quirk Convert Sonoff buttons to v2 quirk Mar 19, 2024
@TheJulianJES TheJulianJES marked this pull request as ready for review March 26, 2024 20:44
@TheJulianJES
Copy link
Collaborator Author

Codecov/project coverage decrease is expected, as a lot of code is removed.
This should be good as-is now. Merging to get it in the next quirks release for HA beta.

@TheJulianJES TheJulianJES merged commit ef83953 into zigpy:dev Mar 27, 2024
5 of 6 checks passed
lgraf pushed a commit to lgraf/zha-device-handlers that referenced this pull request May 6, 2024
* Add Sonoff button `SNZB-01P` variant

* Inherit `SonoffSmartButtonSNZB01P` to use existing device triggers

* Initial v2 quirk conversion for Sonoff button

* Remove signature test for Sonoff button

* Also convert other Sonoff button to v2

* Merge Sonoff button quirks into one file

* Combine both v2 quirks into one, use less strict device triggers
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.

2 participants