{"action":"created","issue":{"url":"https://api.github.com/repos/home-assistant/home-assistant/issues/13961","repository_url":"https://api.github.com/repos/home-assistant/home-assistant","labels_url":"https://api.github.com/repos/home-assistant/home-assistant/issues/13961/labels{/name}","comments_url":"https://api.github.com/repos/home-assistant/home-assistant/issues/13961/comments","events_url":"https://api.github.com/repos/home-assistant/home-assistant/issues/13961/events","html_url":"https://github.com/home-assistant/home-assistant/issues/13961","id":315172626,"number":13961,"title":"Sonos platform throwing error on start up, preventing custom service availability","user":{"login":"maddox","id":260,"avatar_url":"https://avatars0.githubusercontent.com/u/260?v=4","gravatar_id":"","url":"https://api.github.com/users/maddox","html_url":"https://github.com/maddox","followers_url":"https://api.github.com/users/maddox/followers","following_url":"https://api.github.com/users/maddox/following{/other_user}","gists_url":"https://api.github.com/users/maddox/gists{/gist_id}","starred_url":"https://api.github.com/users/maddox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maddox/subscriptions","organizations_url":"https://api.github.com/users/maddox/orgs","repos_url":"https://api.github.com/users/maddox/repos","events_url":"https://api.github.com/users/maddox/events{/privacy}","received_events_url":"https://api.github.com/users/maddox/received_events","type":"User","site_admin":true},"labels":[{"id":56754858,"url":"https://api.github.com/repos/home-assistant/home-assistant/labels/bug","name":"bug","color":"fc2929","default":true},{"id":526305192,"url":"https://api.github.com/repos/home-assistant/home-assistant/labels/platform:%20media_player.sonos","name":"platform: media_player.sonos","color":"ededed","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-04-17T18:10:19Z","updated_at":"2018-04-18T02:17:22Z","closed_at":null,"author_association":"MEMBER","body":"The Sonos platform is throwing an error while starting up. It looks like it's related to `night_mode`. Night Mode support was introduced on [this pull](https://github.com/home-assistant/home-assistant/pull/10765).\r\n\r\nThe sonos platform does in fact get set up, just not completely. The media players are available, but the sonos specific services are not.\r\n\r\nThis has been observed on `0.67.0` running via the docker container.\r\n\r\n```\r\n2018-04-17 14:00:53 ERROR (MainThread) [homeassistant.components.media_player] Error while setting up platform sonos\r\nTraceback (most recent call last):\r\n  File \"/usr/src/app/homeassistant/helpers/entity_platform.py\", line 82, in async_setup\r\n    SLOW_SETUP_MAX_WAIT, loop=hass.loop)\r\n  File \"/usr/local/lib/python3.6/asyncio/tasks.py\", line 358, in wait_for\r\n    return fut.result()\r\n  File \"/usr/local/lib/python3.6/concurrent/futures/thread.py\", line 56, in run\r\n    result = self.fn(*self.args, **self.kwargs)\r\n  File \"/usr/src/app/homeassistant/components/media_player/sonos.py\", line 176, in setup_platform\r\n    add_devices(SonosDevice(p) for p in players)\r\n  File \"/usr/src/app/homeassistant/helpers/entity_platform.py\", line 119, in _schedule_add_entities\r\n    self._async_schedule_add_entities, list(new_entities),\r\n  File \"/usr/src/app/homeassistant/components/media_player/sonos.py\", line 176, in <genexpr>\r\n    add_devices(SonosDevice(p) for p in players)\r\n  File \"/usr/src/app/homeassistant/components/media_player/sonos.py\", line 359, in __init__\r\n    self._set_basic_information()\r\n  File \"/usr/src/app/homeassistant/components/media_player/sonos.py\", line 426, in _set_basic_information\r\n    self.update_volume()\r\n  File \"/usr/src/app/homeassistant/components/media_player/sonos.py\", line 668, in update_volume\r\n    self._night_sound = self.soco.night_mode\r\nAttributeError: 'SoCo' object has no attribute 'night_mode'\r\n2018-04-17 14:00:53 INFO (MainThread) [homeassistant.core] Bus:Handling <Event system_log_event[L]: timestamp=1523988053.399213, level=ERROR, message=Error while setting up platform sonos, exception=Traceback (most recent call last):\r\n  File \"/usr/src/app/homeassistant/helpers/entity_platform.py\", line 82, in async_setup\r\n    SLOW_SETUP_MAX_WAIT, loop=hass.loop)\r\n  File \"/usr/local/lib/python3.6/asyncio/tasks.py\", line 358, in wait_for\r\n    return fut.result()\r\n  File \"/usr/local/lib/python3.6/concurrent/futures/thread.py\", line 56, in run\r\n    result = self.fn(*self.args, **self.kwargs)\r\n  File \"/usr/src/app/homeassistant/components/media_player/sonos.py\", line 176, in setup_platform\r\n    add_devices(SonosDevice(p) for p in players)\r\n  File \"/usr/src/app/homeassistant/helpers/entity_platform.py\", line 119, in _schedule_add_entities\r\n    self._async_schedule_add_entities, list(new_entities),\r\n  File \"/usr/src/app/homeassistant/components/media_player/sonos.py\", line 176, in <genexpr>\r\n    add_devices(SonosDevice(p) for p in players)\r\n  File \"/usr/src/app/homeassistant/components/media_player/sonos.py\", line 359, in __init__\r\n    self._set_basic_information()\r\n  File \"/usr/src/app/homeassistant/components/media_player/sonos.py\", line 426, in _set_basic_information\r\n    self.update_volume()\r\n  File \"/usr/src/app/homeassistant/components/media_player/sonos.py\", line 668, in update_volume\r\n    self._night_sound = self.soco.night_mode\r\nAttributeError: 'SoCo' object has no attribute 'night_mode'\r\n, source=components/media_player/sonos.py>\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/home-assistant/home-assistant/issues/comments/382225443","html_url":"https://github.com/home-assistant/home-assistant/issues/13961#issuecomment-382225443","issue_url":"https://api.github.com/repos/home-assistant/home-assistant/issues/13961","id":382225443,"user":{"login":"maddox","id":260,"avatar_url":"https://avatars0.githubusercontent.com/u/260?v=4","gravatar_id":"","url":"https://api.github.com/users/maddox","html_url":"https://github.com/maddox","followers_url":"https://api.github.com/users/maddox/followers","following_url":"https://api.github.com/users/maddox/following{/other_user}","gists_url":"https://api.github.com/users/maddox/gists{/gist_id}","starred_url":"https://api.github.com/users/maddox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maddox/subscriptions","organizations_url":"https://api.github.com/users/maddox/orgs","repos_url":"https://api.github.com/users/maddox/repos","events_url":"https://api.github.com/users/maddox/events{/privacy}","received_events_url":"https://api.github.com/users/maddox/received_events","type":"User","site_admin":true},"created_at":"2018-04-18T02:17:22Z","updated_at":"2018-04-18T02:17:22Z","author_association":"MEMBER","body":"I copied the current component code into `custom_components` and have been loading it like that. I first tried to comment out the call to `night_mode`, but it then failed on `dialog_mode`. Soooo I commented that out too, but then I ran into this:\r\n\r\n```\r\n    for fav in self.soco.music_library.get_sonos_favorites():\r\nAttributeError: 'MusicLibrary' object has no attribute 'get_sonos_favorites'\r\n```\r\n\r\nSooo weird. Again, this works on macOS for me without a docker env. I don't have `discover:` turned on, but I never have, and I don't on macOS. \r\n\r\nI'm just trying to add as much info as I can do this."}}
{"actor":{"display_login":"maddox"}}