From 0b219d1236f96520f142ebecc7ca287ddb79a6da Mon Sep 17 00:00:00 2001 From: Nils Schulte Date: Mon, 23 Mar 2020 12:16:50 +0100 Subject: [PATCH] added alarmOn/Off Setting --- Screens.py | 6 +++++- Settings.py | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Screens.py b/Screens.py index 7f5b49e..37f759a 100644 --- a/Screens.py +++ b/Screens.py @@ -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)) diff --git a/Settings.py b/Settings.py index 5517f65..94b0765 100644 --- a/Settings.py +++ b/Settings.py @@ -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"):