{"action":"created","comment":{"url":"https://api.github.com/repos/athombv/com.fibaro/pulls/comments/80681295","pull_request_review_id":1721539,"id":80681295,"diff_hunk":"@@ -1,55 +1,57 @@\n-\"use strict\";\n+'use strict';\n \n-const path\t\t\t= require('path');\n-const ZwaveDriver\t= require('homey-zwavedriver');\n+const path = require('path');\n+const ZwaveDriver = require('homey-zwavedriver');\n \n // http://manuals.fibaro.com/content/manuals/en/FGPB-101/FGPB-101-EN-T-v1.0.pdf\n \n module.exports = new ZwaveDriver( path.basename(__dirname), {\n \tcapabilities: {\n \t\t'measure_battery': {\n-\t\t\t'command_class'\t\t\t\t: 'COMMAND_CLASS_BATTERY',\n-\t\t\t'command_get'\t\t\t\t: 'BATTERY_GET',\n-\t\t\t'command_report'\t\t\t: 'BATTERY_REPORT',\n-\t\t\t'command_report_parser'\t\t: function( report ) {\n-\t\t\t\tif( report['Battery Level'] === \"battery low warning\" ) {\n-\t\t\t\t\treturn 1;\n-\t\t\t\t}\n+\t\t\t'command_class': 'COMMAND_CLASS_BATTERY',\n+\t\t\t'command_get': 'BATTERY_GET',\n+\t\t\t'command_report': 'BATTERY_REPORT',\n+\t\t\t'command_report_parser': report => {\n+\t\t\t\tif (report['Battery Level'] === \"battery low warning\") return 1;\n+\t\t\t\t\n \t\t\t\treturn report['Battery Level (Raw)'][0];\n \t\t\t}\n \t\t}\n \t}\n });\n \n-module.exports.on('initNode', function( token ){\n-\tvar node = module.exports.nodes[ token ];\n-\tvar debouncer = 0;\n-\tif( node ) {\n-\t\tnode.instance.CommandClass['COMMAND_CLASS_CENTRAL_SCENE'].on('report', function( command, report ){\n-\t\t\tif( command.name === 'CENTRAL_SCENE_NOTIFICATION' ) {\n-\t\t\t\tif(report.Properties1['Key Attributes'] === 1) {\n-\t\t\t\t\tif(debouncer === 0) {\n+module.exports.on('initNode', function (token){\n+\tconst node = module.exports.nodes[token];\n+\tlet debouncer = 0;\n+\tif (node) {\n+\t\tnode.instance.CommandClass['COMMAND_CLASS_CENTRAL_SCENE'].on('report', (command, report) => {\n+\t\t\tif (command.name === 'CENTRAL_SCENE_NOTIFICATION') {\n+\t\t\t\tif (report.Properties1['Key Attributes'] === 1) {\n+\t\t\t\t\tif (debouncer === 0) {\n \t\t\t\t\t\tdebouncer++;\n-\t\t\t\t\t\tvar button_value = {\n+\t\t\t\t\t\t\n+\t\t\t\t\t\tconst button_value = {\n \t\t\t\t\t\t\t\"scene\": report.Properties1['Key Attributes'].toString()\n \t\t\t\t\t\t};\n+\t\t\t\t\t\t\n \t\t\t\t\t\tHomey.manager('flow').triggerDevice('FGPB-101', null, button_value, node.device_data);\n-\t\t\t\t\t\tsetTimeout(function() { debouncer = 0; }, 2000);\n+\t\t\t\t\t\t\n+\t\t\t\t\t\tsetTimeout(debouncer = 0, 2000);","path":"drivers/FGPB-101/driver.js","position":null,"original_position":59,"commit_id":"5f8c957c558c741df7254dbd442b5e2da2e52913","original_commit_id":"5b89e32a8dfa9554afe4904d60f88189a016e85e","user":{"login":"RobinBol","id":5762579,"avatar_url":"https://avatars.githubusercontent.com/u/5762579?v=3","gravatar_id":"","url":"https://api.github.com/users/RobinBol","html_url":"https://github.com/RobinBol","followers_url":"https://api.github.com/users/RobinBol/followers","following_url":"https://api.github.com/users/RobinBol/following{/other_user}","gists_url":"https://api.github.com/users/RobinBol/gists{/gist_id}","starred_url":"https://api.github.com/users/RobinBol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RobinBol/subscriptions","organizations_url":"https://api.github.com/users/RobinBol/orgs","repos_url":"https://api.github.com/users/RobinBol/repos","events_url":"https://api.github.com/users/RobinBol/events{/privacy}","received_events_url":"https://api.github.com/users/RobinBol/received_events","type":"User","site_admin":false},"body":"Why do you have the debounce in the first place, do duplicate reports get in or?","created_at":"2016-09-27T12:37:20Z","updated_at":"2016-09-27T12:37:20Z","html_url":"https://github.com/athombv/com.fibaro/pull/56#discussion_r80681295","pull_request_url":"https://api.github.com/repos/athombv/com.fibaro/pulls/56","_links":{"self":{"href":"https://api.github.com/repos/athombv/com.fibaro/pulls/comments/80681295"},"html":{"href":"https://github.com/athombv/com.fibaro/pull/56#discussion_r80681295"},"pull_request":{"href":"https://api.github.com/repos/athombv/com.fibaro/pulls/56"}}},"pull_request":{"url":"https://api.github.com/repos/athombv/com.fibaro/pulls/56","id":86665057,"html_url":"https://github.com/athombv/com.fibaro/pull/56","diff_url":"https://github.com/athombv/com.fibaro/pull/56.diff","patch_url":"https://github.com/athombv/com.fibaro/pull/56.patch","issue_url":"https://api.github.com/repos/athombv/com.fibaro/issues/56","number":56,"state":"open","locked":false,"title":"Fix FGK-101, FGSS-001, FGSD-002; Coding Cleanup according to ESlint","user":{"login":"caseda","id":2565450,"avatar_url":"https://avatars.githubusercontent.com/u/2565450?v=3","gravatar_id":"","url":"https://api.github.com/users/caseda","html_url":"https://github.com/caseda","followers_url":"https://api.github.com/users/caseda/followers","following_url":"https://api.github.com/users/caseda/following{/other_user}","gists_url":"https://api.github.com/users/caseda/gists{/gist_id}","starred_url":"https://api.github.com/users/caseda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caseda/subscriptions","organizations_url":"https://api.github.com/users/caseda/orgs","repos_url":"https://api.github.com/users/caseda/repos","events_url":"https://api.github.com/users/caseda/events{/privacy}","received_events_url":"https://api.github.com/users/caseda/received_events","type":"User","site_admin":false},"body":null,"created_at":"2016-09-25T22:34:09Z","updated_at":"2016-09-27T12:37:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"94d30fed51a23014ca167a2a30eeeababb3dd9fd","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/athombv/com.fibaro/pulls/56/commits","review_comments_url":"https://api.github.com/repos/athombv/com.fibaro/pulls/56/comments","review_comment_url":"https://api.github.com/repos/athombv/com.fibaro/pulls/comments{/number}","comments_url":"https://api.github.com/repos/athombv/com.fibaro/issues/56/comments","statuses_url":"https://api.github.com/repos/athombv/com.fibaro/statuses/5f8c957c558c741df7254dbd442b5e2da2e52913","head":{"label":"caseda:master","ref":"master","sha":"5f8c957c558c741df7254dbd442b5e2da2e52913","user":{"login":"caseda","id":2565450,"avatar_url":"https://avatars.githubusercontent.com/u/2565450?v=3","gravatar_id":"","url":"https://api.github.com/users/caseda","html_url":"https://github.com/caseda","followers_url":"https://api.github.com/users/caseda/followers","following_url":"https://api.github.com/users/caseda/following{/other_user}","gists_url":"https://api.github.com/users/caseda/gists{/gist_id}","starred_url":"https://api.github.com/users/caseda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caseda/subscriptions","organizations_url":"https://api.github.com/users/caseda/orgs","repos_url":"https://api.github.com/users/caseda/repos","events_url":"https://api.github.com/users/caseda/events{/privacy}","received_events_url":"https://api.github.com/users/caseda/received_events","type":"User","site_admin":false},"repo":{"id":69051705,"name":"com.fibaro","full_name":"caseda/com.fibaro","owner":{"login":"caseda","id":2565450,"avatar_url":"https://avatars.githubusercontent.com/u/2565450?v=3","gravatar_id":"","url":"https://api.github.com/users/caseda","html_url":"https://github.com/caseda","followers_url":"https://api.github.com/users/caseda/followers","following_url":"https://api.github.com/users/caseda/following{/other_user}","gists_url":"https://api.github.com/users/caseda/gists{/gist_id}","starred_url":"https://api.github.com/users/caseda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caseda/subscriptions","organizations_url":"https://api.github.com/users/caseda/orgs","repos_url":"https://api.github.com/users/caseda/repos","events_url":"https://api.github.com/users/caseda/events{/privacy}","received_events_url":"https://api.github.com/users/caseda/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/caseda/com.fibaro","description":"Fibaro for Homey","fork":true,"url":"https://api.github.com/repos/caseda/com.fibaro","forks_url":"https://api.github.com/repos/caseda/com.fibaro/forks","keys_url":"https://api.github.com/repos/caseda/com.fibaro/keys{/key_id}","collaborators_url":"https://api.github.com/repos/caseda/com.fibaro/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/caseda/com.fibaro/teams","hooks_url":"https://api.github.com/repos/caseda/com.fibaro/hooks","issue_events_url":"https://api.github.com/repos/caseda/com.fibaro/issues/events{/number}","events_url":"https://api.github.com/repos/caseda/com.fibaro/events","assignees_url":"https://api.github.com/repos/caseda/com.fibaro/assignees{/user}","branches_url":"https://api.github.com/repos/caseda/com.fibaro/branches{/branch}","tags_url":"https://api.github.com/repos/caseda/com.fibaro/tags","blobs_url":"https://api.github.com/repos/caseda/com.fibaro/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/caseda/com.fibaro/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/caseda/com.fibaro/git/refs{/sha}","trees_url":"https://api.github.com/repos/caseda/com.fibaro/git/trees{/sha}","statuses_url":"https://api.github.com/repos/caseda/com.fibaro/statuses/{sha}","languages_url":"https://api.github.com/repos/caseda/com.fibaro/languages","stargazers_url":"https://api.github.com/repos/caseda/com.fibaro/stargazers","contributors_url":"https://api.github.com/repos/caseda/com.fibaro/contributors","subscribers_url":"https://api.github.com/repos/caseda/com.fibaro/subscribers","subscription_url":"https://api.github.com/repos/caseda/com.fibaro/subscription","commits_url":"https://api.github.com/repos/caseda/com.fibaro/commits{/sha}","git_commits_url":"https://api.github.com/repos/caseda/com.fibaro/git/commits{/sha}","comments_url":"https://api.github.com/repos/caseda/com.fibaro/comments{/number}","issue_comment_url":"https://api.github.com/repos/caseda/com.fibaro/issues/comments{/number}","contents_url":"https://api.github.com/repos/caseda/com.fibaro/contents/{+path}","compare_url":"https://api.github.com/repos/caseda/com.fibaro/compare/{base}...{head}","merges_url":"https://api.github.com/repos/caseda/com.fibaro/merges","archive_url":"https://api.github.com/repos/caseda/com.fibaro/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/caseda/com.fibaro/downloads","issues_url":"https://api.github.com/repos/caseda/com.fibaro/issues{/number}","pulls_url":"https://api.github.com/repos/caseda/com.fibaro/pulls{/number}","milestones_url":"https://api.github.com/repos/caseda/com.fibaro/milestones{/number}","notifications_url":"https://api.github.com/repos/caseda/com.fibaro/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/caseda/com.fibaro/labels{/name}","releases_url":"https://api.github.com/repos/caseda/com.fibaro/releases{/id}","deployments_url":"https://api.github.com/repos/caseda/com.fibaro/deployments","created_at":"2016-09-23T18:43:12Z","updated_at":"2016-09-23T18:43:13Z","pushed_at":"2016-09-26T21:18:09Z","git_url":"git://github.com/caseda/com.fibaro.git","ssh_url":"git@github.com:caseda/com.fibaro.git","clone_url":"https://github.com/caseda/com.fibaro.git","svn_url":"https://github.com/caseda/com.fibaro","homepage":null,"size":2857,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"athombv:master","ref":"master","sha":"0a581ae9356e019a5ce87ff3f72e2039e6f4814c","user":{"login":"athombv","id":8502422,"avatar_url":"https://avatars.githubusercontent.com/u/8502422?v=3","gravatar_id":"","url":"https://api.github.com/users/athombv","html_url":"https://github.com/athombv","followers_url":"https://api.github.com/users/athombv/followers","following_url":"https://api.github.com/users/athombv/following{/other_user}","gists_url":"https://api.github.com/users/athombv/gists{/gist_id}","starred_url":"https://api.github.com/users/athombv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/athombv/subscriptions","organizations_url":"https://api.github.com/users/athombv/orgs","repos_url":"https://api.github.com/users/athombv/repos","events_url":"https://api.github.com/users/athombv/events{/privacy}","received_events_url":"https://api.github.com/users/athombv/received_events","type":"Organization","site_admin":false},"repo":{"id":64409363,"name":"com.fibaro","full_name":"athombv/com.fibaro","owner":{"login":"athombv","id":8502422,"avatar_url":"https://avatars.githubusercontent.com/u/8502422?v=3","gravatar_id":"","url":"https://api.github.com/users/athombv","html_url":"https://github.com/athombv","followers_url":"https://api.github.com/users/athombv/followers","following_url":"https://api.github.com/users/athombv/following{/other_user}","gists_url":"https://api.github.com/users/athombv/gists{/gist_id}","starred_url":"https://api.github.com/users/athombv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/athombv/subscriptions","organizations_url":"https://api.github.com/users/athombv/orgs","repos_url":"https://api.github.com/users/athombv/repos","events_url":"https://api.github.com/users/athombv/events{/privacy}","received_events_url":"https://api.github.com/users/athombv/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/athombv/com.fibaro","description":"Fibaro for Homey","fork":false,"url":"https://api.github.com/repos/athombv/com.fibaro","forks_url":"https://api.github.com/repos/athombv/com.fibaro/forks","keys_url":"https://api.github.com/repos/athombv/com.fibaro/keys{/key_id}","collaborators_url":"https://api.github.com/repos/athombv/com.fibaro/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/athombv/com.fibaro/teams","hooks_url":"https://api.github.com/repos/athombv/com.fibaro/hooks","issue_events_url":"https://api.github.com/repos/athombv/com.fibaro/issues/events{/number}","events_url":"https://api.github.com/repos/athombv/com.fibaro/events","assignees_url":"https://api.github.com/repos/athombv/com.fibaro/assignees{/user}","branches_url":"https://api.github.com/repos/athombv/com.fibaro/branches{/branch}","tags_url":"https://api.github.com/repos/athombv/com.fibaro/tags","blobs_url":"https://api.github.com/repos/athombv/com.fibaro/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/athombv/com.fibaro/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/athombv/com.fibaro/git/refs{/sha}","trees_url":"https://api.github.com/repos/athombv/com.fibaro/git/trees{/sha}","statuses_url":"https://api.github.com/repos/athombv/com.fibaro/statuses/{sha}","languages_url":"https://api.github.com/repos/athombv/com.fibaro/languages","stargazers_url":"https://api.github.com/repos/athombv/com.fibaro/stargazers","contributors_url":"https://api.github.com/repos/athombv/com.fibaro/contributors","subscribers_url":"https://api.github.com/repos/athombv/com.fibaro/subscribers","subscription_url":"https://api.github.com/repos/athombv/com.fibaro/subscription","commits_url":"https://api.github.com/repos/athombv/com.fibaro/commits{/sha}","git_commits_url":"https://api.github.com/repos/athombv/com.fibaro/git/commits{/sha}","comments_url":"https://api.github.com/repos/athombv/com.fibaro/comments{/number}","issue_comment_url":"https://api.github.com/repos/athombv/com.fibaro/issues/comments{/number}","contents_url":"https://api.github.com/repos/athombv/com.fibaro/contents/{+path}","compare_url":"https://api.github.com/repos/athombv/com.fibaro/compare/{base}...{head}","merges_url":"https://api.github.com/repos/athombv/com.fibaro/merges","archive_url":"https://api.github.com/repos/athombv/com.fibaro/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/athombv/com.fibaro/downloads","issues_url":"https://api.github.com/repos/athombv/com.fibaro/issues{/number}","pulls_url":"https://api.github.com/repos/athombv/com.fibaro/pulls{/number}","milestones_url":"https://api.github.com/repos/athombv/com.fibaro/milestones{/number}","notifications_url":"https://api.github.com/repos/athombv/com.fibaro/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/athombv/com.fibaro/labels{/name}","releases_url":"https://api.github.com/repos/athombv/com.fibaro/releases{/id}","deployments_url":"https://api.github.com/repos/athombv/com.fibaro/deployments","created_at":"2016-07-28T16:01:22Z","updated_at":"2016-09-21T20:56:39Z","pushed_at":"2016-09-26T21:18:10Z","git_url":"git://github.com/athombv/com.fibaro.git","ssh_url":"git@github.com:athombv/com.fibaro.git","clone_url":"https://github.com/athombv/com.fibaro.git","svn_url":"https://github.com/athombv/com.fibaro","homepage":null,"size":2817,"stargazers_count":4,"watchers_count":4,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":9,"forks":11,"open_issues":9,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/athombv/com.fibaro/pulls/56"},"html":{"href":"https://github.com/athombv/com.fibaro/pull/56"},"issue":{"href":"https://api.github.com/repos/athombv/com.fibaro/issues/56"},"comments":{"href":"https://api.github.com/repos/athombv/com.fibaro/issues/56/comments"},"review_comments":{"href":"https://api.github.com/repos/athombv/com.fibaro/pulls/56/comments"},"review_comment":{"href":"https://api.github.com/repos/athombv/com.fibaro/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/athombv/com.fibaro/pulls/56/commits"},"statuses":{"href":"https://api.github.com/repos/athombv/com.fibaro/statuses/5f8c957c558c741df7254dbd442b5e2da2e52913"}}}}
{"actor":{"display_login":"RobinBol"}}