Skip to content

Commit

Permalink
fix: handle exception on originalDate/originalTime
Browse files Browse the repository at this point in the history
Alexa notifications API no longer returns originalDate or originalTime
for timers.
closes #633
  • Loading branch information
alandtse committed Apr 8, 2020
1 parent 31908ee commit e47274c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions custom_components/alexa_media/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -604,9 +604,10 @@ async def process_notifications(login_obj, raw_notifications=None):
if n_type == "MusicAlarm":
n_type = "Alarm"
n_id = notification["notificationIndex"]
n_date = notification["originalDate"]
n_time = notification["originalTime"]
notification["date_time"] = f"{n_date} {n_time}"
if n_type != "Timer":
n_date = notification["originalDate"]
n_time = notification["originalTime"]
notification["date_time"] = f"{n_date} {n_time}"
if n_dev_id not in notifications:
notifications[n_dev_id] = {}
if n_type not in notifications[n_dev_id]:
Expand Down

0 comments on commit e47274c

Please sign in to comment.