{"action":"created","comment":{"url":"https://api.github.com/repos/balloob/home-assistant/pulls/comments/50198362","id":50198362,"diff_hunk":"@@ -38,12 +38,23 @@\n def setup_platform(hass, config, add_devices, discovery_info=None):\n     \"\"\" Sets up the Sonos platform. \"\"\"\n     import soco\n+    import socket\n \n     if discovery_info:\n         add_devices([SonosDevice(hass, soco.SoCo(discovery_info))])\n         return True\n \n-    players = soco.discover()\n+    players = None\n+    hosts = config.get('hosts', None)\n+    if hosts:\n+        players = []\n+        for host in hosts.split(\",\"):\n+            host = socket.gethostbyname(host)\n+            _LOGGER.warning(\"Sonos host %s\" % host)","path":"homeassistant/components/media_player/sonos.py","position":17,"original_position":17,"commit_id":"39804b41854da3c74cffc64daf6be276d4899153","original_commit_id":"39804b41854da3c74cffc64daf6be276d4899153","user":{"login":"trollkarlen","id":91164,"avatar_url":"https://avatars.githubusercontent.com/u/91164?v=3","gravatar_id":"","url":"https://api.github.com/users/trollkarlen","html_url":"https://github.com/trollkarlen","followers_url":"https://api.github.com/users/trollkarlen/followers","following_url":"https://api.github.com/users/trollkarlen/following{/other_user}","gists_url":"https://api.github.com/users/trollkarlen/gists{/gist_id}","starred_url":"https://api.github.com/users/trollkarlen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trollkarlen/subscriptions","organizations_url":"https://api.github.com/users/trollkarlen/orgs","repos_url":"https://api.github.com/users/trollkarlen/repos","events_url":"https://api.github.com/users/trollkarlen/events{/privacy}","received_events_url":"https://api.github.com/users/trollkarlen/received_events","type":"User","site_admin":false},"body":"Sry it was an debug print left unintentionally.\nNo other comments?\n\n/R\n\nOn Tue, Jan 19, 2016, 20:43 Paulus Schoutsen <notifications@github.com>\nwrote:\n\n> In homeassistant/components/media_player/sonos.py\n> <https://github.com/balloob/home-assistant/pull/937#discussion_r50163948>:\n>\n> >\n> >      if discovery_info:\n> >          add_devices([SonosDevice(hass, soco.SoCo(discovery_info))])\n> >          return True\n> >\n> > -    players = soco.discover()\n> > +    players = None\n> > +    hosts = config.get('hosts', None)\n> > +    if hosts:\n> > +        players = []\n> > +        for host in hosts.split(\",\"):\n> > +            host = socket.gethostbyname(host)\n> > +            _LOGGER.warning(\"Sonos host %s\" % host)\n>\n> Warning should only be used for non-fatal errors.\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/balloob/home-assistant/pull/937/files#r50163948>.\n>\n","created_at":"2016-01-20T00:26:14Z","updated_at":"2016-01-20T00:26:14Z","html_url":"https://github.com/balloob/home-assistant/pull/937#discussion_r50198362","pull_request_url":"https://api.github.com/repos/balloob/home-assistant/pulls/937","_links":{"self":{"href":"https://api.github.com/repos/balloob/home-assistant/pulls/comments/50198362"},"html":{"href":"https://github.com/balloob/home-assistant/pull/937#discussion_r50198362"},"pull_request":{"href":"https://api.github.com/repos/balloob/home-assistant/pulls/937"}}},"pull_request":{"url":"https://api.github.com/repos/balloob/home-assistant/pulls/937","id":56506632,"html_url":"https://github.com/balloob/home-assistant/pull/937","diff_url":"https://github.com/balloob/home-assistant/pull/937.diff","patch_url":"https://github.com/balloob/home-assistant/pull/937.patch","issue_url":"https://api.github.com/repos/balloob/home-assistant/issues/937","number":937,"state":"open","locked":false,"title":"sonos: add hosts and interface_addr to sonos config","user":{"login":"trollkarlen","id":91164,"avatar_url":"https://avatars.githubusercontent.com/u/91164?v=3","gravatar_id":"","url":"https://api.github.com/users/trollkarlen","html_url":"https://github.com/trollkarlen","followers_url":"https://api.github.com/users/trollkarlen/followers","following_url":"https://api.github.com/users/trollkarlen/following{/other_user}","gists_url":"https://api.github.com/users/trollkarlen/gists{/gist_id}","starred_url":"https://api.github.com/users/trollkarlen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trollkarlen/subscriptions","organizations_url":"https://api.github.com/users/trollkarlen/orgs","repos_url":"https://api.github.com/users/trollkarlen/repos","events_url":"https://api.github.com/users/trollkarlen/events{/privacy}","received_events_url":"https://api.github.com/users/trollkarlen/received_events","type":"User","site_admin":false},"body":"Config can now specify one or more hosts to connect and\r\nalso a interface_addr to multicast on if multiple interfaces exists.\r\n\r\nSigned-off-by: Robert Marklund <robbelibobban@gmail.com>","created_at":"2016-01-19T18:34:49Z","updated_at":"2016-01-20T00:26:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5f1bb54a8f6f9a509f16688475f1585da86636fe","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/balloob/home-assistant/pulls/937/commits","review_comments_url":"https://api.github.com/repos/balloob/home-assistant/pulls/937/comments","review_comment_url":"https://api.github.com/repos/balloob/home-assistant/pulls/comments{/number}","comments_url":"https://api.github.com/repos/balloob/home-assistant/issues/937/comments","statuses_url":"https://api.github.com/repos/balloob/home-assistant/statuses/39804b41854da3c74cffc64daf6be276d4899153","head":{"label":"trollkarlen:sonos-multicast","ref":"sonos-multicast","sha":"39804b41854da3c74cffc64daf6be276d4899153","user":{"login":"trollkarlen","id":91164,"avatar_url":"https://avatars.githubusercontent.com/u/91164?v=3","gravatar_id":"","url":"https://api.github.com/users/trollkarlen","html_url":"https://github.com/trollkarlen","followers_url":"https://api.github.com/users/trollkarlen/followers","following_url":"https://api.github.com/users/trollkarlen/following{/other_user}","gists_url":"https://api.github.com/users/trollkarlen/gists{/gist_id}","starred_url":"https://api.github.com/users/trollkarlen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trollkarlen/subscriptions","organizations_url":"https://api.github.com/users/trollkarlen/orgs","repos_url":"https://api.github.com/users/trollkarlen/repos","events_url":"https://api.github.com/users/trollkarlen/events{/privacy}","received_events_url":"https://api.github.com/users/trollkarlen/received_events","type":"User","site_admin":false},"repo":{"id":49973666,"name":"home-assistant","full_name":"trollkarlen/home-assistant","owner":{"login":"trollkarlen","id":91164,"avatar_url":"https://avatars.githubusercontent.com/u/91164?v=3","gravatar_id":"","url":"https://api.github.com/users/trollkarlen","html_url":"https://github.com/trollkarlen","followers_url":"https://api.github.com/users/trollkarlen/followers","following_url":"https://api.github.com/users/trollkarlen/following{/other_user}","gists_url":"https://api.github.com/users/trollkarlen/gists{/gist_id}","starred_url":"https://api.github.com/users/trollkarlen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trollkarlen/subscriptions","organizations_url":"https://api.github.com/users/trollkarlen/orgs","repos_url":"https://api.github.com/users/trollkarlen/repos","events_url":"https://api.github.com/users/trollkarlen/events{/privacy}","received_events_url":"https://api.github.com/users/trollkarlen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/trollkarlen/home-assistant","description":"Open-source home automation platform running on Python 3","fork":true,"url":"https://api.github.com/repos/trollkarlen/home-assistant","forks_url":"https://api.github.com/repos/trollkarlen/home-assistant/forks","keys_url":"https://api.github.com/repos/trollkarlen/home-assistant/keys{/key_id}","collaborators_url":"https://api.github.com/repos/trollkarlen/home-assistant/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/trollkarlen/home-assistant/teams","hooks_url":"https://api.github.com/repos/trollkarlen/home-assistant/hooks","issue_events_url":"https://api.github.com/repos/trollkarlen/home-assistant/issues/events{/number}","events_url":"https://api.github.com/repos/trollkarlen/home-assistant/events","assignees_url":"https://api.github.com/repos/trollkarlen/home-assistant/assignees{/user}","branches_url":"https://api.github.com/repos/trollkarlen/home-assistant/branches{/branch}","tags_url":"https://api.github.com/repos/trollkarlen/home-assistant/tags","blobs_url":"https://api.github.com/repos/trollkarlen/home-assistant/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/trollkarlen/home-assistant/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/trollkarlen/home-assistant/git/refs{/sha}","trees_url":"https://api.github.com/repos/trollkarlen/home-assistant/git/trees{/sha}","statuses_url":"https://api.github.com/repos/trollkarlen/home-assistant/statuses/{sha}","languages_url":"https://api.github.com/repos/trollkarlen/home-assistant/languages","stargazers_url":"https://api.github.com/repos/trollkarlen/home-assistant/stargazers","contributors_url":"https://api.github.com/repos/trollkarlen/home-assistant/contributors","subscribers_url":"https://api.github.com/repos/trollkarlen/home-assistant/subscribers","subscription_url":"https://api.github.com/repos/trollkarlen/home-assistant/subscription","commits_url":"https://api.github.com/repos/trollkarlen/home-assistant/commits{/sha}","git_commits_url":"https://api.github.com/repos/trollkarlen/home-assistant/git/commits{/sha}","comments_url":"https://api.github.com/repos/trollkarlen/home-assistant/comments{/number}","issue_comment_url":"https://api.github.com/repos/trollkarlen/home-assistant/issues/comments{/number}","contents_url":"https://api.github.com/repos/trollkarlen/home-assistant/contents/{+path}","compare_url":"https://api.github.com/repos/trollkarlen/home-assistant/compare/{base}...{head}","merges_url":"https://api.github.com/repos/trollkarlen/home-assistant/merges","archive_url":"https://api.github.com/repos/trollkarlen/home-assistant/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/trollkarlen/home-assistant/downloads","issues_url":"https://api.github.com/repos/trollkarlen/home-assistant/issues{/number}","pulls_url":"https://api.github.com/repos/trollkarlen/home-assistant/pulls{/number}","milestones_url":"https://api.github.com/repos/trollkarlen/home-assistant/milestones{/number}","notifications_url":"https://api.github.com/repos/trollkarlen/home-assistant/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/trollkarlen/home-assistant/labels{/name}","releases_url":"https://api.github.com/repos/trollkarlen/home-assistant/releases{/id}","created_at":"2016-01-19T18:30:10Z","updated_at":"2016-01-19T18:30:12Z","pushed_at":"2016-01-19T18:34:24Z","git_url":"git://github.com/trollkarlen/home-assistant.git","ssh_url":"git@github.com:trollkarlen/home-assistant.git","clone_url":"https://github.com/trollkarlen/home-assistant.git","svn_url":"https://github.com/trollkarlen/home-assistant","homepage":"https://home-assistant.io","size":37198,"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":"balloob:dev","ref":"dev","sha":"85df9e98bd94f1a84aa7549209feedfce3721f62","user":{"login":"balloob","id":1444314,"avatar_url":"https://avatars.githubusercontent.com/u/1444314?v=3","gravatar_id":"","url":"https://api.github.com/users/balloob","html_url":"https://github.com/balloob","followers_url":"https://api.github.com/users/balloob/followers","following_url":"https://api.github.com/users/balloob/following{/other_user}","gists_url":"https://api.github.com/users/balloob/gists{/gist_id}","starred_url":"https://api.github.com/users/balloob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/balloob/subscriptions","organizations_url":"https://api.github.com/users/balloob/orgs","repos_url":"https://api.github.com/users/balloob/repos","events_url":"https://api.github.com/users/balloob/events{/privacy}","received_events_url":"https://api.github.com/users/balloob/received_events","type":"User","site_admin":false},"repo":{"id":12888993,"name":"home-assistant","full_name":"balloob/home-assistant","owner":{"login":"balloob","id":1444314,"avatar_url":"https://avatars.githubusercontent.com/u/1444314?v=3","gravatar_id":"","url":"https://api.github.com/users/balloob","html_url":"https://github.com/balloob","followers_url":"https://api.github.com/users/balloob/followers","following_url":"https://api.github.com/users/balloob/following{/other_user}","gists_url":"https://api.github.com/users/balloob/gists{/gist_id}","starred_url":"https://api.github.com/users/balloob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/balloob/subscriptions","organizations_url":"https://api.github.com/users/balloob/orgs","repos_url":"https://api.github.com/users/balloob/repos","events_url":"https://api.github.com/users/balloob/events{/privacy}","received_events_url":"https://api.github.com/users/balloob/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/balloob/home-assistant","description":"Open-source home automation platform running on Python 3","fork":false,"url":"https://api.github.com/repos/balloob/home-assistant","forks_url":"https://api.github.com/repos/balloob/home-assistant/forks","keys_url":"https://api.github.com/repos/balloob/home-assistant/keys{/key_id}","collaborators_url":"https://api.github.com/repos/balloob/home-assistant/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/balloob/home-assistant/teams","hooks_url":"https://api.github.com/repos/balloob/home-assistant/hooks","issue_events_url":"https://api.github.com/repos/balloob/home-assistant/issues/events{/number}","events_url":"https://api.github.com/repos/balloob/home-assistant/events","assignees_url":"https://api.github.com/repos/balloob/home-assistant/assignees{/user}","branches_url":"https://api.github.com/repos/balloob/home-assistant/branches{/branch}","tags_url":"https://api.github.com/repos/balloob/home-assistant/tags","blobs_url":"https://api.github.com/repos/balloob/home-assistant/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/balloob/home-assistant/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/balloob/home-assistant/git/refs{/sha}","trees_url":"https://api.github.com/repos/balloob/home-assistant/git/trees{/sha}","statuses_url":"https://api.github.com/repos/balloob/home-assistant/statuses/{sha}","languages_url":"https://api.github.com/repos/balloob/home-assistant/languages","stargazers_url":"https://api.github.com/repos/balloob/home-assistant/stargazers","contributors_url":"https://api.github.com/repos/balloob/home-assistant/contributors","subscribers_url":"https://api.github.com/repos/balloob/home-assistant/subscribers","subscription_url":"https://api.github.com/repos/balloob/home-assistant/subscription","commits_url":"https://api.github.com/repos/balloob/home-assistant/commits{/sha}","git_commits_url":"https://api.github.com/repos/balloob/home-assistant/git/commits{/sha}","comments_url":"https://api.github.com/repos/balloob/home-assistant/comments{/number}","issue_comment_url":"https://api.github.com/repos/balloob/home-assistant/issues/comments{/number}","contents_url":"https://api.github.com/repos/balloob/home-assistant/contents/{+path}","compare_url":"https://api.github.com/repos/balloob/home-assistant/compare/{base}...{head}","merges_url":"https://api.github.com/repos/balloob/home-assistant/merges","archive_url":"https://api.github.com/repos/balloob/home-assistant/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/balloob/home-assistant/downloads","issues_url":"https://api.github.com/repos/balloob/home-assistant/issues{/number}","pulls_url":"https://api.github.com/repos/balloob/home-assistant/pulls{/number}","milestones_url":"https://api.github.com/repos/balloob/home-assistant/milestones{/number}","notifications_url":"https://api.github.com/repos/balloob/home-assistant/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/balloob/home-assistant/labels{/name}","releases_url":"https://api.github.com/repos/balloob/home-assistant/releases{/id}","created_at":"2013-09-17T07:29:48Z","updated_at":"2016-01-19T15:03:41Z","pushed_at":"2016-01-19T23:09:11Z","git_url":"git://github.com/balloob/home-assistant.git","ssh_url":"git@github.com:balloob/home-assistant.git","clone_url":"https://github.com/balloob/home-assistant.git","svn_url":"https://github.com/balloob/home-assistant","homepage":"https://home-assistant.io","size":38042,"stargazers_count":2607,"watchers_count":2607,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":392,"mirror_url":null,"open_issues_count":119,"forks":392,"open_issues":119,"watchers":2607,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/balloob/home-assistant/pulls/937"},"html":{"href":"https://github.com/balloob/home-assistant/pull/937"},"issue":{"href":"https://api.github.com/repos/balloob/home-assistant/issues/937"},"comments":{"href":"https://api.github.com/repos/balloob/home-assistant/issues/937/comments"},"review_comments":{"href":"https://api.github.com/repos/balloob/home-assistant/pulls/937/comments"},"review_comment":{"href":"https://api.github.com/repos/balloob/home-assistant/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/balloob/home-assistant/pulls/937/commits"},"statuses":{"href":"https://api.github.com/repos/balloob/home-assistant/statuses/39804b41854da3c74cffc64daf6be276d4899153"}}}}