{"action":"created","comment":{"url":"https://api.github.com/repos/home-assistant/home-assistant/pulls/comments/67602547","id":67602547,"diff_hunk":"@@ -5,13 +5,28 @@\n https://home-assistant.io/components/wink/\n \"\"\"\n import logging\n+import json\n \n-from homeassistant.const import CONF_ACCESS_TOKEN, ATTR_BATTERY_LEVEL\n from homeassistant.helpers import validate_config, discovery\n from homeassistant.helpers.entity import ToggleEntity\n+from homeassistant import bootstrap","path":"homeassistant/components/wink.py","position":9,"original_position":9,"commit_id":"aa9d011611ce92869ad17185a170b4cad85cd069","original_commit_id":"aa9d011611ce92869ad17185a170b4cad85cd069","user":{"login":"balloobbot","id":16367972,"avatar_url":"https://avatars.githubusercontent.com/u/16367972?v=3","gravatar_id":"","url":"https://api.github.com/users/balloobbot","html_url":"https://github.com/balloobbot","followers_url":"https://api.github.com/users/balloobbot/followers","following_url":"https://api.github.com/users/balloobbot/following{/other_user}","gists_url":"https://api.github.com/users/balloobbot/gists{/gist_id}","starred_url":"https://api.github.com/users/balloobbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/balloobbot/subscriptions","organizations_url":"https://api.github.com/users/balloobbot/orgs","repos_url":"https://api.github.com/users/balloobbot/repos","events_url":"https://api.github.com/users/balloobbot/events{/privacy}","received_events_url":"https://api.github.com/users/balloobbot/received_events","type":"User","site_admin":false},"body":"_[farcy v1.1](https://github.com/appfolio/farcy)_\n* 1: F401 'bootstrap' imported but unused","created_at":"2016-06-18T15:41:23Z","updated_at":"2016-06-18T15:41:23Z","html_url":"https://github.com/home-assistant/home-assistant/pull/2324#discussion_r67602547","pull_request_url":"https://api.github.com/repos/home-assistant/home-assistant/pulls/2324","_links":{"self":{"href":"https://api.github.com/repos/home-assistant/home-assistant/pulls/comments/67602547"},"html":{"href":"https://github.com/home-assistant/home-assistant/pull/2324#discussion_r67602547"},"pull_request":{"href":"https://api.github.com/repos/home-assistant/home-assistant/pulls/2324"}}},"pull_request":{"url":"https://api.github.com/repos/home-assistant/home-assistant/pulls/2324","id":74340132,"html_url":"https://github.com/home-assistant/home-assistant/pull/2324","diff_url":"https://github.com/home-assistant/home-assistant/pull/2324.diff","patch_url":"https://github.com/home-assistant/home-assistant/pull/2324.patch","issue_url":"https://api.github.com/repos/home-assistant/home-assistant/issues/2324","number":2324,"state":"open","locked":false,"title":"Wink pubnub subscription support and base Wink device","user":{"login":"w1ll1am23","id":6432770,"avatar_url":"https://avatars.githubusercontent.com/u/6432770?v=3","gravatar_id":"","url":"https://api.github.com/users/w1ll1am23","html_url":"https://github.com/w1ll1am23","followers_url":"https://api.github.com/users/w1ll1am23/followers","following_url":"https://api.github.com/users/w1ll1am23/following{/other_user}","gists_url":"https://api.github.com/users/w1ll1am23/gists{/gist_id}","starred_url":"https://api.github.com/users/w1ll1am23/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/w1ll1am23/subscriptions","organizations_url":"https://api.github.com/users/w1ll1am23/orgs","repos_url":"https://api.github.com/users/w1ll1am23/repos","events_url":"https://api.github.com/users/w1ll1am23/events{/privacy}","received_events_url":"https://api.github.com/users/w1ll1am23/received_events","type":"User","site_admin":false},"body":"**Description:**\r\nThis will migrate all Wink devices from the current polling method of updating to a push based update. This results in faster updates. This PR also creates a base Wink device that all other devices extend from which should make future updates easier. \r\n\r\nI have tested powerstrips, lights, binary sensors, sensors, and locks. I don't own a garage door, or any non-wink z-wave devices so if anyone could test those out that would be cool.\r\n\r\nThere are two minor issues I have noticed.\r\n1. Occasionally the state will not update. Based on some testing it looks like the pubnub updates come in out of order. The new state followed by the old state. Doesn't happen often and I think I have noticed it in the official Wink app too so it might not be possible to fix it.\r\n2. This one is strange but I noticed that after ~8 hours (could be less) of inactivity, state stop functioning until I manually change the state of a light bulb and then everything starts functioning again. I have fixed this temporarily by running a script every hour to turn a light on and then off. I also just updated the pubnub version from 3.7.6 to 3.7.8 in this PR so I am not sure if this issue remains.\r\n\r\nShould a configuration option be added to switch back to polling based updates?\r\n\r\nI will be out of town starting tomorrow 6/19-6/22 so it may be awhile before I can make any updates that may be required for this PR.\r\n\r\n**Related issue (if applicable):** fixes #2314 \r\n\r\n**Checklist:**\r\n\r\nIf code communicates with devices:\r\n  - [] Local tests with `tox` run successfully. **Your PR cannot be merged unless tests pass**\r\n  - [X] New dependencies have been added to the `REQUIREMENTS` variable ([example][ex-requir]).\r\n  - [ ] New dependencies are only imported inside functions that use them ([example][ex-import]).\r\n  - [X] New dependencies have been added to `requirements_all.txt` by running `script/gen_requirements_all.py`.\r\n\r\n[fork]: http://stackoverflow.com/a/7244456\r\n[squash]: https://github.com/ginatrapani/todo.txt-android/wiki/Squash-All-Commits-Related-to-a-Single-Issue-into-a-Single-Commit\r\n[ex-requir]: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/keyboard.py#L16\r\n[ex-import]: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/keyboard.py#L51\r\n\r\n","created_at":"2016-06-18T15:41:02Z","updated_at":"2016-06-18T15:41:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"363e7982658a2321783fb79252f45edf3773f7e9","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/home-assistant/home-assistant/pulls/2324/commits","review_comments_url":"https://api.github.com/repos/home-assistant/home-assistant/pulls/2324/comments","review_comment_url":"https://api.github.com/repos/home-assistant/home-assistant/pulls/comments{/number}","comments_url":"https://api.github.com/repos/home-assistant/home-assistant/issues/2324/comments","statuses_url":"https://api.github.com/repos/home-assistant/home-assistant/statuses/aa9d011611ce92869ad17185a170b4cad85cd069","head":{"label":"w1ll1am23:wink_pubnub","ref":"wink_pubnub","sha":"aa9d011611ce92869ad17185a170b4cad85cd069","user":{"login":"w1ll1am23","id":6432770,"avatar_url":"https://avatars.githubusercontent.com/u/6432770?v=3","gravatar_id":"","url":"https://api.github.com/users/w1ll1am23","html_url":"https://github.com/w1ll1am23","followers_url":"https://api.github.com/users/w1ll1am23/followers","following_url":"https://api.github.com/users/w1ll1am23/following{/other_user}","gists_url":"https://api.github.com/users/w1ll1am23/gists{/gist_id}","starred_url":"https://api.github.com/users/w1ll1am23/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/w1ll1am23/subscriptions","organizations_url":"https://api.github.com/users/w1ll1am23/orgs","repos_url":"https://api.github.com/users/w1ll1am23/repos","events_url":"https://api.github.com/users/w1ll1am23/events{/privacy}","received_events_url":"https://api.github.com/users/w1ll1am23/received_events","type":"User","site_admin":false},"repo":{"id":49031551,"name":"home-assistant","full_name":"w1ll1am23/home-assistant","owner":{"login":"w1ll1am23","id":6432770,"avatar_url":"https://avatars.githubusercontent.com/u/6432770?v=3","gravatar_id":"","url":"https://api.github.com/users/w1ll1am23","html_url":"https://github.com/w1ll1am23","followers_url":"https://api.github.com/users/w1ll1am23/followers","following_url":"https://api.github.com/users/w1ll1am23/following{/other_user}","gists_url":"https://api.github.com/users/w1ll1am23/gists{/gist_id}","starred_url":"https://api.github.com/users/w1ll1am23/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/w1ll1am23/subscriptions","organizations_url":"https://api.github.com/users/w1ll1am23/orgs","repos_url":"https://api.github.com/users/w1ll1am23/repos","events_url":"https://api.github.com/users/w1ll1am23/events{/privacy}","received_events_url":"https://api.github.com/users/w1ll1am23/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/w1ll1am23/home-assistant","description":"Open-source home automation platform running on Python 3","fork":true,"url":"https://api.github.com/repos/w1ll1am23/home-assistant","forks_url":"https://api.github.com/repos/w1ll1am23/home-assistant/forks","keys_url":"https://api.github.com/repos/w1ll1am23/home-assistant/keys{/key_id}","collaborators_url":"https://api.github.com/repos/w1ll1am23/home-assistant/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/w1ll1am23/home-assistant/teams","hooks_url":"https://api.github.com/repos/w1ll1am23/home-assistant/hooks","issue_events_url":"https://api.github.com/repos/w1ll1am23/home-assistant/issues/events{/number}","events_url":"https://api.github.com/repos/w1ll1am23/home-assistant/events","assignees_url":"https://api.github.com/repos/w1ll1am23/home-assistant/assignees{/user}","branches_url":"https://api.github.com/repos/w1ll1am23/home-assistant/branches{/branch}","tags_url":"https://api.github.com/repos/w1ll1am23/home-assistant/tags","blobs_url":"https://api.github.com/repos/w1ll1am23/home-assistant/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/w1ll1am23/home-assistant/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/w1ll1am23/home-assistant/git/refs{/sha}","trees_url":"https://api.github.com/repos/w1ll1am23/home-assistant/git/trees{/sha}","statuses_url":"https://api.github.com/repos/w1ll1am23/home-assistant/statuses/{sha}","languages_url":"https://api.github.com/repos/w1ll1am23/home-assistant/languages","stargazers_url":"https://api.github.com/repos/w1ll1am23/home-assistant/stargazers","contributors_url":"https://api.github.com/repos/w1ll1am23/home-assistant/contributors","subscribers_url":"https://api.github.com/repos/w1ll1am23/home-assistant/subscribers","subscription_url":"https://api.github.com/repos/w1ll1am23/home-assistant/subscription","commits_url":"https://api.github.com/repos/w1ll1am23/home-assistant/commits{/sha}","git_commits_url":"https://api.github.com/repos/w1ll1am23/home-assistant/git/commits{/sha}","comments_url":"https://api.github.com/repos/w1ll1am23/home-assistant/comments{/number}","issue_comment_url":"https://api.github.com/repos/w1ll1am23/home-assistant/issues/comments{/number}","contents_url":"https://api.github.com/repos/w1ll1am23/home-assistant/contents/{+path}","compare_url":"https://api.github.com/repos/w1ll1am23/home-assistant/compare/{base}...{head}","merges_url":"https://api.github.com/repos/w1ll1am23/home-assistant/merges","archive_url":"https://api.github.com/repos/w1ll1am23/home-assistant/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/w1ll1am23/home-assistant/downloads","issues_url":"https://api.github.com/repos/w1ll1am23/home-assistant/issues{/number}","pulls_url":"https://api.github.com/repos/w1ll1am23/home-assistant/pulls{/number}","milestones_url":"https://api.github.com/repos/w1ll1am23/home-assistant/milestones{/number}","notifications_url":"https://api.github.com/repos/w1ll1am23/home-assistant/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/w1ll1am23/home-assistant/labels{/name}","releases_url":"https://api.github.com/repos/w1ll1am23/home-assistant/releases{/id}","deployments_url":"https://api.github.com/repos/w1ll1am23/home-assistant/deployments","created_at":"2016-01-05T00:23:59Z","updated_at":"2016-01-29T21:38:06Z","pushed_at":"2016-06-18T15:35:31Z","git_url":"git://github.com/w1ll1am23/home-assistant.git","ssh_url":"git@github.com:w1ll1am23/home-assistant.git","clone_url":"https://github.com/w1ll1am23/home-assistant.git","svn_url":"https://github.com/w1ll1am23/home-assistant","homepage":"https://home-assistant.io","size":48663,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"dev"}},"base":{"label":"home-assistant:dev","ref":"dev","sha":"e7ea6ecf5ad764c45d677e4546a4f1079f9cb969","user":{"login":"home-assistant","id":13844975,"avatar_url":"https://avatars.githubusercontent.com/u/13844975?v=3","gravatar_id":"","url":"https://api.github.com/users/home-assistant","html_url":"https://github.com/home-assistant","followers_url":"https://api.github.com/users/home-assistant/followers","following_url":"https://api.github.com/users/home-assistant/following{/other_user}","gists_url":"https://api.github.com/users/home-assistant/gists{/gist_id}","starred_url":"https://api.github.com/users/home-assistant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/home-assistant/subscriptions","organizations_url":"https://api.github.com/users/home-assistant/orgs","repos_url":"https://api.github.com/users/home-assistant/repos","events_url":"https://api.github.com/users/home-assistant/events{/privacy}","received_events_url":"https://api.github.com/users/home-assistant/received_events","type":"Organization","site_admin":false},"repo":{"id":12888993,"name":"home-assistant","full_name":"home-assistant/home-assistant","owner":{"login":"home-assistant","id":13844975,"avatar_url":"https://avatars.githubusercontent.com/u/13844975?v=3","gravatar_id":"","url":"https://api.github.com/users/home-assistant","html_url":"https://github.com/home-assistant","followers_url":"https://api.github.com/users/home-assistant/followers","following_url":"https://api.github.com/users/home-assistant/following{/other_user}","gists_url":"https://api.github.com/users/home-assistant/gists{/gist_id}","starred_url":"https://api.github.com/users/home-assistant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/home-assistant/subscriptions","organizations_url":"https://api.github.com/users/home-assistant/orgs","repos_url":"https://api.github.com/users/home-assistant/repos","events_url":"https://api.github.com/users/home-assistant/events{/privacy}","received_events_url":"https://api.github.com/users/home-assistant/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/home-assistant/home-assistant","description":":house_with_garden: Open-source home automation platform running on Python 3","fork":false,"url":"https://api.github.com/repos/home-assistant/home-assistant","forks_url":"https://api.github.com/repos/home-assistant/home-assistant/forks","keys_url":"https://api.github.com/repos/home-assistant/home-assistant/keys{/key_id}","collaborators_url":"https://api.github.com/repos/home-assistant/home-assistant/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/home-assistant/home-assistant/teams","hooks_url":"https://api.github.com/repos/home-assistant/home-assistant/hooks","issue_events_url":"https://api.github.com/repos/home-assistant/home-assistant/issues/events{/number}","events_url":"https://api.github.com/repos/home-assistant/home-assistant/events","assignees_url":"https://api.github.com/repos/home-assistant/home-assistant/assignees{/user}","branches_url":"https://api.github.com/repos/home-assistant/home-assistant/branches{/branch}","tags_url":"https://api.github.com/repos/home-assistant/home-assistant/tags","blobs_url":"https://api.github.com/repos/home-assistant/home-assistant/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/home-assistant/home-assistant/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/home-assistant/home-assistant/git/refs{/sha}","trees_url":"https://api.github.com/repos/home-assistant/home-assistant/git/trees{/sha}","statuses_url":"https://api.github.com/repos/home-assistant/home-assistant/statuses/{sha}","languages_url":"https://api.github.com/repos/home-assistant/home-assistant/languages","stargazers_url":"https://api.github.com/repos/home-assistant/home-assistant/stargazers","contributors_url":"https://api.github.com/repos/home-assistant/home-assistant/contributors","subscribers_url":"https://api.github.com/repos/home-assistant/home-assistant/subscribers","subscription_url":"https://api.github.com/repos/home-assistant/home-assistant/subscription","commits_url":"https://api.github.com/repos/home-assistant/home-assistant/commits{/sha}","git_commits_url":"https://api.github.com/repos/home-assistant/home-assistant/git/commits{/sha}","comments_url":"https://api.github.com/repos/home-assistant/home-assistant/comments{/number}","issue_comment_url":"https://api.github.com/repos/home-assistant/home-assistant/issues/comments{/number}","contents_url":"https://api.github.com/repos/home-assistant/home-assistant/contents/{+path}","compare_url":"https://api.github.com/repos/home-assistant/home-assistant/compare/{base}...{head}","merges_url":"https://api.github.com/repos/home-assistant/home-assistant/merges","archive_url":"https://api.github.com/repos/home-assistant/home-assistant/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/home-assistant/home-assistant/downloads","issues_url":"https://api.github.com/repos/home-assistant/home-assistant/issues{/number}","pulls_url":"https://api.github.com/repos/home-assistant/home-assistant/pulls{/number}","milestones_url":"https://api.github.com/repos/home-assistant/home-assistant/milestones{/number}","notifications_url":"https://api.github.com/repos/home-assistant/home-assistant/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/home-assistant/home-assistant/labels{/name}","releases_url":"https://api.github.com/repos/home-assistant/home-assistant/releases{/id}","deployments_url":"https://api.github.com/repos/home-assistant/home-assistant/deployments","created_at":"2013-09-17T07:29:48Z","updated_at":"2016-06-18T12:00:41Z","pushed_at":"2016-06-18T15:41:04Z","git_url":"git://github.com/home-assistant/home-assistant.git","ssh_url":"git@github.com:home-assistant/home-assistant.git","clone_url":"https://github.com/home-assistant/home-assistant.git","svn_url":"https://github.com/home-assistant/home-assistant","homepage":"https://home-assistant.io","size":80014,"stargazers_count":3575,"watchers_count":3575,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":768,"mirror_url":null,"open_issues_count":171,"forks":768,"open_issues":171,"watchers":3575,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/home-assistant/home-assistant/pulls/2324"},"html":{"href":"https://github.com/home-assistant/home-assistant/pull/2324"},"issue":{"href":"https://api.github.com/repos/home-assistant/home-assistant/issues/2324"},"comments":{"href":"https://api.github.com/repos/home-assistant/home-assistant/issues/2324/comments"},"review_comments":{"href":"https://api.github.com/repos/home-assistant/home-assistant/pulls/2324/comments"},"review_comment":{"href":"https://api.github.com/repos/home-assistant/home-assistant/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/home-assistant/home-assistant/pulls/2324/commits"},"statuses":{"href":"https://api.github.com/repos/home-assistant/home-assistant/statuses/aa9d011611ce92869ad17185a170b4cad85cd069"}}}}
{"actor":{"display_login":"balloobbot"}}