aboutsummaryrefslogtreecommitdiff
path: root/lib/python
diff options
context:
space:
mode:
Diffstat (limited to 'lib/python')
-rw-r--r--lib/python/Components/TunerInfo.py18
-rw-r--r--lib/python/Plugins/SystemPlugins/Satfinder/plugin.py11
2 files changed, 19 insertions, 10 deletions
diff --git a/lib/python/Components/TunerInfo.py b/lib/python/Components/TunerInfo.py
index a7e22fb1..490b9bef 100644
--- a/lib/python/Components/TunerInfo.py
+++ b/lib/python/Components/TunerInfo.py
@@ -86,15 +86,15 @@ class TunerInfo(GUIComponent):
return feinfo.getFrontendInfo(iFrontendInformation.lockState)
elif self.frontendfkt is not None:
frontend = self.frontendfkt()
- if what == self.SNR:
- return frontend.readFrontendData(iFrontendInformation.signalPower)
- elif what == self.AGC:
- return frontend.readFrontendData(iFrontendInformation.signalQuality)
- elif what == self.BER:
- return frontend.readFrontendData(iFrontendInformation.bitErrorRate)
- elif what == self.LOCK:
- return frontend.readFrontendData(iFrontendInformation.lockState)
-
+ if frontend:
+ if what == self.SNR:
+ return frontend.readFrontendData(iFrontendInformation.signalPower)
+ elif what == self.AGC:
+ return frontend.readFrontendData(iFrontendInformation.signalQuality)
+ elif what == self.BER:
+ return frontend.readFrontendData(iFrontendInformation.bitErrorRate)
+ elif what == self.LOCK:
+ return frontend.readFrontendData(iFrontendInformation.lockState)
return 0
def createWidget(self, parent):
diff --git a/lib/python/Plugins/SystemPlugins/Satfinder/plugin.py b/lib/python/Plugins/SystemPlugins/Satfinder/plugin.py
index fceff4ce..d915b91f 100644
--- a/lib/python/Plugins/SystemPlugins/Satfinder/plugin.py
+++ b/lib/python/Plugins/SystemPlugins/Satfinder/plugin.py
@@ -77,8 +77,10 @@ class Satfinder(ScanSetup):
def __init__(self, session, feid):
self.initcomplete = False
self.feid = feid
-
+ self.oldref = None
+
if not self.openFrontend():
+ self.oldref = session.nav.getCurrentlyPlayingServiceReference()
session.nav.stopService() # try to disable foreground service
if not self.openFrontend():
if session.pipshown: # try to disable pip
@@ -110,6 +112,7 @@ class Satfinder(ScanSetup):
self.statusTimer.start(50, False)
self.initcomplete = True
+ self.session = session
def updateStatus(self):
self["snr_percentage"].update()
@@ -221,6 +224,11 @@ class Satfinder(ScanSetup):
self.retune(config.tuning.type)
def keyCancel(self):
+ if self.oldref:
+ if self.frontend:
+ self.frontend = None
+ del self.raw_channel
+ self.session.nav.playService(self.oldref)
self.close(None)
def tune(self, transponder):
@@ -269,5 +277,6 @@ def SatfinderMain(session, **kwargs):
else:
session.open(MessageBox, _("No tuner is configured for use with a diseqc positioner!"), MessageBox.TYPE_ERROR)
+
def Plugins(**kwargs):
return PluginDescriptor(name="Satfinder", description="Helps setting up your dish", where = PluginDescriptor.WHERE_PLUGINMENU, fnc=SatfinderMain)