Add input/output example to readme

This commit is contained in:
s3lph 2019-12-02 22:27:30 +01:00
parent 138234c4a3
commit 45384b2a62

View file

@ -28,6 +28,60 @@ currently open), you can replace parts of the JSON document (anything
except object keys) with [Jinja2 templates][jinja], from which you can
invoke custom plugins, which look up and return your dynamic content.
<table>
<thead>
<tr>
<td>Input</td>
<td>Output</td>
</tr>
</thead>
<tbody>
<tr>
<td>
```json
{
"api": "0.13",
"space": "My Hackerspace",
"state": "{{ space_state() }}",
"sensors": {
"network_connections": "{{ network_connections() }}"
}
}
```
</td>
<td>
```json
{
"api": "0.13",
"state": {
"open": true,
"lastchange": 1575160777,
"message": "Visitors Welcome!"
},
"sensors": {
"network_connections": [
{
"value": 4,
"type": "wifi",
"name": "2.4 GHz"
},
{
"value": 7,
"type": "wifi",
"name": "5 GHz"
}
]
}
}
```
</td>
</tr>
</tbody>
</table>
## Usage
### 0. Download