- #~ if not self.timer is None:
- #~ logging.debug("checkAgainIn: canceled previous running Timer")
- #~ self.timer.cancel()
- logging.debug("checkAgainIn: starting Timer with timeout %fs" % sec)
- self.timer=threading.Timer(sec, self.checkPresenceStateChangeAndNotify)
- self.timer.start()
+ if self.timer_timeout < time.time():
+ logging.debug("checkAgainIn: starting Timer with timeout %fs" % sec)
+ self.timer=threading.Timer(sec, self.checkPresenceStateChangeAndNotify)
+ self.timer.start()
+ self.timer_timeout = time.time() + sec
+ else:
+ logging.debug("checkAgainIn: not starting timer, already one scheduled in %fs" % (time.time() - self.timer_timeout))