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 2-clamp power meter _TZE200_rks0sgb7 #2870

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

Conversation

jmuf
Copy link

@jmuf jmuf commented Dec 28, 2023

Proposed change

Adds a "quirk" for the above device.

  • use separate classes for AB/A/B readings, with several Bus()es as Hash
  • allow to report negative power reading (under reverse load)
  • use constants from ElectricalMeasurement, Metering and for divisors
  • do not set voltage/current/energy multipliers, just divisors

Additional information

Fixes #2650
Outstanding issue: naming for the triplicated endpoint measurements ( #2840). This is cosmetic, devices can be manually renamed to something more meaningful.

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

* use separate classes for AB/A/B readings, with several Bus()es as Hash
* allow to report negative power reading (under reverse load)
* use constants from ElectricalMeasurement, Metering and for divisors
* do not set voltage/current/energy multipliers, just divisors
Copy link

codecov bot commented Dec 28, 2023

Codecov Report

Attention: Patch coverage is 48.95105% with 73 lines in your changes missing coverage. Please review.

Project coverage is 86.89%. Comparing base (a2911a0) to head (f968218).
Report is 119 commits behind head on dev.

Files with missing lines Patch % Lines
zhaquirks/tuya/ts0601_sp_clamp_power.py 48.95% 73 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #2870      +/-   ##
==========================================
- Coverage   87.50%   86.89%   -0.61%     
==========================================
  Files         292      293       +1     
  Lines        8952     9095     +143     
==========================================
+ Hits         7833     7903      +70     
- Misses       1119     1192      +73     

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

@TheJulianJES TheJulianJES added the Tuya Request/PR regarding a Tuya device label Dec 30, 2023
@TheJulianJES TheJulianJES changed the title support for _TZE200_rks0sgb7 2-clamp power meter (zigpy#2650) Add Tuya 2-clamp power meter _TZE200_rks0sgb7 Dec 30, 2023
@TheJulianJES TheJulianJES added the missing tests PR has no tests and might need them label Jan 19, 2024
jeverley added a commit to jeverley/zha-device-handlers that referenced this pull request Feb 1, 2024
Aims to address device support requests:

2 bidirectional clamps:
zigpy#2549 (_TZE204_81yrt3lo)
zigpy#2650 (_TZE200_rks0sgb7)

1 bidirectional clamp:
zigpy#2420 (_TZE204_ac0fhfiq)

1 clamp:
zigpy#1973 (_TZE204_cjbofhxw)

@jmuf I've just spotted that in parallel you've also been working on zigpy#2870 for 
_TZE200_rks0sgb7, shall we pool ideas?
jeverley added a commit to jeverley/zha-device-handlers that referenced this pull request Feb 1, 2024
Amendments from details in zigpy#2650 & zigpy#2870 (however that approach uses attributes directly rather than datapoints).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
missing tests PR has no tests and might need them Tuya Request/PR regarding a Tuya device
Projects
None yet
2 participants