Skip to content

Should plugins detect changes before calling setAttribute? #195

Closed
@AMoo-Miki

Description

@AMoo-Miki

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

questionFurther information is requested

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions