project-chip / rs-matter

Rust implementation of the Matter protocol. Status: Experimental
Apache License 2.0
303 stars 43 forks source link

[IM/DM] More intelligent reporting on subscriptions #166

Open ivmarkov opened 2 months ago

ivmarkov commented 2 months ago

Since the merge of https://github.com/project-chip/rs-matter/pull/147 , we now do have subscriptions and we do report on these.

However, the current implementation is a bit suboptimal, in that it always reports everything, regardless whether any of the attributes reported by the subscription are actually changed.

I also believe that the existing ChangeNotifier idea, which is somewhat implemented throughout the code (but unfinished), might not have a future, as I don't see it helping in anyway to solve the problem:

I think something more fruitful would be if the notification is traversing all clusters it reports on, and trying to detect (possibly by comparing against a preserved set of datavers, or a simpler -hash-based derivation of multiple datavers) if there are changes or not.