From fac356d34f1d23dfcd987ab4666081283aa8297f Mon Sep 17 00:00:00 2001 From: "Alan D. Tse" Date: Mon, 2 Sep 2019 01:46:21 -0700 Subject: [PATCH] fix(notify): add key check for targets --- custom_components/alexa_media/notify.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/custom_components/alexa_media/notify.py b/custom_components/alexa_media/notify.py index ac87a5e4..2cb61e4c 100644 --- a/custom_components/alexa_media/notify.py +++ b/custom_components/alexa_media/notify.py @@ -98,6 +98,8 @@ def targets(self): devices = {} for account, account_dict in (self.hass.data[DATA_ALEXAMEDIA] ['accounts'].items()): + if ('devices' not in account_dict): + return devices for serial, alexa in (account_dict ['devices']['media_player'].items()): devices[alexa['accountName']] = serial