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

Add Tuya remote TS0042 and TS0043 variants #3368

Merged

Conversation

robertcsakany
Copy link
Contributor

@robertcsakany robertcsakany commented Sep 16, 2024

Proposed change

Fixes #3367
As desribed in #668 and #663 custom quirks is required to support the following models:
A Tuya zigbee remote 2-button one TS0042 & a 3-button one TS0043. I could connected them to ZHA but they could not match the Tuya quirks.

Additional information

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 Sep 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.51%. Comparing base (acecf70) to head (f3d4b4a).
Report is 8 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #3368      +/-   ##
==========================================
+ Coverage   88.49%   88.51%   +0.01%     
==========================================
  Files         305      305              
  Lines        9621     9636      +15     
==========================================
+ Hits         8514     8529      +15     
  Misses       1107     1107              

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

@robertcsakany robertcsakany changed the title #3367 Add support for TS0042 and TS0043 variant #3367 Add support for Tuya TS0042 and TS0043 variant Sep 16, 2024
@robertcsakany robertcsakany changed the title #3367 Add support for Tuya TS0042 and TS0043 variant Add support for Tuya TS0042 and TS0043 variant Sep 16, 2024
@TheJulianJES TheJulianJES added the Tuya Request/PR regarding a Tuya device label Sep 18, 2024
@TheJulianJES TheJulianJES changed the title Add support for Tuya TS0042 and TS0043 variant Add Tuya remote TS0042 and TS0043 variants Sep 24, 2024
zhaquirks/tuya/ts0043.py Outdated Show resolved Hide resolved
zhaquirks/tuya/ts0042.py Outdated Show resolved Hide resolved
Comment on lines +296 to +303
device_automation_triggers = {
(SHORT_PRESS, BUTTON_1): {ENDPOINT_ID: 1, COMMAND: SHORT_PRESS},
(LONG_PRESS, BUTTON_1): {ENDPOINT_ID: 1, COMMAND: LONG_PRESS},
(DOUBLE_PRESS, BUTTON_1): {ENDPOINT_ID: 1, COMMAND: DOUBLE_PRESS},
(SHORT_PRESS, BUTTON_2): {ENDPOINT_ID: 2, COMMAND: SHORT_PRESS},
(LONG_PRESS, BUTTON_2): {ENDPOINT_ID: 2, COMMAND: LONG_PRESS},
(DOUBLE_PRESS, BUTTON_2): {ENDPOINT_ID: 2, COMMAND: DOUBLE_PRESS},
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

If they are the same as other triggers, we could just do

device_automation_triggers = TuyaSmartRemote0042TOPlusA.device_automation_triggers

This is also fine though.

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.

Thanks!

@TheJulianJES TheJulianJES merged commit b858a88 into zigpy:dev Sep 24, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Tuya Request/PR regarding a Tuya device
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Device Support Request] Tuya remote TS0042 (_TYZB02_keyjhapk) and TS0043 (_TYZB02_key8kk7r)
2 participants