def resetAlarm(self): hour, minute, second = Utility.hms() print('RESET TRIGGER', hour, minute, second) # Update internal state and let observers know self.alarmSounding = False self.notify()
def update(self): hour, minute, second = Utility.hms() if(minute == 0): if(second == 0): print('Chime!') return
def update(self): hour, minute, second = Utility.hms() if(self.isDayActive(self.daysOfTheWeek[localtime().__getattribute__('tm_wday')])): if(self.hour == hour): if(self.minute == minute): if(self.second == second): # Alarm ready to go! self.startAlarm() return
def startAlarm(self): if not(self.alarmSounding): hour, minute, second = Utility.hms() print('ALARM SOUNDING', hour, minute, second) # Internal state to be sounding the alarm self.alarmSounding = True # Let any observers know we are sounding self.notify() # The reset time (i.e. when the alarm goes off by itself) t = Timer(5.0, self.resetAlarm).start()