Closed FireWizard52 closed 3 years ago
See: https://discourse.nodered.org/t/nr-lint-indicates-loop-detected/49273
NR Lint indicates an error "loop detected" in case of a branch, which is joined later on one of the branches.
No error message "loop detected" from NR Lint in case of a branch.
See flow
[{"id":"e8e8b8a4.3e5bc8","type":"tab","label":"Afvalwijzer","disabled":false,"info":""},{"id":"6f7712af.f2cb54","type":"inject","z":"e8e8b8a4.3e5bc8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"00 18 * * 1,2,3,4,5,6","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":110,"y":140,"wires":[["93eaa2b4.249eb"]]},{"id":"93eaa2b4.249eb","type":"http request","z":"e8e8b8a4.3e5bc8","name":"","method":"GET","ret":"txt","paytoqs":"ignore","url":"https://www.mijnafvalwijzer.nl/nl/3781HW/92/","tls":"","persist":false,"proxy":"","authType":"","x":310,"y":140,"wires":[["e51c77e7.b368a","2ab9fec0.f9b64a"]]},{"id":"e51c77e7.b368a","type":"html","z":"e8e8b8a4.3e5bc8","name":"First Date","property":"payload","outproperty":"payload","tag":"p.firstDate","ret":"html","as":"single","x":500,"y":120,"wires":[["9700d0607625f7f2"]]},{"id":"2ab9fec0.f9b64a","type":"html","z":"e8e8b8a4.3e5bc8","name":"First Waste Type","property":"payload","outproperty":"payload","tag":"p.firstWasteType","ret":"html","as":"single","x":530,"y":160,"wires":[["f978799e.1a9178"]]},{"id":"f978799e.1a9178","type":"change","z":"e8e8b8a4.3e5bc8","name":"Set Topic","rules":[{"t":"set","p":"topic","pt":"msg","to":"firstWasteType","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":740,"y":160,"wires":[["d613b028.3c4bd"]]},{"id":"d613b028.3c4bd","type":"join","z":"e8e8b8a4.3e5bc8","name":"Join Date and Type","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":950,"y":140,"wires":[["747b2314.40b464"]]},{"id":"747b2314.40b464","type":"function","z":"e8e8b8a4.3e5bc8","name":"Waste","func":"var msg1 = {};\nvar msg2 = {};\nvar d=new Date();\n\nvar wasteType = {};\n\nvar url = \"http://192.168.10.50:8080\";\n\nif (msg.payload.firstDate.length <= 1) {\n \n wasteType = msg.payload.firstWasteType[0];\n msg1.payload = {\"command\":\"udevice\",\"idx\":497,\"nvalue\":0,\"svalue\":\"Eerstvolgende ophaalmoment: \" + msg.payload.firstDate[0] + \"\\n\" + wasteType};\n\n} else if (msg.payload.firstDate.length > 1) {\n if (18 - d.getHours() > 0) {\n wasteType = msg.payload.firstWasteType[0];\n msg1.payload = {\"command\":\"udevice\",\"idx\":497,\"nvalue\":0,\"svalue\":\"Eerstvolgende ophaalmoment: \" + msg.payload.firstDate[0] + \"\\n\" + wasteType};\n } else if (18 - d.getHours() <= 0) {\n wasteType = msg.payload.firstWasteType[1];\n msg1.payload = {\"command\":\"udevice\",\"idx\":497,\"nvalue\":0,\"svalue\":\"Eerstvolgende ophaalmoment: \" + msg.payload.firstDate[1] + \"\\n\" + wasteType};\n } \n}\n\nswitch (wasteType) {\n\n case \"Plastic verpakkingen, Metalen verpakkingen en Drankkartons\":\n msg2.url = url + \"/json.htm?type=setused&used=true&name=Afvalkalender&idx=497&switchtype=0&customimage=118\";\n break;\n\n case \"Groente, Fruit en Tuinafval\":\n msg2.url = url + \"/json.htm?type=setused&used=true&name=Afvalkalender&idx=497&switchtype=0&customimage=116\";\n break;\n\n case \"Papier en karton\":\n msg2.url = url + \"/json.htm?type=setused&used=true&name=Afvalkalender&idx=497&switchtype=0&customimage=119\";\n break;\n\n case \"Restafval\":\n msg2.url = url + \"/json.htm?type=setused&used=true&name=Afvalkalender&idx=497&switchtype=0&customimage=117\";\n break;\n}\n\nreturn [msg1,msg2];","outputs":2,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1150,"y":140,"wires":[["9db9a79d.7682c8"],["22a9bf64.bdcb68"]]},{"id":"9db9a79d.7682c8","type":"mqtt out","z":"e8e8b8a4.3e5bc8","name":"To Domoticz","topic":"domoticz/in","qos":"0","retain":"false","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"8591549f.77809","x":1350,"y":100,"wires":[]},{"id":"22a9bf64.bdcb68","type":"http request","z":"e8e8b8a4.3e5bc8","name":"To Domoticz","method":"GET","ret":"txt","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","authType":"","x":1350,"y":180,"wires":[[]]},{"id":"9700d0607625f7f2","type":"change","z":"e8e8b8a4.3e5bc8","name":"Set Topic","rules":[{"t":"set","p":"topic","pt":"msg","to":"firstDate","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":740,"y":120,"wires":[["d613b028.3c4bd"]]},{"id":"8591549f.77809","type":"mqtt-broker","name":"Jonas_MQTT_Server","broker":"192.168.10.24","port":"1883","clientid":"","usetls":false,"protocolVersion":4,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]
Duplicate of #12
This will be fixed in 1.0.3
Current Behavior
See: https://discourse.nodered.org/t/nr-lint-indicates-loop-detected/49273
NR Lint indicates an error "loop detected" in case of a branch, which is joined later on one of the branches.
Expected Behavior
No error message "loop detected" from NR Lint in case of a branch.
Steps To Reproduce
See flow
Example flow
Environment