Skip to content

Commit

Permalink
updates to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
mikemucc committed Dec 29, 2019
1 parent 8ad07dc commit 17243b5
Show file tree
Hide file tree
Showing 2 changed files with 188 additions and 3 deletions.
187 changes: 186 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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"
}
]
```
4 changes: 2 additions & 2 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
})
Expand All @@ -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);
});
Expand Down

0 comments on commit 17243b5

Please sign in to comment.