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

[LCD4linux] revert commit 1df1cc0 #759

Merged
merged 1 commit into from
Dec 3, 2023
Merged
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
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