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

Fix writing of Nullable attributes #768

Merged
merged 2 commits into from
Jun 21, 2024
Merged

Conversation

marcelveldt
Copy link
Contributor

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
tests/common/test_parser.py Outdated Show resolved Hide resolved
matter_server/common/helpers/util.py Show resolved Hide resolved
@marcelveldt marcelveldt requested a review from agners June 21, 2024 12:10
@marcelveldt marcelveldt merged commit 189a820 into main Jun 21, 2024
4 checks passed
@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