{"action":"created","comment":{"url":"https://api.github.com/repos/letscontrolit/ESPEasy/pulls/comments/227319839","pull_request_review_id":167331765,"id":227319839,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNzMxOTgzOQ==","diff_hunk":"@@ -67,31 +124,151 @@ boolean Plugin_009(byte function, struct EventStruct *event, String& string)\n         Plugin_009_Config(Settings.TaskDevicePort[event->TaskIndex], 1);\n \n         // read and store current state to prevent switching at boot time\n-        switchstate[event->TaskIndex] = Plugin_009_Read(Settings.TaskDevicePort[event->TaskIndex]);\n+        switchstate[event->TaskIndex] = (int) Plugin_009_Read(Settings.TaskDevicePort[event->TaskIndex]);\n+\n+        // @giig1967g-20181022: set initial UserVar of the switch\n+        if (Settings.TaskDevicePin1Inversed[event->TaskIndex]){\n+          UserVar[event->BaseVarIndex] = !switchstate[event->TaskIndex];\n+        } else {\n+          UserVar[event->BaseVarIndex] = switchstate[event->TaskIndex];\n+        }\n \n         // if boot state must be send, inverse default state\n         if (Settings.TaskDevicePluginConfig[event->TaskIndex][0])\n           switchstate[event->TaskIndex] = !switchstate[event->TaskIndex];\n \n+        // @giig1967g-20181022: doubleclick counter = 0\n+        Settings.TaskDevicePluginConfig[event->TaskIndex][7]=0;\n+\n+        // @giig1967g-20181022: used to track if LP has fired\n+        Settings.TaskDevicePluginConfig[event->TaskIndex][6]=false;\n+\n+        // @giig1967g-20181022: store millis for debounce, doubleclick and long press\n+        Settings.TaskDevicePluginConfigLong[event->TaskIndex][0]=millis(); //debounce timer\n+        Settings.TaskDevicePluginConfigLong[event->TaskIndex][1]=millis(); //doubleclick timer\n+        Settings.TaskDevicePluginConfigLong[event->TaskIndex][2]=millis(); //longpress timer\n+\n+        // @giig1967g-20181022: set minimum value for doubleclick MIN max speed\n+        if (Settings.TaskDevicePluginConfigFloat[event->TaskIndex][1] < PLUGIN_009_DOUBLECLICK_MIN_INTERVAL)\n+          Settings.TaskDevicePluginConfigFloat[event->TaskIndex][1] = PLUGIN_009_DOUBLECLICK_MIN_INTERVAL;\n+\n+        // @giig1967g-20181022: set minimum value for longpress MIN max speed\n+        if (Settings.TaskDevicePluginConfigFloat[event->TaskIndex][2] < PLUGIN_009_LONGPRESS_MIN_INTERVAL)\n+          Settings.TaskDevicePluginConfigFloat[event->TaskIndex][2] = PLUGIN_009_LONGPRESS_MIN_INTERVAL;\n+\n+        // @giig1967g-20181022: set initial UserVar of the switch\n+        UserVar[event->BaseVarIndex] = switchstate[event->TaskIndex];","path":"src/_P009_MCP.ino","position":135,"original_position":135,"commit_id":"e2e715d7de290589e5fb2d2ad92189aba4664991","original_commit_id":"e2e715d7de290589e5fb2d2ad92189aba4664991","user":{"login":"giig1967g","id":21318099,"node_id":"MDQ6VXNlcjIxMzE4MDk5","avatar_url":"https://avatars3.githubusercontent.com/u/21318099?v=4","gravatar_id":"","url":"https://api.github.com/users/giig1967g","html_url":"https://github.com/giig1967g","followers_url":"https://api.github.com/users/giig1967g/followers","following_url":"https://api.github.com/users/giig1967g/following{/other_user}","gists_url":"https://api.github.com/users/giig1967g/gists{/gist_id}","starred_url":"https://api.github.com/users/giig1967g/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/giig1967g/subscriptions","organizations_url":"https://api.github.com/users/giig1967g/orgs","repos_url":"https://api.github.com/users/giig1967g/repos","events_url":"https://api.github.com/users/giig1967g/events{/privacy}","received_events_url":"https://api.github.com/users/giig1967g/received_events","type":"User","site_admin":false},"body":"will review it","created_at":"2018-10-23T10:06:13Z","updated_at":"2018-10-23T10:06:14Z","html_url":"https://github.com/letscontrolit/ESPEasy/pull/1942#discussion_r227319839","pull_request_url":"https://api.github.com/repos/letscontrolit/ESPEasy/pulls/1942","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/letscontrolit/ESPEasy/pulls/comments/227319839"},"html":{"href":"https://github.com/letscontrolit/ESPEasy/pull/1942#discussion_r227319839"},"pull_request":{"href":"https://api.github.com/repos/letscontrolit/ESPEasy/pulls/1942"}},"in_reply_to_id":227154298},"pull_request":{"url":"https://api.github.com/repos/letscontrolit/ESPEasy/pulls/1942","id":224804500,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI0ODA0NTAw","html_url":"https://github.com/letscontrolit/ESPEasy/pull/1942","diff_url":"https://github.com/letscontrolit/ESPEasy/pull/1942.diff","patch_url":"https://github.com/letscontrolit/ESPEasy/pull/1942.patch","issue_url":"https://api.github.com/repos/letscontrolit/ESPEasy/issues/1942","number":1942,"state":"open","locked":false,"title":"doubleclick and longpress for PCF and MCP","user":{"login":"giig1967g","id":21318099,"node_id":"MDQ6VXNlcjIxMzE4MDk5","avatar_url":"https://avatars3.githubusercontent.com/u/21318099?v=4","gravatar_id":"","url":"https://api.github.com/users/giig1967g","html_url":"https://github.com/giig1967g","followers_url":"https://api.github.com/users/giig1967g/followers","following_url":"https://api.github.com/users/giig1967g/following{/other_user}","gists_url":"https://api.github.com/users/giig1967g/gists{/gist_id}","starred_url":"https://api.github.com/users/giig1967g/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/giig1967g/subscriptions","organizations_url":"https://api.github.com/users/giig1967g/orgs","repos_url":"https://api.github.com/users/giig1967g/repos","events_url":"https://api.github.com/users/giig1967g/events{/privacy}","received_events_url":"https://api.github.com/users/giig1967g/received_events","type":"User","site_admin":false},"body":"Added doubleclick and longpress events for PCF (P019) and MCP (P009).\r\nSame logic as #1880.\r\n","created_at":"2018-10-22T20:31:33Z","updated_at":"2018-10-23T10:06:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"527f649b5fe813d7b67e2f1e2686371ebfd1b90c","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/letscontrolit/ESPEasy/pulls/1942/commits","review_comments_url":"https://api.github.com/repos/letscontrolit/ESPEasy/pulls/1942/comments","review_comment_url":"https://api.github.com/repos/letscontrolit/ESPEasy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/letscontrolit/ESPEasy/issues/1942/comments","statuses_url":"https://api.github.com/repos/letscontrolit/ESPEasy/statuses/e2e715d7de290589e5fb2d2ad92189aba4664991","head":{"label":"giig1967g:new/doubleclick-pcf","ref":"new/doubleclick-pcf","sha":"e2e715d7de290589e5fb2d2ad92189aba4664991","user":{"login":"giig1967g","id":21318099,"node_id":"MDQ6VXNlcjIxMzE4MDk5","avatar_url":"https://avatars3.githubusercontent.com/u/21318099?v=4","gravatar_id":"","url":"https://api.github.com/users/giig1967g","html_url":"https://github.com/giig1967g","followers_url":"https://api.github.com/users/giig1967g/followers","following_url":"https://api.github.com/users/giig1967g/following{/other_user}","gists_url":"https://api.github.com/users/giig1967g/gists{/gist_id}","starred_url":"https://api.github.com/users/giig1967g/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/giig1967g/subscriptions","organizations_url":"https://api.github.com/users/giig1967g/orgs","repos_url":"https://api.github.com/users/giig1967g/repos","events_url":"https://api.github.com/users/giig1967g/events{/privacy}","received_events_url":"https://api.github.com/users/giig1967g/received_events","type":"User","site_admin":false},"repo":{"id":131743632,"node_id":"MDEwOlJlcG9zaXRvcnkxMzE3NDM2MzI=","name":"ESPEasy","full_name":"giig1967g/ESPEasy","private":false,"owner":{"login":"giig1967g","id":21318099,"node_id":"MDQ6VXNlcjIxMzE4MDk5","avatar_url":"https://avatars3.githubusercontent.com/u/21318099?v=4","gravatar_id":"","url":"https://api.github.com/users/giig1967g","html_url":"https://github.com/giig1967g","followers_url":"https://api.github.com/users/giig1967g/followers","following_url":"https://api.github.com/users/giig1967g/following{/other_user}","gists_url":"https://api.github.com/users/giig1967g/gists{/gist_id}","starred_url":"https://api.github.com/users/giig1967g/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/giig1967g/subscriptions","organizations_url":"https://api.github.com/users/giig1967g/orgs","repos_url":"https://api.github.com/users/giig1967g/repos","events_url":"https://api.github.com/users/giig1967g/events{/privacy}","received_events_url":"https://api.github.com/users/giig1967g/received_events","type":"User","site_admin":false},"html_url":"https://github.com/giig1967g/ESPEasy","description":"Easy MultiSensor device based on ESP8266","fork":true,"url":"https://api.github.com/repos/giig1967g/ESPEasy","forks_url":"https://api.github.com/repos/giig1967g/ESPEasy/forks","keys_url":"https://api.github.com/repos/giig1967g/ESPEasy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/giig1967g/ESPEasy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/giig1967g/ESPEasy/teams","hooks_url":"https://api.github.com/repos/giig1967g/ESPEasy/hooks","issue_events_url":"https://api.github.com/repos/giig1967g/ESPEasy/issues/events{/number}","events_url":"https://api.github.com/repos/giig1967g/ESPEasy/events","assignees_url":"https://api.github.com/repos/giig1967g/ESPEasy/assignees{/user}","branches_url":"https://api.github.com/repos/giig1967g/ESPEasy/branches{/branch}","tags_url":"https://api.github.com/repos/giig1967g/ESPEasy/tags","blobs_url":"https://api.github.com/repos/giig1967g/ESPEasy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/giig1967g/ESPEasy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/giig1967g/ESPEasy/git/refs{/sha}","trees_url":"https://api.github.com/repos/giig1967g/ESPEasy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/giig1967g/ESPEasy/statuses/{sha}","languages_url":"https://api.github.com/repos/giig1967g/ESPEasy/languages","stargazers_url":"https://api.github.com/repos/giig1967g/ESPEasy/stargazers","contributors_url":"https://api.github.com/repos/giig1967g/ESPEasy/contributors","subscribers_url":"https://api.github.com/repos/giig1967g/ESPEasy/subscribers","subscription_url":"https://api.github.com/repos/giig1967g/ESPEasy/subscription","commits_url":"https://api.github.com/repos/giig1967g/ESPEasy/commits{/sha}","git_commits_url":"https://api.github.com/repos/giig1967g/ESPEasy/git/commits{/sha}","comments_url":"https://api.github.com/repos/giig1967g/ESPEasy/comments{/number}","issue_comment_url":"https://api.github.com/repos/giig1967g/ESPEasy/issues/comments{/number}","contents_url":"https://api.github.com/repos/giig1967g/ESPEasy/contents/{+path}","compare_url":"https://api.github.com/repos/giig1967g/ESPEasy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/giig1967g/ESPEasy/merges","archive_url":"https://api.github.com/repos/giig1967g/ESPEasy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/giig1967g/ESPEasy/downloads","issues_url":"https://api.github.com/repos/giig1967g/ESPEasy/issues{/number}","pulls_url":"https://api.github.com/repos/giig1967g/ESPEasy/pulls{/number}","milestones_url":"https://api.github.com/repos/giig1967g/ESPEasy/milestones{/number}","notifications_url":"https://api.github.com/repos/giig1967g/ESPEasy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/giig1967g/ESPEasy/labels{/name}","releases_url":"https://api.github.com/repos/giig1967g/ESPEasy/releases{/id}","deployments_url":"https://api.github.com/repos/giig1967g/ESPEasy/deployments","created_at":"2018-05-01T17:42:01Z","updated_at":"2018-10-22T08:59:53Z","pushed_at":"2018-10-22T21:32:02Z","git_url":"git://github.com/giig1967g/ESPEasy.git","ssh_url":"git@github.com:giig1967g/ESPEasy.git","clone_url":"https://github.com/giig1967g/ESPEasy.git","svn_url":"https://github.com/giig1967g/ESPEasy","homepage":"http://www.esp8266.nu","size":11138,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"mega"}},"base":{"label":"letscontrolit:mega","ref":"mega","sha":"c519d887dbf9ed3b9d06a8efb5a7ffd280ea19a3","user":{"login":"letscontrolit","id":23070406,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzMDcwNDA2","avatar_url":"https://avatars0.githubusercontent.com/u/23070406?v=4","gravatar_id":"","url":"https://api.github.com/users/letscontrolit","html_url":"https://github.com/letscontrolit","followers_url":"https://api.github.com/users/letscontrolit/followers","following_url":"https://api.github.com/users/letscontrolit/following{/other_user}","gists_url":"https://api.github.com/users/letscontrolit/gists{/gist_id}","starred_url":"https://api.github.com/users/letscontrolit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/letscontrolit/subscriptions","organizations_url":"https://api.github.com/users/letscontrolit/orgs","repos_url":"https://api.github.com/users/letscontrolit/repos","events_url":"https://api.github.com/users/letscontrolit/events{/privacy}","received_events_url":"https://api.github.com/users/letscontrolit/received_events","type":"Organization","site_admin":false},"repo":{"id":42119846,"node_id":"MDEwOlJlcG9zaXRvcnk0MjExOTg0Ng==","name":"ESPEasy","full_name":"letscontrolit/ESPEasy","private":false,"owner":{"login":"letscontrolit","id":23070406,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzMDcwNDA2","avatar_url":"https://avatars0.githubusercontent.com/u/23070406?v=4","gravatar_id":"","url":"https://api.github.com/users/letscontrolit","html_url":"https://github.com/letscontrolit","followers_url":"https://api.github.com/users/letscontrolit/followers","following_url":"https://api.github.com/users/letscontrolit/following{/other_user}","gists_url":"https://api.github.com/users/letscontrolit/gists{/gist_id}","starred_url":"https://api.github.com/users/letscontrolit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/letscontrolit/subscriptions","organizations_url":"https://api.github.com/users/letscontrolit/orgs","repos_url":"https://api.github.com/users/letscontrolit/repos","events_url":"https://api.github.com/users/letscontrolit/events{/privacy}","received_events_url":"https://api.github.com/users/letscontrolit/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/letscontrolit/ESPEasy","description":"Easy MultiSensor device based on ESP8266","fork":false,"url":"https://api.github.com/repos/letscontrolit/ESPEasy","forks_url":"https://api.github.com/repos/letscontrolit/ESPEasy/forks","keys_url":"https://api.github.com/repos/letscontrolit/ESPEasy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/letscontrolit/ESPEasy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/letscontrolit/ESPEasy/teams","hooks_url":"https://api.github.com/repos/letscontrolit/ESPEasy/hooks","issue_events_url":"https://api.github.com/repos/letscontrolit/ESPEasy/issues/events{/number}","events_url":"https://api.github.com/repos/letscontrolit/ESPEasy/events","assignees_url":"https://api.github.com/repos/letscontrolit/ESPEasy/assignees{/user}","branches_url":"https://api.github.com/repos/letscontrolit/ESPEasy/branches{/branch}","tags_url":"https://api.github.com/repos/letscontrolit/ESPEasy/tags","blobs_url":"https://api.github.com/repos/letscontrolit/ESPEasy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/letscontrolit/ESPEasy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/letscontrolit/ESPEasy/git/refs{/sha}","trees_url":"https://api.github.com/repos/letscontrolit/ESPEasy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/letscontrolit/ESPEasy/statuses/{sha}","languages_url":"https://api.github.com/repos/letscontrolit/ESPEasy/languages","stargazers_url":"https://api.github.com/repos/letscontrolit/ESPEasy/stargazers","contributors_url":"https://api.github.com/repos/letscontrolit/ESPEasy/contributors","subscribers_url":"https://api.github.com/repos/letscontrolit/ESPEasy/subscribers","subscription_url":"https://api.github.com/repos/letscontrolit/ESPEasy/subscription","commits_url":"https://api.github.com/repos/letscontrolit/ESPEasy/commits{/sha}","git_commits_url":"https://api.github.com/repos/letscontrolit/ESPEasy/git/commits{/sha}","comments_url":"https://api.github.com/repos/letscontrolit/ESPEasy/comments{/number}","issue_comment_url":"https://api.github.com/repos/letscontrolit/ESPEasy/issues/comments{/number}","contents_url":"https://api.github.com/repos/letscontrolit/ESPEasy/contents/{+path}","compare_url":"https://api.github.com/repos/letscontrolit/ESPEasy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/letscontrolit/ESPEasy/merges","archive_url":"https://api.github.com/repos/letscontrolit/ESPEasy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/letscontrolit/ESPEasy/downloads","issues_url":"https://api.github.com/repos/letscontrolit/ESPEasy/issues{/number}","pulls_url":"https://api.github.com/repos/letscontrolit/ESPEasy/pulls{/number}","milestones_url":"https://api.github.com/repos/letscontrolit/ESPEasy/milestones{/number}","notifications_url":"https://api.github.com/repos/letscontrolit/ESPEasy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/letscontrolit/ESPEasy/labels{/name}","releases_url":"https://api.github.com/repos/letscontrolit/ESPEasy/releases{/id}","deployments_url":"https://api.github.com/repos/letscontrolit/ESPEasy/deployments","created_at":"2015-09-08T15:03:44Z","updated_at":"2018-10-23T08:25:43Z","pushed_at":"2018-10-23T07:27:06Z","git_url":"git://github.com/letscontrolit/ESPEasy.git","ssh_url":"git@github.com:letscontrolit/ESPEasy.git","clone_url":"https://github.com/letscontrolit/ESPEasy.git","svn_url":"https://github.com/letscontrolit/ESPEasy","homepage":"http://www.esp8266.nu","size":11177,"stargazers_count":1213,"watchers_count":1213,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":881,"mirror_url":null,"archived":false,"open_issues_count":489,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":881,"open_issues":489,"watchers":1213,"default_branch":"mega"}},"_links":{"self":{"href":"https://api.github.com/repos/letscontrolit/ESPEasy/pulls/1942"},"html":{"href":"https://github.com/letscontrolit/ESPEasy/pull/1942"},"issue":{"href":"https://api.github.com/repos/letscontrolit/ESPEasy/issues/1942"},"comments":{"href":"https://api.github.com/repos/letscontrolit/ESPEasy/issues/1942/comments"},"review_comments":{"href":"https://api.github.com/repos/letscontrolit/ESPEasy/pulls/1942/comments"},"review_comment":{"href":"https://api.github.com/repos/letscontrolit/ESPEasy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/letscontrolit/ESPEasy/pulls/1942/commits"},"statuses":{"href":"https://api.github.com/repos/letscontrolit/ESPEasy/statuses/e2e715d7de290589e5fb2d2ad92189aba4664991"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"giig1967g"}}