Add some info to readme

This commit is contained in:
Dorian Zedler 2021-08-19 11:40:36 +02:00
parent b6f8b54bc2
commit 23f4d4ced9
Signed by: dozedler
GPG key ID: 989DE36109AFA354

View file

@ -1,3 +1,20 @@
# server
The backend server of MlmAccess
# Workflows
## Pairing
A new actor can pair like this:
1. Connect to the broker using `pair-actor` as username and the pair secret as password
2. Subscribe to `mlmAccess/pair/response/actor`
3. Publish its desired ID to `mlmAccess/pair/request/actor`
4. The backend will publish the password for the actor to `mlmAccess/pair/response/actor` in case of success
5. In case of an error, the backend will publish an empty string to `mlmAccess/pair/response/actor`
6. The actor may now connect using `actor-{id}` as username and the password it got in 4
## Actor normal operation
During normal operation (after pairing) the actor has to follow this workflow:
1. The actor subscribes to `mlmAccess/actor/{id}/action`
2. The actor publishes its status to `mlmAccess/actor/{id}/status`
3. The backend will publish a requested state change to `mlmAccess/actor/{id}/action`
4. The actor will publish its state to `mlmAccess/actor/{id}/status` to let the backend know that the action was executed successfully