Skip to content

Commit

Permalink
lcd add more led control options
Browse files Browse the repository at this point in the history
  • Loading branch information
captain committed May 30, 2019
1 parent 74c17dc commit 7365256
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 0 deletions.
6 changes: 6 additions & 0 deletions data/setup.xml
Expand Up @@ -296,6 +296,12 @@
<item level="0" requires="PowerLed" text="Turn on the power LED." description="Power LED can be turned on or off here.">config.usage.lcd_powerled</item>
<item level="0" requires="StandbyPowerLed" text="Power LED State in Standby" description="Power LED state during standby.">config.usage.lcd_standbypowerled</item>
<item level="0" requires="SuspendPowerLed" text="Power LED State in Deep-Standby" description="Power LED state during deep-standby.">config.usage.lcd_deepstandbypowerled</item>
<item level="0" requires="LedPowerColor" text="Power LED State when Running." description="Set LED Color or disable the LED.">config.usage.lcd_ledpowercolor</item>
<item level="0" requires="LedStandbyColor" text="Power LED State in Standby" description="Set LED Color or disable the LED.">config.usage.lcd_ledstandbycolor</item>
<item level="0" requires="LedSuspendColor" text="Power LED State in Deep-Standby" description="Set LED Color or disable the LED.">config.usage.lcd_ledsuspendcolor</item>
<item level="0" requires="Power4x7On" text="PowerControl FrontDisplay Normal Mode" description="This option allows you to Power Off the display.">config.usage.lcd_power4x7on</item>
<item level="0" requires="Power4x7Standby" text="PowerControl FrontDisplay Standby Mode" description="This option allows you to Power Off the display.">config.usage.lcd_power4x7standby</item>
<item level="0" requires="Power4x7Suspend" text="PowerControl FrontDisplay Suspend Mode" description="This option allows you to Power Off the display.">config.usage.lcd_power4x7suspend</item>
<item level="0" requires="7segmentORtextlcd7segment" text="Show in Standby" description="This option allows you choose how to display the Time or nothing in Standby">config.usage.show_in_standby</item>
<item level="2" requires="VFD_initial_scroll_delay" text="Initial scroll delay" description="Delay in miliseconds before start of scrolling text on display.">config.usage.vfd_initial_scroll_delay</item>
<item level="2" requires="VFD_final_scroll_delay" text="Final scroll delay" description="Delay in miliseconds after finish scrolling text on display.">config.usage.vfd_final_scroll_delay</item>
Expand Down
54 changes: 54 additions & 0 deletions lib/python/Components/Lcd.py
Expand Up @@ -446,6 +446,42 @@ def setPowerLEDdeepstanbystate(configElement):
f.write(configElement.value)
f.close()

def setLedPowerColor(configElement):
if fileExists("/proc/stb/fp/ledpowercolor"):
f = open("/proc/stb/fp/ledpowercolor", "w")
f.write(configElement.value)
f.close()

def setLedStandbyColor(configElement):
if fileExists("/proc/stb/fp/ledstandbycolor"):
f = open("/proc/stb/fp/ledstandbycolor", "w")
f.write(configElement.value)
f.close()

def setLedSuspendColor(configElement):
if fileExists("/proc/stb/fp/ledsuspendledcolor"):
f = open("/proc/stb/fp/ledsuspendledcolor", "w")
f.write(configElement.value)
f.close()

def setPower4x7On(configElement):
if fileExists("/proc/stb/fp/power4x7on"):
f = open("/proc/stb/fp/power4x7on", "w")
f.write(configElement.value)
f.close()

def setPower4x7Standby(configElement):
if fileExists("/proc/stb/fp/power4x7standby"):
f = open("/proc/stb/fp/power4x7standby", "w")
f.write(configElement.value)
f.close()

def setPower4x7Suspend(configElement):
if fileExists("/proc/stb/fp/power4x7suspend"):
f = open("/proc/stb/fp/power4x7suspend", "w")
f.write(configElement.value)
f.close()

