node-red-contrib-xkeys_led
Version:
Xkeys LED node for Node-RED using Dynamic Control Data Protocol (DCDP)
192 lines • 4.64 kB
JSON
[
{
"id": "c88923ef7194371e",
"type": "tab",
"label": "X-Keys LED test",
"disabled": false,
"info": "",
"env": []
},
{
"id": "c1c93955269612d0",
"type": "inject",
"z": "c88923ef7194371e",
"name": "start main led",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "{\"action\":\"start\",\"ledid\":\"1\",\"flashing\":false}",
"payloadType": "json",
"x": 530,
"y": 80,
"wires": [
[
"cb15b4c9a7f56f74"
]
]
},
{
"id": "b9487442a960c53d",
"type": "inject",
"z": "c88923ef7194371e",
"name": "stop main led",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "{\"action\":\"stop\",\"ledid\":\"1\"}",
"payloadType": "json",
"x": 530,
"y": 160,
"wires": [
[
"cb15b4c9a7f56f74"
]
]
},
{
"id": "f66f53ba117a2f44",
"type": "xkeys_button",
"z": "c88923ef7194371e",
"newname": "Any X-keys Button",
"name": "",
"device": "Any X-keys",
"productid": "",
"pid_list": "[]",
"unit_id": "",
"duplicate_id": "",
"button_id": "",
"presstype": "all",
"x": 170,
"y": 340,
"wires": [
[
"25c462d5c31cc870"
]
]
},
{
"id": "25c462d5c31cc870",
"type": "switch",
"z": "c88923ef7194371e",
"name": "",
"property": "payload.button_id",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "1",
"vt": "str"
},
{
"t": "eq",
"v": "2",
"vt": "str"
},
{
"t": "eq",
"v": "3",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 3,
"x": 330,
"y": 340,
"wires": [
[
"248e2fe6c9112a86"
],
[],
[
"9141735c744c8f54"
]
]
},
{
"id": "248e2fe6c9112a86",
"type": "function",
"z": "c88923ef7194371e",
"name": "start LED",
"func": "var newMsg={};\nvar pid_list=[];\npid_list.push(parseInt(msg.payload.product_id));\nnewMsg[\"payload\"] = { \"action\": \"start\", \"ledid\": \"2\",\"pid_list\":pid_list};\n\nreturn newMsg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 520,
"y": 320,
"wires": [
[
"cb15b4c9a7f56f74"
]
]
},
{
"id": "9141735c744c8f54",
"type": "function",
"z": "c88923ef7194371e",
"name": "stop LED",
"func": "var newMsg={};\nvar pid_list=[];\npid_list.push(parseInt(msg.payload.product_id));\nnewMsg[\"payload\"] = { \"action\": \"stop\",\"pid_list\":pid_list};\n\nreturn newMsg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 520,
"y": 360,
"wires": [
[
"cb15b4c9a7f56f74"
]
]
},
{
"id": "15e1c54ee0e63b31",
"type": "xkeys_flashrate",
"z": "c88923ef7194371e",
"newname": "Any X-keys Flash Rate 30",
"name": "",
"device": "Any X-keys",
"productid": "",
"pid_list": "[]",
"unit_id": "",
"duplicate_id": "",
"flashrate": "30",
"x": 830,
"y": 200,
"wires": []
},
{
"id": "cb15b4c9a7f56f74",
"type": "xkeys_led",
"z": "c88923ef7194371e",
"newname": "XK12JOYSTICK LED 2",
"name": "",
"device": "XK12JOYSTICK",
"productid": "",
"pid_list": "[1065,1067]",
"unit_id": "",
"duplicate_id": "",
"ledid": "",
"flashing": "true",
"buttonState": true,
"x": 830,
"y": 340,
"wires": []
}
]