Update 107.md

This commit is contained in:
Vlad Stan 2023-10-24 17:16:32 +03:00 committed by GitHub
parent 0b2bc68313
commit c629819c72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

12
107.md
View File

@ -79,8 +79,14 @@ This message is sent by an admin `user` to a `device`. The `device` saves the co
### Intent Events (`kind: 8000`)
Intent Events represent different actions that can be performed on a device. These actions can be triggered by a `user` or by another `device`.
The content of the event is a `JSON` array
The content of the event is a `JSON` array representing the data type and the data value as specified in [NIP-91 Event Kinds](https://github.com/nostr-protocol/nips/blob/iot/91.md#event-kinds)
**Event Content**:
```json
[[<Integer, Iot kind>, <Any, value> ]]
```
Example that turns on a device and sets the temperature to `20.9` degrees Celsius:
```json
[[8001, true], [8003, 20.9]]
```
@ -88,8 +94,8 @@ The content of the event is a `JSON` array
**Event Tags**:
```json
"tags": [["d", <String, pubkey of the configured device]]
"tags": [["p", <String, pubkey of the targeted device]]
```
- the `d` tag is required, its value MUST be the same as the pubkey of the `device`.
- the `p` tag is required, its value MUST be the same as the pubkey of the `device`.