-
Notifications
You must be signed in to change notification settings - Fork 3
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
consider splitting namespaces for requested settings and actual settings #81
Comments
I think we would need to see an actual use case for this before moving forward. Right now, the only benefit I see is in reporting quanitzed values. quartiq/booster#206 was found to be caused by #71, so it doesn't quite fall under this, and I believe we came to the conclusion that a retained setting should apply if the MQTT client is reconnected. I think the main concern that this would address is when a settings configuration has a "side effect". In this case, some requested setting would need to be significantly changed as a result of another. However, as of yet, we haven't seen that use case arise. |
One general argument is that the device must in general republish actual settings, not just on startup.
The Device can not republish to the same topic:
Summarizing, the device:
|
This is the key point that I was missing and had forgotten since our last chat. All of the above information can be shovelled off to telemetry without issue, but it's a good point that that's not necessarily the desired result e.g. because of logging infra. The main issue I'm trying to reconcile is that, at least for Booster, the requested settings and the actual state are actually two different structures. For booster, the |
Ack. I think it's fine and desirable that requested settings and actual state (let's call it that) are not the same struct and may not be the same values either (see the statemachine "event" vs "state" case). |
The one potentially disappointing effect of this may be that now a new settings request coming in, should never be applied using the previous requested settings as context, but always and only the current state as context. That may make the entire idea of having one Miniconf struct obsolete. |
@jordens and I discussed this today at length and came to the following conclusions:
As a workaround to (2), it was proposed that we should actually implement this type of state tracking + republication of current state at the Booster application-level logic. In the scenario, Booster's telemetry client would be used for publishing channel state changes (and potentially any other settings state values) to a separate topic namespace in MQTT. This would let us tailor the implementation to Booster for now, and if we see a more generic need for this type of API, we could implement it into Miniconf or some other library in a generic fashion. Summary:
|
Upon thinking about more Miniconf use cases, it occurs to me that there's another abstract desire for requested vs. actual settings. If there's an optional setting that is present during one execution, the user may configure it as a If the device is then reconnected later such that the setting is no longer present, it may appear as if it is present because of the requested configuration. An example of this would be configuring an RF channel on Booster. If the user configured a channel as a retained setting, but then removed that channel and reboot booster, it would not be obvious from the available topics that the channel is not actually present. |
Requested settings to be "owned" by the user, actual settings to be owned by the application, representing truth.
Supports reporting of quantized values, clamping
TBD: where to take initial settings from
TBD: retaining actual settings
Reconnecting ethernet while booster in standby may re-enable channels booster#206 for one potential thing this adresses
Commands/Events #72 for a similar line of thought of splitting request response
The text was updated successfully, but these errors were encountered: