Skip to content

Commit

Permalink
simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Bestoso authored and Peter Bestoso committed Mar 3, 2017
1 parent 98ba954 commit 30f0be8
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions server.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,6 @@ def blink_light(light_id):
while brightness <= MAX_BRIGHTNESS:
set_light(light_id, brightness)
brightness += .01

def blink_all_lights():
all_lights_up()
brightness = MAX_BRIGHTNESS
while brightness >= MIN_BRIGHTNESS:
for light_id in range(5):
set_light(light_id, brightness)
brightness -= .01

while brightness <= MAX_BRIGHTNESS:
for light_id in range(5):
set_light(light_id, brightness)
brightness += .01


def wave_lights():
count_downs = [0, 10, 20, 30, 40]
Expand Down Expand Up @@ -115,7 +101,8 @@ def down_endpoint():
def blink_endpoint():
light_id_arg = request.args.get('light')
if not light_id_arg:
blink_all_lights()
all_lights_down()
all_lights_up()

light_id = int(light_id_arg)

Expand Down

0 comments on commit 30f0be8

Please sign in to comment.