{"action":"closed","issue":{"url":"https://api.github.com/repos/tzapu/node-red-contrib-blynk/issues/15","labels_url":"https://api.github.com/repos/tzapu/node-red-contrib-blynk/issues/15/labels{/name}","comments_url":"https://api.github.com/repos/tzapu/node-red-contrib-blynk/issues/15/comments","events_url":"https://api.github.com/repos/tzapu/node-red-contrib-blynk/issues/15/events","html_url":"https://github.com/tzapu/node-red-contrib-blynk/issues/15","id":118199357,"number":15,"title":"Another cacheing issue","user":{"login":"scargill","id":1889411,"avatar_url":"https://avatars.githubusercontent.com/u/1889411?v=3","gravatar_id":"","url":"https://api.github.com/users/scargill","html_url":"https://github.com/scargill","followers_url":"https://api.github.com/users/scargill/followers","following_url":"https://api.github.com/users/scargill/following{/other_user}","gists_url":"https://api.github.com/users/scargill/gists{/gist_id}","starred_url":"https://api.github.com/users/scargill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scargill/subscriptions","organizations_url":"https://api.github.com/users/scargill/orgs","repos_url":"https://api.github.com/users/scargill/repos","events_url":"https://api.github.com/users/scargill/events{/privacy}","received_events_url":"https://api.github.com/users/scargill/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-11-21T14:13:35Z","updated_at":"2015-12-13T06:17:01Z","closed_at":"2015-12-13T06:17:01Z","body":"At least I think it is... but firstly - this new node ie the LCD node (I already control the LCD)... is there a description somewhere of what it does? Sorry, might just be me being thick.\r\n\r\nRight - to my issue... see the code below - very simple - a single button toggles a control between auto, on and off- and only does it on the downward stroke of the button. On the App is a button and one of those rectangular displays that can show a few characters - ie the result \"on\", \"off\" or \"auto\".\r\n\r\nI had this on my main page in Node-Red.    I hit control-X to delete it - and went to another page where I now keep all my BLYNK stuff - and PASTED it in. I SAVED everything.   I made sure the original was not still there.\r\n\r\nWhen pressing a button (you have to look carefully) I noted that the message was jumping and not in the right order, that is - the symptoms of the function being called TWICE in very quick succession - as if BOTH versions were running.\r\n\r\nI checked again that the original was no longer there. I restarted Node-Red. The problem went away.\r\n\r\nPete.\r\n\r\n\r\n\r\nif (msg.payload==\"1\") \r\n    {\r\n     switch (context.global.pergola_override)\r\n     {\r\n         case 2: msg.payload=\"off\"; context.global.pergola_override=1; break;\r\n         case 1: msg.payload=\"auto\"; context.global.pergola_override=0; break;\r\n         case 0: msg.payload=\"on\"; context.global.pergola_override=2; break;\r\n         default: context.global.pergola_override=0; msg.payload=\"auto\"; break;\r\n     }\r\n    return msg;\r\n    }\r\nelse\r\n    {\r\n     switch (context.global.pergola_override)\r\n     {\r\n         case 0: msg.payload=\"auto\";  break;\r\n         case 1: msg.payload=\"off\";  break;\r\n         case 2: msg.payload=\"on\";  break;\r\n         default: context.global.pergola_override=0; msg.payload=\"auto\";break;\r\n     }\r\n    return msg;\r\n    }\r\n"}}