performance – Remember what to do every day with LED patterns

I'm using a b model of Raspberry Pi 3 to control the LEDs connected to an editing board. I want the lights to tell me what chore I have to do today. When to take out garbage cans, recyclables, vacuum and clean the bathroom. There is also another rotation every 6 days that I have to follow. The code works and fulfills its purpose, but it is really embarrassing that I have to rewrite the functions. Fixed(), empty(), and chores () for the code to start in the position I want. My question is: how can I run the code in the correct starting position of cycle with only entries without having to rewrite the sections?

#! / usr / bin / python
# - * - coding: utf-8 - * -

"By André Akue"

to import RPi.GPIO as GPIO
GPIO.setmode (GPIO.BCM)
GPIO.setwarnings (True)
import time
import date / time
of the bone import system
since a multiprocessing import process

speed = 2 # flashing speed
day_duration = 60 * 60 * 24
check_time = 600 #check for day change every 600 seconds

class fires: # establishment of leds

def __init __ (self, color_name, color_pin):
self.name = color_name
self.pin = color_pin
GPIO.setup (self.pin, GPIO.OUT, initial = 0)

def solid (self): # stays on the first day or garbage collection the next day (warning)
GPIO.output (self.pin, 1)
time.sleep (check_time)
GPIO.output (self.pin, 0)

flash def (self): #blink when it's the second day or when the recycle bin is collected
stp = time.time (); etp = time.time () + check_time # stp / etp = start / end time template
while time.time () <etp:
GPIO.output (self.pin, 0)
time.sleep (0.8 / speed)
GPIO.output (self.pin, 1)
time.sleep (0.2 / speed)
GPIO.output (self.pin, 0)

L1 = lights ("white", 21)
L2 = lights ("yellow", 16)
L3 = lights ("red", 12)
L4 = lights ("blue", 25)
L5 = lights ("green", 24)
L6 = lights ("snow", 23)

def chores (): # a 6 day cycle divided into 3 stages of 2 days each
while 1:
# Sweep the ground - Day one
L2.solid () # yellow stays on
# Sweep the ground - Second day
L2.flash () # yellow keeps flashing
#Place the table - First day
L3.solid () # red stays on
#Place the table - Second day
L3.flash () # red continues to flash
#Washing dishes - First day
GPIO.output ((L2.pin, L3.pin), 1) # remains red and yellow
time.sleep (check_time)
GPIO.output ((L2.pin, L3.pin), 0)
#Washing dishes - Second day
stp = time.time (); etp = time.time () + check_time # stp / etp = start / end time template
while time.time () <etp: #red and yellow continue to flash
GPIO.output ((L2.pin, L3.pin), 0)
time.sleep (0.8 / speed)
GPIO.output ((L2.pin, L3.pin), 1)
time.sleep (0.2 / speed)
GPIO.output ((L2.pin, L3.pin), 0)

def log (): # displays the day of the week and the number of days in the command prompt
account = 0
while 1:
for day in week_order:
account + = 1
print ('Day':% s  t  tDay of the week:% i% (day, number))
time.sleep (day_duration)

def vacuum ():
while 1:
#only arrives Friday to Sunday every 3 weeks
for the day in the list (range (1,22)):
if the day is not in [4,5,6]:
time.sleep (day_duration)
day elif == 4:
L5.solid ()
elif day == 5:
L5.solid ()
day elif == 6:
L5.flash ()



def start_tomorrow (): #cycle starts the day after the code is started
tomorrow = datetime.datetime.now () + datetime.timedelta (days = 1)
While datetime.datetime.now () <tomorrow:
hour (60)
print ( nchore cycle started & # 39;)

def fixed (): #all weekly fixed items
while 1:
if datetime.datetime.now (). strftime (& # 39;% a & # 39;) == & # 39;
L1.flash () # trash
L6.solid () # recycle
elif datetime.datetime.now (). strftime (& # 39;% a & # 39;) == & # 39; Tuesday & # 39;
L6.flash () # recycle
elif datetime.datetime.now (). strftime (& # 39;% a & # 39;) == & # 39; Sea & # 39;
L1.solid () # trash
L4.solid () # bath
elif datetime.datetime.now (). strftime (& # 39;% a & # 39;) == & # 39; Thu & # 39;
L1.flash () # trash
L4.flash () # bath
elif datetime.datetime.now (). strftime (& # 39;% a & # 39;) == & nbsp;

elif datetime.datetime.now (). strftime (& # 39;% a & # 39;) == & # 39; Sat & # 39;

elif datetime.datetime.now (). strftime (& # 39;% a & # 39;) == & nbsp; Sun & # 39;
L1.solid () # trash

try: #using process so that different cycles can work independently
if __name__ == __ hand __:
Process (target = log) .start ()
Process (target = housework) .start ()
Process (target = bath) .start ()
Process (target = recycle) .start ()
Process (target = empty) .start ()
Process (target = recycle bin) .start ()

except KeyboardInterrupt:
system (& # 39; clear & # 39;)
print (" n  n  texited via a keyboard break  n  n")
GPIO.cleanup ()

# during the reset:
Cycle # 3-chore
# place the chore that happens tomorrow in the first place of the sequence

#Bath, trash, recycle & # 39; and & # 39; newspaper & # 39;
# place tomorrow first in the list of days of the week
# & # 39; week_order & # 39;

cycle #vaccum
# count the number of days until the next 'first day of emptiness',
# and start with this number in the list of "if" loops