add stv0299 snr to dB Calculation (thx to adenin for this)
[enigma2.git] / lib / python / Components / Converter / FrontendInfo.py
index 34d55be468c6ec4be3787ff781508c53f8dff4bd..6377d6808150b589e23b8a886da51d0c3ede9b1e 100644 (file)
@@ -24,6 +24,7 @@ class FrontendInfo(Converter, object):
        @cached
        def getText(self):
                assert self.type != self.LOCK, "the text output of FrontendInfo cannot be used for lock info"
+               percent = None
                if self.type == self.BER: # as count
                        count = self.source.ber
                        if count is not None:
@@ -35,9 +36,11 @@ class FrontendInfo(Converter, object):
                elif self.type == self.SNR:
                        percent = self.source.snr
                elif self.type == self.SNRdB:
-                       if self.source.snr_db is None:
-                               return "N/A"
-                       return "%3.02f dB" % (self.source.snr_db / 100.0)
+                       if self.source.snr_db is not None:
+                               return "%3.02f dB" % (self.source.snr_db / 100.0)
+                       elif self.source.snr is not None: #fallback to normal SNR...
+                               percent = self.source.snr
+                               return "SNR:%d %%" % (percent * 100 / 65536)
                if percent is None:
                        return "N/A"