{"action":"created","issue":{"url":"https://api.github.com/repos/rakeshpai/pi-gpio/issues/37","labels_url":"https://api.github.com/repos/rakeshpai/pi-gpio/issues/37/labels{/name}","comments_url":"https://api.github.com/repos/rakeshpai/pi-gpio/issues/37/comments","events_url":"https://api.github.com/repos/rakeshpai/pi-gpio/issues/37/events","html_url":"https://github.com/rakeshpai/pi-gpio/pull/37","id":73109103,"number":37,"title":"Add method to write to pin regardless of whether its opened or not","user":{"login":"risingtiger","id":1186976,"avatar_url":"https://avatars.githubusercontent.com/u/1186976?v=3","gravatar_id":"","url":"https://api.github.com/users/risingtiger","html_url":"https://github.com/risingtiger","followers_url":"https://api.github.com/users/risingtiger/followers","following_url":"https://api.github.com/users/risingtiger/following{/other_user}","gists_url":"https://api.github.com/users/risingtiger/gists{/gist_id}","starred_url":"https://api.github.com/users/risingtiger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/risingtiger/subscriptions","organizations_url":"https://api.github.com/users/risingtiger/orgs","repos_url":"https://api.github.com/users/risingtiger/repos","events_url":"https://api.github.com/users/risingtiger/events{/privacy}","received_events_url":"https://api.github.com/users/risingtiger/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-05-04T19:38:46Z","updated_at":"2015-05-06T14:27:13Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/rakeshpai/pi-gpio/pulls/37","html_url":"https://github.com/rakeshpai/pi-gpio/pull/37","diff_url":"https://github.com/rakeshpai/pi-gpio/pull/37.diff","patch_url":"https://github.com/rakeshpai/pi-gpio/pull/37.patch"},"body":"I’ve created a rather simple method called writeRegardless (open to name suggestions here) that allows for writing to a pin without knowing whether its opened and set to the ‘out' direction. The method simply opens the pin if not opened already and sets the direction to out. \r\n\r\nMy argument for adding this is that there are legitimate cases where a script won’t know before hand which pins will be used. And I believe the logic to detect whether open or not should be scoped to the pi-gpio library, not the script referencing it. \r\n\r\nI’d be curious to hear other’s remarks about this. I do understand that there is overhead with running testing logic, thats why it wouldn’t be a replacement for write, but more of a convenience method in the particular cases where it makes sense. "},"comment":{"url":"https://api.github.com/repos/rakeshpai/pi-gpio/issues/comments/99488157","html_url":"https://github.com/rakeshpai/pi-gpio/pull/37#issuecomment-99488157","issue_url":"https://api.github.com/repos/rakeshpai/pi-gpio/issues/37","id":99488157,"user":{"login":"risingtiger","id":1186976,"avatar_url":"https://avatars.githubusercontent.com/u/1186976?v=3","gravatar_id":"","url":"https://api.github.com/users/risingtiger","html_url":"https://github.com/risingtiger","followers_url":"https://api.github.com/users/risingtiger/followers","following_url":"https://api.github.com/users/risingtiger/following{/other_user}","gists_url":"https://api.github.com/users/risingtiger/gists{/gist_id}","starred_url":"https://api.github.com/users/risingtiger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/risingtiger/subscriptions","organizations_url":"https://api.github.com/users/risingtiger/orgs","repos_url":"https://api.github.com/users/risingtiger/repos","events_url":"https://api.github.com/users/risingtiger/events{/privacy}","received_events_url":"https://api.github.com/users/risingtiger/received_events","type":"User","site_admin":false},"created_at":"2015-05-06T14:27:13Z","updated_at":"2015-05-06T14:27:13Z","body":"I'm in favor of merging tjansons work. I'll do some testing today of his branch, see if anything breaks. "}}