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

Feature: add callback data to the bridge device type callback (CON-989) #811

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Ravenen
Copy link

@Ravenen Ravenen commented Jan 26, 2024

What

I have added callback data to the bridge device type callback (esp_matter_bridge::set_device_type). Correspondingly, callback data has been integrated into the esp_matter_bridge::create_device and esp_matter_bridge::resume_device functions.

Why

This enhancement allows for the efficient transmission of type-specific configuration data to the device during its creation. This is particularly beneficial in scenarios where passing such information to the priv_data parameter might not be ideal. The priv_data parameter, typically passed to endpoint metadata and other callbacks like attribute_callback, can now be kept separate from configuration details.

Use-case

In my specific use-case, I have implemented an abstraction layer above esp-matter. When a device is created, I aim to transmit both application user context (device object with application meta-data) and Matter-specific configuration (e.g., features for a generic switch). By utilizing the callback data, I can achieve a clean separation between priv_data and configurations within the abstraction layer. This proves to be advantageous as the abstraction layer does not need to be aware of the context structure in priv_data, resulting in a more organized and maintainable codebase.

I believe that this enhancement aligns with common use-cases where developers desire to keep priv_data and configurations distinctly separated.

@CLAassistant
Copy link

CLAassistant commented Jan 26, 2024

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot changed the title Feature: add callback data to the bridge device type callback Feature: add callback data to the bridge device type callback (CON-989) Jan 26, 2024
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