{"action":"created","comment":{"url":"https://api.github.com/repos/home-assistant/home-assistant/pulls/comments/92919345","pull_request_review_id":13444532,"id":92919345,"diff_hunk":"@@ -15,20 +19,49 @@\n     SUPPORT_TURN_OFF, MediaPlayerDevice, PLATFORM_SCHEMA)\n from homeassistant.const import (\n     STATE_IDLE, STATE_OFF, STATE_PAUSED, STATE_PLAYING, CONF_HOST, CONF_NAME,\n-    CONF_PORT, CONF_USERNAME, CONF_PASSWORD)\n+    CONF_PORT, CONF_USERNAME, CONF_PASSWORD, EVENT_HOMEASSISTANT_STOP)\n import homeassistant.helpers.config_validation as cv\n \n-REQUIREMENTS = ['jsonrpc-requests==0.3']\n+REQUIREMENTS = ['websockets==3.2']\n \n _LOGGER = logging.getLogger(__name__)\n \n+CONF_WEBSOCKET_PORT = 'websocket_port'","path":"homeassistant/components/media_player/kodi.py","position":27,"original_position":27,"commit_id":"5c09a2617fffce7ef7b01fbd96ae24576e489562","original_commit_id":"5c09a2617fffce7ef7b01fbd96ae24576e489562","user":{"login":"lwis","id":873275,"avatar_url":"https://avatars.githubusercontent.com/u/873275?v=3","gravatar_id":"","url":"https://api.github.com/users/lwis","html_url":"https://github.com/lwis","followers_url":"https://api.github.com/users/lwis/followers","following_url":"https://api.github.com/users/lwis/following{/other_user}","gists_url":"https://api.github.com/users/lwis/gists{/gist_id}","starred_url":"https://api.github.com/users/lwis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lwis/subscriptions","organizations_url":"https://api.github.com/users/lwis/orgs","repos_url":"https://api.github.com/users/lwis/repos","events_url":"https://api.github.com/users/lwis/events{/privacy}","received_events_url":"https://api.github.com/users/lwis/received_events","type":"User","site_admin":false},"body":"We should call this the TCP port, as it may be used for other things in the future (and that's how Kodi describe it today)","created_at":"2016-12-17T10:25:54Z","updated_at":"2016-12-17T10:25:54Z","html_url":"https://github.com/home-assistant/home-assistant/pull/4951#discussion_r92919345","pull_request_url":"https://api.github.com/repos/home-assistant/home-assistant/pulls/4951","_links":{"self":{"href":"https://api.github.com/repos/home-assistant/home-assistant/pulls/comments/92919345"},"html":{"href":"https://github.com/home-assistant/home-assistant/pull/4951#discussion_r92919345"},"pull_request":{"href":"https://api.github.com/repos/home-assistant/home-assistant/pulls/4951"}}},"pull_request":{"url":"https://api.github.com/repos/home-assistant/home-assistant/pulls/4951","id":98433143,"html_url":"https://github.com/home-assistant/home-assistant/pull/4951","diff_url":"https://github.com/home-assistant/home-assistant/pull/4951.diff","patch_url":"https://github.com/home-assistant/home-assistant/pull/4951.patch","issue_url":"https://api.github.com/repos/home-assistant/home-assistant/issues/4951","number":4951,"state":"open","locked":false,"title":"Update kodi for async and local push via websocket","user":{"login":"armills","id":1386547,"avatar_url":"https://avatars.githubusercontent.com/u/1386547?v=3","gravatar_id":"","url":"https://api.github.com/users/armills","html_url":"https://github.com/armills","followers_url":"https://api.github.com/users/armills/followers","following_url":"https://api.github.com/users/armills/following{/other_user}","gists_url":"https://api.github.com/users/armills/gists{/gist_id}","starred_url":"https://api.github.com/users/armills/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/armills/subscriptions","organizations_url":"https://api.github.com/users/armills/orgs","repos_url":"https://api.github.com/users/armills/repos","events_url":"https://api.github.com/users/armills/events{/privacy}","received_events_url":"https://api.github.com/users/armills/received_events","type":"User","site_admin":false},"body":"**Description:**\r\nThis PR converts Kodi to async. Included is an async interface to the Kodi websockets API, which allows push notifications of state changes from Kodi to Home Assistant.\r\n\r\nI wasn't able to find a Python asyncio JSON-RPC library that also supports Python 3.4, so JSON-RPC methods are included here. If there is a library I can switch to it, or this functionality can be moved to a helper object if we expect to reuse it.\r\n\r\nThis change requires that 'http://' be removed from user configurations. This brings Kodi in line with other platform configurations. Code is included to strip it where found and issue a log warning.\r\n\r\n**Pull request in [home-assistant.github.io](https://github.com/home-assistant/home-assistant.github.io) with documentation (if applicable):** home-assistant/home-assistant.github.io#<home-assistant.github.io PR number goes here>\r\n\r\n**Example entry for `configuration.yaml` (if applicable):**\r\n```yaml\r\nmedia_player:\r\n  - platform: kodi\r\n    host: 192.168.0.123\r\n    websocket_port: 9090\r\n```\r\n\r\n**Checklist:**\r\n\r\nIf user exposed functionality or configuration variables are added/changed:\r\n  - [ ] Documentation added/updated in [home-assistant.github.io](https://github.com/home-assistant/home-assistant.github.io)\r\n\r\nIf the code communicates with devices, web services, or third-party tools:\r\n  - [x] 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  - [x] 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[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","created_at":"2016-12-17T04:42:39Z","updated_at":"2016-12-17T10:25:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d8fb46a3c8d395d38be02d9df8b87e32bec39bba","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/home-assistant/home-assistant/pulls/4951/commits","review_comments_url":"https://api.github.com/repos/home-assistant/home-assistant/pulls/4951/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/4951/comments","statuses_url":"https://api.github.com/repos/home-assistant/home-assistant/statuses/5c09a2617fffce7ef7b01fbd96ae24576e489562","head":{"label":"armills:kodi-push","ref":"kodi-push","sha":"5c09a2617fffce7ef7b01fbd96ae24576e489562","user":{"login":"armills","id":1386547,"avatar_url":"https://avatars.githubusercontent.com/u/1386547?v=3","gravatar_id":"","url":"https://api.github.com/users/armills","html_url":"https://github.com/armills","followers_url":"https://api.github.com/users/armills/followers","following_url":"https://api.github.com/users/armills/following{/other_user}","gists_url":"https://api.github.com/users/armills/gists{/gist_id}","starred_url":"https://api.github.com/users/armills/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/armills/subscriptions","organizations_url":"https://api.github.com/users/armills/orgs","repos_url":"https://api.github.com/users/armills/repos","events_url":"https://api.github.com/users/armills/events{/privacy}","received_events_url":"https://api.github.com/users/armills/received_events","type":"User","site_admin":false},"repo":{"id":60287084,"name":"home-assistant","full_name":"armills/home-assistant","owner":{"login":"armills","id":1386547,"avatar_url":"https://avatars.githubusercontent.com/u/1386547?v=3","gravatar_id":"","url":"https://api.github.com/users/armills","html_url":"https://github.com/armills","followers_url":"https://api.github.com/users/armills/followers","following_url":"https://api.github.com/users/armills/following{/other_user}","gists_url":"https://api.github.com/users/armills/gists{/gist_id}","starred_url":"https://api.github.com/users/armills/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/armills/subscriptions","organizations_url":"https://api.github.com/users/armills/orgs","repos_url":"https://api.github.com/users/armills/repos","events_url":"https://api.github.com/users/armills/events{/privacy}","received_events_url":"https://api.github.com/users/armills/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/armills/home-assistant","description":":house_with_garden: Open-source home automation platform running on Python 3","fork":true,"url":"https://api.github.com/repos/armills/home-assistant","forks_url":"https://api.github.com/repos/armills/home-assistant/forks","keys_url":"https://api.github.com/repos/armills/home-assistant/keys{/key_id}","collaborators_url":"https://api.github.com/repos/armills/home-assistant/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/armills/home-assistant/teams","hooks_url":"https://api.github.com/repos/armills/home-assistant/hooks","issue_events_url":"https://api.github.com/repos/armills/home-assistant/issues/events{/number}","events_url":"https://api.github.com/repos/armills/home-assistant/events","assignees_url":"https://api.github.com/repos/armills/home-assistant/assignees{/user}","branches_url":"https://api.github.com/repos/armills/home-assistant/branches{/branch}","tags_url":"https://api.github.com/repos/armills/home-assistant/tags","blobs_url":"https://api.github.com/repos/armills/home-assistant/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/armills/home-assistant/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/armills/home-assistant/git/refs{/sha}","trees_url":"https://api.github.com/repos/armills/home-assistant/git/trees{/sha}","statuses_url":"https://api.github.com/repos/armills/home-assistant/statuses/{sha}","languages_url":"https://api.github.com/repos/armills/home-assistant/languages","stargazers_url":"https://api.github.com/repos/armills/home-assistant/stargazers","contributors_url":"https://api.github.com/repos/armills/home-assistant/contributors","subscribers_url":"https://api.github.com/repos/armills/home-assistant/subscribers","subscription_url":"https://api.github.com/repos/armills/home-assistant/subscription","commits_url":"https://api.github.com/repos/armills/home-assistant/commits{/sha}","git_commits_url":"https://api.github.com/repos/armills/home-assistant/git/commits{/sha}","comments_url":"https://api.github.com/repos/armills/home-assistant/comments{/number}","issue_comment_url":"https://api.github.com/repos/armills/home-assistant/issues/comments{/number}","contents_url":"https://api.github.com/repos/armills/home-assistant/contents/{+path}","compare_url":"https://api.github.com/repos/armills/home-assistant/compare/{base}...{head}","merges_url":"https://api.github.com/repos/armills/home-assistant/merges","archive_url":"https://api.github.com/repos/armills/home-assistant/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/armills/home-assistant/downloads","issues_url":"https://api.github.com/repos/armills/home-assistant/issues{/number}","pulls_url":"https://api.github.com/repos/armills/home-assistant/pulls{/number}","milestones_url":"https://api.github.com/repos/armills/home-assistant/milestones{/number}","notifications_url":"https://api.github.com/repos/armills/home-assistant/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/armills/home-assistant/labels{/name}","releases_url":"https://api.github.com/repos/armills/home-assistant/releases{/id}","deployments_url":"https://api.github.com/repos/armills/home-assistant/deployments","created_at":"2016-06-02T18:17:19Z","updated_at":"2016-06-02T18:17:21Z","pushed_at":"2016-12-17T04:33:12Z","git_url":"git://github.com/armills/home-assistant.git","ssh_url":"git@github.com:armills/home-assistant.git","clone_url":"https://github.com/armills/home-assistant.git","svn_url":"https://github.com/armills/home-assistant","homepage":"https://home-assistant.io","size":85299,"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":"6d6abab358e30f558a01dfc44f0c2f73daad135c","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-12-17T07:39:18Z","pushed_at":"2016-12-17T07:24:40Z","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":45823,"stargazers_count":5040,"watchers_count":5040,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1338,"mirror_url":null,"open_issues_count":349,"forks":1338,"open_issues":349,"watchers":5040,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/home-assistant/home-assistant/pulls/4951"},"html":{"href":"https://github.com/home-assistant/home-assistant/pull/4951"},"issue":{"href":"https://api.github.com/repos/home-assistant/home-assistant/issues/4951"},"comments":{"href":"https://api.github.com/repos/home-assistant/home-assistant/issues/4951/comments"},"review_comments":{"href":"https://api.github.com/repos/home-assistant/home-assistant/pulls/4951/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/4951/commits"},"statuses":{"href":"https://api.github.com/repos/home-assistant/home-assistant/statuses/5c09a2617fffce7ef7b01fbd96ae24576e489562"}}}}
{"actor":{"display_login":"lwis"}}