From 08063e931b3d75b937c4f307e9db0a2ff3e49da3 Mon Sep 17 00:00:00 2001 From: defkev Date: Tue, 29 Nov 2022 10:08:44 +0100 Subject: [PATCH 1/2] Fix AGC query exception if not tuned to a service -> return default (0) Fix agent autostart (WHERE_NETWORKCONFIG_READ doesn't fire on boot for whatever reason, tested on OpenATV 6.4) --- plugin/plugin.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugin/plugin.py b/plugin/plugin.py index 8f5f69d..a904808 100644 --- a/plugin/plugin.py +++ b/plugin/plugin.py @@ -676,7 +676,8 @@ def getBER(self): def getAGC(self): if self.session and self.session.nav and self.session.nav.getCurrentService(): feinfo = self.session.nav.getCurrentService().frontendInfo() - return feinfo.getFrontendInfo(iFrontendInformation.signalPower) * 100 / 65536 + if feinfo: + return feinfo.getFrontendInfo(iFrontendInformation.signalPower) * 100 / 65536 return 0 def getSNR(self): @@ -1003,6 +1004,7 @@ def startSNMPserver(session): def sessionstart(reason, session): global global_session global_session = session + autostartEntry(True) #=============================================================================== # autostart From afa76c2d28f07920c1b51eb1d4b19fb67062325c Mon Sep 17 00:00:00 2001 From: defkev Date: Mon, 5 Dec 2022 03:19:50 +0100 Subject: [PATCH 2/2] Handle exception if bitrate receives garbage data --- plugin/bitrate.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugin/bitrate.py b/plugin/bitrate.py index c9ce477..d4a5ce6 100644 --- a/plugin/bitrate.py +++ b/plugin/bitrate.py @@ -87,8 +87,11 @@ def dataAvail(self, str): if len(line): self.datalines.append(line) if len(self.datalines) >= 2: - self.vmin, self.vmax, self.vavg, self.vcur = self.datalines[0].split(' ') - self.amin, self.amax, self.aavg, self.acur = self.datalines[1].split(' ') + try: + self.vmin, self.vmax, self.vavg, self.vcur = self.datalines[0].split(' ') + self.amin, self.amax, self.aavg, self.acur = self.datalines[1].split(' ') + except: + self.clearValues() self.datalines = [] if self.refresh_func: self.refresh_func()