Sonos Error Logs

I recently started noticing the following error when I restart Hass. These errors started after I was playing around with some scripting and Sonos - I deleted all the scripts but the error still comes up after a restart.

I tried searching first and saw people with similar errors but not any fixes. I would love some help interpreting this error, could this be caused by device discovery? (I’m trying to figure out how to approach a fix).

Thu Mar 08 2018 16:16:21 GMT-0500 (EST)

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.4/asyncio/tasks.py", line 238, in _step
    result = next(coro)
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/helpers/entity.py", line 222, in async_update_ha_state
    attr = self.state_attributes or {}
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/media_player/__init__.py", line 876, in state_attributes
    in ATTR_TO_PROPERTY if getattr(self, attr) is not None
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/media_player/__init__.py", line 876, in <dictcomp>
    in ATTR_TO_PROPERTY if getattr(self, attr) is not None
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/media_player/sonos.py", line 978, in source_list
    return self._coordinator.source_list
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/media_player/sonos.py", line 980, in source_list
    model_name = self._speaker_info['model_name']
TypeError: 'NoneType' object is not subscriptable

You should upgrade to the latest Home Assistant (0.64.3), the Sonos support in previous versions is quite fragile.

Incidentally, you should also upgrade to a more recent Python because Home Assistant support for Python 3.4 has ended.

Great advice, I’ll try that.

I’ve been planning to upgrade to Python 3.5+, I’ve just been busy and lazy. :grinning: