Skip to content

Commit 046bcde

Browse files
MrServoHains
authored andcommitted
[LCD4linux] v5.0-r25 tiny bugfix in 'resetBrightness'
- 'resetBrightness' corrected acc. original version V5.2-r0 - tiny code improvements
1 parent f0e3916 commit 046bcde

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

lcd4linux/src/module.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,10 @@ def setScreen(self, S, Lcd="", Hold=False):
110110
L4Lelement.Refresh = True
111111

112112
def resetBrightness(self, AKT=[]):
113-
L4Lelement.BrightAkt = AKT if len(AKT) == 3 else [-1, -1, -1]
113+
if len(AKT) == 3:
114+
L4Lelement.BrightAkt = AKT
115+
else:
116+
L4Lelement.Bright = [-1, -1, -1]
114117

115118
def setBrightness(self, LCD, BRI=-1):
116119
if int(LCD) > 0 and int(LCD) < 4:
@@ -119,7 +122,7 @@ def setBrightness(self, LCD, BRI=-1):
119122

120123
def getBrightness(self, LCD=0, ORG=True):
121124
if int(LCD) > 0 and int(LCD) < 4:
122-
return L4Lelement.Bright[int(LCD) - 1] if ORG == False else L4Lelement.BrightAkt[int(LCD) - 1]
125+
return [L4Lelement.Bright[int(LCD) - 1]] if ORG == False else [L4Lelement.BrightAkt[int(LCD) - 1]]
123126
else:
124127
return L4Lelement.Bright if ORG == False else L4Lelement.BrightAkt
125128

lcd4linux/src/plugin.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2698,13 +2698,13 @@ def getFB2(check):
26982698

26992699

27002700
def BRI(w1, w2):
2701-
gb = L4LElist.getBrightness(w2, False)
2701+
gb = int(L4LElist.getBrightness(w2, False)[0])
27022702
return int(w1) if gb == -1 else gb
27032703

27042704

27052705
def virtBRI(LCD):
27062706
global AktNight
2707-
vb = BRI(L4LElist.getBrightness(LCD), LCD)
2707+
vb = BRI(L4LElist.getBrightness(LCD)[0], LCD)
27082708
if vb < 1:
27092709
return 0
27102710
elif vb == 10:
@@ -5103,11 +5103,11 @@ def MailDecode(Sdecode):
51035103
Date = ""
51045104
for R in mailserver.retr(M)[1]:
51055105
if str(R).upper().startswith("FROM:"):
5106-
From = R[R.find(" "):].strip()
5106+
From = R[str(R).find(" "):].strip()
51075107
elif str(R).upper().startswith("SUBJECT:"):
5108-
Subj = R[R.find(" "):].strip()
5108+
Subj = R[str(R).find(" "):].strip()
51095109
elif str(R).upper().startswith("DATE:") and LCD4linux.MailShowDate.value == True:
5110-
Date = R[R.find(" "):].strip()
5110+
Date = R[str(R).find(" "):].strip()
51115111
Date = "- %s" % str(Date).split("+")[0].split(",")[-1].strip()
51125112
if From != "" and Subj != "":
51135113
break

0 commit comments

Comments
 (0)