alsuren/mijia-homie

controller: properties sometimes have no payload if not updated at runtime

Closed this issue · 1 comments

Core issue is this:

// TODO: What about values of properties we don't yet know about? They may arrive
// before the $properties of the node, because the "homie/node_id/+" subscription
// matches both.

I have a node that updates very rarely. After restart of the controller, my broker publishes the retained payload topic before the node's $properties attribute, causing those payloads to get lost.

I'd suggest not to subscribe to wildcards, instead subscribe explicitly to the attributes, then to the payloads as discovered.

I've pushed homie-controller 0.7.0 to crates.io with your fix for this.