From 033c4af350e1a298799f02753071012b2d9053ef Mon Sep 17 00:00:00 2001 From: "Mr.Servo" Date: Fri, 10 Oct 2025 09:59:49 +0200 Subject: [PATCH 1/2] [LCD4linux] V5.0-r35 photoframe "Samsung SPF-800W 800x600" added - improvement: optimization of image transfer to Samsung picture frames - improvement: added support for photoframe "Samsung SPF-800W 800x600" - some AUTOPEP8 corrections (mainly commentary lines) THX to User **KenTucky @ OpenA.TV** details see: www.opena.tv/viewtopic.php?p=590972#p590966 HINT: **LCD4linux** is still working under Python2 and Python3 --- lcd4linux/src/Photoframe.py | 43 +++++++++++++++------------ lcd4linux/src/plugin.py | 58 +++++++++++++++++++------------------ 2 files changed, 55 insertions(+), 46 deletions(-) diff --git a/lcd4linux/src/Photoframe.py b/lcd4linux/src/Photoframe.py index 920c45b..9fa77ad 100644 --- a/lcd4linux/src/Photoframe.py +++ b/lcd4linux/src/Photoframe.py @@ -5,7 +5,6 @@ from usb.util import get_string from PIL import Image from struct import pack -from six import ensure_binary from six.moves import cStringIO as StringIO @@ -19,7 +18,11 @@ def write_jpg2frame(dev, pic): tdata = rawdata + b'\xff\x00' + pad * b'\x00' # Syntax: write(self, endpoint, data, interface = None, timeout = None): endpoint = 0x02 - dev.write(endpoint, tdata) + # send to device in packages of = 2^16 + psize = 65536 + for p in range(int(len(tdata) / psize)): + pdata = tdata[p * psize:(p + 1) * psize] + dev.write(endpoint, pdata) def get_known_devices(): @@ -27,58 +30,62 @@ def get_known_devices(): dlist = [] # listed as: Name, idVendor, idProduct, [width , height - in pixel if applicable] - #0,1 Samsung SPF-75H/76H (23) + # 0,1 Samsung SPF-75H/76H (23) dlist.append({'name': "SPF75H/76H Mini Monitor", 'idVendor': 0x04e8, 'idProduct': 0x200f, 'width': 800, 'height': 480}) dlist.append({'name': "SPF75H/76H Mass Storage", 'idVendor': 0x04e8, 'idProduct': 0x200e}) - #2,3 Samsung SPF-87H (24) + # 2,3 Samsung SPF-87H (24) dlist.append({'name': "SPF87H Mini Monitor", 'idVendor': 0x04e8, 'idProduct': 0x2034, 'width': 800, 'height': 480}) dlist.append({'name': "SPF87H Mass Storage", 'idVendor': 0x04e8, 'idProduct': 0x2033}) - #4,5 Samsung SPF-87Hold (25) + # 4,5 Samsung SPF-87Hold (25) dlist.append({'name': "SPF87Hold Mini Monitor", 'idVendor': 0x04e8, 'idProduct': 0x2026, 'width': 800, 'height': 480}) dlist.append({'name': "SPF87Hold Mass Storage", 'idVendor': 0x04e8, 'idProduct': 0x2025}) - #6,7 Samsung SPF-83H (26) + # 6,7 Samsung SPF-83H (26) dlist.append({'name': "SPF83H Mini Monitor", 'idVendor': 0x04e8, 'idProduct': 0x200d, 'width': 800, 'height': 600}) dlist.append({'name': "SPF83H Mass Storage", 'idVendor': 0x04e8, 'idProduct': 0x200c}) - #8,9 Samsung SPF-107H (27) + # 8,9 Samsung SPF-107H (27) dlist.append({'name': "SPF107H Mini Monitor", 'idVendor': 0x04e8, 'idProduct': 0x2036, 'width': 1024, 'height': 600}) dlist.append({'name': "SPF107H Mass Storage", 'idVendor': 0x04e8, 'idProduct': 0x2035}) - #10,11 Samsung SPF-105P (28) + # 10,11 Samsung SPF-105P (28) dlist.append({'name': "SPF105P Mini Monitor", 'idVendor': 0x04e8, 'idProduct': 0x201b, 'width': 1024, 'height': 600}) dlist.append({'name': "SPF105P Mass Storage", 'idVendor': 0x04e8, 'idProduct': 0x201c}) - #12,13 Samsung SPF-85H/86H (29) + # 12,13 Samsung SPF-85H/86H (29) dlist.append({'name': "SPF85H/86H Mini Monitor", 'idVendor': 0x04e8, 'idProduct': 0x2013, 'width': 800, 'height': 600}) dlist.append({'name': "SPF85H/86H Mass Storage", 'idVendor': 0x04e8, 'idProduct': 0x2012}) - #14,15 Samsung SPF-72H (210) + # 14,15 Samsung SPF-72H (210) dlist.append({'name': "SPF72H Mini Monitor", 'idVendor': 0x04e8, 'idProduct': 0x200b, 'width': 800, 'height': 480}) dlist.append({'name': "SPF72H Mass Storage", 'idVendor': 0x04e8, 'idProduct': 0x200a}) - #16,17 Samsung SPF-700T (211) + # 16,17 Samsung SPF-700T (211) dlist.append({'name': "SPF700T Mini Monitor", 'idVendor': 0x04e8, 'idProduct': 0x2050, 'width': 800, 'height': 600}) dlist.append({'name': "SPF700T Mass Storage", 'idVendor': 0x04e8, 'idProduct': 0x204f}) - #18,19 Samsung SPF-85P/86P (212) + # 18,19 Samsung SPF-85P/86P (212) dlist.append({'name': "SPF85P/86P Mini Monitor", 'idVendor': 0x04e8, 'idProduct': 0x2017, 'width': 800, 'height': 600}) dlist.append({'name': "SPF85P/86P Mass Storage", 'idVendor': 0x04e8, 'idProduct': 0x2016}) - #20,21 Samsung SPF-107Hold (213) + # 20,21 Samsung SPF-107Hold (213) dlist.append({'name': "SPF107Hold Mini Monitor", 'idVendor': 0x04e8, 'idProduct': 0x2028, 'width': 1024, 'height': 600}) dlist.append({'name': "SPF107Hold Mass Storage", 'idVendor': 0x04e8, 'idProduct': 0x2027}) - #22,23 Samsung SPF-1000P (214) + # 22,23 Samsung SPF-1000P (214) dlist.append({'name': "SPF1000P Mini Monitor", 'idVendor': 0x04e8, 'idProduct': 0x2040, 'width': 1024, 'height': 600}) dlist.append({'name': "SPF1000P Mass Storage", 'idVendor': 0x04e8, 'idProduct': 0x2039}) - #24,25 Samsung SPF-800P (215) + # 24,25 Samsung SPF-800P (215) dlist.append({'name': "SPF800P Mini Monitor", 'idVendor': 0x04e8, 'idProduct': 0x2038, 'width': 800, 'height': 480}) dlist.append({'name': "SPF800P Mass Storage", 'idVendor': 0x04e8, 'idProduct': 0x2037}) + # 26,27 Samsung SPF-800W (216) + dlist.append({'name': "SPF800W Mini Monitor", 'idVendor': 0x04e8, 'idProduct': 0x204c, 'width': 800, 'height': 600}) + dlist.append({'name': "SPF800W Mass Storage", 'idVendor': 0x04e8, 'idProduct': 0x204b}) + # Amazon Fire 7 (9th Generation 2019) dlist.append({'name': "Amazon Fire 7 Mini Monitor", 'idVendor': 0x1949, 'idProduct': 0x03C3, 'width': 1024, 'height': 600}) dlist.append({'name': "Amazon Fire 7 Mass Storage", 'idVendor': 0x1949, 'idProduct': 0x03C1}) @@ -115,7 +122,7 @@ def init_device(anzahl, device0, device1): dev = find_device(anzahl, device0, device1) if dev is not None: - ## found it, trying to init it + # found it, trying to init it print("[LCD4linux] Find frame device: %s" % dev) if dev.idProduct == device0["idProduct"]: print("[LCD4linux] init Device") @@ -128,7 +135,7 @@ def init_device(anzahl, device0, device1): # may need to burn some time dev = find_device(anzahl, device0, device1) if dev is not None and dev.idProduct == device0["idProduct"]: - #switching successful + # switching successful break elif time() - ts > 3: print("[LCD4linux] switching failed. Ending program") @@ -195,7 +202,7 @@ def main(): dev = init_device(1, device0, device1) print("Frame is in Mini Monitor mode and initialized. Sending pictures now") image = Image.open("mypicture.jpg") - #manipulations to consider: + # manipulations to consider: # convert # thumbnail # rotate diff --git a/lcd4linux/src/plugin.py b/lcd4linux/src/plugin.py index df2dcc2..2d552e8 100644 --- a/lcd4linux/src/plugin.py +++ b/lcd4linux/src/plugin.py @@ -172,7 +172,7 @@ if find_library("usb-0.1") is not None or find_library("usb-1.0") is not None: print("[LCD4linux] libusb found :-)", getEnigmaVersionString()) USBok = True -Version = "V5.0-r34" +Version = "V5.0-r35" L4LElist = L4Lelement() L4LdoThread = True LCD4enigma2config = resolveFilename(SCOPE_CONFIG) # /etc/enigma2/ @@ -310,11 +310,13 @@ TimeSelect = [("1", _("5s")), ("2", _("10s")), ("3", _("15s")), ("4", _("20s")), ("6", _("30s")), ("8", _("40s")), ("10", _("50s")), ("12", _("1min")), ("24", _("2min")), ("36", _("3min")), ("48", _("4min")), ("60", _("5min")), ("120", _("10min")), ("240", _("20min")), ("360", _("30min")), ("720", _("60min")), ("1440", _("2h")), ("2160", _("3h")), ("3600", _("5h"))] LCDSelect = [("1", _("LCD 1")), ("2", _("LCD 2")), ("12", _("LCD 1+2")), ("3", _("LCD 3")), ("13", _("LCD 1+3")), ("23", _("LCD 2+3")), ("123", _("LCD 1+2+3"))] LCDSwitchSelect = [("0", _("LCD 1-3")), ("1", _("LCD 1")), ("2", _("LCD 2")), ("3", _("LCD 3"))] -LCDType = [("11", _("Pearl (or compatible LCD) 320x240")), ("12", _("Pearl (or compatible LCD) 240x320")), ("121", _("Corby@Pearl 128x128")), ("122", _("AX206 (or compatible LCD) 480x320")), ("123", _("AX206 (or compatible LCD) 800x480")), - ("210", _("Samsung SPF-72H 800x480")), ("23", _("Samsung SPF-75H/76H 800x480")), ("24", _("Samsung SPF-87H 800x480")), ("25", _("Samsung SPF-87H old 800x480")), ("26", _("Samsung SPF-83H 800x600")), - ("29", _("Samsung SPF-85H/86H 800x600")), ("212", _("Samsung SPF-85P/86P 800x600")), ("28", _("Samsung SPF-105P 1024x600")), ("27", _("Samsung SPF-107H 1024x600")), ("213", _("Samsung SPF-107H old 1024x600")), - ("211", _("Samsung SPF-700T 800x600")), ("215", _("Samsung SPF-800P 800x480")), ("214", _("Samsung SPF-1000P 1024x600")), ("430", _("Internal TFT-LCD 400x240")), ("50", _("Internal Box-Skin-LCD")), - ("31", _("only Picture 320x240")), ("33", _("only Picture 800x480")), ("36", _("only Picture 800x600")), ("37", _("only Picture 1024x600")), ("320", _("only Picture Custom Size")), ("420", _("only Picture Custom Size 2"))] +LCDType = [ + ("11", _("Pearl (or compatible LCD) 320x240")), ("12", _("Pearl (or compatible LCD) 240x320")), ("121", _("Corby@Pearl 128x128")), ("122", _("AX206 (or compatible LCD) 480x320")), ("123", _("AX206 (or compatible LCD) 800x480")), + ("210", _("Samsung SPF-72H 800x480")), ("23", _("Samsung SPF-75H/76H 800x480")), ("24", _("Samsung SPF-87H 800x480")), ("25", _("Samsung SPF-87H old 800x480")), ("26", _("Samsung SPF-83H 800x600")), + ("29", _("Samsung SPF-85H/86H 800x600")), ("212", _("Samsung SPF-85P/86P 800x600")), ("28", _("Samsung SPF-105P 1024x600")), ("27", _("Samsung SPF-107H 1024x600")), ("213", _("Samsung SPF-107H old 1024x600")), + ("211", _("Samsung SPF-700T 800x600")), ("215", _("Samsung SPF-800P 800x480")), ("214", _("Samsung SPF-1000P 1024x600")), ("216", _("Samsung SPF-800W 800x600")), ("430", _("Internal TFT-LCD 400x240")), ("50", _("Internal Box-Skin-LCD")), + ("31", _("only Picture 320x240")), ("33", _("only Picture 800x480")), ("36", _("only Picture 800x600")), ("37", _("only Picture 1024x600")), ("320", _("only Picture Custom Size")), ("420", _("only Picture Custom Size 2")) +] if PNGutilOK: LCDType.insert(14, ("930", _("Internal Vu+ Duo2 LCD 400x240"))) xmlLCDType = [("96x64", _("96x64")), ("128x32", _("128x32")), ("128x64", _("128x64")), ("132x64", _("132x64")), ("220x176", _("220x176")), ("255x64", _("255x64")), ("400x240", _("400x240")), ("480x320", _("480x320")), ("700x390", _("720x405")), ("800x480", _("800x480"))] @@ -2890,7 +2892,7 @@ def getResolution(t, r): MAX_W, MAX_H = 240, 320 elif t[1:] in ["3", "4", "5", "10", "15"]: MAX_W, MAX_H = 800, 480 - elif t[1:] in ["6", "9", "11", "12"]: + elif t[1:] in ["6", "9", "11", "12", "16"]: MAX_W, MAX_H = 800, 600 elif t[1:] in ["7", "8", "13", "14"]: MAX_W, MAX_H = 1024, 600 @@ -5149,7 +5151,7 @@ def MailDecode(Sdecode): try: if mailserver is not None: mailserver.select("inbox") -# typ, data = mailserver.search(None, '(SINCE "{date}")'.format(date=Date)) +# typ, data = mailserver.search(None, '(SINCE "{date}")'.format(date=Date)) if str(LCD4linux.MailIMAPDays.value) == "0": typ, data = mailserver.search(None, 'ALL') else: @@ -5743,8 +5745,8 @@ def SetList(self): self.list1.append(getConfigListEntry(_("- Color"), LCD4linux.PopupColor)) self.list1.append(getConfigListEntry(_("- Background Color"), LCD4linux.PopupBackColor)) self.list1.append(getConfigListEntry(_("- Font"), LCD4linux.PopupFont)) -# if LCD4linux.LCDType1.value[0] == "4" or LCD4linux.LCDType2.value[0] == "4": -# self.list1.append(getConfigListEntry(_("Internal TFT Active"), LCD4linux.LCDTFT)) +# if LCD4linux.LCDType1.value[0] == "4" or LCD4linux.LCDType2.value[0] == "4": +# self.list1.append(getConfigListEntry(_("Internal TFT Active"), LCD4linux.LCDTFT)) self.list1.append(getConfigListEntry(_("Active Screen"), LCD4linux.ScreenActive)) self.list1.append(getConfigListEntry(_("Screen Switch Select - Screen"), LCD4linux.ScreenSwitch)) self.list1.append(getConfigListEntry(_("Screen Default after mode change - Screen"), LCD4linux.ScreenDefault)) @@ -5764,9 +5766,9 @@ def SetList(self): self.list1.append(getConfigListEntry(_("Picture Sort"), LCD4linux.BilderSort)) self.list1.append(getConfigListEntry(_("Picture Directory Recursive"), LCD4linux.BilderRecursiv)) self.list1.append(getConfigListEntry(_("Picture Quality for Resizing"), LCD4linux.BilderQuality)) -# self.list1.append(getConfigListEntry(_("Picture JPEG-Quality [%]"), LCD4linux.BilderJPEG)) +# self.list1.append(getConfigListEntry(_("Picture JPEG-Quality [%]"), LCD4linux.BilderJPEG)) self.list1.append(getConfigListEntry(_("Picture Quick Update Time [s]"), LCD4linux.BilderQuick)) -# self.list1.append(getConfigListEntry(_("Picture Quick JPEG-Quality [%]"), LCD4linux.BilderJPEGQuick)) +# self.list1.append(getConfigListEntry(_("Picture Quick JPEG-Quality [%]"), LCD4linux.BilderJPEGQuick)) self.list1.append(getConfigListEntry(_("Picture Type [only Picture]"), LCD4linux.BilderTyp)) self.list1.append(getConfigListEntry(_("Background-Picture Type"), LCD4linux.BilderBackground)) self.list1.append(getConfigListEntry(_("Weather API"), LCD4linux.WetterApi)) @@ -5897,7 +5899,7 @@ def SetList(self): self.list1.append(getConfigListEntry(_("MJPEG Stream LCD 3 enable"), LCD4linux.MJPEGenable3)) self.list1.append(getConfigListEntry(_("MJPEG Stream LCD 3 Port"), LCD4linux.MJPEGport3)) self.list1.append(getConfigListEntry(_("MJPEG Stream LCD 3 Virtual Brightness"), LCD4linux.MJPEGvirtbri3)) -# self.list1.append(getConfigListEntry(_("MJPEG Boundary Mode"), LCD4linux.MJPEGMode)) +# self.list1.append(getConfigListEntry(_("MJPEG Boundary Mode"), LCD4linux.MJPEGMode)) self.list1.append(getConfigListEntry(_("MJPEG Cycle"), LCD4linux.MJPEGCycle)) self.list1.append(getConfigListEntry(_("MJPEG Restart on Error"), LCD4linux.MJPEGRestart)) self.list1.append(getConfigListEntry(_("MJPEG Header Mode"), LCD4linux.MJPEGHeader)) @@ -8011,8 +8013,8 @@ def fileSelected(self, dir, dir1): LCD4linux.MPTextFile.value = dirdir elif sel == LCD4linux.MPCoverFile: LCD4linux.MPCoverFile.value = dirdir -# elif sel == LCD4linux.MPCoverFile2: -# LCD4linux.MPCoverFile2.value = dirdir +# elif sel == LCD4linux.MPCoverFile2: +# LCD4linux.MPCoverFile2.value = dirdir elif sel == LCD4linux.BildFile: LCD4linux.BildFile.value = dirdir elif sel == LCD4linux.Bild2File: @@ -8492,7 +8494,7 @@ def __init__(self, session): self.ExternalIP = getExternalIP() self.timerlist = "" self.pluginlist = "" -# self.onShow.append(self.ServiceChange) +# self.onShow.append(self.ServiceChange) config.misc.standbyCounter.addNotifier(self.standbyQuery, initial_call=False) getBilder() self.Temp = GetTempSensor() @@ -8622,10 +8624,10 @@ def getSonos(self): return if self.SonosSoCo is not None: cti = self.SonosSoCo.get_current_transport_info() -# if LCD4linux.SonosON.value == True: -# cti = {u'current_transport_status': 'OK', u'current_transport_state': 'PLAYING', u'current_transport_speed': '1'} -# else: -# cti = {u'current_transport_status': 'OK', u'current_transport_state': 'STOPPED', u'current_transport_speed': '1'} +# if LCD4linux.SonosON.value == True: +# cti = {u'current_transport_status': 'OK', u'current_transport_state': 'PLAYING', u'current_transport_speed': '1'} +# else: +# cti = {u'current_transport_status': 'OK', u'current_transport_state': 'STOPPED', u'current_transport_speed': '1'} self.SonosInfo = cti.get("current_transport_state", "STOPPED") if self.SonosInfo != "PLAYING" or self.SonosSoCo.is_playing_tv: if self.SonosRunning: @@ -8638,8 +8640,8 @@ def getSonos(self): else: self.SonosTrack = self.SonosSoCo.get_current_track_info() self.Lvol = self.SonosSoCo.volume -# self.SonosTrack = {u'album': 'Sehnsucht', u'artist': 'Rammstein', u'title': 'Eifersucht', u'uri': 'x-sonos-spotify:spotify%3atrack%3a4Ugp6Wu4hVXnbEKT3Nrka0?sid=9&flags=8224&sn=3', u'playlist_position': '10', u'duration': '0:03:35', u'position': '0:01:39', u'album_art': u'http://192.168.0.84:1400/getaa?s=1&u=x-sonos-spotify%3aspotify%253atrack%253a4Ugp6Wu4hVXnbEKT3Nrka0%3fsid%3d9%26flags%3d8224%26sn%3d3', u'metadata': 'x-sonos-spotify:spotify%3atrack%3a4Ugp6Wu4hVXnbEKT3Nrka0?sid=9&flags=8224&sn=3/getaa?s=1&u=x-sonos-spotify%3aspotify%253atrack%253a4Ugp6Wu4hVXnbEKT3Nrka0%3fsid%3d9%26flags%3d8224%26sn%3d3Eifersuchtobject.item.audioItem.musicTrackRammsteinSehnsucht'} - if self.SonosRunning == False: +# self.SonosTrack = {u'album': 'Sehnsucht', u'artist': 'Rammstein', u'title': 'Eifersucht', u'uri': 'x-sonos-spotify:spotify%3atrack%3a4Ugp6Wu4hVXnbEKT3Nrka0?sid=9&flags=8224&sn=3', u'playlist_position': '10', u'duration': '0:03:35', u'position': '0:01:39', u'album_art': u'http://192.168.0.84:1400/getaa?s=1&u=x-sonos-spotify%3aspotify%253atrack%253a4Ugp6Wu4hVXnbEKT3Nrka0%3fsid%3d9%26flags%3d8224%26sn%3d3', u'metadata': 'x-sonos-spotify:spotify%3atrack%3a4Ugp6Wu4hVXnbEKT3Nrka0?sid=9&flags=8224&sn=3/getaa?s=1&u=x-sonos-spotify%3aspotify%253atrack%253a4Ugp6Wu4hVXnbEKT3Nrka0%3fsid%3d9%26flags%3d8224%26sn%3d3Eifersuchtobject.item.audioItem.musicTrackRammsteinSehnsucht'} + if self.SonosRunning is False: self.SonosSoCo = None self.SonosRunning = True isMediaPlayer = "sonos" @@ -10392,7 +10394,7 @@ def getNumber(actservice): # actservice must be an instance of eServiceReferenc playable = not (service.flags & mask) if playable: number += 1 -# L4logE(" ",service.getPath()) +# L4logE(" ",service.getPath()) if actbouquet: if actbouquet == bouquet and actservice == service: return number @@ -12325,7 +12327,7 @@ def putProgress(workaround, draw, im): else: ms = 1 font = ImageFont.truetype(ConfigFont, int(ConfigSize * ms) + 8, encoding='unic') # 5 -# if self.Lpath and ":0:" not in self.Lpath and "//" not in self.Lpath: # Movie +# if self.Lpath and ":0:" not in self.Lpath and "//" not in self.Lpath: # Movie if self.Llength is not None and self.Llength[0] != -1: isVideoPlaying = 1 try: @@ -13914,7 +13916,7 @@ def getColor(c): if ConfigModule == "0": ConfigModule = ConfigModuleUser font = ImageFont.truetype(ConfigFont, ConfigSize, encoding='unic') -# font1 = ImageFont.truetype(ConfigFont, int(ConfigSize / 1.5), encoding='unic') +# font1 = ImageFont.truetype(ConfigFont, int(ConfigSize / 1.5), encoding='unic') font2 = ImageFont.truetype(ConfigFont, int(ConfigSize / 2), encoding='unic') font3 = ImageFont.truetype(ConfigFont, int(ConfigSize / 3), encoding='unic') font4 = ImageFont.truetype(ConfigFont, int(ConfigSize / 5), encoding='unic') @@ -14462,7 +14464,7 @@ def Sync(L): L4Lkeys = sorted(L4LElist.get().keys()) for E in L4Lkeys: CUR = L4LElist.get(E) -# L4logE("CUR: %s Active %s" % (CUR,ScreenActive[0])) +# L4logE("CUR: %s Active %s" % (CUR,ScreenActive[0])) LCD = str(CUR.get("Lcd", "1")) if getSA(int(LCD)) in str(CUR.get("Screen", "1")) and MODE in CUR.get("Mode", "On"): Typ = CUR.get("Typ", None) @@ -14543,7 +14545,7 @@ def Lput4(LCD, SCR, FUNC, PARA): if not LCD4linux.Enable.value: return tt = time() -# L4logE("MP-Mode", isMediaPlayer) +# L4logE("MP-Mode", isMediaPlayer) L4log("creating LCD-Picture: %s" % ScreenActive) if isdir("%slcd4linux" % TMP) == False: try: @@ -14571,7 +14573,7 @@ def Lput4(LCD, SCR, FUNC, PARA): self.SaveisMediaPlayer = isMediaPlayer isMediaPlayer = "" rmFile(MP3tmp) -# rmFile(GoogleCover) +# rmFile(GoogleCover) if self.SonosRunning: isMediaPlayer, logtext = ("sonos", "detected Sonos") elif self.YMCastRunning: From f8668c2707129ff5cdf3490ae772ec65a40c1c3c Mon Sep 17 00:00:00 2001 From: "Mr.Servo" Date: Mon, 13 Oct 2025 19:09:37 +0200 Subject: [PATCH 2/2] [LCD4linux] V5.0-r36 photoframe "Samsung SPF-1000W 1024x768" added - improvement: added support for photoframe "SPF-1000W" - reveted some AUTOPEP8 corrections (mainly commentary lines) THX to User **KenTucky @ OpenA.TV** details see: www.opena.tv/viewtopic.php?p=591144#p591139 HINT: **LCD4linux** is still working under Python2 and Python3 --- lcd4linux/src/Photoframe.py | 4 ++++ lcd4linux/src/plugin.py | 46 ++++++++++++++++++------------------- 2 files changed, 27 insertions(+), 23 deletions(-) diff --git a/lcd4linux/src/Photoframe.py b/lcd4linux/src/Photoframe.py index 9fa77ad..e8f2137 100644 --- a/lcd4linux/src/Photoframe.py +++ b/lcd4linux/src/Photoframe.py @@ -86,6 +86,10 @@ def get_known_devices(): dlist.append({'name': "SPF800W Mini Monitor", 'idVendor': 0x04e8, 'idProduct': 0x204c, 'width': 800, 'height': 600}) dlist.append({'name': "SPF800W Mass Storage", 'idVendor': 0x04e8, 'idProduct': 0x204b}) + # 28,29 Samsung SPF-1000W (217) + dlist.append({'name': "SPF1000W Mini Monitor", 'idVendor': 0x04e8, 'idProduct': 0x204e, 'width': 1024, 'height': 768}) + dlist.append({'name': "SPF1000W Mass Storage", 'idVendor': 0x04e8, 'idProduct': 0x204d}) + # Amazon Fire 7 (9th Generation 2019) dlist.append({'name': "Amazon Fire 7 Mini Monitor", 'idVendor': 0x1949, 'idProduct': 0x03C3, 'width': 1024, 'height': 600}) dlist.append({'name': "Amazon Fire 7 Mass Storage", 'idVendor': 0x1949, 'idProduct': 0x03C1}) diff --git a/lcd4linux/src/plugin.py b/lcd4linux/src/plugin.py index 2d552e8..18e1804 100644 --- a/lcd4linux/src/plugin.py +++ b/lcd4linux/src/plugin.py @@ -172,7 +172,7 @@ if find_library("usb-0.1") is not None or find_library("usb-1.0") is not None: print("[LCD4linux] libusb found :-)", getEnigmaVersionString()) USBok = True -Version = "V5.0-r35" +Version = "V5.0-r36" L4LElist = L4Lelement() L4LdoThread = True LCD4enigma2config = resolveFilename(SCOPE_CONFIG) # /etc/enigma2/ @@ -314,7 +314,7 @@ ("11", _("Pearl (or compatible LCD) 320x240")), ("12", _("Pearl (or compatible LCD) 240x320")), ("121", _("Corby@Pearl 128x128")), ("122", _("AX206 (or compatible LCD) 480x320")), ("123", _("AX206 (or compatible LCD) 800x480")), ("210", _("Samsung SPF-72H 800x480")), ("23", _("Samsung SPF-75H/76H 800x480")), ("24", _("Samsung SPF-87H 800x480")), ("25", _("Samsung SPF-87H old 800x480")), ("26", _("Samsung SPF-83H 800x600")), ("29", _("Samsung SPF-85H/86H 800x600")), ("212", _("Samsung SPF-85P/86P 800x600")), ("28", _("Samsung SPF-105P 1024x600")), ("27", _("Samsung SPF-107H 1024x600")), ("213", _("Samsung SPF-107H old 1024x600")), - ("211", _("Samsung SPF-700T 800x600")), ("215", _("Samsung SPF-800P 800x480")), ("214", _("Samsung SPF-1000P 1024x600")), ("216", _("Samsung SPF-800W 800x600")), ("430", _("Internal TFT-LCD 400x240")), ("50", _("Internal Box-Skin-LCD")), + ("211", _("Samsung SPF-700T 800x600")), ("215", _("Samsung SPF-800P 800x480")), ("214", _("Samsung SPF-1000P 1024x600")), ("216", _("Samsung SPF-800W 800x600")), ("217", _("Samsung SPF-1000W 1024x768")), ("430", _("Internal TFT-LCD 400x240")), ("50", _("Internal Box-Skin-LCD")), ("31", _("only Picture 320x240")), ("33", _("only Picture 800x480")), ("36", _("only Picture 800x600")), ("37", _("only Picture 1024x600")), ("320", _("only Picture Custom Size")), ("420", _("only Picture Custom Size 2")) ] if PNGutilOK: @@ -2897,7 +2897,7 @@ def getResolution(t, r): elif t[1:] in ["7", "8", "13", "14"]: MAX_W, MAX_H = 1024, 600 elif t[1:] == "17": - MAX_W, MAX_H = 220, 176 + MAX_W, MAX_H = 1024, 768 elif t[1:] == "18": MAX_W, MAX_H = 255, 64 elif t[1:] == "22": @@ -5151,7 +5151,7 @@ def MailDecode(Sdecode): try: if mailserver is not None: mailserver.select("inbox") -# typ, data = mailserver.search(None, '(SINCE "{date}")'.format(date=Date)) +# typ, data = mailserver.search(None, '(SINCE "{date}")'.format(date=Date)) if str(LCD4linux.MailIMAPDays.value) == "0": typ, data = mailserver.search(None, 'ALL') else: @@ -5745,8 +5745,8 @@ def SetList(self): self.list1.append(getConfigListEntry(_("- Color"), LCD4linux.PopupColor)) self.list1.append(getConfigListEntry(_("- Background Color"), LCD4linux.PopupBackColor)) self.list1.append(getConfigListEntry(_("- Font"), LCD4linux.PopupFont)) -# if LCD4linux.LCDType1.value[0] == "4" or LCD4linux.LCDType2.value[0] == "4": -# self.list1.append(getConfigListEntry(_("Internal TFT Active"), LCD4linux.LCDTFT)) +# if LCD4linux.LCDType1.value[0] == "4" or LCD4linux.LCDType2.value[0] == "4": +# self.list1.append(getConfigListEntry(_("Internal TFT Active"), LCD4linux.LCDTFT)) self.list1.append(getConfigListEntry(_("Active Screen"), LCD4linux.ScreenActive)) self.list1.append(getConfigListEntry(_("Screen Switch Select - Screen"), LCD4linux.ScreenSwitch)) self.list1.append(getConfigListEntry(_("Screen Default after mode change - Screen"), LCD4linux.ScreenDefault)) @@ -5766,9 +5766,9 @@ def SetList(self): self.list1.append(getConfigListEntry(_("Picture Sort"), LCD4linux.BilderSort)) self.list1.append(getConfigListEntry(_("Picture Directory Recursive"), LCD4linux.BilderRecursiv)) self.list1.append(getConfigListEntry(_("Picture Quality for Resizing"), LCD4linux.BilderQuality)) -# self.list1.append(getConfigListEntry(_("Picture JPEG-Quality [%]"), LCD4linux.BilderJPEG)) +# self.list1.append(getConfigListEntry(_("Picture JPEG-Quality [%]"), LCD4linux.BilderJPEG)) self.list1.append(getConfigListEntry(_("Picture Quick Update Time [s]"), LCD4linux.BilderQuick)) -# self.list1.append(getConfigListEntry(_("Picture Quick JPEG-Quality [%]"), LCD4linux.BilderJPEGQuick)) +# self.list1.append(getConfigListEntry(_("Picture Quick JPEG-Quality [%]"), LCD4linux.BilderJPEGQuick)) self.list1.append(getConfigListEntry(_("Picture Type [only Picture]"), LCD4linux.BilderTyp)) self.list1.append(getConfigListEntry(_("Background-Picture Type"), LCD4linux.BilderBackground)) self.list1.append(getConfigListEntry(_("Weather API"), LCD4linux.WetterApi)) @@ -5899,7 +5899,7 @@ def SetList(self): self.list1.append(getConfigListEntry(_("MJPEG Stream LCD 3 enable"), LCD4linux.MJPEGenable3)) self.list1.append(getConfigListEntry(_("MJPEG Stream LCD 3 Port"), LCD4linux.MJPEGport3)) self.list1.append(getConfigListEntry(_("MJPEG Stream LCD 3 Virtual Brightness"), LCD4linux.MJPEGvirtbri3)) -# self.list1.append(getConfigListEntry(_("MJPEG Boundary Mode"), LCD4linux.MJPEGMode)) +# self.list1.append(getConfigListEntry(_("MJPEG Boundary Mode"), LCD4linux.MJPEGMode)) self.list1.append(getConfigListEntry(_("MJPEG Cycle"), LCD4linux.MJPEGCycle)) self.list1.append(getConfigListEntry(_("MJPEG Restart on Error"), LCD4linux.MJPEGRestart)) self.list1.append(getConfigListEntry(_("MJPEG Header Mode"), LCD4linux.MJPEGHeader)) @@ -8013,8 +8013,8 @@ def fileSelected(self, dir, dir1): LCD4linux.MPTextFile.value = dirdir elif sel == LCD4linux.MPCoverFile: LCD4linux.MPCoverFile.value = dirdir -# elif sel == LCD4linux.MPCoverFile2: -# LCD4linux.MPCoverFile2.value = dirdir +# elif sel == LCD4linux.MPCoverFile2: +# LCD4linux.MPCoverFile2.value = dirdir elif sel == LCD4linux.BildFile: LCD4linux.BildFile.value = dirdir elif sel == LCD4linux.Bild2File: @@ -8494,7 +8494,7 @@ def __init__(self, session): self.ExternalIP = getExternalIP() self.timerlist = "" self.pluginlist = "" -# self.onShow.append(self.ServiceChange) +# self.onShow.append(self.ServiceChange) config.misc.standbyCounter.addNotifier(self.standbyQuery, initial_call=False) getBilder() self.Temp = GetTempSensor() @@ -8624,10 +8624,10 @@ def getSonos(self): return if self.SonosSoCo is not None: cti = self.SonosSoCo.get_current_transport_info() -# if LCD4linux.SonosON.value == True: -# cti = {u'current_transport_status': 'OK', u'current_transport_state': 'PLAYING', u'current_transport_speed': '1'} -# else: -# cti = {u'current_transport_status': 'OK', u'current_transport_state': 'STOPPED', u'current_transport_speed': '1'} +# if LCD4linux.SonosON.value == True: +# cti = {u'current_transport_status': 'OK', u'current_transport_state': 'PLAYING', u'current_transport_speed': '1'} +# else: +# cti = {u'current_transport_status': 'OK', u'current_transport_state': 'STOPPED', u'current_transport_speed': '1'} self.SonosInfo = cti.get("current_transport_state", "STOPPED") if self.SonosInfo != "PLAYING" or self.SonosSoCo.is_playing_tv: if self.SonosRunning: @@ -8640,7 +8640,7 @@ def getSonos(self): else: self.SonosTrack = self.SonosSoCo.get_current_track_info() self.Lvol = self.SonosSoCo.volume -# self.SonosTrack = {u'album': 'Sehnsucht', u'artist': 'Rammstein', u'title': 'Eifersucht', u'uri': 'x-sonos-spotify:spotify%3atrack%3a4Ugp6Wu4hVXnbEKT3Nrka0?sid=9&flags=8224&sn=3', u'playlist_position': '10', u'duration': '0:03:35', u'position': '0:01:39', u'album_art': u'http://192.168.0.84:1400/getaa?s=1&u=x-sonos-spotify%3aspotify%253atrack%253a4Ugp6Wu4hVXnbEKT3Nrka0%3fsid%3d9%26flags%3d8224%26sn%3d3', u'metadata': 'x-sonos-spotify:spotify%3atrack%3a4Ugp6Wu4hVXnbEKT3Nrka0?sid=9&flags=8224&sn=3/getaa?s=1&u=x-sonos-spotify%3aspotify%253atrack%253a4Ugp6Wu4hVXnbEKT3Nrka0%3fsid%3d9%26flags%3d8224%26sn%3d3Eifersuchtobject.item.audioItem.musicTrackRammsteinSehnsucht'} +# self.SonosTrack = {u'album': 'Sehnsucht', u'artist': 'Rammstein', u'title': 'Eifersucht', u'uri': 'x-sonos-spotify:spotify%3atrack%3a4Ugp6Wu4hVXnbEKT3Nrka0?sid=9&flags=8224&sn=3', u'playlist_position': '10', u'duration': '0:03:35', u'position': '0:01:39', u'album_art': u'http://192.168.0.84:1400/getaa?s=1&u=x-sonos-spotify%3aspotify%253atrack%253a4Ugp6Wu4hVXnbEKT3Nrka0%3fsid%3d9%26flags%3d8224%26sn%3d3', u'metadata': 'x-sonos-spotify:spotify%3atrack%3a4Ugp6Wu4hVXnbEKT3Nrka0?sid=9&flags=8224&sn=3/getaa?s=1&u=x-sonos-spotify%3aspotify%253atrack%253a4Ugp6Wu4hVXnbEKT3Nrka0%3fsid%3d9%26flags%3d8224%26sn%3d3Eifersuchtobject.item.audioItem.musicTrackRammsteinSehnsucht'} if self.SonosRunning is False: self.SonosSoCo = None self.SonosRunning = True @@ -10394,7 +10394,7 @@ def getNumber(actservice): # actservice must be an instance of eServiceReferenc playable = not (service.flags & mask) if playable: number += 1 -# L4logE(" ",service.getPath()) +# L4logE(" ",service.getPath()) if actbouquet: if actbouquet == bouquet and actservice == service: return number @@ -12327,7 +12327,7 @@ def putProgress(workaround, draw, im): else: ms = 1 font = ImageFont.truetype(ConfigFont, int(ConfigSize * ms) + 8, encoding='unic') # 5 -# if self.Lpath and ":0:" not in self.Lpath and "//" not in self.Lpath: # Movie +# if self.Lpath and ":0:" not in self.Lpath and "//" not in self.Lpath: # Movie if self.Llength is not None and self.Llength[0] != -1: isVideoPlaying = 1 try: @@ -13916,7 +13916,7 @@ def getColor(c): if ConfigModule == "0": ConfigModule = ConfigModuleUser font = ImageFont.truetype(ConfigFont, ConfigSize, encoding='unic') -# font1 = ImageFont.truetype(ConfigFont, int(ConfigSize / 1.5), encoding='unic') +# font1 = ImageFont.truetype(ConfigFont, int(ConfigSize / 1.5), encoding='unic') font2 = ImageFont.truetype(ConfigFont, int(ConfigSize / 2), encoding='unic') font3 = ImageFont.truetype(ConfigFont, int(ConfigSize / 3), encoding='unic') font4 = ImageFont.truetype(ConfigFont, int(ConfigSize / 5), encoding='unic') @@ -14464,7 +14464,7 @@ def Sync(L): L4Lkeys = sorted(L4LElist.get().keys()) for E in L4Lkeys: CUR = L4LElist.get(E) -# L4logE("CUR: %s Active %s" % (CUR,ScreenActive[0])) +# L4logE("CUR: %s Active %s" % (CUR,ScreenActive[0])) LCD = str(CUR.get("Lcd", "1")) if getSA(int(LCD)) in str(CUR.get("Screen", "1")) and MODE in CUR.get("Mode", "On"): Typ = CUR.get("Typ", None) @@ -14545,7 +14545,7 @@ def Lput4(LCD, SCR, FUNC, PARA): if not LCD4linux.Enable.value: return tt = time() -# L4logE("MP-Mode", isMediaPlayer) +# L4logE("MP-Mode", isMediaPlayer) L4log("creating LCD-Picture: %s" % ScreenActive) if isdir("%slcd4linux" % TMP) == False: try: @@ -14573,7 +14573,7 @@ def Lput4(LCD, SCR, FUNC, PARA): self.SaveisMediaPlayer = isMediaPlayer isMediaPlayer = "" rmFile(MP3tmp) -# rmFile(GoogleCover) +# rmFile(GoogleCover) if self.SonosRunning: isMediaPlayer, logtext = ("sonos", "detected Sonos") elif self.YMCastRunning: