Add some documentation

This commit is contained in:
uwap 2017-09-17 21:27:43 +02:00
parent 81d8840c32
commit 0569c820a7

View file

@ -10,4 +10,31 @@
## Config
See `src/config.js`
See `src/config.js`.
The Config format consists out of two sections. Topics and Controls.
### Topics
The topics section defines the mqtt interfaces.
### Controls
The Controls define the UI Controls.
| Name | Type | Optional? | Default |
|-----------------|-------------------|------------|-----------------|
| type | "toggle" | "dropDown" | "slider" | No | / |
| text | string | No | / |
| topic | string | No | / |
| enableCondition | string => boolean | Yes | () => true |
| *Toggle Options* |
| on | string | Yes | "on" |
| off | string | Yes | "off" |
| toggled | string => boolean | Yes | x => x == "off" |
| *DropDown Options* |
| options | Map<string,*> | Yes | {} |
| *Slider Options* |
| min | number | Yes | 0 |
| max | number | Yes | 1 |
| step | number | Yes | 1 |