Skip to content

Commit

Permalink
remove half
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Bestoso authored and Peter Bestoso committed Mar 8, 2017
1 parent 04fc500 commit f298ab2
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions server.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
LIGHT_BRIGHTS = [0.0, 0.0, 0.0, 0.0, 0.0]
MAX_BRIGHTNESS = 0.8
MIN_BRIGHTNESS = 0.0
HALF_BRIGHTNESS = (MAX_BRIGHTNESS + MIN_BRIGHTNESS) / 2
INCR = 0.015
NUM_LIGHTS = 5

Expand Down Expand Up @@ -40,19 +39,6 @@ def all_lights_down():
set_light(i, 0)
return

def all_lights_half():
while True:
done = True
for i in range(5):
if (LIGHT_BRIGHTS[i] > HALF_BRIGHTNESS):
done = False
set_light(i, LIGHT_BRIGHTS[i] - INCR)
elif LIGHT_BRIGHTS[i] < HALF_BRIGHTNESS:
done = False
set_light(i, LIGHT_BRIGHTS[i] + INCR)
if done:
return

def blink_light(light_id):
brightness = LIGHT_BRIGHTS[light_id]
while brightness >= MIN_BRIGHTNESS:
Expand Down Expand Up @@ -109,11 +95,6 @@ def down_endpoint():
all_lights_down()
return '{}'

@app.route('/half')
def half_endpoint():
all_lights_half()
return '{}'

@app.route('/blink')
def blink_endpoint():
light_id_arg = request.args.get('light')
Expand Down

0 comments on commit f298ab2

Please sign in to comment.