Highly configurable MQTT map interface
Find a file
2018-01-21 11:26:45 +01:00
config Add a progress bar 2018-01-21 11:26:45 +01:00
css Fix rainbow colors 2018-01-13 20:05:47 +01:00
img/layers/rzl RZL: Use svg 2017-11-04 04:53:07 +01:00
raw RZL: Use svg 2017-11-04 04:53:07 +01:00
src Add a progress bar 2018-01-21 11:26:45 +01:00
types Add a progress bar 2018-01-21 11:26:45 +01:00
.babelrc Almost completely rewrite UiItems 2017-11-26 16:49:41 +01:00
.eslintrc.js Fix most eslint warnings 2018-01-19 21:52:53 +01:00
.flowconfig Type mqtt.js a bit 2018-01-20 14:15:16 +01:00
.gitignore Fix the icon color + allow changing icons depending on the state 2017-11-11 05:44:04 +01:00
.travis.yml Change travis build 2018-01-19 17:26:07 +01:00
index.ejs Use material-design-icons instead of material-icons 2017-11-06 05:50:15 +01:00
package.json Upgrade all dependencies 2018-01-19 17:07:31 +01:00
README.md refacor all the things \o/ 2017-09-19 10:12:32 +02:00
shell.nix Automatically run flow on build 2017-10-27 16:40:42 +02:00
webpack.common.js Fix all type errors 2018-01-19 16:53:16 +01:00
webpack.dev.js Put vendor in an own file in production 2017-11-06 14:20:35 +01:00
webpack.prod.js Hopefully fix the build 2017-11-13 14:10:45 +01:00
yarn.lock RZL: Add Partkeepr Link 2018-01-19 21:00:30 +01:00

Space Map

How to set up

  1. run yarn to install all dependencies.
  2. run yarn build to compile everything
  3. open the index.html
  4. ???
  5. profit

Config

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 Description
type "toggle" | "dropDown" | "slider" No The type of the UI element.
text string No The text displayed right next to the UI element.
topic string No The topic the UI element is supposed to change and/or receive its status from.
enableCondition (key: string, value: *) => boolean Yes () => true This option allows you to enable or disable UI elements, depending on the current state. The first parameter is the internal representation of the value. For example "off". The second parameter is the actual value that was received via MQTT. Return true to enable the element and false to disable it.
Toggle Options
on string Yes "on" If the state is equal to the value of this option the toggle will be toggled on (if the toggled function is not overriden). This is also the value that will be sent when the button is toggled on.
off string Yes "off" If the state is equal to the value of this option the toggle will be toggled off (if the toggled function is not overriden). This is also the value that will be sent when the button is toggled off.
toggled (key: string, value: *) => boolean Yes Use the on and off options This is the function that decides whether the button should be in a toggled state or not. The parameters are equivalent to those of enableCondition. Return true to set the button to a toggled state. Return false to set it to the untoggled state.
DropDown Options
options Map<string,string> Yes {} This is an attribute set that will map all values defined in the topics section to a description text. For example { on: "Lights On", off: "Lights Off" } will give the drop down element two options, one that is named Lights On and one that is named Lights Off.
Slider Options
min number Yes 0 The minimum value of that slider.
max number Yes 1 The maximum value of that slider.
step number Yes 1 The smallest step of the slider.