Skip to content
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

KeyError: 'dnd' #270

Closed
snakuzzo opened this issue Aug 8, 2019 · 4 comments · Fixed by #271
Closed

KeyError: 'dnd' #270

snakuzzo opened this issue Aug 8, 2019 · 4 comments · Fixed by #271

Comments

@snakuzzo
Copy link

snakuzzo commented Aug 8, 2019

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. update alexa_media_player to 1.4.0 version
  2. restart homeassistant
  3. See error...
2019-08-08 09:00:53 ERROR (MainThread) [homeassistant.components.media_player] Error while setting up platform alexa_media
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 149, in _async_setup_platform
    await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
  File "/usr/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
    return fut.result()
  File "/usr/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/homeassistant/.homeassistant/custom_components/alexa_media/media_player.py", line 66, in setup_platform
    hass)
  File "/home/homeassistant/.homeassistant/custom_components/alexa_media/media_player.py", line 144, in __init__
    self.refresh(device)
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/util/__init__.py", line 240, in wrapper
    result = method(*args, **kwargs)
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/util/__init__.py", line 240, in wrapper
    result = method(*args, **kwargs)
  File "/home/homeassistant/.homeassistant/custom_components/alexa_media/media_player.py", line 279, in refresh
    self._dnd = device['dnd']
KeyError: 'dnd'

Expected behavior
No error while starting homeassistant

System details

  • Home-assistant (version): 0.97.0
  • Hassio (Yes/No): No
  • alexa_media (version from const.py or HA startup): 1.4.0
  • alexapy (version from pip show alexapy or HA startup): 0.7.1
@alandtse
Copy link
Owner

alandtse commented Aug 8, 2019

Just to check, what region are you in and do you have a setting to enable do not disturb through the Alexa App?

@snakuzzo
Copy link
Author

snakuzzo commented Aug 8, 2019

I'm from Europe (Italy) and I have just alexa app (not speakers) and no "do not disturb" enabled

@snakuzzo
Copy link
Author

snakuzzo commented Aug 8, 2019

but now this issue is solved...I have no KeyError: 'dnd' anymore.
Now I have errors described in issue 268 and 269

@vigonotion
Copy link

Had the same issue, in the German Alexa app. But I do have a toggle switch in the app to turn on/off DND.
It works now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants