Should plugins detect changes before calling setAttribute
?
#195
Labels
question
Further information is requested
setAttribute
?
#195
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.
The text was updated successfully, but these errors were encountered: