revert local change
[enigma2.git] / lib / python / Components / Sources / Clock.py
index e2d7faa..4833ddd 100644 (file)
@@ -1,4 +1,5 @@
 from Tools.Event import Event
+from Components.Element import cached
 from enigma import eTimer
 import time
 
@@ -11,6 +12,7 @@ class Clock(Source):
                self.clock_timer.timeout.get().append(self.poll)
                self.clock_timer.start(1000)
 
+       @cached
        def getClock(self):
                return time.time()
 
@@ -18,3 +20,10 @@ class Clock(Source):
 
        def poll(self):
                self.changed((self.CHANGED_POLL,))
+
+       def doSuspend(self, suspended):
+               if suspended:
+                       self.clock_timer.stop()
+               else:
+                       self.clock_timer.start(1000)
+                       self.poll()