add possibility to use ValueRange as ValueEqual Converter
[enigma2.git] / lib / python / Components / Converter / ValueRange.py
index 443e7a3..42e2483 100644 (file)
@@ -1,13 +1,15 @@
 from Converter import Converter
 from Converter import Converter
+from Components.Element import cached
 
 class ValueRange(Converter, object):
        def __init__(self, arg):
                Converter.__init__(self, arg)
                (self.lower, self.upper) = [int(x) for x in arg.split(',')]
 
 
 class ValueRange(Converter, object):
        def __init__(self, arg):
                Converter.__init__(self, arg)
                (self.lower, self.upper) = [int(x) for x in arg.split(',')]
 
+       @cached
        def getBoolean(self):
        def getBoolean(self):
-               if self.lower < self.upper:
-                       return self.lower < self.source.value < self.upper
+               if self.lower <= self.upper:
+                       return self.lower <= self.source.value <= self.upper
                else:
                        return not (self.upper < self.source.value < self.lower)
 
                else:
                        return not (self.upper < self.source.value < self.lower)