{"action":"closed","number":5,"pull_request":{"url":"https://api.github.com/repos/mjbrown/bgapi/pulls/5","id":44971703,"html_url":"https://github.com/mjbrown/bgapi/pull/5","diff_url":"https://github.com/mjbrown/bgapi/pull/5.diff","patch_url":"https://github.com/mjbrown/bgapi/pull/5.patch","issue_url":"https://api.github.com/repos/mjbrown/bgapi/issues/5","number":5,"state":"closed","locked":false,"title":"while replacement","user":{"login":"pinkavaj","id":692166,"avatar_url":"https://avatars.githubusercontent.com/u/692166?v=3","gravatar_id":"","url":"https://api.github.com/users/pinkavaj","html_url":"https://github.com/pinkavaj","followers_url":"https://api.github.com/users/pinkavaj/followers","following_url":"https://api.github.com/users/pinkavaj/following{/other_user}","gists_url":"https://api.github.com/users/pinkavaj/gists{/gist_id}","starred_url":"https://api.github.com/users/pinkavaj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pinkavaj/subscriptions","organizations_url":"https://api.github.com/users/pinkavaj/orgs","repos_url":"https://api.github.com/users/pinkavaj/repos","events_url":"https://api.github.com/users/pinkavaj/events{/privacy}","received_events_url":"https://api.github.com/users/pinkavaj/received_events","type":"User","site_admin":false},"body":"Hi,\r\n\r\nthis is not regular pull request, but I want to bring you attention some trouble I have found.\r\n\r\nI have experimentally replaced one of the while loops with Event and found one of the tests failing. It starts emitting some events before any command is send. This is probably caused by previous command which cause event emission, but reset of device to default state does not happen soon enough. You can derive simple fix for master branch from the last patch, so You can reject this request, but I'm interested whatever you can reproduce this behaviour (checkout one commit before this branch head).\r\n\r\nThere is still niche chance I have done something wrong, but not found anything so far.\r\n\r\nI have one more question to discussion. In the higher level API (module.py) You are using the same locking mechanism for both responses and events. This seems wrong to my. It would be nice to have \"middle level\" API which waits synchronously for response on command (you cannot send another command until you get response), but event should be still handled asynchronously. I'm thinking about some way to implement it, but I want to know if this seems acceptible idea to You.\r\n","created_at":"2015-09-14T19:42:52Z","updated_at":"2015-09-24T05:17:04Z","closed_at":"2015-09-24T05:17:04Z","merged_at":"2015-09-24T05:17:04Z","merge_commit_sha":"195e9c351bf26b1c92b0b8f9c80352987fc86b0b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mjbrown/bgapi/pulls/5/commits","review_comments_url":"https://api.github.com/repos/mjbrown/bgapi/pulls/5/comments","review_comment_url":"https://api.github.com/repos/mjbrown/bgapi/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mjbrown/bgapi/issues/5/comments","statuses_url":"https://api.github.com/repos/mjbrown/bgapi/statuses/e6ca6592c92730bd2ac12e2d231d751f4167593b","head":{"label":"pinkavaj:fix-sleep-01","ref":"fix-sleep-01","sha":"e6ca6592c92730bd2ac12e2d231d751f4167593b","user":{"login":"pinkavaj","id":692166,"avatar_url":"https://avatars.githubusercontent.com/u/692166?v=3","gravatar_id":"","url":"https://api.github.com/users/pinkavaj","html_url":"https://github.com/pinkavaj","followers_url":"https://api.github.com/users/pinkavaj/followers","following_url":"https://api.github.com/users/pinkavaj/following{/other_user}","gists_url":"https://api.github.com/users/pinkavaj/gists{/gist_id}","starred_url":"https://api.github.com/users/pinkavaj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pinkavaj/subscriptions","organizations_url":"https://api.github.com/users/pinkavaj/orgs","repos_url":"https://api.github.com/users/pinkavaj/repos","events_url":"https://api.github.com/users/pinkavaj/events{/privacy}","received_events_url":"https://api.github.com/users/pinkavaj/received_events","type":"User","site_admin":false},"repo":{"id":42267230,"name":"bgapi","full_name":"pinkavaj/bgapi","owner":{"login":"pinkavaj","id":692166,"avatar_url":"https://avatars.githubusercontent.com/u/692166?v=3","gravatar_id":"","url":"https://api.github.com/users/pinkavaj","html_url":"https://github.com/pinkavaj","followers_url":"https://api.github.com/users/pinkavaj/followers","following_url":"https://api.github.com/users/pinkavaj/following{/other_user}","gists_url":"https://api.github.com/users/pinkavaj/gists{/gist_id}","starred_url":"https://api.github.com/users/pinkavaj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pinkavaj/subscriptions","organizations_url":"https://api.github.com/users/pinkavaj/orgs","repos_url":"https://api.github.com/users/pinkavaj/repos","events_url":"https://api.github.com/users/pinkavaj/events{/privacy}","received_events_url":"https://api.github.com/users/pinkavaj/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pinkavaj/bgapi","description":"A python package for communicating with BlueGiga modules through their proprietary API.","fork":true,"url":"https://api.github.com/repos/pinkavaj/bgapi","forks_url":"https://api.github.com/repos/pinkavaj/bgapi/forks","keys_url":"https://api.github.com/repos/pinkavaj/bgapi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pinkavaj/bgapi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pinkavaj/bgapi/teams","hooks_url":"https://api.github.com/repos/pinkavaj/bgapi/hooks","issue_events_url":"https://api.github.com/repos/pinkavaj/bgapi/issues/events{/number}","events_url":"https://api.github.com/repos/pinkavaj/bgapi/events","assignees_url":"https://api.github.com/repos/pinkavaj/bgapi/assignees{/user}","branches_url":"https://api.github.com/repos/pinkavaj/bgapi/branches{/branch}","tags_url":"https://api.github.com/repos/pinkavaj/bgapi/tags","blobs_url":"https://api.github.com/repos/pinkavaj/bgapi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pinkavaj/bgapi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pinkavaj/bgapi/git/refs{/sha}","trees_url":"https://api.github.com/repos/pinkavaj/bgapi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pinkavaj/bgapi/statuses/{sha}","languages_url":"https://api.github.com/repos/pinkavaj/bgapi/languages","stargazers_url":"https://api.github.com/repos/pinkavaj/bgapi/stargazers","contributors_url":"https://api.github.com/repos/pinkavaj/bgapi/contributors","subscribers_url":"https://api.github.com/repos/pinkavaj/bgapi/subscribers","subscription_url":"https://api.github.com/repos/pinkavaj/bgapi/subscription","commits_url":"https://api.github.com/repos/pinkavaj/bgapi/commits{/sha}","git_commits_url":"https://api.github.com/repos/pinkavaj/bgapi/git/commits{/sha}","comments_url":"https://api.github.com/repos/pinkavaj/bgapi/comments{/number}","issue_comment_url":"https://api.github.com/repos/pinkavaj/bgapi/issues/comments{/number}","contents_url":"https://api.github.com/repos/pinkavaj/bgapi/contents/{+path}","compare_url":"https://api.github.com/repos/pinkavaj/bgapi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pinkavaj/bgapi/merges","archive_url":"https://api.github.com/repos/pinkavaj/bgapi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pinkavaj/bgapi/downloads","issues_url":"https://api.github.com/repos/pinkavaj/bgapi/issues{/number}","pulls_url":"https://api.github.com/repos/pinkavaj/bgapi/pulls{/number}","milestones_url":"https://api.github.com/repos/pinkavaj/bgapi/milestones{/number}","notifications_url":"https://api.github.com/repos/pinkavaj/bgapi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pinkavaj/bgapi/labels{/name}","releases_url":"https://api.github.com/repos/pinkavaj/bgapi/releases{/id}","created_at":"2015-09-10T19:52:57Z","updated_at":"2015-09-10T19:52:57Z","pushed_at":"2015-09-23T09:03:16Z","git_url":"git://github.com/pinkavaj/bgapi.git","ssh_url":"git@github.com:pinkavaj/bgapi.git","clone_url":"https://github.com/pinkavaj/bgapi.git","svn_url":"https://github.com/pinkavaj/bgapi","homepage":"","size":289,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"mjbrown:master","ref":"master","sha":"506eedbf7c964e99bdd9c8c01f664fcb3eb3bbfa","user":{"login":"mjbrown","id":1373715,"avatar_url":"https://avatars.githubusercontent.com/u/1373715?v=3","gravatar_id":"","url":"https://api.github.com/users/mjbrown","html_url":"https://github.com/mjbrown","followers_url":"https://api.github.com/users/mjbrown/followers","following_url":"https://api.github.com/users/mjbrown/following{/other_user}","gists_url":"https://api.github.com/users/mjbrown/gists{/gist_id}","starred_url":"https://api.github.com/users/mjbrown/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjbrown/subscriptions","organizations_url":"https://api.github.com/users/mjbrown/orgs","repos_url":"https://api.github.com/users/mjbrown/repos","events_url":"https://api.github.com/users/mjbrown/events{/privacy}","received_events_url":"https://api.github.com/users/mjbrown/received_events","type":"User","site_admin":false},"repo":{"id":29120343,"name":"bgapi","full_name":"mjbrown/bgapi","owner":{"login":"mjbrown","id":1373715,"avatar_url":"https://avatars.githubusercontent.com/u/1373715?v=3","gravatar_id":"","url":"https://api.github.com/users/mjbrown","html_url":"https://github.com/mjbrown","followers_url":"https://api.github.com/users/mjbrown/followers","following_url":"https://api.github.com/users/mjbrown/following{/other_user}","gists_url":"https://api.github.com/users/mjbrown/gists{/gist_id}","starred_url":"https://api.github.com/users/mjbrown/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjbrown/subscriptions","organizations_url":"https://api.github.com/users/mjbrown/orgs","repos_url":"https://api.github.com/users/mjbrown/repos","events_url":"https://api.github.com/users/mjbrown/events{/privacy}","received_events_url":"https://api.github.com/users/mjbrown/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mjbrown/bgapi","description":"A python package for communicating with BlueGiga modules through their proprietary API.","fork":false,"url":"https://api.github.com/repos/mjbrown/bgapi","forks_url":"https://api.github.com/repos/mjbrown/bgapi/forks","keys_url":"https://api.github.com/repos/mjbrown/bgapi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mjbrown/bgapi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mjbrown/bgapi/teams","hooks_url":"https://api.github.com/repos/mjbrown/bgapi/hooks","issue_events_url":"https://api.github.com/repos/mjbrown/bgapi/issues/events{/number}","events_url":"https://api.github.com/repos/mjbrown/bgapi/events","assignees_url":"https://api.github.com/repos/mjbrown/bgapi/assignees{/user}","branches_url":"https://api.github.com/repos/mjbrown/bgapi/branches{/branch}","tags_url":"https://api.github.com/repos/mjbrown/bgapi/tags","blobs_url":"https://api.github.com/repos/mjbrown/bgapi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mjbrown/bgapi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mjbrown/bgapi/git/refs{/sha}","trees_url":"https://api.github.com/repos/mjbrown/bgapi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mjbrown/bgapi/statuses/{sha}","languages_url":"https://api.github.com/repos/mjbrown/bgapi/languages","stargazers_url":"https://api.github.com/repos/mjbrown/bgapi/stargazers","contributors_url":"https://api.github.com/repos/mjbrown/bgapi/contributors","subscribers_url":"https://api.github.com/repos/mjbrown/bgapi/subscribers","subscription_url":"https://api.github.com/repos/mjbrown/bgapi/subscription","commits_url":"https://api.github.com/repos/mjbrown/bgapi/commits{/sha}","git_commits_url":"https://api.github.com/repos/mjbrown/bgapi/git/commits{/sha}","comments_url":"https://api.github.com/repos/mjbrown/bgapi/comments{/number}","issue_comment_url":"https://api.github.com/repos/mjbrown/bgapi/issues/comments{/number}","contents_url":"https://api.github.com/repos/mjbrown/bgapi/contents/{+path}","compare_url":"https://api.github.com/repos/mjbrown/bgapi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mjbrown/bgapi/merges","archive_url":"https://api.github.com/repos/mjbrown/bgapi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mjbrown/bgapi/downloads","issues_url":"https://api.github.com/repos/mjbrown/bgapi/issues{/number}","pulls_url":"https://api.github.com/repos/mjbrown/bgapi/pulls{/number}","milestones_url":"https://api.github.com/repos/mjbrown/bgapi/milestones{/number}","notifications_url":"https://api.github.com/repos/mjbrown/bgapi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mjbrown/bgapi/labels{/name}","releases_url":"https://api.github.com/repos/mjbrown/bgapi/releases{/id}","created_at":"2015-01-12T05:34:50Z","updated_at":"2015-09-08T17:08:19Z","pushed_at":"2015-09-24T05:17:04Z","git_url":"git://github.com/mjbrown/bgapi.git","ssh_url":"git@github.com:mjbrown/bgapi.git","clone_url":"https://github.com/mjbrown/bgapi.git","svn_url":"https://github.com/mjbrown/bgapi","homepage":"","size":445,"stargazers_count":5,"watchers_count":5,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":1,"forks":4,"open_issues":1,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mjbrown/bgapi/pulls/5"},"html":{"href":"https://github.com/mjbrown/bgapi/pull/5"},"issue":{"href":"https://api.github.com/repos/mjbrown/bgapi/issues/5"},"comments":{"href":"https://api.github.com/repos/mjbrown/bgapi/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/mjbrown/bgapi/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/mjbrown/bgapi/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mjbrown/bgapi/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/mjbrown/bgapi/statuses/e6ca6592c92730bd2ac12e2d231d751f4167593b"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"mjbrown","id":1373715,"avatar_url":"https://avatars.githubusercontent.com/u/1373715?v=3","gravatar_id":"","url":"https://api.github.com/users/mjbrown","html_url":"https://github.com/mjbrown","followers_url":"https://api.github.com/users/mjbrown/followers","following_url":"https://api.github.com/users/mjbrown/following{/other_user}","gists_url":"https://api.github.com/users/mjbrown/gists{/gist_id}","starred_url":"https://api.github.com/users/mjbrown/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjbrown/subscriptions","organizations_url":"https://api.github.com/users/mjbrown/orgs","repos_url":"https://api.github.com/users/mjbrown/repos","events_url":"https://api.github.com/users/mjbrown/events{/privacy}","received_events_url":"https://api.github.com/users/mjbrown/received_events","type":"User","site_admin":false},"comments":2,"review_comments":0,"commits":2,"additions":8,"deletions":10,"changed_files":1}}