Skip to content

Decompose attribute_name tuple to new DP mapping list format #3986

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 7 commits into
base: dev
Choose a base branch
from

Conversation

abmantis
Copy link
Contributor

@abmantis abmantis commented Mar 26, 2025

Proposed change

Requires #3977.

As previously discussed in #3643, this converts the old tuple in DPToAttributeMapping to the new list of DPToAttributeMapping.

For this, the dp_converter also needs to be wrapped and a new attributes_to_dp_converters attribute was introduced in TuyaMCUCluster.

In a follow-up PR I'll add support to the TuyaQuirkBuilder for the new dp_converter. Eventually, after migrating all existing clusters and quirks to the new format we could change the deprecation info logs in DPToAttributeMapping to warnings, so we can clean up the code after some time.

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 Mar 26, 2025

Codecov Report

Attention: Patch coverage is 98.11321% with 1 line in your changes missing coverage. Please review.

Project coverage is 91.22%. Comparing base (5556090) to head (c9fc19a).

Files with missing lines Patch % Lines
zhaquirks/tuya/__init__.py 94.44% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #3986      +/-   ##
==========================================
+ Coverage   91.19%   91.22%   +0.02%     
==========================================
  Files         335      335              
  Lines       10886    10920      +34     
==========================================
+ Hits         9928     9962      +34     
  Misses        958      958              

☔ 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.

@TheJulianJES TheJulianJES added the Tuya Request/PR regarding a Tuya device label Apr 21, 2025
@abmantis abmantis changed the title Decompose attribute_name tuple to new DP mapping list format Decompose attribute_name tuple to new DP mapping list format Apr 21, 2025
@abmantis abmantis marked this pull request as ready for review April 21, 2025 17:40
@TheJulianJES TheJulianJES added the needs review This PR should be reviewed soon, as it generally looks good. label Apr 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs review This PR should be reviewed soon, as it generally looks good. Tuya Request/PR regarding a Tuya device
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants