add stv0299 snr to dB Calculation (thx to adenin for this)
[vuplus_dvbapp] / lib / python / Components / Converter / EventTime.py
index 3c312a6..955fdbc 100644 (file)
@@ -1,6 +1,7 @@
 from Converter import Converter
 from Poll import Poll
 from time import time
+from Components.Element import cached
 
 class EventTime(Poll, Converter, object):
        STARTTIME = 0
@@ -9,8 +10,8 @@ class EventTime(Poll, Converter, object):
        PROGRESS = 3
        DURATION = 4
 
-       def __init__(self, type, *args, **kwargs):
-               Converter.__init__(self)
+       def __init__(self, type):
+               Converter.__init__(self, type)
                Poll.__init__(self)
                if type == "EndTime":
                        self.type = self.ENDTIME
@@ -29,6 +30,7 @@ class EventTime(Poll, Converter, object):
                else:
                        raise str("'%s' is not <StartTime|EndTime|Remaining|Duration> for EventTime converter" % type)
 
+       @cached
        def getTime(self):
                assert self.type != self.PROGRESS
 
@@ -52,6 +54,7 @@ class EventTime(Poll, Converter, object):
                        else:
                                return (duration, None)
 
+       @cached
        def getValue(self):
                assert self.type == self.PROGRESS