Skip to content

Fix writing of Nullable attributes#768

Merged
marcelveldt merged 2 commits intomainfrom
fix-write-nullable-attributes
Jun 21, 2024
Merged

Fix writing of Nullable attributes#768
marcelveldt merged 2 commits intomainfrom
fix-write-nullable-attributes

Conversation

@marcelveldt
Copy link
Copy Markdown
Collaborator

Some Matter Attributes require sending a Null value to reset it to its device/factory default.
This was not working correctly, especially in the case if the annotation was a union (e/.g. an optional int).

This issue is now fixed so the write_attribute can correctly understand that it actually needs to write the sdk's Null if python sends a None.

Also added a quick test case

@marcelveldt marcelveldt added the bugfix Pull request that fixes a (known) issue/bug label Jun 21, 2024
@frenck frenck requested a review from agners June 21, 2024 09:06
Comment thread tests/common/test_parser.py Outdated
Comment thread matter_server/common/helpers/util.py
@marcelveldt marcelveldt requested a review from agners June 21, 2024 12:10
@marcelveldt marcelveldt merged commit 189a820 into main Jun 21, 2024
@marcelveldt marcelveldt deleted the fix-write-nullable-attributes branch June 21, 2024 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Pull request that fixes a (known) issue/bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants