Update 107.md

This commit is contained in:
Vlad Stan 2023-10-24 09:29:59 +03:00 committed by GitHub
parent c8de5d7847
commit 15fc9f1ebe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

14
107.md
View File

@ -47,22 +47,26 @@ Each `JSON` message `MUST` have a `type` field indicating the what the JSON repr
| 2 | Device | State Data |
### Event: Configure `device`
This message is sent by a `user` to a `device`. The `device` saves the config locally and uses it.
**Event Content**:
```json
{
"type": <String, UUID generated by the user.Sequential IDs (`0`, `1`, `2`...) are discouraged>,
"device_id": <String, UUID of the device>,
"name": <String, device name>,
"type": 0,
"admin_pubkeys": [ [<String (optional), admin user public-key>]],
"name": <String (optional), set a name for the device>,
"description": <String (optional), device description>,
"categories":[ <String (optional), device category, such as 'boiler'>],
"users":[ [<String (optional), user public-key>]],
"send_to_pubkeys":[ [<String (optional), user public-key>]],
"commands_from_pubkeys":[ [<String (optional), user public-key>]],
}
```
Note:
- `admin_pubkeys`:
- list of public keys that are allowed to configure this device. A fresh/blank device will not have this value, so the first received `"type: 0"` should set it.
- `users`:
- A list that can restrict access to public-keys, `device`(s) also has keys and can be a `user`.
- a list that can restrict access to public-keys, `device`(s) also has keys and can be a `user`.
### Event: Update a `device`