def profile(id): now = time.time() - profile_start if getBoxBrand() == "fegasus": dev_fmt = ("/proc/progress", "Loading %d %%") elif getBoxBrand() == "fulan": dev_fmt = ("/proc/vfd", "%d \n) else: dev_fmt = ("/proc/progress", "%d \n") (dev, fmt) = dev_fmt if profile_file: profile_file.write("%7.3f\t%s\n" % (now, id)) if id in profile_data: t = profile_data[id] if total_time: perc = t * (PERCENTAGE_END - PERCENTAGE_START) / total_time + PERCENTAGE_START else: perc = PERCENTAGE_START try: open(dev, "w").write(fmt % perc) evfd.getInstance().vfd_write_string("-%02d-" % perc) # Used for fulan vfd except IOError: pass
def kodiPlayerExitCB(self, callback=None): setaudio.switch(True, True) if getBoxBrand() == "formuler" or getBoxBrand() == "vuplus": setresolution.switch(True, True) SESSION.nav.stopService() self.kodiPlayer = None self.subtitles = []
def keyGreen(self): config.misc.window_animation_speed.save() setAnimation_speed(int(config.misc.window_animation_speed.value)) config.misc.listbox_animation_default.save() if not getBoxBrand() == 'gigablue': setAnimation_current_listbox(int(config.misc.listbox_animation_default.value)) self.close()
def sessionstart(session, reason, **kwargs): global iBluetoothDevicesTask if reason == 0: if getBoxBrand() in ("xcore", "edision"): if iBluetoothDevicesTask is None: iBluetoothDevicesTask = BluetoothDevicesTask(session)
def autostart(reason, **kwargs): if reason == 0: if getBoxBrand() not in ("xcore", "edision"): if config.btdevicesmanager.autostart.getValue(): print "[BluetoothManager] Autostart: Loading driver" ## We have it on a blacklist because We want to have faster system loading, so We load driver while we enable it. Console().ePopen("modprobe rtk_btusb") else: print "[BluetoothManager] Autostart: Unloading driver" ## We know it is blacklisted, but try to remove it anyway. Console().ePopen("rmmod rtk_btusb") if getBoxBrand() in ("xcore", "edision"): if config.btdevicesmanager.audioconnect.getValue(): Console().ePopen( "%s %s" % (commandconnect, config.btdevicesmanager.audioaddress.getValue()))
def showRadioButton(self): if getBoxBrand() in ("gigablue", "azbox") or getBoxType() in ( "classm", "genius", "evo", "galaxym6", "sezam5000hd", "mbtwin", "beyonwizt3") or getBoxProc() in ("ini-3000", "ini-5000", "ini-7000", "ini-7012"): self.toggleTvRadio() else: self.showRadio()
def __init__(self): if SystemInfo["RcTypeChangable"] and getBoxBrand() not in ( "gigablue", "odin", "ini", "entwopia", "tripledot"): self.isSupported = True self.boxType = open('/proc/stb/info/boxtype', 'r').read().strip() if config.plugins.remotecontroltype.rctype.value != 0: self.writeRcType(config.plugins.remotecontroltype.rctype.value) else: self.isSupported = False
def getCPUBrand(): if SystemInfo["AmlogicFamily"]: return _("Amlogic") elif SystemInfo["HiSilicon"]: return _("HiSilicon") elif getBoxBrand() == "azbox": return _("Sigma Designs") else: return _("Broadcom")
def showTvButton(self): if getBoxBrand() == "gigablue" or getBoxType() in ("classm", "genius", "evo", "galaxym6"): self.toggleTvRadio() elif getBoxType() in ("sezam5000hd", "mbtwin") or getBoxProc() in ( "ini-3000", "ini-5000", "ini-7000", "ini-7012"): self.showMovies() else: self.showTv()
def __init__(self): self.E2res = None self.kodires = "720p" self.kodirate = "50Hz" self.port = config.av.videoport.value self.rate = None if getBoxBrand() == "formuler" or getBoxBrand() == "vuplus": resolutions = ("720i", "720p") else: resolutions = ("720i", "720p", "1080i", "1080p") rates = ("60Hz", "50Hz") for res in resolutions: for rate in rates: try: if video_hw.isModeAvailable(self.port, res, rate): self.kodires = res self.kodirate = rate except: pass
def ok(self): current = self["list"].getCurrent() if current: key = current[1] config.misc.window_animation_default.value = key config.misc.window_animation_default.save() setAnimation_current(key) if not getBoxBrand() == 'gigablue': setAnimation_current_listbox(int(config.misc.listbox_animation_default.value)) self.close()
def __init__(self, url, outfile, headers=None): client.HTTPDownloader.__init__( self, url, outfile, headers=headers, agent="%s %s Enigma2 HbbTV/1.1.1 (+PVR+RTSP+DL;OpenVision;;;)" % (getBoxBrand(), getBoxType())) self.status = self.progress_callback = self.error_callback = self.end_callback = None self.deferred = defer.Deferred()
def keyGreen(self): print "[BluetoothManager] keyGreen" if config.btdevicesmanager.autostart.getValue() or getBoxBrand() in ( "xcore", "edision"): self["ConnStatus"].setText(_("No connected to any device")) self.initDevice() else: self["devicelist"].setList([]) self["ConnStatus"].setText( _("Please load BT driver by pressing BLUE button."))
def makeConfigList(self): self.entrylist = [] entrySpeed = getConfigListEntry(_("Animation Speed"), config.misc.window_animation_speed) self.entrylist.append(entrySpeed) if not getBoxBrand() == 'gigablue': entryMoveSelection = getConfigListEntry(_("Enable Focus Animation"), config.misc.listbox_animation_default) self.entrylist.append(entryMoveSelection) self["config"].list = self.entrylist self["config"].l.setList(self.entrylist)
def getCPUBrand(): if SystemInfo["AmlogicFamily"]: return _("Amlogic") elif SystemInfo["HiSilicon"]: return _("HiSilicon") elif socfamily.startswith("smp"): return _("Sigma Designs") elif socfamily.startswith("bcm") or getBoxBrand() == "rpi": return _("Broadcom") else: return _("undefined")
def getTranslation(self, text): return _(text).replace( "%s %s (kernel %s)", "%s %s (kernel %s)" % (getBoxBrand(), getBoxType(), boxbranding.getKernelVersion())).replace( "%s-%s", "%s-%s" % (boxbranding.getVisionVersion(), boxbranding.getVisionRevision())).replace( "%s (type %s id %s)", "%s (type %s id %s)" % (boxbranding.getRCName(), boxbranding.getRCType(), boxbranding.getRCIDNum()))
def Power(self): print "[Standby] leave standby" self.close(True) if os.path.exists("/usr/script/StandbyLeave.sh"): Console().ePopen("/usr/script/StandbyLeave.sh") if getBoxBrand() == "fulan": try: open("/proc/stb/hdmi/output", "w").write("on") except: pass
def Power(self): print "[Standby] leave standby" SystemInfo["StandbyState"] = False self.close(True) if os.path.exists("/usr/script/StandbyLeave.sh"): Console().ePopen("/usr/script/StandbyLeave.sh") if SystemInfo["HiSilicon"] or getBoxBrand() == "dinobot": try: open("/proc/stb/hdmi/output", "w").write("on") except: pass
def preWidgetRemove(self, instance): self.mTimer.stop() try: #from boxbranding import getImageDistro, getImageVersion, getOEVersion self.mTimer.callback.remove(self.movingLoop) except: if getBoxBrand() == "dreambox": self.mTimer_conn = self.mTimer.timeout.disconnect(self.movingLoop) self.mTimer = None self.scroll_label = None
def sessionAnimationSetup(session, reason, **kwargs): setAnimation_current(config.misc.window_animation_default.value) setAnimation_speed(int(config.misc.window_animation_speed.value)) if not getBoxBrand() == 'gigablue': setAnimation_current_listbox(int(config.misc.listbox_animation_default.value)) global g_orig_show, g_orig_doClose if g_orig_show is None: g_orig_show = Screen.show if g_orig_doClose is None: g_orig_doClose = Screen.doClose Screen.show = screen_show Screen.doClose = screen_doClose
def saveAndExit(self): for x in self['config'].list: x[1].save() if getBoxBrand() not in ("xcore", "edision"): if config.btdevicesmanager.autostart.getValue(): print "[BluetoothManager] Autostart: Loading driver" Console().ePopen("modprobe rtk_btusb") else: print "[BluetoothManager] Autostart: Unloading driver" Console().ePopen("rmmod rtk_btusb") if getBoxBrand() in ("xcore", "edision"): if config.btdevicesmanager.audioconnect.getValue(): Console().ePopen( "%s %s" % (commandconnect, config.btdevicesmanager.audioaddress.getValue())) else: Console().ePopen("%s" % commandconnect) config.btdevicesmanager.save() self.close()
def getFPVersion(): ret = "unknown" try: if getBoxBrand() == "blackbox" and fileExists("/proc/stb/info/micomver"): ret = open("/proc/stb/info/micomver", "r").read() elif fileExists("/proc/stb/fp/version"): if getMachineBuild() == "dm4kgen" or getBoxType() in ("dm520","dm7080","dm820"): ret = open("/proc/stb/fp/version", "r").read() else: ret = long(open("/proc/stb/fp/version", "r").read()) elif fileExists("/sys/firmware/devicetree/base/bolt/tag"): ret = open("/sys/firmware/devicetree/base/bolt/tag", "r").read().rstrip("\0") else: fp = open("/dev/dbox/fp0") ret = ioctl(fp.fileno(),0) except IOError: print("[StbHardware] getFPVersion failed!") return ret
def showConnections(self): print "[BluetoothManager] showConnections" if getBoxBrand() not in ("xcore", "edision"): cmd = "hidd --show" self.taskManager.append(cmd, self.cbPrintCurrentConnections, self.cbStopDone) self.taskManager.next() else: paired_devices = iBluetoothctl.get_paired_devices() if paired_devices is not None: for d in paired_devices: if d is not None: mac_address = d['mac_address'] name = d['name'] msg = _("Connection with:\n" ) + name + " (" + mac_address + ")" self["ConnStatus"].setText(msg) self["key_yellow"].setText(_("Disconnect")) else: self["ConnStatus"].setText(_("No connected to any device"))
def getFPVersion(): ret = None try: if getBoxBrand() == "blackbox" and fileExists("/proc/stb/info/micomver"): ret = open("/proc/stb/info/micomver", "r").read() elif SystemInfo["DreamBoxDTSAudio"] or getBoxType().startswith("dm9") or getBoxType().startswith("dm52"): ret = open("/proc/stb/fp/version", "r").read() else: ret = long(open("/proc/stb/fp/version", "r").read()) except IOError: try: fp = open("/dev/dbox/fp0") ret = ioctl(fp.fileno(),0) fp.close() except IOError: try: ret = open("/sys/firmware/devicetree/base/bolt/tag", "r").read().rstrip("\0") except: print("[StbHardware] getFPVersion failed!") return ret
def postWidgetCreate(self, instance): for (attrib, value) in self.skinAttributes: if attrib == "size": x, y = value.split(',') self.W, self.H = int(x), int(y) self.instance.move(ePoint(0,0)) self.instance.resize( eSize(self.W,self.H) ) self.scroll_label = eLabel(instance) self.mTimer = eTimer() try: #from boxbranding import getImageDistro, getImageVersion, getOEVersion self.mTimer.callback.append(self.movingLoop) except: try: if getBoxBrand() == "dreambox": self.mTimer_conn = self.mTimer.timeout.connect(self.movingLoop) except: pass
def __init__(self, session): Screen.__init__(self, session) Screen.setTitle(self, _("Bluetooth Devices Manager")) self.taskManager = TaskManager() self["actions"] = ActionMap( [ "OkCancelActions", "WizardActions", "ColorActions", "SetupActions", "NumberActions", "MenuActions" ], { "ok": self.keyOK, "cancel": self.keyCancel, "red": self.keyCancel, "green": self.keyGreen, "yellow": self.keyYellow, "blue": self.keyBlue, }, -1) self["key_red"] = Label(_("Exit")) self["key_green"] = Label(_("(Re)Scan")) self["key_yellow"] = Label(_("Connect")) self["key_blue"] = Label(_("Config")) self["ConnStatus"] = Label(_("No connected to any device")) self.devicelist = [] self["devicelist"] = MenuList(self.devicelist) if config.btdevicesmanager.autostart.getValue(): self.initDevice() if getBoxBrand() in ("xcore", "edision"): self.initDevice() self.showConnections() self.refreshStatusTimer = eTimer() self.refreshStatusTimer.callback.append(self.cbRefreshStatus) self.cb_mac_address = None self.cb_name = None
#!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import print_function from Components.config import config, ConfigSelection, ConfigSubDict, ConfigYesNo from Components.SystemInfo import SystemInfo from Tools.CList import CList import os from enigma import getBoxType, getBoxBrand from Components.About import about from boxbranding import getHaveAVJACK, getHaveHDMI, getMachineBuild, getSoCFamily brand = getBoxBrand() socfamily = getSoCFamily().replace('bcm', '').replace('hisi', '') chipsetstring = about.getChipSetString() has_hdmi = getHaveHDMI() == "True" has_scart = SystemInfo["HasScart"] has_yuv = SystemInfo["HasYPbPr"] has_rca = SystemInfo["HasComposite"] has_avjack = getHaveAVJACK() == "True" # The "VideoHardware" is the interface to /proc/stb/video. # It generates hotplug events, and gives you the list of # available and preferred modes, as well as handling the currently # selected mode. No other strict checking is done. config.av.edid_override = ConfigYesNo(default=True) class VideoHardware: rates = {} # high-level, use selectable modes.
SystemInfo["HasYPbPr"] = getBoxType() in ("dm8000","et5x00","et6x00","et9x00","et10000","formuler1","mbtwinplus","spycat","vusolo","vuduo","vuduo2","vuultimo") SystemInfo["HasScart"] = getBoxType() in ("dm8000","et4x00","et6x00","et8000","et9x00","et10000","formuler1","hd1100","hd1200","hd1265","hd2400","vusolo","vusolo2","vuduo","vuduo2","vuultimo","vuuno","xp1000") SystemInfo["HasSVideo"] = getBoxType() == "dm8000" SystemInfo["HasComposite"] = getBoxType() not in ("dm900","dm920","dreamone","i55","gbquad4k","gbue4k","hd1500","osnino","osninoplus","purehd","purehdse","revo4k","vusolo4k","vuzero4k") SystemInfo["HasAutoVolume"] = fileExists("/proc/stb/audio/avl_choices") and fileCheck("/proc/stb/audio/avl") SystemInfo["HasAutoVolumeLevel"] = fileExists("/proc/stb/audio/autovolumelevel_choices") and fileCheck("/proc/stb/audio/autovolumelevel") SystemInfo["Has3DSurround"] = fileExists("/proc/stb/audio/3d_surround_choices") and fileCheck("/proc/stb/audio/3d_surround") SystemInfo["Has3DSpeaker"] = fileExists("/proc/stb/audio/3d_surround_speaker_position_choices") and fileCheck("/proc/stb/audio/3d_surround_speaker_position") SystemInfo["Has3DSurroundSpeaker"] = fileExists("/proc/stb/audio/3dsurround_choices") and fileCheck("/proc/stb/audio/3dsurround") SystemInfo["Has3DSurroundSoftLimiter"] = fileExists("/proc/stb/audio/3dsurround_softlimiter_choices") and fileCheck("/proc/stb/audio/3dsurround_softlimiter") SystemInfo["hasXcoreVFD"] = getBoxType() in ("osmega","spycat4k","spycat4kmini","spycat4kcombo") and fileCheck("/sys/module/brcmstb_%s/parameters/pt6302_cgram" % getBoxType()) SystemInfo["HasOfflineDecoding"] = getBoxType() not in ("osmini","osminiplus","et7000mini","et11000","mbmicro","mbtwinplus","mbmicrov2","et7x00","et8500") SystemInfo["HasRootSubdir"] = fileHas("/proc/cmdline", "rootsubdir=") SystemInfo["canMultiBoot"] = SystemInfo["HasRootSubdir"] and (1, 4, "mmcblk0", False) or fileHas("/proc/cmdline", "_4.boxmode=") and (1, 4, "mmcblk0", False) or getBoxType() in ("gbue4k","gbquad4k","gbx34k") and (3, 3, "mmcblk0", True) or getBoxType() == "e4hdultra" and (1, 4, "mmcblk0", False) or getBoxType() in ("osmio4k","osmio4kplus") and (1, 4, "mmcblk1", True) SystemInfo["canMode12"] = fileHas("/proc/cmdline", "_4.boxmode=1 ") and '192M' or fileHas("/proc/cmdline", "_4.boxmode=12") and '192M' SystemInfo["canFlashWithOfgwrite"] = getBoxBrand() != "dreambox" SystemInfo["HDRSupport"] = fileExists("/proc/stb/hdmi/hlg_support_choices") and fileCheck("/proc/stb/hdmi/hlg_support") SystemInfo["CanDownmixAC3"] = fileHas("/proc/stb/audio/ac3_choices","downmix") SystemInfo["CanDownmixDTS"] = fileHas("/proc/stb/audio/dts_choices","downmix") SystemInfo["CanDownmixAAC"] = fileHas("/proc/stb/audio/aac_choices","downmix") SystemInfo["HDMIAudioSource"] = fileCheck("/proc/stb/hdmi/audio_source") SystemInfo["SmallFlash"] = fileExists("/etc/smallflash") SystemInfo["HaveCISSL"] = fileCheck("/etc/ssl/certs/customer.pem") and fileCheck("/etc/ssl/certs/device.pem") SystemInfo["CanChangeOsdAlpha"] = access("/proc/stb/video/alpha", R_OK) and True or False SystemInfo["ScalerSharpness"] = fileExists("/proc/stb/vmpeg/0/pep_scaler_sharpness") SystemInfo["OScamInstalled"] = fileExists("/usr/bin/oscam") or fileExists("/usr/bin/oscam-emu") or fileExists("/usr/bin/oscam-smod") SystemInfo["OScamIsActive"] = SystemInfo["OScamInstalled"] and fileExists("/tmp/.oscam/oscam.version") SystemInfo["NCamInstalled"] = fileExists("/usr/bin/ncam") SystemInfo["NCamIsActive"] = SystemInfo["NCamInstalled"] and fileExists("/tmp/.ncam/ncam.version") SystemInfo["OpenVisionModule"] = fileCheck("/proc/stb/info/openvision") SystemInfo["OLDE2API"] = getBoxType() in ("dm800","su980")
def runScreenTest(): config.misc.startCounter.value += 1 config.misc.startCounter.save() profile("readPluginList") enigma.pauseInit() plugins.readPluginList(resolveFilename(SCOPE_PLUGINS)) enigma.resumeInit() profile("Init:Session") nav = Navigation() session = Session(desktop=enigma.getDesktop(0), summary_desktop=enigma.getDesktop(1), navigation=nav) CiHandler.setSession(session) screensToRun = [ p.__call__ for p in plugins.getPlugins(PluginDescriptor.WHERE_WIZARD) ] profile("wizards") screensToRun += wizardManager.getWizards() screensToRun.append((100, InfoBar.InfoBar)) screensToRun.sort() enigma.ePythonConfigQuery.setQueryFunc(configfile.getResolvedKey) def runNextScreen(session, screensToRun, *result): if result: enigma.quitMainloop(*result) return screen = screensToRun[0][1] args = screensToRun[0][2:] if screensToRun: session.openWithCallback( boundFunction(runNextScreen, session, screensToRun[1:]), screen, *args) else: session.open(screen, *args) config.misc.epgcache_filename.addNotifier(setEPGCachePath) runNextScreen(session, screensToRun) profile("Init:VolumeControl") vol = VolumeControl(session) profile("Init:PowerKey") power = PowerKey(session) from enigma import getBoxType if SystemInfo in [ "FirstCheckModel", "SecondCheckModel", "ThirdCheckModel", "DifferentLCDSettings" ] or getBoxType() in ("alphatriplehd", "tmtwin4k", "osminiplus", "sf3038", "spycat", "et7x00", "ebox5000", "ebox7358", "eboxlumi", "maram9", "sezam5000hd", "mbtwin", "sezam1000hd", "mbmini", "atemio5x00", "beyonwizt3", "dinoboth265", "axashistwin"): profile("VFDSYMBOLS") import Components.VfdSymbols Components.VfdSymbols.SymbolsCheck(session) # we need session.scart to access it from within menu.xml session.scart = AutoScartControl(session) profile("Init:Trashcan") import Tools.Trashcan Tools.Trashcan.init(session) profile("RunReactor") profile_final() runReactor() profile("wakeup") from time import strftime, localtime from Tools.StbHardware import setFPWakeuptime, setRTCtime from Screens.SleepTimerEdit import isNextWakeupTime #get currentTime nowTime = time() wakeupList = [ x for x in ((session.nav.RecordTimer.getNextRecordingTime(), 0), (session.nav.RecordTimer.getNextZapTime(isWakeup=True), 1), (plugins.getNextWakeupTime(), 2), (isNextWakeupTime(), 3)) if x[0] != -1 ] wakeupList.sort() if wakeupList: from time import strftime from enigma import getBoxBrand startTime = wakeupList[0] if (startTime[0] - nowTime) < 270: # no time to switch box back on wptime = nowTime + 30 # so switch back on in 30 seconds else: if getBoxBrand() == 'gigablue': wptime = startTime[ 0] - 120 # GigaBlue already starts 2 min. before wakeup time else: wptime = startTime[0] - 240 if not config.misc.SyncTimeUsing.value == "0" or getBoxBrand( ) == 'gigablue': print( "[mytest] dvb time sync disabled... so set RTC now to current linux time!", strftime("%Y/%m/%d %H:%M", localtime(nowTime))) setRTCtime(nowTime) print("[mytest] set wakeup time to", strftime("%Y/%m/%d %H:%M", localtime(wptime))) setFPWakeuptime(wptime) config.misc.prev_wakeup_time.value = int(startTime[0]) config.misc.prev_wakeup_time_type.value = startTime[1] config.misc.prev_wakeup_time_type.save() else: config.misc.prev_wakeup_time.value = 0 config.misc.prev_wakeup_time.save() profile("stopService") session.nav.stopService() profile("nav shutdown") session.nav.shutdown() profile("configfile.save") configfile.save() from Screens import InfoBarGenerics InfoBarGenerics.saveResumePoints() return 0
class RemoteControlType(Screen, ConfigListScreen): if getBoxBrand() in ("broadmedia","octagon","odin","protek","ultramini") or getBoxType() in ("et7x00","et8500","et1x000","et13000") or getBoxProc() in ("et7000","et7100","et7200","et7500"): rcList = [ ("0", _("Default")), ("3", _("MaraM9")), ("4", _("DMM normal")), ("5", _("et9000/et9100")), ("6", _("DMM advanced")), ("7", _("et5000/6000")), ("8", _("VU+")), ("9", _("et8000/et10000/et13000/SF5008")), ("11", _("et9200/9500/6500")), ("13", _("et4000")), ("14", _("XP1000")), ("16", _("HD11/HD51/HD1100/HD1200/HD1265/HD1500/HD500C/HD530C/et7x00/et8500/VS1000/VS1500")), ("17", _("XP3000")), ("18", _("F1/F3/F4/F4-TURBO/TRIPLEX")), ("19", _("HD2400")), ("20", _("Zgemma Star S/2S/H1/H2")), ("21", _("Zgemma H.S/H.2S/H.2H/H5/H7")), ("500", _("WWIO_BRE2ZE_TC")), ("501", _("OCTAGON_SF4008")), ("502", _("GIGABLUE Black")), ("503", _("MIRACLEBOX_TWINPLUS")), ("504", _("E3HD/XPEEDLX/GI")), ("505", _("ODIN_M7")), ("507", _("Beyonwiz U4")), ("511", _("OCTAGON SF5008")) ] defaultRcList = [ ("default", 0), ("et4000", 13), ("et5000", 7), ("et6000", 7), ("et6500", 11), ("et7x00",16), ("et7100",16), ("et7000",16), ("et7500",16), ("et7000mini",16), ("et8000", 9), ("et13000", 9), ("et8500",16), ("et9000", 5), ("et9100", 5), ("et9200", 11), ("et9500", 11), ("et10000", 9), ("formuler1",18), ("formuler3",18), ("formuler4",18), ("formuler4turbo",18), ("hd11",16), ("hd51",16), ("hd1100",16), ("hd1200",16), ("hd1265",16), ("hd500c",16), ("hd530c",16), ("vs1000",16), ("vs1500",16), ("hd2400",19), ("triplex",18), ("xp1000", 14), ("xp3000", 17), ("sh1", 20), ("h3", 21), ("h5", 21), ("h7", 21), ("bre2ze_tc", 500), ("sf4008", 501), ("g100", 501), ("sf4018", 501), ("gbquadplus", 502), ("g300", 503), ("e3hd", 504), ("et7000mini", 504), ("et1x000", 504), ("xpeedc.", 504), ("odinm7", 505), ("beyonwizu4", 507), ("sf5008", 511) ] else: rcList = [ ("0", _("Default")), ("3", _("MaraM9")), ("4", _("DMM normal")), ("5", _("et9000/et9100")), ("6", _("DMM advanced")), ("7", _("et5000/6000")), ("8", _("VU+")), ("9", _("et8000/et10000/et13000")), ("11", _("et9200/9500/6500")), ("13", _("et4000")), ("14", _("XP1000")), ("16", _("HD11/HD51/HD1100/HD1200/HD1265/HD1500/HD500C/HD530C/VS1000/VS1500")), ("17", _("XP3000")), ("18", _("F1/F3/F4/F4-TURBO/TRIPLEX")), ("19", _("HD2400")), ("20", _("Zgemma Star S/2S/H1/H2")), ("21", _("Zgemma H.S/H.2S/H.2H/H5/H7")), ("22", _("Zgemma i55")), ("23", _("WWIO 4K")), ("24", _("Axas E4HD Ultra")), ("25", _("Zgemma H9/I55Plus")), ("26", _("Protek 4K UHD")), ("27", _("HD60/HD61")) ] defaultRcList = [ ("default", 0), ("et4000", 13), ("et5000", 7), ("et6000", 7), ("et6500", 11), ("et8000", 9), ("et13000", 9), ("et9000", 5), ("et9100", 5), ("et9200", 11), ("et9500", 11), ("et10000", 9), ("formuler1",18), ("formuler3",18), ("formuler4",18), ("formuler4turbo",18), ("hd11",16), ("hd51",16), ("hd1100",16), ("hd1200",16), ("hd1265",16), ("hd500c",16), ("hd530c",16), ("vs1000",16), ("vs1500",16), ("hd2400",19), ("triplex",18), ("xp1000", 14), ("xp3000", 17), ("sh1", 20), ("h3", 21), ("h5", 21), ("h7", 21), ("i55", 22), ("bre2ze4k", 23), ("e4hd", 24), ("h9", 25), ("i55plus", 25), ("protek4k", 26), ("hd60", 27), ("hd61", 27) ] def __init__(self, session): Screen.__init__(self, session) self.skinName = ["RemoteControlType", "Setup" ] self.setTitle(_("Remote control type setup")) self["actions"] = ActionMap(["SetupActions"], { "cancel": self.keyCancel, "save": self.keySave, }, -1) self["key_green"] = StaticText(_("Save")) self["key_red"] = StaticText(_("Cancel")) self.list = [] ConfigListScreen.__init__(self, self.list, session = self.session) rctype = config.plugins.remotecontroltype.rctype.value self.rctype = ConfigSelection(choices = self.rcList, default = str(rctype)) self.list.append(getConfigListEntry(_("Remote control type"), self.rctype)) self["config"].list = self.list self.defaultRcType = 0 self.getDefaultRcType() def getDefaultRcType(self): data = iRcTypeControl.getBoxType() for x in self.defaultRcList: if x[0] in data: self.defaultRcType = x[1] break if self.defaultRcType == 0: self.defaultRcType = iRcTypeControl.readRcType() def setDefaultRcType(self): iRcTypeControl.writeRcType(self.defaultRcType) def keySave(self): if config.plugins.remotecontroltype.rctype.value == int(self.rctype.value): self.close() else: self.setNewSetting() self.session.openWithCallback(self.keySaveCallback, MessageBox, _("Is this setting ok?"), MessageBox.TYPE_YESNO, timeout=20, default=True, timeout_default=False) def keySaveCallback(self, answer): if answer is False: self.restoreOldSetting() else: config.plugins.remotecontroltype.rctype.value = int(self.rctype.value) config.plugins.remotecontroltype.save() self.close() def restoreOldSetting(self): if config.plugins.remotecontroltype.rctype.value == 0: self.setDefaultRcType() else: iRcTypeControl.writeRcType(config.plugins.remotecontroltype.rctype.value) def setNewSetting(self): if int(self.rctype.value) == 0: self.setDefaultRcType() else: iRcTypeControl.writeRcType(int(self.rctype.value)) def keyCancel(self): self.restoreOldSetting() self.close()