Commit 5604c0e7 authored by Gert Steenssens's avatar Gert Steenssens

added quick and dirty way to configure variables in PijamaClock.conf

parent 429cab50
nighttime=False
rainbow_alarm=7
whitelow = (8,0,0)
......@@ -44,7 +44,6 @@ twelve=[(1,2),(2,1),(2,2),(2,3),(2,4),(2,5),(2,6),(4,2),(5,1),(6,2),(6,3),(5,4),
numbers=(one,two,three,four,five,six,seven,eight,nine,ten,eleven,twelve)
#show rainbow a
def show_rainbow(animate=True):
rainbow=Image.open("rainbow.png")
......@@ -147,10 +146,16 @@ def set_display_rotation():
rot=270
s.set_rotation(rot)
# set hour to enable rainbow alarm function
rainbow_alarm=5
# quick and dirty way to configure any default variables via PijamaClock.conf
try:
conf=open('PijamaClock.conf','r');
for line in conf: exec(line);
except:
print('PijamaClock.conf not found');
# clock is not set yet
clock_hour=clock_min=0
update_hour=update_min=0
......@@ -158,8 +163,6 @@ pm=False
# set led output to lowlight by default
(hour_color,min_color)=set_lowlight(s)
while True:
set_display_rotation()
......
......@@ -35,6 +35,7 @@ python /home/pi/PijamaClock/PijamaClock.py &
* basic temperature compensation for CPU heat affecting Sense HAT temperature sensors
* scrolls an error message when temperature measurements are invalid
* added basic rainbow effect for wake-up alarm (set to 6am by default, make sure to change this if that's too early for you)
* added quick and dirty way to configure variables in PijamaClock.conf file
# TODO
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment