{"action":"created","comment":{"url":"https://api.github.com/repos/nebrius/raspi-io/pulls/comments/83828170","pull_request_review_id":4644413,"id":83828170,"diff_hunk":"@@ -352,9 +354,14 @@ class Raspi extends EventEmitter {\n       pin: normalizedPin,\n       pullResistor: pinInstance.pullResistor\n     };\n-    if (this[pins][normalizedPin].supportedModes.indexOf(mode) == -1) {\n+    const isModeSupported = this[pins][normalizedPin].supportedModes.indexOf(mode) > -1;\n+\n+    if (mode === PWM_MODE && isModeSupported === false) {","path":"index.js","position":23,"original_position":23,"commit_id":"090bdd1e2a79a0c5efbdc098553543774152cab7","original_commit_id":"090bdd1e2a79a0c5efbdc098553543774152cab7","user":{"login":"nebrius","id":1141386,"avatar_url":"https://avatars.githubusercontent.com/u/1141386?v=3","gravatar_id":"","url":"https://api.github.com/users/nebrius","html_url":"https://github.com/nebrius","followers_url":"https://api.github.com/users/nebrius/followers","following_url":"https://api.github.com/users/nebrius/following{/other_user}","gists_url":"https://api.github.com/users/nebrius/gists{/gist_id}","starred_url":"https://api.github.com/users/nebrius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nebrius/subscriptions","organizations_url":"https://api.github.com/users/nebrius/orgs","repos_url":"https://api.github.com/users/nebrius/repos","events_url":"https://api.github.com/users/nebrius/events{/privacy}","received_events_url":"https://api.github.com/users/nebrius/received_events","type":"User","site_admin":false},"body":"Given the `enableSoftwarePwm` flag, and the removal of `SOFT_PWM_MODE` this logic, and the logic further down will need to be refactored.","created_at":"2016-10-18T10:52:15Z","updated_at":"2016-10-18T10:52:50Z","html_url":"https://github.com/nebrius/raspi-io/pull/74#discussion_r83828170","pull_request_url":"https://api.github.com/repos/nebrius/raspi-io/pulls/74","_links":{"self":{"href":"https://api.github.com/repos/nebrius/raspi-io/pulls/comments/83828170"},"html":{"href":"https://github.com/nebrius/raspi-io/pull/74#discussion_r83828170"},"pull_request":{"href":"https://api.github.com/repos/nebrius/raspi-io/pulls/74"}}},"pull_request":{"url":"https://api.github.com/repos/nebrius/raspi-io/pulls/74","id":89661137,"html_url":"https://github.com/nebrius/raspi-io/pull/74","diff_url":"https://github.com/nebrius/raspi-io/pull/74.diff","patch_url":"https://github.com/nebrius/raspi-io/pull/74.patch","issue_url":"https://api.github.com/repos/nebrius/raspi-io/issues/74","number":74,"state":"open","locked":false,"title":"Fall back to software PWM if hardware PWM not supported","user":{"login":"andrewn","id":1762,"avatar_url":"https://avatars.githubusercontent.com/u/1762?v=3","gravatar_id":"","url":"https://api.github.com/users/andrewn","html_url":"https://github.com/andrewn","followers_url":"https://api.github.com/users/andrewn/followers","following_url":"https://api.github.com/users/andrewn/following{/other_user}","gists_url":"https://api.github.com/users/andrewn/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewn/subscriptions","organizations_url":"https://api.github.com/users/andrewn/orgs","repos_url":"https://api.github.com/users/andrewn/repos","events_url":"https://api.github.com/users/andrewn/events{/privacy}","received_events_url":"https://api.github.com/users/andrewn/received_events","type":"User","site_admin":false},"body":"As discussed in #73, this implements the ability to fall back to a software-generated PWM if the specified pin doesn't support hardware PWM.\r\n\r\nThis is transparent to the user which is good - because things like RGB LEDs will \"just work\". It's also bad - because each software PWM has a CPU penalty.\r\n\r\nThis is achieved using a fork of `raspi-pwm`, called [`raspi-soft-pwm`](https://github.com/andrewn/raspi-soft-pwm) that wraps [Wiring Pi's Software PWM support](http://wiringpi.com/reference/software-pwm-library/).\r\n\r\nCurrently, `raspi-soft-pwm` isn't pushed to the NPM registry as I wanted to get feedback on this approach first.","created_at":"2016-10-17T16:49:56Z","updated_at":"2016-10-18T10:52:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"18314551d7de82eb4219f4cc1685a3b03bf5ae98","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/nebrius/raspi-io/pulls/74/commits","review_comments_url":"https://api.github.com/repos/nebrius/raspi-io/pulls/74/comments","review_comment_url":"https://api.github.com/repos/nebrius/raspi-io/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nebrius/raspi-io/issues/74/comments","statuses_url":"https://api.github.com/repos/nebrius/raspi-io/statuses/090bdd1e2a79a0c5efbdc098553543774152cab7","head":{"label":"andrewn:soft-pwm","ref":"soft-pwm","sha":"090bdd1e2a79a0c5efbdc098553543774152cab7","user":{"login":"andrewn","id":1762,"avatar_url":"https://avatars.githubusercontent.com/u/1762?v=3","gravatar_id":"","url":"https://api.github.com/users/andrewn","html_url":"https://github.com/andrewn","followers_url":"https://api.github.com/users/andrewn/followers","following_url":"https://api.github.com/users/andrewn/following{/other_user}","gists_url":"https://api.github.com/users/andrewn/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewn/subscriptions","organizations_url":"https://api.github.com/users/andrewn/orgs","repos_url":"https://api.github.com/users/andrewn/repos","events_url":"https://api.github.com/users/andrewn/events{/privacy}","received_events_url":"https://api.github.com/users/andrewn/received_events","type":"User","site_admin":false},"repo":{"id":44070993,"name":"raspi-io","full_name":"andrewn/raspi-io","owner":{"login":"andrewn","id":1762,"avatar_url":"https://avatars.githubusercontent.com/u/1762?v=3","gravatar_id":"","url":"https://api.github.com/users/andrewn","html_url":"https://github.com/andrewn","followers_url":"https://api.github.com/users/andrewn/followers","following_url":"https://api.github.com/users/andrewn/following{/other_user}","gists_url":"https://api.github.com/users/andrewn/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewn/subscriptions","organizations_url":"https://api.github.com/users/andrewn/orgs","repos_url":"https://api.github.com/users/andrewn/repos","events_url":"https://api.github.com/users/andrewn/events{/privacy}","received_events_url":"https://api.github.com/users/andrewn/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/andrewn/raspi-io","description":"An IO plugin for Johnny-Five that provides support for the Raspberry Pi","fork":true,"url":"https://api.github.com/repos/andrewn/raspi-io","forks_url":"https://api.github.com/repos/andrewn/raspi-io/forks","keys_url":"https://api.github.com/repos/andrewn/raspi-io/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andrewn/raspi-io/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andrewn/raspi-io/teams","hooks_url":"https://api.github.com/repos/andrewn/raspi-io/hooks","issue_events_url":"https://api.github.com/repos/andrewn/raspi-io/issues/events{/number}","events_url":"https://api.github.com/repos/andrewn/raspi-io/events","assignees_url":"https://api.github.com/repos/andrewn/raspi-io/assignees{/user}","branches_url":"https://api.github.com/repos/andrewn/raspi-io/branches{/branch}","tags_url":"https://api.github.com/repos/andrewn/raspi-io/tags","blobs_url":"https://api.github.com/repos/andrewn/raspi-io/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andrewn/raspi-io/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andrewn/raspi-io/git/refs{/sha}","trees_url":"https://api.github.com/repos/andrewn/raspi-io/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andrewn/raspi-io/statuses/{sha}","languages_url":"https://api.github.com/repos/andrewn/raspi-io/languages","stargazers_url":"https://api.github.com/repos/andrewn/raspi-io/stargazers","contributors_url":"https://api.github.com/repos/andrewn/raspi-io/contributors","subscribers_url":"https://api.github.com/repos/andrewn/raspi-io/subscribers","subscription_url":"https://api.github.com/repos/andrewn/raspi-io/subscription","commits_url":"https://api.github.com/repos/andrewn/raspi-io/commits{/sha}","git_commits_url":"https://api.github.com/repos/andrewn/raspi-io/git/commits{/sha}","comments_url":"https://api.github.com/repos/andrewn/raspi-io/comments{/number}","issue_comment_url":"https://api.github.com/repos/andrewn/raspi-io/issues/comments{/number}","contents_url":"https://api.github.com/repos/andrewn/raspi-io/contents/{+path}","compare_url":"https://api.github.com/repos/andrewn/raspi-io/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andrewn/raspi-io/merges","archive_url":"https://api.github.com/repos/andrewn/raspi-io/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andrewn/raspi-io/downloads","issues_url":"https://api.github.com/repos/andrewn/raspi-io/issues{/number}","pulls_url":"https://api.github.com/repos/andrewn/raspi-io/pulls{/number}","milestones_url":"https://api.github.com/repos/andrewn/raspi-io/milestones{/number}","notifications_url":"https://api.github.com/repos/andrewn/raspi-io/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andrewn/raspi-io/labels{/name}","releases_url":"https://api.github.com/repos/andrewn/raspi-io/releases{/id}","deployments_url":"https://api.github.com/repos/andrewn/raspi-io/deployments","created_at":"2015-10-11T21:45:10Z","updated_at":"2016-09-09T10:14:09Z","pushed_at":"2016-10-17T16:43:11Z","git_url":"git://github.com/andrewn/raspi-io.git","ssh_url":"git@github.com:andrewn/raspi-io.git","clone_url":"https://github.com/andrewn/raspi-io.git","svn_url":"https://github.com/andrewn/raspi-io","homepage":"","size":545,"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":"nebrius:master","ref":"master","sha":"04d3a986ac749bd551735c7333a5dab465488638","user":{"login":"nebrius","id":1141386,"avatar_url":"https://avatars.githubusercontent.com/u/1141386?v=3","gravatar_id":"","url":"https://api.github.com/users/nebrius","html_url":"https://github.com/nebrius","followers_url":"https://api.github.com/users/nebrius/followers","following_url":"https://api.github.com/users/nebrius/following{/other_user}","gists_url":"https://api.github.com/users/nebrius/gists{/gist_id}","starred_url":"https://api.github.com/users/nebrius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nebrius/subscriptions","organizations_url":"https://api.github.com/users/nebrius/orgs","repos_url":"https://api.github.com/users/nebrius/repos","events_url":"https://api.github.com/users/nebrius/events{/privacy}","received_events_url":"https://api.github.com/users/nebrius/received_events","type":"User","site_admin":false},"repo":{"id":24878653,"name":"raspi-io","full_name":"nebrius/raspi-io","owner":{"login":"nebrius","id":1141386,"avatar_url":"https://avatars.githubusercontent.com/u/1141386?v=3","gravatar_id":"","url":"https://api.github.com/users/nebrius","html_url":"https://github.com/nebrius","followers_url":"https://api.github.com/users/nebrius/followers","following_url":"https://api.github.com/users/nebrius/following{/other_user}","gists_url":"https://api.github.com/users/nebrius/gists{/gist_id}","starred_url":"https://api.github.com/users/nebrius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nebrius/subscriptions","organizations_url":"https://api.github.com/users/nebrius/orgs","repos_url":"https://api.github.com/users/nebrius/repos","events_url":"https://api.github.com/users/nebrius/events{/privacy}","received_events_url":"https://api.github.com/users/nebrius/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nebrius/raspi-io","description":"An IO plugin for Johnny-Five that provides support for the Raspberry Pi","fork":false,"url":"https://api.github.com/repos/nebrius/raspi-io","forks_url":"https://api.github.com/repos/nebrius/raspi-io/forks","keys_url":"https://api.github.com/repos/nebrius/raspi-io/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nebrius/raspi-io/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nebrius/raspi-io/teams","hooks_url":"https://api.github.com/repos/nebrius/raspi-io/hooks","issue_events_url":"https://api.github.com/repos/nebrius/raspi-io/issues/events{/number}","events_url":"https://api.github.com/repos/nebrius/raspi-io/events","assignees_url":"https://api.github.com/repos/nebrius/raspi-io/assignees{/user}","branches_url":"https://api.github.com/repos/nebrius/raspi-io/branches{/branch}","tags_url":"https://api.github.com/repos/nebrius/raspi-io/tags","blobs_url":"https://api.github.com/repos/nebrius/raspi-io/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nebrius/raspi-io/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nebrius/raspi-io/git/refs{/sha}","trees_url":"https://api.github.com/repos/nebrius/raspi-io/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nebrius/raspi-io/statuses/{sha}","languages_url":"https://api.github.com/repos/nebrius/raspi-io/languages","stargazers_url":"https://api.github.com/repos/nebrius/raspi-io/stargazers","contributors_url":"https://api.github.com/repos/nebrius/raspi-io/contributors","subscribers_url":"https://api.github.com/repos/nebrius/raspi-io/subscribers","subscription_url":"https://api.github.com/repos/nebrius/raspi-io/subscription","commits_url":"https://api.github.com/repos/nebrius/raspi-io/commits{/sha}","git_commits_url":"https://api.github.com/repos/nebrius/raspi-io/git/commits{/sha}","comments_url":"https://api.github.com/repos/nebrius/raspi-io/comments{/number}","issue_comment_url":"https://api.github.com/repos/nebrius/raspi-io/issues/comments{/number}","contents_url":"https://api.github.com/repos/nebrius/raspi-io/contents/{+path}","compare_url":"https://api.github.com/repos/nebrius/raspi-io/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nebrius/raspi-io/merges","archive_url":"https://api.github.com/repos/nebrius/raspi-io/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nebrius/raspi-io/downloads","issues_url":"https://api.github.com/repos/nebrius/raspi-io/issues{/number}","pulls_url":"https://api.github.com/repos/nebrius/raspi-io/pulls{/number}","milestones_url":"https://api.github.com/repos/nebrius/raspi-io/milestones{/number}","notifications_url":"https://api.github.com/repos/nebrius/raspi-io/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nebrius/raspi-io/labels{/name}","releases_url":"https://api.github.com/repos/nebrius/raspi-io/releases{/id}","deployments_url":"https://api.github.com/repos/nebrius/raspi-io/deployments","created_at":"2014-10-07T06:00:02Z","updated_at":"2016-10-17T04:00:21Z","pushed_at":"2016-10-17T16:49:56Z","git_url":"git://github.com/nebrius/raspi-io.git","ssh_url":"git@github.com:nebrius/raspi-io.git","clone_url":"https://github.com/nebrius/raspi-io.git","svn_url":"https://github.com/nebrius/raspi-io","homepage":"","size":571,"stargazers_count":184,"watchers_count":184,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":30,"mirror_url":null,"open_issues_count":8,"forks":30,"open_issues":8,"watchers":184,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nebrius/raspi-io/pulls/74"},"html":{"href":"https://github.com/nebrius/raspi-io/pull/74"},"issue":{"href":"https://api.github.com/repos/nebrius/raspi-io/issues/74"},"comments":{"href":"https://api.github.com/repos/nebrius/raspi-io/issues/74/comments"},"review_comments":{"href":"https://api.github.com/repos/nebrius/raspi-io/pulls/74/comments"},"review_comment":{"href":"https://api.github.com/repos/nebrius/raspi-io/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nebrius/raspi-io/pulls/74/commits"},"statuses":{"href":"https://api.github.com/repos/nebrius/raspi-io/statuses/090bdd1e2a79a0c5efbdc098553543774152cab7"}}}}
{"actor":{"display_login":"nebrius"}}