parnic / node-screenlogic

Pentair ScreenLogic Javascript library using Node.JS
https://www.npmjs.com/package/node-screenlogic
MIT License
53 stars 15 forks source link

Lights Command questions #16

Closed mikemucc closed 4 years ago

mikemucc commented 4 years ago

In the README it lists a bunch of light commands, but says that the command takes an Integer. Is this the correct mapping?

Edit: Correct Integers per below.

Number Meaning
0 ScreenLogic.LIGHT_CMD_LIGHTS_OFF
1 ScreenLogic.LIGHT_CMD_LIGHTS_ON
2 ScreenLogic.LIGHT_CMD_COLOR_SET
3 ScreenLogic.LIGHT_CMD_COLOR_SYNC
4 ScreenLogic.LIGHT_CMD_COLOR_SWIM
5 ScreenLogic.LIGHT_CMD_COLOR_MODE_PARTY
6 ScreenLogic.LIGHT_CMD_COLOR_MODE_ROMANCE
7 ScreenLogic.LIGHT_CMD_COLOR_MODE_CARIBBEAN
8 ScreenLogic.LIGHT_CMD_COLOR_MODE_AMERICAN
9 ScreenLogic.LIGHT_CMD_COLOR_MODE_SUNSET
10 ScreenLogic.LIGHT_CMD_COLOR_MODE_ROYAL
11 ScreenLogic.LIGHT_CMD_COLOR_SET_SAVE
12 ScreenLogic.LIGHT_CMD_COLOR_SET_RECALL
13 ScreenLogic.LIGHT_CMD_COLOR_BLUE
14 ScreenLogic.LIGHT_CMD_COLOR_GREEN
16 ScreenLogic.LIGHT_CMD_COLOR_RED
17 ScreenLogic.LIGHT_CMD_COLOR_WHITE
18 ScreenLogic.LIGHT_CMD_COLOR_PURPLE
parnic commented 4 years ago

Subtract everything by one.

Yes, the command takes an integer, but each of those constants you listed is an integer, so just pass them to the function. sendLightCommand(0, ScreenLogic.LIGHT_CMD_COLOR_MODE_AMERICAN) for example