From 29eeed4eca59aa9017ca0c06a543b32dc23a83ed Mon Sep 17 00:00:00 2001 From: fairbird Date: Mon, 5 Feb 2024 22:02:45 +0300 Subject: [PATCH 1/7] Update --- data/setup.xml | 8 ++++---- lib/python/Components/Lcd.py | 27 +++++++++++++++++++++++++++ lib/python/Screens/SessionGlobals.py | 2 +- 3 files changed, 32 insertions(+), 5 deletions(-) diff --git a/data/setup.xml b/data/setup.xml index bdc2adc78..e5444cab3 100644 --- a/data/setup.xml +++ b/data/setup.xml @@ -404,14 +404,14 @@ config.lcd.ledpowercolor config.lcd.ledstandbycolor config.lcd.ledsuspendcolor - config.lcd.ledblinkcontrolcolor - config.lcd.ledbrightnesscontrol - config.lcd.ledcolorcontrolcolor - config.lcd.ledfadecontrolcolor config.lcd.power4x7on config.lcd.power4x7standby config.lcd.power4x7suspend config.usage.show_in_standby + config.lcd.ledblinkcontrolcolor + config.lcd.ledbrightnesscontrol + config.lcd.ledcolorcontrolcolor + config.lcd.ledfadecontrolcolor config.sat.tunerslot diff --git a/lib/python/Components/Lcd.py b/lib/python/Components/Lcd.py index 0274f8673..ab1b182ae 100644 --- a/lib/python/Components/Lcd.py +++ b/lib/python/Components/Lcd.py @@ -686,6 +686,33 @@ def doNothing(): def doNothing(): pass + # For Dreamone only + def setLedBlinkControlColor(configElement): + fileWriteLine("/proc/stb/fp/led_blink", configElement.value) + + def setLedBrightnessControl(configElement): + fileWriteLine("/proc/stb/fp/led_brightness", configElement.value) + + def setLedColorControlColor(configElement): + fileWriteLine("/proc/stb/fp/led_color", configElement.value) + + def setLedFadeControlColor(configElement): + fileWriteLine("/proc/stb/fp/led_fade", configElement.value) + + if isfile("/proc/stb/fp/led_blink"): + config.lcd.ledblinkcontrolcolor.addNotifier(setLedBlinkControlColor) + print("led_blink ***************", config.lcd.ledblinkcontrolcolor.addNotifier(setLedBlinkControlColor)) + if isfile("/proc/stb/fp/led_brightness"): + config.lcd.ledbrightnesscontrol.addNotifier(setLedBrightnessControl) + print("led_brightness ***************", config.lcd.ledbrightnesscontrol.addNotifier(setLedBrightnessControl)) + if isfile("/proc/stb/fp/led_color"): + config.lcd.ledcolorcontrolcolor.addNotifier(setLedColorControlColor) + print("led_color ***************", config.lcd.ledcolorcontrolcolor.addNotifier(setLedColorControlColor)) + if isfile("/proc/stb/fp/led_fade"): + config.lcd.ledfadecontrolcolor.addNotifier(setLedFadeControlColor) + print("led_fade ***************", config.lcd.ledfadecontrolcolor.addNotifier(setLedFadeControlColor)) + ## + config.lcd.contrast = ConfigNothing() config.lcd.bright = ConfigNothing() config.lcd.standby = ConfigNothing() diff --git a/lib/python/Screens/SessionGlobals.py b/lib/python/Screens/SessionGlobals.py index 972cd1452..b31784b44 100644 --- a/lib/python/Screens/SessionGlobals.py +++ b/lib/python/Screens/SessionGlobals.py @@ -97,7 +97,7 @@ def __init__(self, session): if MODEL in ("dm520"): FrontpanelLed(which=0, boolean=False, patterns=[PATTERN_ON, PATTERN_BLINK, PATTERN_OFF, PATTERN_BLINK]).connect(combine) FrontpanelLed(which=1, boolean=False, patterns=[PATTERN_OFF, PATTERN_OFF, PATTERN_OFF, PATTERN_OFF]).connect(combine) - elif MODEL in ("dm900", "dm920"): + elif MODEL in ("dm900", "dm920", "dreamone", "dreamtwo"): FrontpanelLed(which=0, boolean=False, patterns=[NormalLed0, RecLed0, StandbyLed0, RecstdbyLed0]).connect(combine) FrontpanelLed(which=1, boolean=False, patterns=[NormalLed1, RecLed1, StandbyLed1, RecstdbyLed1]).connect(combine) else: From 4b76ddcf180badaa556f12759a2347dbc8de299f Mon Sep 17 00:00:00 2001 From: fairbird Date: Mon, 5 Feb 2024 22:18:26 +0300 Subject: [PATCH 2/7] Update --- lib/python/Components/SystemInfo.py | 1 + lib/python/StartEnigma.py | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/lib/python/Components/SystemInfo.py b/lib/python/Components/SystemInfo.py index b61161074..1c42f26e7 100644 --- a/lib/python/Components/SystemInfo.py +++ b/lib/python/Components/SystemInfo.py @@ -341,6 +341,7 @@ def getBoxName(): BoxInfo.setItem("HasHDMIinPiP", BoxInfo.getItem("HasHDMIin") and BRAND != "dreambox") BoxInfo.setItem("DreamBoxAudio", MODEL in ("dm7080", "dm800", "dm900", "dm920", "dreamone", "dreamtwo")) BoxInfo.setItem("DreamBoxDVI", MODEL in ("dm8000", "dm800")) +BoxInfo.setItem("VFDSymbol", BoxInfo.getItem("vfdsymbol")) BoxInfo.setItem("HasHDMI-CEC", BoxInfo.getItem("hdmi") and fileExists(resolveFilename(SCOPE_PLUGINS, "SystemPlugins/HdmiCEC/plugin.pyc")) and (fileExists("/dev/cec0") or fileExists("/dev/hdmi_cec") or fileExists("/dev/misc/hdmi_cec0"))) BoxInfo.setItem("HasYPbPr", MODEL in ("dm8000", "et5000", "et6000", "et6500", "et9000", "et9200", "et9500", "et10000", "formuler1", "mbtwinplus", "spycat", "vusolo", "vuduo", "vuduo2", "vuultimo")) BoxInfo.setItem("HasScart", MODEL in ("dm8000", "et4000", "et6500", "et8000", "et9000", "et9200", "et9500", "et10000", "formuler1", "hd1100", "hd1200", "hd1265", "hd2400", "vusolo", "vusolo2", "vuduo", "vuduo2", "vuultimo", "vuuno", "xp1000")) diff --git a/lib/python/StartEnigma.py b/lib/python/StartEnigma.py index 760cda883..d86482201 100644 --- a/lib/python/StartEnigma.py +++ b/lib/python/StartEnigma.py @@ -530,6 +530,11 @@ def runNextScreen(session, screensToRun, *result): enigma.eProfileWrite("Init:PowerKey") power = PowerKey(session) + if BoxInfo.getItem("VFDSymbol"): +# profile("VFDSymbols") + from Components.VfdSymbols import SymbolsCheck + SymbolsCheck(session) + # we need session.scart to access it from within menu.xml session.scart = AutoScartControl(session) From 05a168661dcc7acc1f068030390a2bd6035d72d8 Mon Sep 17 00:00:00 2001 From: fairbird Date: Tue, 6 Feb 2024 15:01:40 +0300 Subject: [PATCH 3/7] [SystemInfo] Update --- lib/python/Components/SystemInfo.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/python/Components/SystemInfo.py b/lib/python/Components/SystemInfo.py index 1c42f26e7..1c34fa17c 100644 --- a/lib/python/Components/SystemInfo.py +++ b/lib/python/Components/SystemInfo.py @@ -290,6 +290,7 @@ def getBoxName(): BoxInfo.setItem("StandbyLED", fileCheck("/proc/stb/power/standbyled") or MODEL in ("gbue4k", "gbquad4k") and fileCheck("/proc/stb/fp/led0_pattern")) BoxInfo.setItem("SuspendLED", fileCheck("/proc/stb/power/suspendled") or fileCheck("/proc/stb/fp/enable_led")) BoxInfo.setItem("Display", BoxInfo.getItem("FrontpanelDisplay") or BoxInfo.getItem("StandbyLED") or MODEL in ("dreamone", "dreamtwo")) +BoxInfo.setItem("LEDColorControl", fileExists("/proc/stb/fp/led_color")) BoxInfo.setItem("LedPowerColor", fileCheck("/proc/stb/fp/ledpowercolor")) BoxInfo.setItem("LedStandbyColor", fileCheck("/proc/stb/fp/ledstandbycolor")) BoxInfo.setItem("LedSuspendColor", fileCheck("/proc/stb/fp/ledsuspendledcolor")) From 55accd0844bfe46aa7d9a3136c3e7583c0d988ca Mon Sep 17 00:00:00 2001 From: fairbird Date: Tue, 6 Feb 2024 15:30:19 +0300 Subject: [PATCH 4/7] Update --- data/menu.xml | 3 +- data/setup.xml | 15 +- lib/python/Components/FrontPanelLed.py | 166 ++++++++++++++++++ lib/python/Components/Lcd.py | 57 +----- lib/python/Components/Makefile.am | 2 +- .../Components/Renderer/FrontpanelLed2.py | 39 ++++ lib/python/Components/Renderer/Makefile.am | 2 +- lib/python/Components/SystemInfo.py | 1 + lib/python/Screens/SessionGlobals.py | 14 +- lib/python/StartEnigma.py | 7 + 10 files changed, 239 insertions(+), 67 deletions(-) create mode 100644 lib/python/Components/FrontPanelLed.py create mode 100644 lib/python/Components/Renderer/FrontpanelLed2.py diff --git a/data/menu.xml b/data/menu.xml index c05833355..3eaeb6413 100644 --- a/data/menu.xml +++ b/data/menu.xml @@ -63,7 +63,8 @@ - + + diff --git a/data/setup.xml b/data/setup.xml index e5444cab3..0650011e7 100644 --- a/data/setup.xml +++ b/data/setup.xml @@ -390,10 +390,10 @@ config.lcd.showoutputresolution - config.usage.frontled_color - config.usage.frontledrec_color - config.usage.frontledstdby_color - config.usage.frontledrecstdby_color + config.usage.frontled_color + config.usage.frontledrec_color + config.usage.frontledstdby_color + config.usage.frontledrecstdby_color config.lcd.ledbrightness config.lcd.ledbrightnessstandby config.lcd.ledbrightnessdeepstandby @@ -413,6 +413,13 @@ config.lcd.ledcolorcontrolcolor config.lcd.ledfadecontrolcolor + + config.fp.led.default_color + config.fp.led.default_brightness + config.fp.led.standby_color + config.fp.led.standby_brightness + config.fp.led.shutdown_color + config.sat.tunerslot config.sat.configmode diff --git a/lib/python/Components/FrontPanelLed.py b/lib/python/Components/FrontPanelLed.py new file mode 100644 index 000000000..f69b4ca1d --- /dev/null +++ b/lib/python/Components/FrontPanelLed.py @@ -0,0 +1,166 @@ +from enigma import iRecordableService +from Components.config import config, ConfigSlider, ConfigSelection, ConfigSubsection +from Tools.Directories import fileExists + + +config.fp = ConfigSubsection() +config.fp.led = ConfigSubsection() +colors = [ + ("0xFF0000", _("red")), + ("0xFF3333", _("rose")), + ("0xFF5500", _("orange")), + ("0xDD9900", _("yellow")), + ("0x99DD00", _("lime")), + ("0x00FF00", _("green")), + ("0x00FF99", _("aqua")), + ("0x00BBFF", _("olympic blue")), + ("0x0000FF", _("blue")), + ("0x6666FF", _("azure")), + ("0x9900FF", _("purple")), + ("0xFF0066", _("pink")), + ("0xFFFFFF", _("white")), +] +# running +config.fp.led.default_color = ConfigSelection(colors, default="0xFFFFFF") +config.fp.led.default_brightness = ConfigSlider(default=0xff, increment=25, limits=(0, 0xff)) +# standby +config.fp.led.standby_color = ConfigSelection(colors, default="0xFFFFFF") +config.fp.led.standby_brightness = ConfigSlider(default=0x08, increment=8, limits=(0, 0xff)) +# shutdown +config.fp.led.shutdown_color = ConfigSelection(colors, default="0xFF5500") + +frontPanelLed = None + + +class FrontPanelLed: + BLINK_PATH = "/proc/stb/fp/led_blink" + BLINK_DEFAULT = 0x0710ff + + BRIGHTNESS_PATH = "/proc/stb/fp/led_brightness" + BRIGHTNESS_DEFAULT = 0xFF + + COLOR_PATH = "/proc/stb/fp/led_color" + COLOR_DEFAULT = 0xFFFFFF + + FADE_PATH = "/proc/stb/fp/led_fade" + FADE_DEFAULT = 0x7 + + instance = None + + def __init__(self): + assert (not FrontPanelLed.instance) + FrontPanelLed.instance = self + self._session = None + self.default() + config.misc.standbyCounter.addNotifier(self._onStandby, initial_call=False) + config.fp.led.default_color.addNotifier(self._onDefaultChanged, initial_call=False) + config.fp.led.default_brightness.addNotifier(self._onDefaultChanged, initial_call=False) + + def init(self, session): + self._session = session + session.nav.record_event.append(self.checkRecordings) + + def _onDefaultChanged(self, *args): + from Screens.Standby import inStandby + if not inStandby: + FrontPanelLed.default() + + def _onStandby(self, *args): + FrontPanelLed.standby() + from Screens.Standby import inStandby + if inStandby: + inStandby.onClose.append(self._onLeaveStandby) + + def _onLeaveStandby(self): + FrontPanelLed.default() + + def checkRecordings(self, service=None, event=iRecordableService.evEnd): + if not self._session: + return + if event == iRecordableService.evEnd: + recordings = self._session.nav.getRecordings() + if not recordings: + FrontPanelLed.stopRecording() + else: + FrontPanelLed.recording() + elif event == iRecordableService.evStart: + FrontPanelLed.recording() + + @staticmethod + def _write(path, value): + if not fileExists(path): + print("[FrontPanelLed] %s does not exist!" % (path)) + return + with open(path, 'w') as f: + value = "%x" % (value) + print("[FrontPanelLed] : %s" % (value)) + f.write(value) + + # 8 bit brightness + @staticmethod + def setBrightness(value=BRIGHTNESS_DEFAULT): + if value > 0xff or value < 0: + print("[FrontPanelLed] LED brightness has to be between 0x0 and 0xff! Using default value (%x)" % (FrontPanelLed.BRIGHTNESS_DEFAULT)) + value = FrontPanelLed.BRIGHTNESS_DEFAULT + FrontPanelLed._write(FrontPanelLed.BRIGHTNESS_PATH, value) + + # 24 bit RGB + @staticmethod + def setColor(value=COLOR_DEFAULT): + if value > 0xffffff or value < 0: + print("[FrontPanelLed] LED color has to be between 0x0 and 0xffffff (r, g b)! Using default value (%x)" % (FrontPanelLed.COLOR_DEFAULT)) + value = FrontPanelLed.COLOR_DEFAULT + FrontPanelLed._write(FrontPanelLed.COLOR_PATH, value) + + # 8 bit on-time (* 31ms), 8 bit total time (* 31ms), 8 bit number of repeats (ff == unlimited) + @staticmethod + def setBlink(value=BLINK_DEFAULT): + if value > 0xffffff or value < 0: + print("[FrontPanelLed] LED blink has to be between 0x0 and 0xffffff (on, total, repeats)! Using default value (%x)" % (FrontPanelLed.BLINK_DEFAULT)) + value = FrontPanelLed.BLINK_DEFAULT + FrontPanelLed._write(FrontPanelLed.BLINK_PATH, value) + + # 8 bit fade time (* 51ms) + @staticmethod + def setFade(value=FADE_DEFAULT): + if value > 0xff or value < 0: + value = FrontPanelLed.FADE_DEFAULT + print("[FrontPanelLed] LED fade has to be between 0x0 and 0xff! Using default value (%x)" % (FrontPanelLed.FADE_DEFAULT)) + FrontPanelLed._write(FrontPanelLed.FADE_PATH, value) + + @staticmethod + def default(checkRec=True): + FrontPanelLed.setBrightness(config.fp.led.default_brightness.value) + FrontPanelLed.setColor(int(config.fp.led.default_color.value, 0)) + if checkRec: + FrontPanelLed.instance.checkRecordings() + + @staticmethod + def recording(): + FrontPanelLed.setFade() + FrontPanelLed.setBlink() + + @staticmethod + def stopRecording(): + from Screens.Standby import inStandby + if inStandby: + FrontPanelLed.standby(False) + else: + FrontPanelLed.default(False) + + @staticmethod + def standby(checkRec=True): + FrontPanelLed.setBrightness(config.fp.led.standby_brightness.value) + FrontPanelLed.setColor(int(config.fp.led.standby_color.value, 0)) + if checkRec: + FrontPanelLed.instance.checkRecordings() + + @staticmethod + def shutdown(): + FrontPanelLed.setFade(0) + FrontPanelLed.setBrightness(0xFF) + FrontPanelLed.setColor(int(config.fp.led.shutdown_color.value, 0)) + FrontPanelLed.setBlink() + + +frontPanelLed = FrontPanelLed() diff --git a/lib/python/Components/Lcd.py b/lib/python/Components/Lcd.py index ab1b182ae..55a1cc42b 100644 --- a/lib/python/Components/Lcd.py +++ b/lib/python/Components/Lcd.py @@ -16,27 +16,6 @@ MODEL = BoxInfo.getItem("model") -colorsList = [ - ("0xff0000", _("Red")), - ("0xff3333", _("Rose")), - ("0xff5500", _("Orange")), - ("0xdd9900", _("Yellow")), - ("0x99dd00", _("Lime")), - ("0x00ff00", _("Green")), - ("0x00ff99", _("Aqua")), - ("0x00bbff", _("Olympic blue")), - ("0x0000ff", _("Blue")), - ("0x6666ff", _("Azure")), - ("0x9900ff", _("Purple")), - ("0xff0066", _("Pink")), - ("0xffffff", _("White")), -] -config.lcd = ConfigSubsection() -config.lcd.ledblinkcontrolcolor = ConfigSelection(choices=colorsList, default="0xffffff") -config.lcd.ledbrightnesscontrol = ConfigSlider(default=0xff, increment=25, limits=(0, 0xff)) -config.lcd.ledcolorcontrolcolor = ConfigSelection(choices=colorsList, default="0xffffff") -config.lcd.ledfadecontrolcolor = ConfigSelection(choices=colorsList, default="0xffffff") - class dummyScreen(Screen): skin = """ @@ -288,6 +267,7 @@ def standbyCounterChanged(configElement): def InitLcd(): detected = eDBoxLCD.getInstance().detected() BoxInfo.setItem("Display", detected) + config.lcd = ConfigSubsection() if isfile("/proc/stb/lcd/mode"): can_lcdmodechecking = fileReadLine("/proc/stb/lcd/mode") else: @@ -480,14 +460,6 @@ def setXcoreVFD(configElement): config.lcd.ledsuspendcolor = ConfigSelection(default="2", choices=colorchoices) if isfile("/proc/stb/fp/ledsuspendledcolor"): config.lcd.ledsuspendcolor.addNotifier(setLedSuspendColor) - if isfile("/proc/stb/fp/led_blink"): - config.lcd.ledblinkcontrolcolor.addNotifier(setLedBlinkControlColor) - if isfile("/proc/stb/fp/led_brightness"): - config.lcd.ledbrightnesscontrol.addNotifier(setLedBrightnessControl) - if isfile("/proc/stb/fp/led_color"): - config.lcd.ledcolorcontrolcolor.addNotifier(setLedColorControlColor) - if isfile("/proc/stb/fp/led_fade"): - config.lcd.ledfadecontrolcolor.addNotifier(setLedFadeControlColor) config.lcd.power4x7on = ConfigSelection(choices=[ ("off", _("Off")), ("on", _("On")) @@ -686,33 +658,6 @@ def doNothing(): def doNothing(): pass - # For Dreamone only - def setLedBlinkControlColor(configElement): - fileWriteLine("/proc/stb/fp/led_blink", configElement.value) - - def setLedBrightnessControl(configElement): - fileWriteLine("/proc/stb/fp/led_brightness", configElement.value) - - def setLedColorControlColor(configElement): - fileWriteLine("/proc/stb/fp/led_color", configElement.value) - - def setLedFadeControlColor(configElement): - fileWriteLine("/proc/stb/fp/led_fade", configElement.value) - - if isfile("/proc/stb/fp/led_blink"): - config.lcd.ledblinkcontrolcolor.addNotifier(setLedBlinkControlColor) - print("led_blink ***************", config.lcd.ledblinkcontrolcolor.addNotifier(setLedBlinkControlColor)) - if isfile("/proc/stb/fp/led_brightness"): - config.lcd.ledbrightnesscontrol.addNotifier(setLedBrightnessControl) - print("led_brightness ***************", config.lcd.ledbrightnesscontrol.addNotifier(setLedBrightnessControl)) - if isfile("/proc/stb/fp/led_color"): - config.lcd.ledcolorcontrolcolor.addNotifier(setLedColorControlColor) - print("led_color ***************", config.lcd.ledcolorcontrolcolor.addNotifier(setLedColorControlColor)) - if isfile("/proc/stb/fp/led_fade"): - config.lcd.ledfadecontrolcolor.addNotifier(setLedFadeControlColor) - print("led_fade ***************", config.lcd.ledfadecontrolcolor.addNotifier(setLedFadeControlColor)) - ## - config.lcd.contrast = ConfigNothing() config.lcd.bright = ConfigNothing() config.lcd.standby = ConfigNothing() diff --git a/lib/python/Components/Makefile.am b/lib/python/Components/Makefile.am index 721f2b902..4b2df8884 100644 --- a/lib/python/Components/Makefile.am +++ b/lib/python/Components/Makefile.am @@ -22,4 +22,4 @@ install_PYTHON = \ Keyboard.py Sensors.py FanControl.py HdmiCec.py RcModel.py \ Netlink.py InputHotplug.py updatecheck.py \ ImportChannels.py StackTrace.py EpgLoadSave.py \ - HdmiRecord.py PowerOffTimer.py NetworkTime.py VfdSymbols.py + HdmiRecord.py PowerOffTimer.py NetworkTime.py VfdSymbols.py FrontPanelLed.py diff --git a/lib/python/Components/Renderer/FrontpanelLed2.py b/lib/python/Components/Renderer/FrontpanelLed2.py new file mode 100644 index 000000000..70ee6b9cf --- /dev/null +++ b/lib/python/Components/Renderer/FrontpanelLed2.py @@ -0,0 +1,39 @@ +from Components.Element import Element +from os import path +# this is not a GUI renderer. + + +class FrontpanelLed2(Element): + def __init__(self, which=0, patterns=None, boolean=True): + if not patterns: + patterns = [(20, 0, 0xffffffff), (20, 0x55555555, 0x84fc8c04)] + self.which = which + self.boolean = boolean + self.patterns = patterns + Element.__init__(self) + + def changed(self, *args, **kwargs): + if self.boolean: + val = self.source.boolean and 0 or 1 + else: + val = self.source.value + + (speed, pattern, pattern_4bit) = self.patterns[val] + + if path.exists("/proc/stb/fp/led%d_pattern" % self.which): + f = open("/proc/stb/fp/led%d_pattern" % self.which, "w") + f.write("%08x" % pattern) + f.close() + if self.which == 0: + if path.exists("/proc/stb/fp/led_set_pattern"): + f = open("/proc/stb/fp/led_set_pattern", "w") + f.write("%08x" % pattern_4bit) + f.close() + if path.exists("/proc/stb/fp/led_set_speed"): + f = open("/proc/stb/fp/led_set_speed", "w") + f.write("%d" % speed) + f.close() + if path.exists("/proc/stb/fp/led_pattern_speed"): + f = open("/proc/stb/fp/led_pattern_speed", "w") + f.write("%d" % speed) + f.close() diff --git a/lib/python/Components/Renderer/Makefile.am b/lib/python/Components/Renderer/Makefile.am index 797be3f0b..0276a5383 100644 --- a/lib/python/Components/Renderer/Makefile.am +++ b/lib/python/Components/Renderer/Makefile.am @@ -3,7 +3,7 @@ installdir = $(pkglibdir)/python/Components/Renderer install_PYTHON = \ __init__.py Label.py Progress.py Listbox.py Renderer.py Pixmap.py \ FixedLabel.py PositionGauge.py Canvas.py CiModuleControl.py Picon.py Pig.py \ - FrontpanelLed.py ChannelNumber.py VideoSize.py NextEpgInfo.py GaugeRender.py \ + FrontpanelLed.py FrontpanelLed2.py ChannelNumber.py VideoSize.py NextEpgInfo.py GaugeRender.py \ AnalogClockLCD.py AudioIcon.py Bhclock.py Cover.py EmptyEpg.py LcdPicon.py \ NextEvents.py PicCript.py PicEmu2.py PiconUni.py RollerCharLCD.py RollerCharLCDLong.py \ RunningText.py VolumeText.py VRunningText.py VWatches.py VtiEmuInfo.py VtiImageVersion.py diff --git a/lib/python/Components/SystemInfo.py b/lib/python/Components/SystemInfo.py index 1c34fa17c..bc326e1be 100644 --- a/lib/python/Components/SystemInfo.py +++ b/lib/python/Components/SystemInfo.py @@ -290,6 +290,7 @@ def getBoxName(): BoxInfo.setItem("StandbyLED", fileCheck("/proc/stb/power/standbyled") or MODEL in ("gbue4k", "gbquad4k") and fileCheck("/proc/stb/fp/led0_pattern")) BoxInfo.setItem("SuspendLED", fileCheck("/proc/stb/power/suspendled") or fileCheck("/proc/stb/fp/enable_led")) BoxInfo.setItem("Display", BoxInfo.getItem("FrontpanelDisplay") or BoxInfo.getItem("StandbyLED") or MODEL in ("dreamone", "dreamtwo")) +BoxInfo.setItem("LEDControl", MODEL not in ("dreamone", "dreamtwo")) BoxInfo.setItem("LEDColorControl", fileExists("/proc/stb/fp/led_color")) BoxInfo.setItem("LedPowerColor", fileCheck("/proc/stb/fp/ledpowercolor")) BoxInfo.setItem("LedStandbyColor", fileCheck("/proc/stb/fp/ledstandbycolor")) diff --git a/lib/python/Screens/SessionGlobals.py b/lib/python/Screens/SessionGlobals.py index b31784b44..c4a326c98 100644 --- a/lib/python/Screens/SessionGlobals.py +++ b/lib/python/Screens/SessionGlobals.py @@ -9,18 +9,22 @@ from Components.Sources.Boolean import Boolean from Components.Sources.RecordState import RecordState from Components.Converter.Combine import Combine -from Components.Renderer.FrontpanelLed import FrontpanelLed from Components.config import config from Components.SystemInfo import BoxInfo - MODEL = BoxInfo.getItem("model") +if MODEL in ("dreamone", "dreamtwo"): + from Components.Renderer.FrontpanelLed2 import FrontpanelLed2 +else: + from Components.Renderer.FrontpanelLed import FrontpanelLed + class SessionGlobals(Screen): def __init__(self, session): Screen.__init__(self, session) self["CurrentService"] = CurrentService(session.nav) + self["CurrentTime"] = Clock() self["Event_Now"] = EventInfo(session.nav, EventInfo.NOW) self["Event_Next"] = EventInfo(session.nav, EventInfo.NEXT) self["FrontendStatus"] = FrontendStatus(service_source=session.nav.getCurrentService) @@ -89,15 +93,17 @@ def __init__(self, session): if config.usage.frontledrecstdby_color.value == "4": RecstdbyLed1 = PATTERN_BLINK + have_display = BoxInfo.getItem("FrontpanelDisplay", False) + have_touch_sensor = BoxInfo.getItem("HaveTouchSensor", False) nr_leds = BoxInfo.getItem("NumFrontpanelLEDs", 0) if nr_leds == 1: - FrontpanelLed(which=0, boolean=False, patterns=[PATTERN_OFF, PATTERN_BLINK, PATTERN_OFF, PATTERN_BLINK]).connect(combine) + FrontpanelLed(which=0, boolean=False, patterns=[PATTERN_OFF if have_display else PATTERN_ON, PATTERN_BLINK, PATTERN_OFF, PATTERN_BLINK]).connect(combine) elif nr_leds == 2: if MODEL in ("dm520"): FrontpanelLed(which=0, boolean=False, patterns=[PATTERN_ON, PATTERN_BLINK, PATTERN_OFF, PATTERN_BLINK]).connect(combine) FrontpanelLed(which=1, boolean=False, patterns=[PATTERN_OFF, PATTERN_OFF, PATTERN_OFF, PATTERN_OFF]).connect(combine) - elif MODEL in ("dm900", "dm920", "dreamone", "dreamtwo"): + elif MODEL in ("dm900", "dm920"): FrontpanelLed(which=0, boolean=False, patterns=[NormalLed0, RecLed0, StandbyLed0, RecstdbyLed0]).connect(combine) FrontpanelLed(which=1, boolean=False, patterns=[NormalLed1, RecLed1, StandbyLed1, RecstdbyLed1]).connect(combine) else: diff --git a/lib/python/StartEnigma.py b/lib/python/StartEnigma.py index d86482201..cc15e1a7a 100644 --- a/lib/python/StartEnigma.py +++ b/lib/python/StartEnigma.py @@ -214,6 +214,9 @@ def __init__(self, desktop=None, summary_desktop=None, navigation=None): self.screen = SessionGlobals(self) + from Components.FrontPanelLed import frontPanelLed + frontPanelLed.init(self) + for p in plugins.getPlugins(PluginDescriptor.WHERE_SESSIONSTART): try: p(reason=0, session=self) @@ -544,7 +547,11 @@ def runNextScreen(session, screensToRun, *result): enigma.eProfileWrite("RunReactor") enigma.eProfileDone() + from Components.FrontPanelLed import FrontPanelLed runReactor() + session.shutdown = True + FrontPanelLed.shutdown() + print("[StartEnigma] Normal shutdown.") from time import time, strftime, localtime from Tools.StbHardware import setFPWakeuptime, setRTCtime From e7e4a0cff10a1a1e02919ee635a035f752bc5835 Mon Sep 17 00:00:00 2001 From: fairbird Date: Tue, 6 Feb 2024 15:54:16 +0300 Subject: [PATCH 5/7] Update --- lib/python/Screens/SessionGlobals.py | 1 + lib/python/StartEnigma.py | 16 ++++++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/lib/python/Screens/SessionGlobals.py b/lib/python/Screens/SessionGlobals.py index c4a326c98..eeb80523b 100644 --- a/lib/python/Screens/SessionGlobals.py +++ b/lib/python/Screens/SessionGlobals.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- from Screens.Screen import Screen +from Components.Sources.Clock import Clock from Components.Sources.CurrentService import CurrentService from Components.Sources.EventInfo import EventInfo from Components.Sources.FrontendStatus import FrontendStatus diff --git a/lib/python/StartEnigma.py b/lib/python/StartEnigma.py index cc15e1a7a..2bc483078 100644 --- a/lib/python/StartEnigma.py +++ b/lib/python/StartEnigma.py @@ -17,6 +17,8 @@ from traceback import print_exc +MODEL = BoxInfo.getItem("model") + # These entries should be moved back to UsageConfig.py when it is safe to bring UsageConfig init to this location in StartEnigma.py. # config.crash = ConfigSubsection() @@ -214,8 +216,9 @@ def __init__(self, desktop=None, summary_desktop=None, navigation=None): self.screen = SessionGlobals(self) - from Components.FrontPanelLed import frontPanelLed - frontPanelLed.init(self) + if MODEL in ("dreamone", "dreamtwo"): + from Components.FrontPanelLed import frontPanelLed + frontPanelLed.init(self) for p in plugins.getPlugins(PluginDescriptor.WHERE_SESSIONSTART): try: @@ -547,11 +550,12 @@ def runNextScreen(session, screensToRun, *result): enigma.eProfileWrite("RunReactor") enigma.eProfileDone() - from Components.FrontPanelLed import FrontPanelLed runReactor() - session.shutdown = True - FrontPanelLed.shutdown() - print("[StartEnigma] Normal shutdown.") + if MODEL in ("dreamone", "dreamtwo"): + from Components.FrontPanelLed import FrontPanelLed + session.shutdown = True + FrontPanelLed.shutdown() + print("[StartEnigma] Normal shutdown.") from time import time, strftime, localtime from Tools.StbHardware import setFPWakeuptime, setRTCtime From 3c06ed895f395eab7eb6526e77dde1813cfb5fbb Mon Sep 17 00:00:00 2001 From: fairbird Date: Wed, 7 Feb 2024 02:16:24 +0300 Subject: [PATCH 6/7] Update --- data/menu.xml | 1 - data/setup.xml | 16 +- lib/python/Components/Converter/Makefile.am | 2 +- lib/python/Components/Converter/VfdDisplay.py | 81 ---- lib/python/Components/Makefile.am | 2 +- lib/python/Components/VfdSymbols.py | 402 ------------------ lib/python/StartEnigma.py | 5 - 7 files changed, 7 insertions(+), 502 deletions(-) delete mode 100644 lib/python/Components/Converter/VfdDisplay.py delete mode 100644 lib/python/Components/VfdSymbols.py diff --git a/data/menu.xml b/data/menu.xml index 3eaeb6413..148bd490b 100644 --- a/data/menu.xml +++ b/data/menu.xml @@ -64,7 +64,6 @@ - diff --git a/data/setup.xml b/data/setup.xml index 0650011e7..0a30eb396 100644 --- a/data/setup.xml +++ b/data/setup.xml @@ -394,6 +394,11 @@ config.usage.frontledrec_color config.usage.frontledstdby_color config.usage.frontledrecstdby_color + config.fp.led.default_color + config.fp.led.default_brightness + config.fp.led.standby_color + config.fp.led.standby_brightness + config.fp.led.shutdown_color config.lcd.ledbrightness config.lcd.ledbrightnessstandby config.lcd.ledbrightnessdeepstandby @@ -408,17 +413,6 @@ config.lcd.power4x7standby config.lcd.power4x7suspend config.usage.show_in_standby - config.lcd.ledblinkcontrolcolor - config.lcd.ledbrightnesscontrol - config.lcd.ledcolorcontrolcolor - config.lcd.ledfadecontrolcolor - - - config.fp.led.default_color - config.fp.led.default_brightness - config.fp.led.standby_color - config.fp.led.standby_brightness - config.fp.led.shutdown_color config.sat.tunerslot diff --git a/lib/python/Components/Converter/Makefile.am b/lib/python/Components/Converter/Makefile.am index 41b7551c8..518e0e462 100644 --- a/lib/python/Components/Converter/Makefile.am +++ b/lib/python/Components/Converter/Makefile.am @@ -12,4 +12,4 @@ install_PYTHON = \ EventName2.py ExtendedServiceInfo.py ExtremeInfo.py HbbtvApplicationInfo.py LayoutInfo.py MovieBarInfo.py \ MovieReference.py ProgressDiskSpaceInfo.py RefString.py RouteInfo.py ServiceInfo2.py ServiceInfoEX.py \ ServiceName2.py TextAddAfter.py TextAddBefore.py Textreplace.py TextToUpper.py VAudioInfo.py VExtraNumText.py \ - VNetSpeedInfo.py VtiTempFan.py VWeather.py YWeather.py VtiInfo.py Bitrate2.py VfdDisplay.py + VNetSpeedInfo.py VtiTempFan.py VWeather.py YWeather.py VtiInfo.py Bitrate2.py diff --git a/lib/python/Components/Converter/VfdDisplay.py b/lib/python/Components/Converter/VfdDisplay.py deleted file mode 100644 index bdd6dfa12..000000000 --- a/lib/python/Components/Converter/VfdDisplay.py +++ /dev/null @@ -1,81 +0,0 @@ -from datetime import datetime - -from Components.Converter.Poll import Poll -from Components.Converter.Converter import Converter -from Components.Element import cached - - -class VfdDisplay(Poll, Converter): - def __init__(self, type): - Converter.__init__(self, type) - Poll.__init__(self) - self.num = None - self.showclock = 0 - self.delay = 5000 - self.loop = -1 - self.type = type.lower().split(';') - if 'number' in self.type and 'clock' not in self.type: # Only channel number - self.delay = 0 - self.poll_enabled = False - else: - self.poll_enabled = True - if 'clock' in self.type and 'number' not in self.type: # Only clock - self.showclock = 1 - self.delay = -1 - else: - for x in self.type: - if x.isdigit(): - self.delay = int(x) * 1000 - break - if 'loop' in self.type and self.delay: - self.loop = self.delay - if 'nozero' in self.type: - self.hour = '%-' - else: - self.hour = '%' - if '12h' in self.type: - self.hour = self.hour + 'I' - else: - self.hour = self.hour + 'H' - - @cached - def getText(self): - if self.showclock == 0: - if self.delay: - self.poll_interval = self.delay - self.showclock = 1 - if self.num: - return self.num - else: - if self.showclock == 1: - if 'noblink' in self.type: - self.poll_interval = self.delay - else: - self.poll_interval = 1000 - self.showclock = 3 - clockformat = self.hour + '%M' - elif self.showclock == 2: - self.showclock = 3 - clockformat = self.hour + '%M' - else: - self.showclock = 2 - clockformat = self.hour + ':%M' - if self.loop != -1: - self.loop -= 1000 - if self.loop <= 0: - self.loop = self.delay - self.showclock = 0 - return datetime.today().strftime(clockformat) - - text = property(getText) - - def changed(self, what): - if what[0] is self.CHANGED_SPECIFIC and self.delay >= 0: - self.showclock = 0 - if self.loop != -1: - self.loop = self.delay - service = self.source.serviceref - self.num = service and ('%d' if 'nozero' in self.type else '%04d') % service.getChannelNum() or None - Converter.changed(self, what) - elif what[0] is self.CHANGED_POLL: - Converter.changed(self, what) diff --git a/lib/python/Components/Makefile.am b/lib/python/Components/Makefile.am index 4b2df8884..563ee6c0c 100644 --- a/lib/python/Components/Makefile.am +++ b/lib/python/Components/Makefile.am @@ -22,4 +22,4 @@ install_PYTHON = \ Keyboard.py Sensors.py FanControl.py HdmiCec.py RcModel.py \ Netlink.py InputHotplug.py updatecheck.py \ ImportChannels.py StackTrace.py EpgLoadSave.py \ - HdmiRecord.py PowerOffTimer.py NetworkTime.py VfdSymbols.py FrontPanelLed.py + HdmiRecord.py PowerOffTimer.py NetworkTime.py FrontPanelLed.py diff --git a/lib/python/Components/VfdSymbols.py b/lib/python/Components/VfdSymbols.py deleted file mode 100644 index eec110341..000000000 --- a/lib/python/Components/VfdSymbols.py +++ /dev/null @@ -1,402 +0,0 @@ -# -*- coding: utf-8 -*- -from twisted.internet import threads -from Components.config import config -from enigma import eTimer, iPlayableService, iServiceInformation -import NavigationInstance -from os.path import isfile -from Components.ParentalControl import parentalControl -from Components.ServiceEventTracker import ServiceEventTracker -from Components.SystemInfo import BoxInfo -from time import time, sleep - -model = BoxInfo.getItem("model") -brand = BoxInfo.getItem("brand") -platform = BoxInfo.getItem("platform") - -POLLTIME = 5 # seconds - - -def SymbolsCheck(session, **kwargs): - global symbolspoller, POLLTIME - if BoxInfo.getItem("VFDSymbol"): - POLLTIME = 1 - symbolspoller = SymbolsCheckPoller(session) - symbolspoller.start() - - -class SymbolsCheckPoller: - def __init__(self, session): - self.session = session - self.blink = False - self.led = "0" - self.timer = eTimer() - self.onClose = [] - self.__event_tracker = ServiceEventTracker(screen=self, eventmap={ - iPlayableService.evUpdatedInfo: self.__evUpdatedInfo, - }) - - def __onClose(self): - pass - - def start(self): - if self.symbolscheck not in self.timer.callback: - self.timer.callback.append(self.symbolscheck) - self.timer.startLongTimer(0) - - def stop(self): - if self.symbolscheck in self.timer.callback: - self.timer.callback.remove(self.symbolscheck) - self.timer.stop() - - def symbolscheck(self): - threads.deferToThread(self.JobTask) - self.timer.startLongTimer(POLLTIME) - - def JobTask(self): - self.Recording() - self.PlaySymbol() - self.timer.startLongTimer(POLLTIME) - - def __evUpdatedInfo(self): - self.service = self.session.nav.getCurrentService() - if platform == "u41": - self.Resolution() - self.Audio() - self.Crypted() - self.Teletext() - self.Hbbtv() - self.PauseSymbol() - self.PlaySymbol() - self.PowerSymbol() - self.Timer() - self.Subtitle() - self.ParentalControl() - del self.service - - def Recording(self): - if BoxInfo.getItem("FrontpanelLEDBrightnessControl"): - BRIGHTNESS_DEFAULT = 0xff - if config.lcd.ledbrightnesscontrol.value > 0xff or config.lcd.ledbrightnesscontrol.value < 0: - print("[VfdSymbols] LED brightness has to be between 0x0 and 0xff! Using default value (%x)" % (BRIGHTNESS_DEFAULT)) - config.lcd.ledbrightnesscontrol.value = BRIGHTNESS_DEFAULT - open("/proc/stb/fp/led_brightness", "w").write(config.lcd.ledbrightnesscontrol.value) - elif BoxInfo.getItem("FrontpanelLEDColorControl"): - COLOR_DEFAULT = 0xffffff - if config.lcd.ledcolorcontrolcolor.value > 0xffffff or config.lcd.ledcolorcontrolcolor.value < 0: - print("[VfdSymbols] LED color has to be between 0x0 and 0xffffff (r, g b)! Using default value (%x)" % (COLOR_DEFAULT)) - config.lcd.ledcolorcontrolcolor.value = COLOR_DEFAULT - open("/proc/stb/fp/led_color", "w").write(config.lcd.ledcolorcontrolcolor.value) - elif isfile("/proc/stb/lcd/symbol_circle"): - recordings = len(NavigationInstance.instance.getRecordings()) - print("[VfdSymbols] Write to /proc/stb/lcd/symbol_circle") - if recordings > 0: - open("/proc/stb/lcd/symbol_circle", "w").write("3") - else: - open("/proc/stb/lcd/symbol_circle", "w").write("0") - elif model in ("alphatriplehd", "sf3038") or brand == "ebox" and isfile("/proc/stb/lcd/symbol_recording"): - recordings = len(NavigationInstance.instance.getRecordings()) - print("[VfdSymbols] Write to /proc/stb/lcd/symbol_recording") - if recordings > 0: - open("/proc/stb/lcd/symbol_recording", "w").write("1") - else: - open("/proc/stb/lcd/symbol_recording", "w").write("0") - elif platform == "u41" and isfile("/proc/stb/lcd/symbol_pvr2"): - recordings = len(NavigationInstance.instance.getRecordings()) - print("[VfdSymbols] Write to /proc/stb/lcd/symbol_pvr2") - if recordings > 0: - open("/proc/stb/lcd/symbol_pvr2", "w").write("1") - else: - open("/proc/stb/lcd/symbol_pvr2", "w").write("0") - elif platform == "edisionmipsgen1" or model in ("9910lx", "9911lx", "9920lx") or brand in ("wetek", "ixuss") and isfile("/proc/stb/lcd/powerled"): - recordings = len(NavigationInstance.instance.getRecordings()) - self.blink = not self.blink - print("[VfdSymbols] Write to /proc/stb/lcd/powerled") - if recordings > 0: - if self.blink: - open("/proc/stb/lcd/powerled", "w").write("1") - self.led = "1" - else: - open("/proc/stb/lcd/powerled", "w").write("0") - self.led = "0" - elif self.led == "1": - open("/proc/stb/lcd/powerled", "w").write("0") - elif model in ("mbmicrov2", "mbmicro", "e4hd", "e4hdhybrid") and isfile("/proc/stb/lcd/powerled"): - recordings = len(NavigationInstance.instance.getRecordings()) - self.blink = not self.blink - print("[VfdSymbols] Write to /proc/stb/lcd/powerled") - if recordings > 0: - if self.blink: - open("/proc/stb/lcd/powerled", "w").write("0") - self.led = "1" - else: - open("/proc/stb/lcd/powerled", "w").write("1") - self.led = "0" - elif self.led == "1": - open("/proc/stb/lcd/powerled", "w").write("1") - elif model in ("dm7020hd", "dm7020hdv2") and isfile("/proc/stb/fp/led_set"): - recordings = len(NavigationInstance.instance.getRecordings()) - self.blink = not self.blink - print("[VfdSymbols] Write to /proc/stb/fp/led_set") - if recordings > 0: - if self.blink: - open("/proc/stb/fp/led_set", "w").write("0x00000000") - self.led = "1" - else: - open("/proc/stb/fp/led_set", "w").write("0xffffffff") - self.led = "0" - else: - open("/proc/stb/fp/led_set", "w").write("0xffffffff") - elif platform in ("dags7362", "dags73625") or model in ("tmtwin4k", "revo4k", "force3uhd") and isfile("/proc/stb/lcd/symbol_rec"): - recordings = len(NavigationInstance.instance.getRecordings()) - self.blink = not self.blink - print("[VfdSymbols] Write to /proc/stb/lcd/symbol_rec") - if recordings > 0: - if self.blink: - open("/proc/stb/lcd/symbol_rec", "w").write("1") - self.led = "1" - else: - open("/proc/stb/lcd/symbol_rec", "w").write("0") - self.led = "0" - elif self.led == "1": - open("/proc/stb/lcd/symbol_rec", "w").write("0") - elif BoxInfo.getItem("HiSilicon") and isfile("/proc/stb/fp/ledpowercolor"): - import Screens.Standby - recordings = len(NavigationInstance.instance.getRecordings(False)) - if recordings > 0 and not Screens.Standby.inStandby: - if config.usage.frontledrec_color.value == "2": - open("/proc/stb/fp/ledpowercolor", "w").write("2") - elif config.usage.frontledrec_color.value == "4": - open("/proc/stb/fp/ledpowercolor", "w").write("0") - sleep(10) # blinking - open("/proc/stb/fp/ledpowercolor", "w").write("2") - elif config.usage.frontledrec_color.value == "3": - open("/proc/stb/fp/ledpowercolor", "w").write("0") - sleep(10) # blinking - open("/proc/stb/fp/ledpowercolor", "w").write("1") - elif config.usage.frontledrec_color.value == "1": - open("/proc/stb/fp/ledpowercolor", "w").write("1") - elif config.usage.frontledrec_color.value == "0": - open("/proc/stb/fp/ledpowercolor", "w").write("0") - if recordings > 0 and Screens.Standby.inStandby: - if config.usage.frontledrecstdby_color.value == "2": - open("/proc/stb/fp/ledpowercolor", "w").write("2") - elif config.usage.frontledrecstdby_color.value == "4": - open("/proc/stb/fp/ledpowercolor", "w").write("0") - sleep(10) # blinking standby - open("/proc/stb/fp/ledpowercolor", "w").write("2") - elif config.usage.frontledrecstdby_color.value == "3": - open("/proc/stb/fp/ledpowercolor", "w").write("0") - sleep(10) # blinking standby - open("/proc/stb/fp/ledpowercolor", "w").write("1") - elif config.usage.frontledrecstdby_color.value == "1": - open("/proc/stb/fp/ledpowercolor", "w").write("1") - elif config.usage.frontledrecstdby_color.value == "0": - open("/proc/stb/fp/ledpowercolor", "w").write("0") - if not recordings: - if Screens.Standby.inStandby: - if config.usage.frontledstdby_color.value == "4": - open("/proc/stb/fp/ledpowercolor", "w").write("0") - sleep(10) # blinking standby - open("/proc/stb/fp/ledpowercolor", "w").write("2") - elif config.usage.frontledstdby_color.value == "3": - open("/proc/stb/fp/ledpowercolor", "w").write("0") - sleep(10) # blinking standby - open("/proc/stb/fp/ledpowercolor", "w").write("1") - open("/proc/stb/fp/ledpowercolor", "w").write(config.usage.frontledstdby_color.value) - else: - open("/proc/stb/fp/ledpowercolor", "w").write(config.lcd.ledpowercolor.value) - elif BoxInfo.getItem("FrontpanelLEDFadeControl"): - FADE_DEFAULT = 0x7 - if config.lcd.ledfadecontrolcolor.value > 0xff or config.lcd.ledfadecontrolcolor.value < 0: - print("[VfdSymbols] LED fade has to be between 0x0 and 0xff! Using default value (%x)" % (FADE_DEFAULT)) - config.lcd.ledfadecontrolcolor.value = FADE_DEFAULT - open("/proc/stb/fp/led_fade", "w").write(config.lcd.ledfadecontrolcolor.value) - elif BoxInfo.getItem("FrontpanelLEDBlinkControl"): - BLINK_DEFAULT = 0x0710ff - if config.lcd.ledblinkcontrolcolor.value > 0xffffff or config.lcd.ledblinkcontrolcolor.value < 0: - print("[VfdSymbols] LED blink has to be between 0x0 and 0xffffff (on, total, repeats)! Using default value (%x)" % (BLINK_DEFAULT)) - config.lcd.ledblinkcontrolcolor.value = BLINK_DEFAULT - open("/proc/stb/fp/led_blink", "w").write(config.lcd.ledblinkcontrolcolor.value) - else: - if not isfile("/proc/stb/lcd/symbol_recording") or not isfile("/proc/stb/lcd/symbol_record_1") or not isfile("/proc/stb/lcd/symbol_record_2"): - return - - recordings = len(NavigationInstance.instance.getRecordings()) - - print("[VfdSymbols] Write to /proc/stb/lcd/symbol_recording") - print("[VfdSymbols] Write to /proc/stb/lcd/symbol_record_1") - print("[VfdSymbols] Write to /proc/stb/lcd/symbol_record_2") - if recordings > 0: - open("/proc/stb/lcd/symbol_recording", "w").write("1") - if recordings == 1: - open("/proc/stb/lcd/symbol_record_1", "w").write("1") - open("/proc/stb/lcd/symbol_record_2", "w").write("0") - elif recordings >= 2: - open("/proc/stb/lcd/symbol_record_1", "w").write("1") - open("/proc/stb/lcd/symbol_record_2", "w").write("1") - else: - open("/proc/stb/lcd/symbol_recording", "w").write("0") - open("/proc/stb/lcd/symbol_record_1", "w").write("0") - open("/proc/stb/lcd/symbol_record_2", "w").write("0") - - def Subtitle(self): - if not isfile("/proc/stb/lcd/symbol_smartcard") and not isfile("/proc/stb/lcd/symbol_subtitle"): - return - - subtitle = self.service and self.service.subtitle() - subtitlelist = subtitle and subtitle.getSubtitleList() - - if subtitlelist: - subtitles = len(subtitlelist) - if isfile("/proc/stb/lcd/symbol_subtitle"): - print("[VfdSymbols] Write to /proc/stb/lcd/symbol_subtitle") - if subtitles > 0: - open("/proc/stb/lcd/symbol_subtitle", "w").write("1") - else: - open("/proc/stb/lcd/symbol_subtitle", "w").write("0") - else: - print("[VfdSymbols] Write to /proc/stb/lcd/symbol_smartcard") - if subtitles > 0: - open("/proc/stb/lcd/symbol_smartcard", "w").write("1") - else: - open("/proc/stb/lcd/symbol_smartcard", "w").write("0") - else: - if isfile("/proc/stb/lcd/symbol_smartcard"): - print("[VfdSymbols] Write to /proc/stb/lcd/symbol_smartcard") - open("/proc/stb/lcd/symbol_smartcard", "w").write("0") - - def ParentalControl(self): - if not isfile("/proc/stb/lcd/symbol_parent_rating"): - return - - service = self.session.nav.getCurrentlyPlayingServiceReference() - - print("[VfdSymbols] Write to /proc/stb/lcd/symbol_parent_rating") - if service: - if parentalControl.getProtectionLevel(service.toCompareString()) == -1: - open("/proc/stb/lcd/symbol_parent_rating", "w").write("0") - else: - open("/proc/stb/lcd/symbol_parent_rating", "w").write("1") - else: - open("/proc/stb/lcd/symbol_parent_rating", "w").write("0") - - def PlaySymbol(self): - if not isfile("/proc/stb/lcd/symbol_play"): - return - - print("[VfdSymbols] Write to /proc/stb/lcd/symbol_play") - if BoxInfo.getItem("SeekStatePlay"): - open("/proc/stb/lcd/symbol_play", "w").write("1") - else: - open("/proc/stb/lcd/symbol_play", "w").write("0") - - def PauseSymbol(self): - if not isfile("/proc/stb/lcd/symbol_pause"): - return - - print("[VfdSymbols] Write to /proc/stb/lcd/symbol_pause") - if BoxInfo.getItem("StatePlayPause"): - open("/proc/stb/lcd/symbol_pause", "w").write("1") - else: - open("/proc/stb/lcd/symbol_pause", "w").write("0") - - def PowerSymbol(self): - if not isfile("/proc/stb/lcd/symbol_power"): - return - - print("[VfdSymbols] Write to /proc/stb/lcd/symbol_power") - if BoxInfo.getItem("StandbyState"): - open("/proc/stb/lcd/symbol_power", "w").write("0") - else: - open("/proc/stb/lcd/symbol_power", "w").write("1") - - def Resolution(self): - if not isfile("/proc/stb/lcd/symbol_hd"): - return - - info = self.service and self.service.info() - if not info: - return "" - - videosize = int(info.getInfo(iServiceInformation.sVideoWidth)) - - print("[VfdSymbols] Write to /proc/stb/lcd/symbol_hd") - if videosize >= 1280: - open("/proc/stb/lcd/symbol_hd", "w").write("1") - else: - open("/proc/stb/lcd/symbol_hd", "w").write("0") - - def Crypted(self): - if not isfile("/proc/stb/lcd/symbol_scramled"): - return - - info = self.service and self.service.info() - if not info: - return "" - - crypted = int(info.getInfo(iServiceInformation.sIsCrypted)) - - print("[VfdSymbols] Write to /proc/stb/lcd/symbol_scramled") - if crypted == 1: - open("/proc/stb/lcd/symbol_scramled", "w").write("1") - else: - open("/proc/stb/lcd/symbol_scramled", "w").write("0") - - def Teletext(self): - if not isfile("/proc/stb/lcd/symbol_teletext"): - return - - info = self.service and self.service.info() - if not info: - return "" - - tpid = int(info.getInfo(iServiceInformation.sTXTPID)) - - print("[VfdSymbols] Write to /proc/stb/lcd/symbol_teletext") - if tpid != -1: - open("/proc/stb/lcd/symbol_teletext", "w").write("1") - else: - open("/proc/stb/lcd/symbol_teletext", "w").write("0") - - def Hbbtv(self): - if not isfile("/proc/stb/lcd/symbol_epg"): - return - - info = self.service and self.service.info() - if not info: - return "" - - hbbtv = int(info.getInfo(iServiceInformation.sHBBTVUrl)) - - print("[VfdSymbols] Write to /proc/stb/lcd/symbol_epg") - if hbbtv != -1: - open("/proc/stb/lcd/symbol_epg", "w").write("0") - else: - open("/proc/stb/lcd/symbol_epg", "w").write("1") - - def Audio(self): - if not isfile("/proc/stb/lcd/symbol_dolby_audio"): - return - - audio = self.service.audioTracks() - print("[VfdSymbols] Write to /proc/stb/lcd/symbol_dolby_audio") - if audio: - n = audio.getNumberOfTracks() - idx = 0 - while idx < n: - i = audio.getTrackInfo(idx) - description = i.getDescription() - if "AC3" in description or "AC-3" in description or "DTS" in description: - open("/proc/stb/lcd/symbol_dolby_audio", "w").write("1") - return - idx += 1 - open("/proc/stb/lcd/symbol_dolby_audio", "w").write("0") - - def Timer(self): - if isfile("/proc/stb/lcd/symbol_timer"): - timer = NavigationInstance.instance.RecordTimer.getNextRecordingTime() - print("[VfdSymbols] Write to /proc/stb/lcd/symbol_timer") - if timer > 0: - open("/proc/stb/lcd/symbol_timer", "w").write("1") - else: - open("/proc/stb/lcd/symbol_timer", "w").write("0") diff --git a/lib/python/StartEnigma.py b/lib/python/StartEnigma.py index 2bc483078..00c78f570 100644 --- a/lib/python/StartEnigma.py +++ b/lib/python/StartEnigma.py @@ -536,11 +536,6 @@ def runNextScreen(session, screensToRun, *result): enigma.eProfileWrite("Init:PowerKey") power = PowerKey(session) - if BoxInfo.getItem("VFDSymbol"): -# profile("VFDSymbols") - from Components.VfdSymbols import SymbolsCheck - SymbolsCheck(session) - # we need session.scart to access it from within menu.xml session.scart = AutoScartControl(session) From 1f86108d05dc50431fa3a7901da99338e06c9511 Mon Sep 17 00:00:00 2001 From: RAED Date: Wed, 7 Feb 2024 02:18:49 +0300 Subject: [PATCH 7/7] Update menu.xml --- data/menu.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/menu.xml b/data/menu.xml index 148bd490b..c05833355 100644 --- a/data/menu.xml +++ b/data/menu.xml @@ -63,7 +63,7 @@ - +