{"action":"created","comment":{"url":"https://api.github.com/repos/tessel/gps-a2235h/pulls/comments/24521228","id":24521228,"diff_hunk":"@@ -93,6 +93,23 @@ var GPS = function (hardware, callback) {\n     }\n   }, 1000);\n \n+  // poll every 2 seconds by default, can bump this up but it'll consume more cpu\n+  var pollTime = 2000;\n+  self.getPollTime = function () {\n+    return pollTime;\n+  };\n+  self.setPollTime = function (time) {\n+    time = parseInt(time, 10);\n+    if (time < 2000) {\n+        // No less than 2 seconds","path":"index.js","position":12,"original_position":12,"commit_id":"b6cb3946d16a7a9fc0f686ebf1592497491ef289","original_commit_id":"b6cb3946d16a7a9fc0f686ebf1592497491ef289","user":{"login":"jiahuang","id":577629,"avatar_url":"https://avatars.githubusercontent.com/u/577629?v=3","gravatar_id":"","url":"https://api.github.com/users/jiahuang","html_url":"https://github.com/jiahuang","followers_url":"https://api.github.com/users/jiahuang/followers","following_url":"https://api.github.com/users/jiahuang/following{/other_user}","gists_url":"https://api.github.com/users/jiahuang/gists{/gist_id}","starred_url":"https://api.github.com/users/jiahuang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jiahuang/subscriptions","organizations_url":"https://api.github.com/users/jiahuang/orgs","repos_url":"https://api.github.com/users/jiahuang/repos","events_url":"https://api.github.com/users/jiahuang/events{/privacy}","received_events_url":"https://api.github.com/users/jiahuang/received_events","type":"User","site_admin":false},"body":"Can you add a console.log that just spits out something like \"GPS Poll time cannot be set less than 2 seconds, defaulting to 2 seconds.\"?\r\n\r\nJust don't want the user confused about why it's not polling constantly if they set a low value.","created_at":"2015-02-11T18:48:33Z","updated_at":"2015-02-11T18:48:33Z","html_url":"https://github.com/tessel/gps-a2235h/pull/15#discussion_r24521228","pull_request_url":"https://api.github.com/repos/tessel/gps-a2235h/pulls/15","_links":{"self":{"href":"https://api.github.com/repos/tessel/gps-a2235h/pulls/comments/24521228"},"html":{"href":"https://github.com/tessel/gps-a2235h/pull/15#discussion_r24521228"},"pull_request":{"href":"https://api.github.com/repos/tessel/gps-a2235h/pulls/15"}}},"pull_request":{"url":"https://api.github.com/repos/tessel/gps-a2235h/pulls/15","id":29084605,"html_url":"https://github.com/tessel/gps-a2235h/pull/15","diff_url":"https://github.com/tessel/gps-a2235h/pull/15.diff","patch_url":"https://github.com/tessel/gps-a2235h/pull/15.patch","issue_url":"https://api.github.com/repos/tessel/gps-a2235h/issues/15","number":15,"state":"open","locked":false,"title":"Allow a custom poll time to be set","user":{"login":"mattsoftware","id":1893056,"avatar_url":"https://avatars.githubusercontent.com/u/1893056?v=3","gravatar_id":"","url":"https://api.github.com/users/mattsoftware","html_url":"https://github.com/mattsoftware","followers_url":"https://api.github.com/users/mattsoftware/followers","following_url":"https://api.github.com/users/mattsoftware/following{/other_user}","gists_url":"https://api.github.com/users/mattsoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/mattsoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattsoftware/subscriptions","organizations_url":"https://api.github.com/users/mattsoftware/orgs","repos_url":"https://api.github.com/users/mattsoftware/repos","events_url":"https://api.github.com/users/mattsoftware/events{/privacy}","received_events_url":"https://api.github.com/users/mattsoftware/received_events","type":"User","site_admin":false},"body":"Added the ability to set poll time, rather than the hardcoded 2000ms value. It still defaults to 2000 to not break existing behaviour.\r\n\r\nThere is a guard against the number being used. I've set a lower limit of one second (there was a comment to say it could be bumped lower than two at the cost of cpu). Perhaps that could be put up to two seconds, but in my opinion if someone wanted to sacrifice cpu for a lower poll time that would be up to them. I've also set an upper limit of 60 seconds. That's arbitrary and I didn't really know what to set it to. My thinking was if they wanted longer than 60 seconds they would likely want to put the device into a low power state and wake it up at the time they want a new coordinate.\r\n\r\nI have made the variable private so to enforce the limit's of the value and stop accidental modification of the number into something that will not work.","created_at":"2015-02-11T11:43:14Z","updated_at":"2015-02-11T18:48:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bbb9b1484af249774ef1633c90563f3afe74cbd0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/tessel/gps-a2235h/pulls/15/commits","review_comments_url":"https://api.github.com/repos/tessel/gps-a2235h/pulls/15/comments","review_comment_url":"https://api.github.com/repos/tessel/gps-a2235h/pulls/comments/{number}","comments_url":"https://api.github.com/repos/tessel/gps-a2235h/issues/15/comments","statuses_url":"https://api.github.com/repos/tessel/gps-a2235h/statuses/b6cb3946d16a7a9fc0f686ebf1592497491ef289","head":{"label":"mattsoftware:custom-poll","ref":"custom-poll","sha":"b6cb3946d16a7a9fc0f686ebf1592497491ef289","user":{"login":"mattsoftware","id":1893056,"avatar_url":"https://avatars.githubusercontent.com/u/1893056?v=3","gravatar_id":"","url":"https://api.github.com/users/mattsoftware","html_url":"https://github.com/mattsoftware","followers_url":"https://api.github.com/users/mattsoftware/followers","following_url":"https://api.github.com/users/mattsoftware/following{/other_user}","gists_url":"https://api.github.com/users/mattsoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/mattsoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattsoftware/subscriptions","organizations_url":"https://api.github.com/users/mattsoftware/orgs","repos_url":"https://api.github.com/users/mattsoftware/repos","events_url":"https://api.github.com/users/mattsoftware/events{/privacy}","received_events_url":"https://api.github.com/users/mattsoftware/received_events","type":"User","site_admin":false},"repo":{"id":30615671,"name":"gps-a2235h","full_name":"mattsoftware/gps-a2235h","owner":{"login":"mattsoftware","id":1893056,"avatar_url":"https://avatars.githubusercontent.com/u/1893056?v=3","gravatar_id":"","url":"https://api.github.com/users/mattsoftware","html_url":"https://github.com/mattsoftware","followers_url":"https://api.github.com/users/mattsoftware/followers","following_url":"https://api.github.com/users/mattsoftware/following{/other_user}","gists_url":"https://api.github.com/users/mattsoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/mattsoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattsoftware/subscriptions","organizations_url":"https://api.github.com/users/mattsoftware/orgs","repos_url":"https://api.github.com/users/mattsoftware/repos","events_url":"https://api.github.com/users/mattsoftware/events{/privacy}","received_events_url":"https://api.github.com/users/mattsoftware/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mattsoftware/gps-a2235h","description":"Driver for the Tessel GPS module","fork":true,"url":"https://api.github.com/repos/mattsoftware/gps-a2235h","forks_url":"https://api.github.com/repos/mattsoftware/gps-a2235h/forks","keys_url":"https://api.github.com/repos/mattsoftware/gps-a2235h/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mattsoftware/gps-a2235h/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mattsoftware/gps-a2235h/teams","hooks_url":"https://api.github.com/repos/mattsoftware/gps-a2235h/hooks","issue_events_url":"https://api.github.com/repos/mattsoftware/gps-a2235h/issues/events{/number}","events_url":"https://api.github.com/repos/mattsoftware/gps-a2235h/events","assignees_url":"https://api.github.com/repos/mattsoftware/gps-a2235h/assignees{/user}","branches_url":"https://api.github.com/repos/mattsoftware/gps-a2235h/branches{/branch}","tags_url":"https://api.github.com/repos/mattsoftware/gps-a2235h/tags","blobs_url":"https://api.github.com/repos/mattsoftware/gps-a2235h/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mattsoftware/gps-a2235h/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mattsoftware/gps-a2235h/git/refs{/sha}","trees_url":"https://api.github.com/repos/mattsoftware/gps-a2235h/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mattsoftware/gps-a2235h/statuses/{sha}","languages_url":"https://api.github.com/repos/mattsoftware/gps-a2235h/languages","stargazers_url":"https://api.github.com/repos/mattsoftware/gps-a2235h/stargazers","contributors_url":"https://api.github.com/repos/mattsoftware/gps-a2235h/contributors","subscribers_url":"https://api.github.com/repos/mattsoftware/gps-a2235h/subscribers","subscription_url":"https://api.github.com/repos/mattsoftware/gps-a2235h/subscription","commits_url":"https://api.github.com/repos/mattsoftware/gps-a2235h/commits{/sha}","git_commits_url":"https://api.github.com/repos/mattsoftware/gps-a2235h/git/commits{/sha}","comments_url":"https://api.github.com/repos/mattsoftware/gps-a2235h/comments{/number}","issue_comment_url":"https://api.github.com/repos/mattsoftware/gps-a2235h/issues/comments/{number}","contents_url":"https://api.github.com/repos/mattsoftware/gps-a2235h/contents/{+path}","compare_url":"https://api.github.com/repos/mattsoftware/gps-a2235h/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mattsoftware/gps-a2235h/merges","archive_url":"https://api.github.com/repos/mattsoftware/gps-a2235h/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mattsoftware/gps-a2235h/downloads","issues_url":"https://api.github.com/repos/mattsoftware/gps-a2235h/issues{/number}","pulls_url":"https://api.github.com/repos/mattsoftware/gps-a2235h/pulls{/number}","milestones_url":"https://api.github.com/repos/mattsoftware/gps-a2235h/milestones{/number}","notifications_url":"https://api.github.com/repos/mattsoftware/gps-a2235h/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mattsoftware/gps-a2235h/labels{/name}","releases_url":"https://api.github.com/repos/mattsoftware/gps-a2235h/releases{/id}","created_at":"2015-02-10T21:32:35Z","updated_at":"2015-02-11T10:59:52Z","pushed_at":"2015-02-11T11:34:31Z","git_url":"git://github.com/mattsoftware/gps-a2235h.git","ssh_url":"git@github.com:mattsoftware/gps-a2235h.git","clone_url":"https://github.com/mattsoftware/gps-a2235h.git","svn_url":"https://github.com/mattsoftware/gps-a2235h","homepage":null,"size":175,"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":"tessel:master","ref":"master","sha":"5e1d416a39929f3439c5c7d6bc2ce3af12957d3a","user":{"login":"tessel","id":5573563,"avatar_url":"https://avatars.githubusercontent.com/u/5573563?v=3","gravatar_id":"","url":"https://api.github.com/users/tessel","html_url":"https://github.com/tessel","followers_url":"https://api.github.com/users/tessel/followers","following_url":"https://api.github.com/users/tessel/following{/other_user}","gists_url":"https://api.github.com/users/tessel/gists{/gist_id}","starred_url":"https://api.github.com/users/tessel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tessel/subscriptions","organizations_url":"https://api.github.com/users/tessel/orgs","repos_url":"https://api.github.com/users/tessel/repos","events_url":"https://api.github.com/users/tessel/events{/privacy}","received_events_url":"https://api.github.com/users/tessel/received_events","type":"Organization","site_admin":false},"repo":{"id":19750675,"name":"gps-a2235h","full_name":"tessel/gps-a2235h","owner":{"login":"tessel","id":5573563,"avatar_url":"https://avatars.githubusercontent.com/u/5573563?v=3","gravatar_id":"","url":"https://api.github.com/users/tessel","html_url":"https://github.com/tessel","followers_url":"https://api.github.com/users/tessel/followers","following_url":"https://api.github.com/users/tessel/following{/other_user}","gists_url":"https://api.github.com/users/tessel/gists{/gist_id}","starred_url":"https://api.github.com/users/tessel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tessel/subscriptions","organizations_url":"https://api.github.com/users/tessel/orgs","repos_url":"https://api.github.com/users/tessel/repos","events_url":"https://api.github.com/users/tessel/events{/privacy}","received_events_url":"https://api.github.com/users/tessel/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/tessel/gps-a2235h","description":"Driver for the Tessel GPS module","fork":false,"url":"https://api.github.com/repos/tessel/gps-a2235h","forks_url":"https://api.github.com/repos/tessel/gps-a2235h/forks","keys_url":"https://api.github.com/repos/tessel/gps-a2235h/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tessel/gps-a2235h/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tessel/gps-a2235h/teams","hooks_url":"https://api.github.com/repos/tessel/gps-a2235h/hooks","issue_events_url":"https://api.github.com/repos/tessel/gps-a2235h/issues/events{/number}","events_url":"https://api.github.com/repos/tessel/gps-a2235h/events","assignees_url":"https://api.github.com/repos/tessel/gps-a2235h/assignees{/user}","branches_url":"https://api.github.com/repos/tessel/gps-a2235h/branches{/branch}","tags_url":"https://api.github.com/repos/tessel/gps-a2235h/tags","blobs_url":"https://api.github.com/repos/tessel/gps-a2235h/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tessel/gps-a2235h/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tessel/gps-a2235h/git/refs{/sha}","trees_url":"https://api.github.com/repos/tessel/gps-a2235h/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tessel/gps-a2235h/statuses/{sha}","languages_url":"https://api.github.com/repos/tessel/gps-a2235h/languages","stargazers_url":"https://api.github.com/repos/tessel/gps-a2235h/stargazers","contributors_url":"https://api.github.com/repos/tessel/gps-a2235h/contributors","subscribers_url":"https://api.github.com/repos/tessel/gps-a2235h/subscribers","subscription_url":"https://api.github.com/repos/tessel/gps-a2235h/subscription","commits_url":"https://api.github.com/repos/tessel/gps-a2235h/commits{/sha}","git_commits_url":"https://api.github.com/repos/tessel/gps-a2235h/git/commits{/sha}","comments_url":"https://api.github.com/repos/tessel/gps-a2235h/comments{/number}","issue_comment_url":"https://api.github.com/repos/tessel/gps-a2235h/issues/comments/{number}","contents_url":"https://api.github.com/repos/tessel/gps-a2235h/contents/{+path}","compare_url":"https://api.github.com/repos/tessel/gps-a2235h/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tessel/gps-a2235h/merges","archive_url":"https://api.github.com/repos/tessel/gps-a2235h/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tessel/gps-a2235h/downloads","issues_url":"https://api.github.com/repos/tessel/gps-a2235h/issues{/number}","pulls_url":"https://api.github.com/repos/tessel/gps-a2235h/pulls{/number}","milestones_url":"https://api.github.com/repos/tessel/gps-a2235h/milestones{/number}","notifications_url":"https://api.github.com/repos/tessel/gps-a2235h/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tessel/gps-a2235h/labels{/name}","releases_url":"https://api.github.com/repos/tessel/gps-a2235h/releases{/id}","created_at":"2014-05-13T18:27:15Z","updated_at":"2015-02-10T22:28:24Z","pushed_at":"2015-02-10T22:28:24Z","git_url":"git://github.com/tessel/gps-a2235h.git","ssh_url":"git@github.com:tessel/gps-a2235h.git","clone_url":"https://github.com/tessel/gps-a2235h.git","svn_url":"https://github.com/tessel/gps-a2235h","homepage":null,"size":540,"stargazers_count":4,"watchers_count":4,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":5,"forks":4,"open_issues":5,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tessel/gps-a2235h/pulls/15"},"html":{"href":"https://github.com/tessel/gps-a2235h/pull/15"},"issue":{"href":"https://api.github.com/repos/tessel/gps-a2235h/issues/15"},"comments":{"href":"https://api.github.com/repos/tessel/gps-a2235h/issues/15/comments"},"review_comments":{"href":"https://api.github.com/repos/tessel/gps-a2235h/pulls/15/comments"},"review_comment":{"href":"https://api.github.com/repos/tessel/gps-a2235h/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/tessel/gps-a2235h/pulls/15/commits"},"statuses":{"href":"https://api.github.com/repos/tessel/gps-a2235h/statuses/b6cb3946d16a7a9fc0f686ebf1592497491ef289"}}}}