Skip to content

Add Aqara light switch H2 US quirk #4008

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

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from
Open

Conversation

jerry0317
Copy link

Proposed change

Added partial support for Aqara Light Switch H2 US. I only have the 2 button 1 channel (WS-K02E) and 2 button 2 channel (WS-K03E) versions so I only added these two.

Additional information

The change enable the button events for the switch, as well as the correct power reading from the switch.

Mentioned in this issue.

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 Apr 13, 2025

Codecov Report

Attention: Patch coverage is 76.92308% with 6 lines in your changes missing coverage. Please review.

Project coverage is 91.16%. Comparing base (7713d81) to head (f6564a2).
Report is 10 commits behind head on dev.

Files with missing lines Patch % Lines
zhaquirks/xiaomi/aqara/switch_h2.py 76.92% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #4008      +/-   ##
==========================================
- Coverage   91.18%   91.16%   -0.02%     
==========================================
  Files         334      336       +2     
  Lines       10862    10912      +50     
==========================================
+ Hits         9904     9948      +44     
- Misses        958      964       +6     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Niek
Copy link

Niek commented Apr 19, 2025

Would it be possible to support the EU version too? See #3957

@TheJulianJES TheJulianJES added the Xiaomi Request/PR regarding a Xiaomi device label Apr 20, 2025
@TheJulianJES TheJulianJES changed the title Add Support for Aqara Light Switch H2 US Add Aqara light switch H2 US quirk Apr 29, 2025
@TheJulianJES TheJulianJES added the needs reviewer answer An answer from a reviewer is needed (e.g. why a PR isn't acceptable in the current state). label Apr 29, 2025
@ftheomunhoz
Copy link

just did some e2e testing with the device and this is working amazing - let me know if you need support getting this to the finish line to get this merged

@jerry0317 jerry0317 marked this pull request as ready for review May 9, 2025 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs reviewer answer An answer from a reviewer is needed (e.g. why a PR isn't acceptable in the current state). Xiaomi Request/PR regarding a Xiaomi device
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants