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

[Python] Fix Event callback for ARM64 Apple Platform devices #56

Merged
merged 1 commit into from
Apr 25, 2024

Conversation

agners
Copy link
Collaborator

@agners agners commented Apr 23, 2024

With the latest build, the macOS builds print the following error on various (presumably all) devices which report events:

2024-04-23 21:40:35.270 (Dummy-8) ERROR [root] 16 is not a valid Status
Traceback (most recent call last):
  File "/Users/marcelvanderveldt/Workdir/home-assistant-libs/python-matter-server/.venv/lib/python3.12/site-packages/chip/clusters/Attribute.py", line 738, in handleEventData
    Header=header, Data=eventValue, Status=chip.interaction_model.Status(status))
                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.12.1_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/enum.py", line 744, in __call__
    return cls.__new__(cls, value)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.12.1_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/enum.py", line 1158, in __new__
    raise ve_exc
ValueError: 16 is not a valid Status

16 is not a valid status indeed, and cannot originate from the C++ SDK really.

In another, second build, the status was 208 on every callback.

It seems that not all data type work with Python CFFI on Arm64. Use size_t here instead.

@agners agners force-pushed the debug-status-16-issue branch 3 times, most recently from 70534de to 45d944d Compare April 24, 2024 11:56
@agners agners changed the base branch from main to release April 24, 2024 11:57
@agners agners changed the title Debug status 16 issue Work around macOS LLVM/Clang compiler bug Apr 24, 2024
@agners agners force-pushed the debug-status-16-issue branch 4 times, most recently from 049d37b to 3e26f82 Compare April 25, 2024 15:50
@agners agners force-pushed the debug-status-16-issue branch from 3e26f82 to c56da6c Compare April 25, 2024 17:48
@agners agners changed the title Work around macOS LLVM/Clang compiler bug [Python] Fix Event callback for ARM64 Apple Platform devices Apr 25, 2024
@agners agners marked this pull request as ready for review April 25, 2024 17:49
Copy link
Contributor

@marcelveldt marcelveldt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

@agners agners merged commit 5b5b915 into release Apr 25, 2024
4 checks passed
@agners agners deleted the debug-status-16-issue branch April 26, 2024 07:37
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.

2 participants