Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update LCD4Linux #1

Merged
merged 17 commits into from
Aug 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 3 additions & 13 deletions lcd4linux/src/WebConfigSite.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,7 @@ class LCD4linuxConfigweb(resource.Resource):

def __init__(self):
self.StatusTimer = eTimer()
if DPKG:
self.StatusTimer_conn = self.StatusTimer.timeout.connect(self.resetWeb)
else:
self.StatusTimer.callback.append(self.resetWeb)
self.StatusTimer.callback.append(self.resetWeb)
self.CurrentMode = ("-", "-")

def resetWeb(self):
Expand Down Expand Up @@ -328,7 +325,6 @@ def action(self, req):
obja = eval(a)
objb = eval(b)
objb.value = obja.value

elif ".Standby" in _a:
b = _a.replace(".Standby", ".")
if (" " + b) in list(zip(*L2))[2]:
Expand Down Expand Up @@ -428,7 +424,8 @@ def action(self, req):
if Cfritz:
rmFile(PICfritz)
if Cwetter:
resetWetter(None)
# resetWetter(None) # action after changing weather parameters
pass
if Cpicon:
if len(LCD4linux.PiconCache.value) > 2:
rmFiles(join(LCD4linux.PiconCache.value, "*.png"))
Expand Down Expand Up @@ -508,18 +505,14 @@ def action(self, req):
html += "<input type=\"image\" name=\"save\" value=\"klick\" src=\"/lcd4linux/data/WEBsave.png\" height=\"40\" title=\"%s\" class=\"style1\" >\n" % _l(_("Save Config"))
html += "</form>\n"
html += "<form method=\"post\"><font color=\"#FFFFFF\">%s</font>\n" % _l(_("Screen"))

html += "<input type=\"hidden\" name=\"cmd\" value=\"\">\n"
for i in range(1, 10):
html += "<input type=\"button\" value=\"%d\" style=\"width:15px; text-align:center; font-size:8pt%s\" onclick=\"this.form.cmd.value = 'Screen%d'; this.form.submit();\">\n" % (i, AktiveScreen(str(i)), i)

Aktiv = "checked" if getSaveEventListChanged() else ""
html += "<input type=\"hidden\" name=\"hold\" value=\"%s\">" % ("unchecked")
html += "<input type=\"checkbox\" title=\"%s\" name=\"hold\" value=\"%s\" onclick=\"this.form.cmd.value = 'hold'; this.form.submit();\" %s>" % (_l(_("stop Screencycle")), "checked", Aktiv)

html += "</form>\n"
html += "</td></tr></table>\n"

html += "<form method=\"get\">"
html += "<fieldset style=\"width:auto\" name=\"Mode1\">"
html += "<legend style=\"color: #FFCC00\">%s&nbsp;</legend>\n" % _l(_("Mode"))
Expand All @@ -532,7 +525,6 @@ def action(self, req):
if str(LCD4linux.Popup.value) != "0":
html += "<input id=\"r5\" name=\"Mode\" type=\"radio\" value=\"5\" %s onclick=\"this.form.submit();\"><label %s for=\"r5\">%s&nbsp;&nbsp;</label>\n" % (AktiveMode("5", "Popup-Text"))
html += "</fieldset></form>\n"

if Mode != "5":
if Mode == "1":
L = L1
Expand Down Expand Up @@ -595,9 +587,7 @@ def action(self, req):
for LL in L:
Conf = LL[2].strip()
ConfObj = eval(Conf)

if (Conf.startswith(Element) and (LL[3] == AktCode or AktCode == 0)) or (Element == "other" and LL[3] == 0):

if Mode in "2":
if "." in Conf:
b = Conf.replace(".", ".MP")
Expand Down
1 change: 1 addition & 0 deletions lcd4linux/src/configOptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@
['self.list1', 'MJPEG Cycle', ' LCD4linux.MJPEGCycle', 14],
['self.list1', 'MJPEG Restart on Error', ' LCD4linux.MJPEGRestart', 14],
['self.list1', 'MJPEG Header Mode', ' LCD4linux.MJPEGHeader', 14],
['self.list1', 'Show Streams \'4097; 5001...5003\' in Mode', ' LCD4linux.Streaming', 0],
['self.list1', 'Sonos IP', ' LCD4linux.SonosIP', 19],
['self.list1', 'Sonos Ping Timeout [ms]', ' LCD4linux.SonosPingTimeout', 19],
['self.list1', 'Sonos Play Check', ' LCD4linux.SonosCheckTimer', 19],
Expand Down
4 changes: 4 additions & 0 deletions lcd4linux/src/data/skin_data.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@
<screen name="SimpleSummary" position="fill" id="3">
<panel name="SummaryTemplate" />
</screen>
<!--ScreenSummary-->
<screen name="ScreenSummary" position="fill" id="3">
<panel name="SummaryTemplate" />
</screen>
<!--ChannelSelectionRadio_summary-->
<screen name="ChannelSelectionRadio_summary" position="fill" id="3">
<panel name="SummaryTemplate" />
Expand Down
15 changes: 8 additions & 7 deletions lcd4linux/src/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# by joergm6 @ IHAD
# for documentation look at IHAD Support Thread

from __future__ import print_function
from os import popen
from os.path import isfile, exists

Expand Down Expand Up @@ -53,7 +54,7 @@ def get(self, element=None):
def web(self, EX):
try:
exec("self.add('%s)" % EX.replace(",", "',", 1))
except:
except Exception:
print("[LCD4linuxE] Error: L4L Web-Elements")

def getResolution(self, LCD):
Expand Down Expand Up @@ -109,7 +110,7 @@ def setScreen(self, S, Lcd="", Hold=False):
L4Lelement.Hold = Hold
L4Lelement.Refresh = True

def resetBrightness(self, AKT=[]):
def resetBrightness(self, AKT=""):
if len(AKT) == 3:
L4Lelement.BrightAkt = AKT
else:
Expand All @@ -122,10 +123,10 @@ def setBrightness(self, LCD, BRI=-1):
L4Lelement.Refresh = True

def getBrightness(self, LCD=0, ORG=True):
if LCD > 0 and LCD < 4:
return L4Lelement.Bright[LCD - 1] if ORG == False else L4Lelement.BrightAkt[LCD - 1]
if int(LCD) > 0 and int(LCD) < 4:
return L4Lelement.Bright[int(LCD) - 1] if ORG == False else L4Lelement.BrightAkt[int(LCD) - 1]
else:
return L4Lelement.Bright[0] if ORG == False else L4Lelement.BrightAkt[0]
return L4Lelement.Bright if ORG == False else L4Lelement.BrightAkt

def getLcd(self):
return L4Lelement.LCD
Expand All @@ -146,7 +147,7 @@ def getstatusoutput(cmd):
sts = 0
if text[-1:] == '\n':
text = text[:-1]
except:
except Exception:
sts = 1
text = "- -"
print("[LCD4linux] Error on os-call")
Expand All @@ -173,6 +174,6 @@ def L4LVtest(VV):
f = open(L4Linfo % (O, P))
OO = f.readline().strip().split()[1].startswith(VV[1:])
f.close()
except:
except Exception:
pass
return OO
Loading
Loading