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

Fix switch events for Aqara T2 relay #2939

Merged
merged 14 commits into from
Jan 29, 2024
Merged

Conversation

trapacska
Copy link
Contributor

@trapacska trapacska commented Jan 26, 2024

Proposed change

  1. Fixed event sending, it has 4 args passed in but could only take 3 so the event was not fired.
  2. There is an event for each endpoint(1 and 2) when the S1-COM and S2-COM pins are shorted but the original implementation did not separate the events so both S1 and S2 was emitting the same event.

Fixes my issue (partially): #2934

image
image

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 Jan 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (e40f71a) 87.64% compared to head (e975c01) 87.64%.

❗ Current head e975c01 differs from pull request most recent head 743233c. Consider uploading reports for the commit 743233c to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #2939      +/-   ##
==========================================
- Coverage   87.64%   87.64%   -0.01%     
==========================================
  Files         297      297              
  Lines        9055     9054       -1     
==========================================
- Hits         7936     7935       -1     
  Misses       1119     1119              

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

@TheJulianJES TheJulianJES changed the title Fix switch events in switch_acn047.py Fix switch events for Aqara T2 relay Jan 27, 2024
@TheJulianJES TheJulianJES added the bugfix This PR fixes a bug label Jan 27, 2024
Copy link
Collaborator

@TheJulianJES TheJulianJES left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Added some small comments

tests/test_xiaomi.py Outdated Show resolved Hide resolved
zhaquirks/xiaomi/aqara/switch_acn047.py Show resolved Hide resolved
zhaquirks/xiaomi/aqara/switch_acn047.py Outdated Show resolved Hide resolved
tests/test_xiaomi.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@TheJulianJES TheJulianJES left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@TheJulianJES TheJulianJES merged commit 6b75c27 into zigpy:dev Jan 29, 2024
12 checks passed
lgraf pushed a commit to lgraf/zha-device-handlers that referenced this pull request May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix This PR fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants