Skip to content

Commit c0d75b8

Browse files
committed
fixing pylint
3rd attempt
1 parent c38a83a commit c0d75b8

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

Toddler_Timer/code.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515
from adafruit_ticks import ticks_ms, ticks_add, ticks_diff
1616
from rainbowio import colorwheel
1717

18-
COLOR = (255, 150, 0) # yellow
18+
COLOR = (255, 150, 0) # yellow
1919
OFF = (0, 0, 0)
2020
PIXEL_PIN = board.A0
2121
NUM_PIXELS = 6
22-
timers = [6, 10, 15, 20, 25, 30] # minutes
23-
color_time = 20 # milliseconds
22+
timers = [6, 10, 15, 20, 25, 30] # minutes
23+
color_time = 20 # milliseconds
2424

2525
# rotary encoder
2626
i2c = board.STEMMA_I2C()
@@ -36,7 +36,7 @@
3636
pixels.fill(OFF)
3737
pixels.show()
3838

39-
#display setup
39+
# display setup
4040
displayio.release_displays()
4141

4242
# oled
@@ -46,17 +46,17 @@
4646
HEIGHT = 64
4747
display = adafruit_displayio_ssd1306.SSD1306(display_bus, width=WIDTH, height=HEIGHT)
4848

49-
font = bitmap_font.load_font('/Arial-14.bdf')
49+
font = bitmap_font.load_font("/Arial-14.bdf")
5050
main_area = label.Label(font, text="6 Minutes", color=0xFFFFFF)
5151
main_area.anchor_point = (0.5, 0.0)
52-
main_area.anchored_position = (display.width / 2, display.height/2)
52+
main_area.anchored_position = (display.width / 2, display.height / 2)
5353
splash = displayio.Group()
5454
splash.append(main_area)
5555
display.root_group = splash
5656

5757
timer_index = 0
5858
timer = timers[timer_index]
59-
time_remaining = timer*60000
59+
time_remaining = timer * 60000
6060
active_timer = False
6161
timer_clock = ticks_ms()
6262
color_clock = ticks_ms()
@@ -94,8 +94,10 @@
9494
remaining //= 60
9595
mins_remaining = remaining % 60
9696
if time_remaining > 0:
97-
mapped_time = simpleio.map_range(time_remaining, 0, (timer*60000), 0, NUM_PIXELS+1)
98-
if mapped_time < 1 :
97+
mapped_time = simpleio.map_range(
98+
time_remaining, 0, (timer * 60000), 0, NUM_PIXELS + 1
99+
)
100+
if mapped_time < 1:
99101
mapped_time = 1
100102
if int(mapped_time) != last_map:
101103
pixels.fill(OFF)

0 commit comments

Comments
 (0)