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 | | 2 | Device | State Data |
### Event: Configure `device` ### Event: Configure `device`
This message is sent by a `user` to a `device`. The `device` saves the config locally and uses it.
**Event Content**: **Event Content**:
```json ```json
{ {
"type": <String, UUID generated by the user.Sequential IDs (`0`, `1`, `2`...) are discouraged>, "type": 0,
"device_id": <String, UUID of the device>, "admin_pubkeys": [ [<String (optional), admin user public-key>]],
"name": <String, device name>, "name": <String (optional), set a name for the device>,
"description": <String (optional), device description>, "description": <String (optional), device description>,
"categories":[ <String (optional), device category, such as 'boiler'>], "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: 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`: - `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` ### Event: Update a `device`