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 Giex GX02 quirk to V2 #3394

Merged
merged 13 commits into from
Oct 20, 2024
Merged

Conversation

prairiesnpr
Copy link
Contributor

@prairiesnpr prairiesnpr commented Oct 2, 2024

Proposed change

Convert GX02 Quirk to a V2 Quirk. Add additional functionality.

Additional information

  1. Requires: Support Timestamp class Sensor zha#222
    or Add Timestamp Sensor zha#224
  2. Device reports temperature, but it's always 0, so I'm not adding an entity.
  3. The device supports an onboard schedule, details below in case someone wants to implement it. I don't see a clean way to implement it, nor do I think it would be very useful, so I skipped it.

image

Setting on board schedule.

### 14 Byte Data Packet ###
[0-1] Message id, increments by 1 
[2] DP Id (0x71)
[3] DP Type (Raw [0x00])
[4-5] Never changed, always 0x0008
[6] Action 0x10: Duration based, 0x11: Volume Based, 0x01: Delete Schedule
[7] Schedule id, 0 indexed
[8] Days of week schedule is active, bitfield [NA, SUN, MON, TUE, WED, THU, FRI, SAT]
[9] Start time HH, max 23
[10] Start time MM, max 59
[11-13] Set point in time(seconds) or volume, max 86,399 seconds or 6500L

Closes: #3052, Closes: #3209

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 Oct 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.37%. Comparing base (9923e5e) to head (d28301d).
Report is 3 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #3394      +/-   ##
==========================================
+ Coverage   89.35%   89.37%   +0.02%     
==========================================
  Files         308      308              
  Lines        9978     9990      +12     
==========================================
+ Hits         8916     8929      +13     
+ Misses       1062     1061       -1     

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

@prairiesnpr prairiesnpr changed the title [RFC] Convert Giex GX02 quirk to V2 Convert Giex GX02 quirk to V2 Oct 4, 2024
@prairiesnpr prairiesnpr force-pushed the giex-valve-02 branch 2 times, most recently from 907a4d3 to 693aa6d Compare October 7, 2024 20:21
@TheJulianJES TheJulianJES added v2 quirk Quirks using v2 API. Might add custom entities that need translation keys in HA. Tuya Request/PR regarding a Tuya device labels Oct 10, 2024
@prairiesnpr prairiesnpr marked this pull request as ready for review October 19, 2024 00:20
@TheJulianJES
Copy link
Collaborator

After pairing, ZHA must be reloaded for the Summation delivered sensor to show.

That might have been fixed by the PR below. Would be great to get confirmation on that (or that it didn't break anything 😄):

@prairiesnpr
Copy link
Contributor Author

After pairing, ZHA must be reloaded for the Summation delivered sensor to show.

That might have been fixed by the PR below. Would be great to get confirmation on that (or that it didn't break anything 😄):

Can confirm, it was created on joining.

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.

Otherwise good

zhaquirks/tuya/ts0601_valve.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.

Looks good

@TheJulianJES TheJulianJES merged commit 9366c42 into zigpy:dev Oct 20, 2024
9 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 v2 quirk Quirks using v2 API. Might add custom entities that need translation keys in HA.
Projects
None yet
2 participants