added alarmOn/Off Setting

This commit is contained in:
Nils Schulte 2020-03-23 12:16:50 +01:00
parent 28395a9138
commit 0b219d1236
2 changed files with 7 additions and 1 deletions

View File

@ -42,7 +42,11 @@ class ClockScreen():
return
self.light = not self.light
elif button == 2:
Settings.selectedColor=(Settings.selectedColor+1)%len(ClockScreen.COLORS)
if pushDownTime > 700:
Settings.selectedColor=(Settings.selectedColor+1)%len(ClockScreen.COLORS)
else:
Settings.alarmOn = not Settings.alarmOn
Settings.save()
HW.housingLEDs.fill([int(c/255*ClockScreen.BRIGHTNESS[Settings.selectedBrightness]) for c in ClockScreen.COLORS[Settings.selectedColor]] if self.light else (0,0,0))

View File

@ -21,6 +21,8 @@ def save():
wf.write("selectedSound="+str(selectedSound)+"\n")
elif l.startswith("alarmTime"):
wf.write("alarmTime="+str(alarmTime)+"\n")
elif l.startswith("alarmOn"):
wf.write("alarmTime="+str(alarmOn)+"\n")
elif l.startswith("selectedColor"):
wf.write("selectedColor="+str(selectedColor)+"\n")
elif l.startswith("selectedBrightness"):