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

Should plugins detect changes before calling setAttribute? #195

Closed
AMoo-Miki opened this issue Dec 28, 2024 · 3 comments
Closed

Should plugins detect changes before calling setAttribute? #195

AMoo-Miki opened this issue Dec 28, 2024 · 3 comments
Assignees
Labels
question Further information is requested

Comments

@AMoo-Miki
Copy link

AMoo-Miki commented Dec 28, 2024

I create a plugin for Wiz light bulbs and outlets. These devices send their status every 5 seconds to the plugin. Should the plugin maintain the state of the devices and only call setAttribute for changes or is this handled by Matterbridge or matter.js?

PS, while the plugin is maintaining the state now, I occasionally see out of sync states. If Matterbridge/matter.js doesn't mind hearing from devices with their same old status, I would rather not maintain the state in the plugin. However, if a broadcast is made for every setAttribute, I would rather improve the state management in the plugin.

Please share your thoughts or any tips you might have.

On a side note, I would be grateful for any critique of the plugin. I would like to improve this before starting on plugins for Tuya and Switchmate.

@Apollon77
Copy link

matter.js wise we will ignore "same value updates" because matter.-side does not care ... so no issue with setting the value

@Luligu
Copy link
Owner

Luligu commented Dec 30, 2024

Concerning the other plugins, I update the states when the devices send update.

Set the debug on matter.js side to understand what is going on the matter side.

Only in z2m I check the update and filter the changes cause there some devices just send too many updates in a sec.

@Luligu Luligu self-assigned this Dec 30, 2024
@Luligu Luligu added the question Further information is requested label Dec 30, 2024
@Luligu
Copy link
Owner

Luligu commented Jan 11, 2025

Hi,
I close the issues.
If you need let me know.
Thanks again for your interest.

When you are ready tell me if you want your plugin on the list.

@Luligu Luligu closed this as completed Jan 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants