technicalpickles / picklehome-homeassistant-config

homeassistant configuration for my house
3 stars 0 forks source link

components/media_player/sonos.py (ERROR) Update for media_player.kitchen fails #35

Closed technicalpickles closed 5 years ago

technicalpickles commented 6 years ago

This showed up dozens of time over the course of an hour.

Update for media_player.kitchen fails

Traceback (most recent call last):
  File "/usr/src/app/homeassistant/helpers/entity.py", line 199, in async_update_ha_state
    yield from self.async_device_update()
  File "/usr/src/app/homeassistant/helpers/entity.py", line 306, in async_device_update
    yield from self.hass.async_add_job(self.update)
  File "/usr/local/lib/python3.6/asyncio/futures.py", line 332, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/local/lib/python3.6/asyncio/tasks.py", line 250, in _wakeup
    future.result()
  File "/usr/local/lib/python3.6/asyncio/futures.py", line 245, in result
    raise self._exception
  File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/app/homeassistant/components/media_player/sonos.py", line 528, in update
    track_info = self._player.get_current_track_info()
  File "/usr/local/lib/python3.6/site-packages/soco/core.py", line 1219, in get_current_track_info
    index = trackinfo.find(' - ')
AttributeError: 'NoneType' object has no attribute 'find'
technicalpickles commented 6 years ago

There were some updates to the soco dependency. I'm not seeing this one, but there's something else:

Exception happened during processing of request from ('10.0.1.87', 53065)
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/socketserver.py", line 639, in process_request_thread
    self.finish_request(request, client_address)
  File "/usr/local/lib/python3.6/socketserver.py", line 361, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/local/lib/python3.6/socketserver.py", line 696, in __init__
    self.handle()
  File "/usr/local/lib/python3.6/http/server.py", line 418, in handle
    self.handle_one_request()
  File "/usr/local/lib/python3.6/http/server.py", line 406, in handle_one_request
    method()
  File "/usr/local/lib/python3.6/site-packages/soco/events.py", line 239, in do_NOTIFY
    variables = parse_event_xml(content)
  File "/usr/src/app/homeassistant/components/media_player/sonos.py", line 131, in safe_parse_event_xml
    return orig_parse_event_xml(xml)
  File "/usr/src/app/homeassistant/components/media_player/sonos.py", line 131, in safe_parse_event_xml
    return orig_parse_event_xml(xml)
  File "/usr/src/app/homeassistant/components/media_player/sonos.py", line 131, in safe_parse_event_xml
    return orig_parse_event_xml(xml)
  [Previous line repeated 3 more times]
  File "/usr/local/lib/python3.6/site-packages/soco/events.py", line 139, in parse_event_xml
    value = from_didl_string(value)[0]
  File "/usr/local/lib/python3.6/site-packages/soco/data_structures_entry.py", line 52, in from_didl_string
    item = cls.from_element(elt)
  File "/usr/local/lib/python3.6/site-packages/soco/data_structures.py", line 492, in from_element
    DidlResource.from_element(res_elt))
  File "/usr/local/lib/python3.6/site-packages/soco/data_structures.py", line 172, in from_element
    raise Exception('Could not create Resource from Element: '
Exception: Could not create Resource from Element: protocolInfo not found (required).
----------------------------------------
technicalpickles commented 6 years ago

I started looking into this, and found it fixed already 😅 looks like these are responsible:

Now to get a 0.65 release 😁

technicalpickles commented 5 years ago

Fixed in https://github.com/technicalpickles/picklehome-homeassistant-config/pull/67/files with:

logger:
  default: info
  logs:
    # ignore sonos warnings, like:
    # - Could not handle track info: ""
    # - Update for media_player.kitchen fails (https://github.com/technicalpickles/picklehome-homeassistant-config/issues/35)
    homeassistant.components.media_player.sonos: error
    soco.core: error