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 a skip_missing kwarg to the as_ methods of Struct objects #954

Merged
merged 1 commit into from Apr 8, 2022

Conversation

puddly
Copy link
Collaborator

@puddly puddly commented Apr 8, 2022

This will be used to generate partial matches for device automation triggers in quirks, without having to define separate constants for "step" or "step_mode":

>>> from zigpy.zcl.clusters.general import LevelControl
>>> step = LevelControl.commands_by_name["step"].schema  # this should be improved
>>> step(step_mode=0).as_dict(skip_missing=True)
{'step_mode': <StepMode.Up: 0>}

@codecov-commenter
Copy link

codecov-commenter commented Apr 8, 2022

Codecov Report

Merging #954 (89038e5) into dev (29f5268) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##              dev     #954   +/-   ##
=======================================
  Coverage   99.74%   99.74%           
=======================================
  Files          45       45           
  Lines        6640     6646    +6     
=======================================
+ Hits         6623     6629    +6     
  Misses         17       17           
Impacted Files Coverage Δ
zigpy/types/struct.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 29f5268...89038e5. Read the comment docs.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.0002%) to 99.737% when pulling 89038e5 on puddly:puddly/struct-dict-without-None into 29f5268 on zigpy:dev.

@puddly puddly merged commit 99c88cd into zigpy:dev Apr 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants