Skip to content

Commit

Permalink
Update alexa_talking_clock.py
Browse files Browse the repository at this point in the history
  • Loading branch information
UbhiTS authored Jul 17, 2020
1 parent 204ea3e commit 9b49314
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions apps/alexa_talking_clock/alexa_talking_clock.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,11 +227,13 @@ def get_time_speech(self, now):

schedule_now = ["daily", day_name, day_abbr, "weekdays" if weekday <= 4 else "weekends"] # daily, weekdays, weekends, mon, tue, wed, thu, fri, sat, sun
speech = ""
for reminder in self.reminders:
schedule = [x.strip().lower() for x in reminder["schedule"].split(',')]
if schedule[0] in schedule_now:
if datetime.strptime(schedule[1], '%H:%M:%S').time() == time(hour, minute, second):
speech += " " + reminder["reminder"]

if self.reminders:
for reminder in self.reminders:
schedule = [x.strip().lower() for x in reminder["schedule"].split(',')]
if schedule[0] in schedule_now:
if datetime.strptime(schedule[1], '%H:%M:%S').time() == time(hour, minute, second):
speech += " " + reminder["reminder"]

date_str = now.strftime("%d %B")

Expand Down

0 comments on commit 9b49314

Please sign in to comment.