Update 107.md

This commit is contained in:
Vlad Stan 2023-10-25 15:23:06 +03:00 committed by GitHub
parent 8e3c74e03d
commit aa8e29902e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

22
107.md
View File

@ -82,15 +82,15 @@ This message is sent by an admin `user` to a `device`. The `device` saves the co
--- ---
Intent Events represent different actions that can be performed on a device. These actions can be triggered by a `user` or by another `device`. 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` object where for each field: The content of the event is a `JSON` object where for each field:
- the key must correspond to the `name` value of an entry from the [Data Types](https://github.com/arcbtc/nips/blob/107/107.md#data-events-kind-8001) table - the key must correspond to the `name` of an entry from the [Data Types](https://github.com/arcbtc/nips/blob/107/107.md#data-events-kind-8001) table
- the value represents the actual - the value represents the value to be set on the device
**Event Content**: **Event Content**:
```json ```json
{ {
"on": <bool>, "on": <bool>,
"temperature": <float Caelsius>, "temperature": <float Caelsius>,
"watts": <float Watts> ...
} }
``` ```
@ -112,10 +112,22 @@ Example that turns on a device and sets the temperature to `20.9` degrees Celsiu
### Data Events (`kind: 8001`) ### Data Events (`kind: 8001`)
--- ---
Data Events represent data published by `device`(s). The `kind` of the event and the `content` must follow ths specification from [NIP-91 Event Kinds](https://github.com/nostr-protocol/nips/blob/iot/91.md#event-kinds). Data Events represent data published by `device`(s).
The content of the event is a `JSON` object where for each field:
- the key must correspond to the `name` of an entry from the [Data Types](https://github.com/arcbtc/nips/blob/107/107.md#data-events-kind-8001) table
- the value represents the data read from a sensor or other type of input
> [!NOTE] > [!NOTE]
> If a device has more sensors attached (eg: temperature and humidity) then it will publish separate events for each measured value. > If a device has more sensors attached (eg: temperature and humidity) then it cam publish one unified event for all measured values.
**Event Content**:
```json
{
"temperature": <float Caelsius>,
"humidity": <float, percentage>,
...
}
```
**Event Tags**: **Event Tags**:
```json ```json