From 17243b570e07a496dc82f336179ac856d61840de Mon Sep 17 00:00:00 2001 From: Michael Mucciarone Date: Sun, 29 Dec 2019 11:57:24 -0600 Subject: [PATCH] updates to readme --- README.md | 187 +++++++++++++++++++++++++++++++++++++++++++++++++++++- server.js | 4 +- 2 files changed, 188 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index edb7514..315887d 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ You can modify the behavoir of the server with the following environment variabl | Endpoint | Function | Notes | |----------|----------|-------| -|`/api/:circuit/:state` | Turn any circuit on or off. `circuit` should be an integer between 500 and 600, `state` should be 1 (on) or 0 (off)| The `/api/all` endpoint will return an object that lists all of the circuit definitions for your system under `controllerconfig.circuits[]`.| +|`/api/circuit/:circuit/:state` | Turn any circuit on or off. `circuit` should be an integer between 500 and 600 corresponding to the circuit you wish to modify, `state` should be 1 (on) or 0 (off)| The `/api/all` endpoint will return an object that lists all of the circuit definitions for your system under `controllerConfig.bodyArray[]`.| ##### Convenience Methods @@ -64,3 +64,188 @@ You can modify the behavoir of the server with the following environment variabl | 2 | Solar Preferred | | 3 | Heat Pump | | 4 | No Change | + +#### Lights + +| Endpoint | Function | Notes | +|----------|----------|-------| +|`/api/lights/:command`| Execute a Light command | This should be a integer from 0 - 17, see below| + +This is the config object I'm using in the angular UI. + +``` ts +[ + { + text: "Lights Off", + buttonType : "primary", + commandInt: 0, + commandString: "ScreenLogic.LIGHT_CMD_LIGHTS_OFF", + visible: false, + pallet: "OnOff", + color: null + }, + { + text: "Lights On", + buttonType : "primary", + commandInt: 1, + commandString: "ScreenLogic.LIGHT_CMD_LIGHTS_ON", + visible: false, + pallet: "OnOff", + color: null + }, +] + +export const COLORLIGHTBUTTONS: LightButton[] = [ + { + text: "Set", + buttonType : "primary", + commandInt: 2, + commandString: "ScreenLogic.LIGHT_CMD_COLOR_SET", + visible: true, + pallet: "Color Lights", + color: null + }, + { + text: "Sync", + buttonType : "primary", + commandInt: 3, + commandString: "ScreenLogic.LIGHT_CMD_COLOR_SYNC", + visible: true, + pallet: "Color Lights", + color: null + }, + { + text: "Swim", + buttonType : "basic", + commandInt: 4, + commandString: "ScreenLogic.LIGHT_CMD_COLOR_SWIM", + visible: true, + pallet: "Color Lights", + color: null + }, +] + +export const INTELLIBRITEBUTTONS: LightButton[] = [ + { + text: "Party", + buttonType : "basic", + commandInt: 5, + commandString: "ScreenLogic.LIGHT_CMD_COLOR_MODE_PARTY", + visible: true, + pallet: "IntelliBrite", + color: null + }, + { + text: "Romance", + buttonType : "basic", + commandInt: 6, + commandString: "ScreenLogic.LIGHT_CMD_COLOR_MODE_ROMANCE", + visible: true, + pallet: "IntelliBrite", + color: null + }, + { + text: "Caribbean", + buttonType : "basic", + commandInt: 7, + commandString: "ScreenLogic.LIGHT_CMD_COLOR_MODE_CARIBBEAN", + visible: true, + pallet: "IntelliBrite", + color: null + }, + { + text: "American", + buttonType : "basic", + commandInt: 8, + commandString: "ScreenLogic.LIGHT_CMD_COLOR_MODE_AMERICAN", + visible: true, + pallet: "IntelliBrite", + color: null + }, + { + text: "Sunset", + buttonType : "basic", + commandInt: 9, + commandString: "ScreenLogic.LIGHT_CMD_COLOR_MODE_SUNSET", + visible: true, + pallet: "IntelliBrite", + color: null + }, + { + text: "Royal", + buttonType : "basic", + commandInt: 10, + commandString: "ScreenLogic.LIGHT_CMD_COLOR_MODE_ROYAL", + visible: true, + pallet: "IntelliBrite", + color: null + }, + { + text: "Save", + buttonType : "basic", + commandInt: 11, + commandString: "ScreenLogic.LIGHT_CMD_COLOR_SET_SAVE", + visible: false, + pallet: "IntelliBrite", + color: null + }, + { + text: "Recall", + buttonType : "basic", + commandInt: 12, + commandString: "ScreenLogic.LIGHT_CMD_COLOR_SET_RECALL", + visible: false, + pallet: "IntelliBrite", + color: null + }, + +] + +export const SOLIDCOLORBUTTONS: LightButton[] = [ + { + text: "Blue", + buttonType : "mat-fab", + commandInt: 13, + commandString: "ScreenLogic.LIGHT_CMD_COLOR_BLUE", + visible: true, + pallet: "Solid Colors", + color: "#2400c7" + }, + { + text: "Green", + buttonType : "mat-fab", + commandInt: 14, + commandString: "ScreenLogic.LIGHT_CMD_COLOR_GREEN", + visible: true, + pallet: "Solid Colors", + color: "#00a008" + }, + { + text: "Red", + buttonType : "mat-fab", + commandInt: 15, + commandString: "ScreenLogic.LIGHT_CMD_COLOR_RED", + visible: true, + pallet: "Solid Colors", + color: "#c20000" + }, + { + text: "White", + buttonType : "mat-fab", + commandInt: 16, + commandString: "ScreenLogic.LIGHT_CMD_COLOR_WHITE", + visible: true, + pallet: "Solid Colors", + color: "#ffffff" + }, + { + text: "Purple", + buttonType : "mat-fab", + commandInt: 17, + commandString: "ScreenLogic.LIGHT_CMD_COLOR_PURPLE", + visible: true, + pallet: "Solid Colors", + color: "#d800ff" + } +] +``` \ No newline at end of file diff --git a/server.js b/server.js index cae3754..1ee5116 100644 --- a/server.js +++ b/server.js @@ -468,7 +468,7 @@ app.put(baseApiPath + '/spa/on', function(req,res){ 'action' : 'on', 'sent' : true } - console.log('Sent poolOn to ScreenLogic') + console.log('Sent spaOn to ScreenLogic') res.json(response) console.log('Returned ' + req.method + ' ' + req.route.path); }) @@ -481,7 +481,7 @@ app.put(baseApiPath + '/spa/off', function(req,res){ 'action' : 'off', 'sent' : true } - console.log('Sent poolOff to ScreenLogic') + console.log('Sent spaOff to ScreenLogic') res.json(response) console.log('Returned ' + req.method + ' ' + req.route.path); });