From 126f67a0bc5bffb0f0d6b8c0308cb81e4c96e42b Mon Sep 17 00:00:00 2001 From: "Mr.Servo" Date: Wed, 21 Aug 2024 20:00:12 +0200 Subject: [PATCH] [CleverTanken] tiny improvement - favorites view now correctly shows the 'Last MTS-K price change' instead of 'Last update' --- CleverTanken/src/plugin.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/CleverTanken/src/plugin.py b/CleverTanken/src/plugin.py index 86c11f1a0..2cb832b27 100644 --- a/CleverTanken/src/plugin.py +++ b/CleverTanken/src/plugin.py @@ -68,10 +68,6 @@ def moveInfo(self, xpos, ypos): self.instance.move(ePoint(xpos, ypos)) -class CTchoicebox(Screen): - pass # future option - - class CTmain(Screen, CTglobs): skin = """ @@ -354,9 +350,9 @@ def makeFavoriteView(self, output): break rawentry = self.searchOneValue(r'', output, "", flag_S=True) pcngtype, pcngdate, pcngdur = ("geändert", "unbekannt", "unbekannt") - for last in rawentry.replace("", "").replace("", "").strip().split("\n"): - part = last.split(": ") - pcngdate, pcngdur = part[1].split(" ") if len(part) > 1 else ("unbekannt", "unbekannt") + changes = rawentry.replace("", "").replace("", "").strip().split("\n") + part = changes[0].split(": ") if changes else [] # changes[0] = Letzte MTS-K Preisänderung, changes[1] = Letzte Aktualisierung + pcngdate, pcngdur = part[1].split(" ") if len(part) > 1 else ("unbekannt", "unbekannt") pricealert = self.createPricealert(price, self.sprit["B"]) self.framefavs.append(tuple((ident, price[0], price[1], pcngtype, pcngdate, pcngdur, name, street, f"{zipcode} {city}", "", "♥", pricealert))) if len(self.framefavs) == len(self.favlist): # all favorites downloaded?