From 0569c820a76ae8d5f0608ed63dfef1377711ca11 Mon Sep 17 00:00:00 2001 From: uwap Date: Sun, 17 Sep 2017 21:27:43 +0200 Subject: [PATCH] Add some documentation --- README.md | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5e9325a..0bf2e96 100644 --- a/README.md +++ b/README.md @@ -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 | Yes | {} | +| *Slider Options* | +| min | number | Yes | 0 | +| max | number | Yes | 1 | +| step | number | Yes | 1 |