Skip to content
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

Publish information about available commands #4

Open
ryan-summers opened this issue Feb 25, 2022 · 3 comments
Open

Publish information about available commands #4

ryan-summers opened this issue Feb 25, 2022 · 3 comments

Comments

@ryan-summers
Copy link
Member

It would be beneficial to the end user if there was some information about available commands automatically posted somewhere.

Ideally, wherever this information is posted would be retained so that it's accessible for any client that connects to the MQTT broker.

Ideally, an implementation would:

  • Provide accepted command strings
  • Indicate expected command format (e.g. JSON schema, or by example)

Such a topic could also be configured to automatically be removed as part of the will, although I am currently unsure if this would be supported via MQTT.

@jordens
Copy link
Member

jordens commented Feb 25, 2022

The more I think about it the more I suspect that instead of republishing the settings individually and after backtracking them from state, we may just publish a schema describing them. Could be one JSON chunk derived from the minconf structure and/or the minireq. That would also allow describing possible values, not just keys.

@ryan-summers
Copy link
Member Author

I've been having similar thoughts about this in my free time. While publishing the current settings in miniconf is a good start, it's not a functionally complete approach, since it doesn't describe possible enums etc. Some time of compile-time schema generation would be helpful here, but this needs a bit more thought and investigation.

It would be nice to use JSON schema though, since then we can develop client-side software that can automatically derive available commands and their expected format. This would also make it so that the client-side software never needs to be updated and would be compatible with multiple firmware versions etc.

@jordens
Copy link
Member

jordens commented Feb 25, 2022

Yes. That's what I meant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants