flow update regarding segmenter and light output changes

(cherry picked from commit cc8667e0e874ece68a0a9330bd29a4231502c788)
This commit is contained in:
Romain Bazile 2021-06-18 11:26:21 +02:00
parent e18d9835ad
commit c0f3c2f439

View file

@ -3031,10 +3031,10 @@
"once": true, "once": true,
"onceDelay": 0.1, "onceDelay": 0.1,
"topic": "", "topic": "",
"payload": "{\"action\":\"off\"}", "payload": "off",
"payloadType": "str", "payloadType": "str",
"x": 150, "x": 140,
"y": 160, "y": 120,
"wires": [ "wires": [
[ [
"f0775525.cf806" "f0775525.cf806"
@ -9072,43 +9072,43 @@
{ {
"label": "100", "label": "100",
"value": "100", "value": "100",
"valueType": "str", "valueType": "num",
"color": "#009933" "color": "#009933"
}, },
{ {
"label": "200", "label": "200",
"value": "200", "value": "200",
"valueType": "str", "valueType": "num",
"color": "#999999" "color": "#999999"
}, },
{ {
"label": "320", "label": "320",
"value": "320", "value": "320",
"valueType": "str", "valueType": "num",
"color": "#ff6666" "color": "#ff6666"
}, },
{ {
"label": "400", "label": "400",
"value": "400", "value": "400",
"valueType": "str", "valueType": "num",
"color": "#009999" "color": "#009999"
}, },
{ {
"label": "500", "label": "500",
"value": "500", "value": "500",
"valueType": "str", "valueType": "num",
"color": "#cccc00" "color": "#cccc00"
}, },
{ {
"label": "640", "label": "640",
"value": "640", "value": "640",
"valueType": "str", "valueType": "num",
"color": "#ff33cc" "color": "#ff33cc"
}, },
{ {
"label": "800", "label": "800",
"value": "800", "value": "800",
"valueType": "str", "valueType": "num",
"color": "#cc6600" "color": "#cc6600"
} }
], ],
@ -9124,11 +9124,11 @@
"id": "f0775525.cf806", "id": "f0775525.cf806",
"type": "ui_multistate_switch", "type": "ui_multistate_switch",
"z": "bccd1f23.87219", "z": "bccd1f23.87219",
"name": "light_state", "name": "light_control",
"group": "4248342d.e55fac", "group": "4248342d.e55fac",
"order": 1, "order": 1,
"width": 0, "width": 5,
"height": 0, "height": 1,
"label": "Light ", "label": "Light ",
"stateField": "payload", "stateField": "payload",
"enableField": "enable", "enableField": "enable",
@ -9138,19 +9138,19 @@
"options": [ "options": [
{ {
"label": "Off", "label": "Off",
"value": "{\"action\":\"off\"}", "value": "off",
"valueType": "str", "valueType": "str",
"color": "#009933" "color": "#009933"
}, },
{ {
"label": "On", "label": "On",
"value": "{\"action\":\"on\"}", "value": "on",
"valueType": "str", "valueType": "str",
"color": "#999999" "color": "#999999"
} }
], ],
"x": 310, "x": 310,
"y": 160, "y": 120,
"wires": [ "wires": [
[ [
"99ae4886.8d43c" "99ae4886.8d43c"
@ -9161,14 +9161,14 @@
"id": "99ae4886.8d43c", "id": "99ae4886.8d43c",
"type": "function", "type": "function",
"z": "bccd1f23.87219", "z": "bccd1f23.87219",
"name": "Encapsulate settings", "name": "Prepare message",
"func": "msg.topic = \"light\"\nreturn msg;", "func": "msg.topic = \"light\"\nmsg.payload = {\"action\":msg.payload}\n\nvar led_output = flow.get('led_output')\nif (led_output !== undefined && led_output !== \"\") {\n msg.payload[\"led\"] = led_output\n}\n\nreturn msg;",
"outputs": 1, "outputs": 1,
"noerr": 0, "noerr": 0,
"initialize": "", "initialize": "",
"finalize": "", "finalize": "",
"x": 500, "x": 490,
"y": 160, "y": 120,
"wires": [ "wires": [
[ [
"d31fcead.7e2ef" "d31fcead.7e2ef"
@ -9184,8 +9184,8 @@
"qos": "", "qos": "",
"retain": "", "retain": "",
"broker": "8dc3722c.06efa8", "broker": "8dc3722c.06efa8",
"x": 670, "x": 650,
"y": 160, "y": 120,
"wires": [] "wires": []
}, },
{ {
@ -10219,5 +10219,92 @@
"8dd6f57f.b77f98" "8dd6f57f.b77f98"
] ]
] ]
},
{
"id": "4535ab65.009354",
"type": "ui_multistate_switch",
"z": "bccd1f23.87219",
"name": "led_output",
"group": "4248342d.e55fac",
"order": 2,
"width": 5,
"height": 1,
"label": "LED output",
"stateField": "payload",
"enableField": "enable",
"rounded": true,
"useThemeColors": true,
"hideSelectedLabel": false,
"options": [
{
"label": "1",
"value": "1",
"valueType": "num",
"color": "#009933"
},
{
"label": "2",
"value": "2",
"valueType": "num",
"color": "#999999"
}
],
"x": 310,
"y": 160,
"wires": [
[
"152f58e5.ca51df"
]
]
},
{
"id": "703d6ecd.62af88",
"type": "inject",
"z": "bccd1f23.87219",
"name": "Default: 1",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": true,
"onceDelay": 0.1,
"topic": "",
"payload": "1",
"payloadType": "num",
"x": 130,
"y": 160,
"wires": [
[
"4535ab65.009354"
]
]
},
{
"id": "152f58e5.ca51df",
"type": "change",
"z": "bccd1f23.87219",
"name": "",
"rules": [
{
"t": "set",
"p": "led_output",
"pt": "flow",
"to": "payload",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 490,
"y": 160,
"wires": [
[]
]
} }
] ]