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 ZCL attributes from strings when writing #267

Merged
merged 4 commits into from
Nov 27, 2024

Conversation

puddly
Copy link
Contributor

@puddly puddly commented Oct 27, 2024

When writing attributes via the ZCL cluster management dialog, strings aren't currently converted into their correct type. I believe this is a regression.

We'll need to figure out a generic way to do string conversion for complex types, like arrays and structs.

Copy link

codecov bot commented Oct 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.49%. Comparing base (82db95f) to head (440698d).
Report is 3 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #267      +/-   ##
==========================================
+ Coverage   96.33%   96.49%   +0.15%     
==========================================
  Files          61       61              
  Lines        9397     9420      +23     
==========================================
+ Hits         9053     9090      +37     
+ Misses        344      330      -14     

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

@Monofin
Copy link

Monofin commented Nov 16, 2024

Hi there - what's needed to push this one forward, as I'm struggling with broken device settings that would be resolved by this? Happy to help out if there's anything I can do :-)

@R3uvysiXozq4Fr3Skmrs
Copy link

R3uvysiXozq4Fr3Skmrs commented Nov 24, 2024

Hi! I am also having problems changing device settings. I have Tuya TZE204_qasjif9e and I can't change its parameters. Any news on enabling your fix?

Write if I can help with testing :)

@puddly
Copy link
Contributor Author

puddly commented Nov 25, 2024

I've not had time to write unit tests for this change so if you'd like to see it merged, 100% test coverage would be nice 😄

@Monofin
Copy link

Monofin commented Nov 25, 2024

Love to help, but I’m not that familiar with the unit test system in use - if you’ve got a hint as to where to get started I’ll have a look though! :-)

@javicalle
Copy link

Love to help, but I’m not that familiar with the unit test system in use - if you’ve got a hint as to where to get started I’ll have a look though! :-)

Maybe you can look at the current tests:

@puddly puddly force-pushed the puddly/zcl-attribute-writing-conversion branch from 6c08089 to 28476b3 Compare November 27, 2024 21:42
@puddly puddly marked this pull request as ready for review November 27, 2024 21:44
@puddly puddly merged commit 6737b36 into zigpy:dev Nov 27, 2024
9 checks passed
gdoffe pushed a commit to gdoffe/zha that referenced this pull request Nov 29, 2024
* Convert ZCL attributes when writing

* Handle bytes too

* Add some unit tests

* Address review comments

Signed-off-by: Gilles DOFFE <g.doffe@gmail.com>
Co-authored-by: Matthéo PERELLE <mattheo.perelle@gmail.com>
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.

5 participants