def setXcoreVFD(configElement):
if fileExists("/sys/module/brcmstb_osmega/parameters/pt6302_cgram"):
f = open("/sys/module/brcmstb_osmega/parameters/pt6302_cgram", "w")
Expand Down Expand Up @@ -476,6 +512,24 @@ def setXcoreVFD(configElement):
config.usage.lcd_deepstandbypowerled = ConfigSelection(default = "on", choices = [("off", _("Off")), ("on", _("On"))])
config.usage.lcd_deepstandbypowerled.addNotifier(setPowerLEDdeepstanbystate)

config.usage.lcd_ledpowercolor = ConfigSelection(default = "1", choices = [("0", _("off")),("1", _("blue")), ("2", _("red")), ("3", _("violet"))])
config.usage.lcd_ledpowercolor.addNotifier(setLedPowerColor)

config.usage.lcd_ledstandbycolor = ConfigSelection(default = "3", choices = [("0", _("off")),("1", _("blue")), ("2", _("red")), ("3", _("violet"))])
config.usage.lcd_ledstandbycolor.addNotifier(setLedStandbyColor)

config.usage.lcd_ledsuspendcolor = ConfigSelection(default = "2", choices = [("0", _("off")),("1", _("blue")), ("2", _("red")), ("3", _("violet"))])
config.usage.lcd_ledsuspendcolor.addNotifier(setLedSuspendColor)

config.usage.lcd_power4x7on = ConfigSelection(default = "on", choices = [("off", _("Off")), ("on", _("On"))])
config.usage.lcd_power4x7on.addNotifier(setPower4x7On)

config.usage.lcd_power4x7standby = ConfigSelection(default = "off", choices = [("off", _("Off")), ("on", _("On"))])
config.usage.lcd_power4x7standby.addNotifier(setPower4x7Standby)

config.usage.lcd_power4x7suspend = ConfigSelection(default = "off", choices = [("off", _("Off")), ("on", _("On"))])
config.usage.lcd_power4x7suspend.addNotifier(setPower4x7Suspend)

if getBoxType() in ('dm900', 'dm920', 'e4hdultra', 'protek4k'):
standby_default = 4
elif getBoxType() in ('spycat4kmini', 'osmega'):
Expand Down
6 changes: 6 additions & 0 deletions lib/python/Components/SystemInfo.py
Expand Up @@ -59,6 +59,12 @@ def haveInitCam():
SystemInfo["PowerLed"] = fileExists("/proc/stb/power/powerled")
SystemInfo["StandbyPowerLed"] = fileExists("/proc/stb/power/standbyled")
SystemInfo["SuspendPowerLed"] = fileExists("/proc/stb/power/suspendled")
SystemInfo["LedPowerColor"] = fileExists("/proc/stb/fp/ledpowercolor")
SystemInfo["LedStandbyColor"] = fileExists("/proc/stb/fp/ledstandbycolor")
SystemInfo["LedSuspendColor"] = fileExists("/proc/stb/fp/ledsuspendledcolor")
SystemInfo["Power4x7On"] = fileExists("/proc/stb/fp/power4x7on")
SystemInfo["Power4x7Standby"] = fileExists("/proc/stb/fp/power4x7standby")
SystemInfo["Power4x7Suspend"] = fileExists("/proc/stb/fp/power4x7suspend")
SystemInfo["LEDButtons"] = getBoxType() == 'vuultimo'
SystemInfo["WakeOnLAN"] = fileCheck("/proc/stb/power/wol") or fileCheck("/proc/stb/fp/wol")
SystemInfo["HDMICEC"] = (fileExists("/dev/hdmi_cec") or fileExists("/dev/misc/hdmi_cec0")) and fileExists("/usr/lib/enigma2/python/Plugins/SystemPlugins/HdmiCEC/plugin.pyo")
Expand Down

0 comments on commit 7365256

Please sign in to comment.