8000 Missing key in Sonos alarm event · Issue #51318 · home-assistant/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Missing key in Sonos alarm event #51318

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jjlawren opened this issue Jun 1, 2021 · 3 comments · Fixed by #51353
Closed

Missing key in Sonos alarm event #51318

jjlawren opened this issue Jun 1, 2021 · 3 comments · Fixed by #51353

Comments

@jjlawren
Copy link
Contributor
jjlawren commented Jun 1, 2021

The problem

Noticed an event payload arrive without an expected key in a dev environment:

2021-05-31 14:27:37 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/home/jj/.pyenv/versions/dev-386/lib/python3.8/site-packages/aiohttp/web_protocol.py", line 422, in _handle_request
    resp = await self._request_handler(request)
  File "/home/jj/.pyenv/versions/dev-386/lib/python3.8/site-packages/aiohttp/web_app.py", line 499, in _handle
    resp = await handler(request)
  File "/home/jj/src/pysonos/pysonos/events_asyncio.py", line 147, in notify
    subscription.send_event(event)
  File "/home/jj/src/pysonos/pysonos/events_base.py", line 595, in send_event
    callback(event)
  File "/home/jj/src/home-assistant/homeassistant/components/sonos/speaker.py", line 370, in async_dispatch_event
    dispatcher(event)
  File "/home/jj/src/home-assistant/homeassistant/components/sonos/speaker.py", line 375, in async_dispatch_alarms
    update_id = event.variables["alarm_list_version"]
KeyError: 'alarm_list_version'

What is version of Home Assistant Core has the issue?

dev

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Core

Integration causing the issue

Sonos

Link to integration documentation on our website

https://www.home-assistant.io/integrations/sonos/

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

@probot-home-assistant
Copy link

sonos documentation
sonos source
(message by IssueLinks)

@jjlawren
Copy link
Contributor Author
jjlawren commented Jun 1, 2021

This is trivial to fix, but I'm experimenting to see if there's something common in "bad" payloads across all of the different subscription types. That way we wouldn't need to guard for a different missing key in each subscription type.

@jjlawren
Copy link
Contributor Author
jjlawren commented Jun 1, 2021

Found the actual payload contents of a "bad" alarm event: {'time_generation': '19'}

Was hoping to see some type of error keys, but that doesn't seem to be the case here. Will just fix this specific callback for now.

@github-actions github-actions bot locked and limited conversation to collaborators Jul 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants
0