more weather linting

This commit is contained in:
helgibbons 2022-10-05 12:20:20 +01:00
parent 9653dcaabd
commit 283986b531
1 changed files with 3 additions and 3 deletions

View File

@ -140,9 +140,9 @@ def clouds():
# add highlights and lowlights # add highlights and lowlights
for i in range(NUM_LEDS): for i in range(NUM_LEDS):
if uniform(0, 1) < 0.001: # highlight if uniform(0, 1) < 0.001: # highlight
target_leds[i] = [x+20 for x in cloud_colour] target_leds[i] = [x + 20 for x in cloud_colour]
elif uniform(0, 1) < 0.001: # lowlight elif uniform(0, 1) < 0.001: # lowlight
target_leds[i] = [x-20 for x in cloud_colour] target_leds[i] = [x - 20 for x in cloud_colour]
elif uniform(0, 1) < 0.005: # normal elif uniform(0, 1) < 0.005: # normal
target_leds[i] = cloud_colour target_leds[i] = cloud_colour
@ -228,7 +228,7 @@ get_data()
# start timer (the timer will update our data every UPDATE_INTERVAL) # start timer (the timer will update our data every UPDATE_INTERVAL)
timer = Timer(-1) timer = Timer(-1)
timer.init(period=UPDATE_INTERVAL*1000, mode=Timer.PERIODIC, callback=lambda t: get_data()) timer.init(period=UPDATE_INTERVAL * 1000, mode=Timer.PERIODIC, callback=lambda t: get_data())
while True: while True:
# do some fancy stuff with the LEDs based on the weather code # do some fancy stuff with the LEDs based on the weather code