Merge remote branch 'origin/acid-burn/network_changes_next' into experimental
[vuplus_dvbapp] / lib / python / Components / Converter / FrontendInfo.py
index 160214a..4043a1b 100644 (file)
@@ -29,7 +29,7 @@ class FrontendInfo(Converter, object):
 
        @cached
        def getText(self):
-               assert self.type not in [self.LOCK, self.SLOT_NUMBER], "the text output of FrontendInfo cannot be used for lock info"
+               assert self.type not in (self.LOCK, self.SLOT_NUMBER), "the text output of FrontendInfo cannot be used for lock info"
                percent = None
                if self.type == self.BER: # as count
                        count = self.source.ber
@@ -54,11 +54,17 @@ class FrontendInfo(Converter, object):
 
        @cached
        def getBool(self):
-               assert self.type in [self.LOCK, self.BER], "the boolean output of FrontendInfo can only be used for lock or BER info"
+               assert self.type in (self.LOCK, self.BER), "the boolean output of FrontendInfo can only be used for lock or BER info"
                if self.type == self.LOCK:
-                       return self.source.lock
+                       lock = self.source.lock
+                       if lock is None:
+                               lock = False
+                       return lock
                else:
-                       return self.source.ber > 0
+                       ber = self.source.ber
+                       if ber is None:
+                               ber = 0
+                       return ber > 0
 
        text = property(getText)
 
@@ -86,7 +92,8 @@ class FrontendInfo(Converter, object):
                                return 2
                        return -1
                elif self.type == self.SLOT_NUMBER:
-                       return self.source.slot_number or -1
+                       num = self.source.slot_number
+                       return num is None and -1 or num
 
        range = 65536
        value = property(getValue)