Skip to content

Commit

Permalink
fix(notify): fix keyerror when unloading with no loaded entities
Browse files Browse the repository at this point in the history
  • Loading branch information
alandtse committed Sep 23, 2019
1 parent 6a40dff commit d4b09ce
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions custom_components/alexa_media/notify.py
Expand Up @@ -43,6 +43,8 @@ async def async_unload_entry(hass, entry) -> bool:
for account, account_dict in (hass.data[DATA_ALEXAMEDIA]
['accounts'].items()):
if account == target_account:
if 'entities' not in account_dict:
continue
for device in (account_dict['entities']
['media_player'].values()):
entity_id = device.entity_id.split('.')
Expand Down

0 comments on commit d4b09ce

Please sign in to comment.