-
Notifications
You must be signed in to change notification settings - Fork 16
Closed
Labels
HacktoberfestDigitalOcean's HacktoberfestDigitalOcean's HacktoberfestbugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomers
Description
The docs claim that it's possible to set animation_time
to zero:
animation: Set
animation_time
to the duration (in seconds) it will take to transition the switch, set zero if you want it to snap into position immediately
However, the code doesn't actually handle that case, thus leading to a ZeroDivisionError
here:
Adafruit_CircuitPython_DisplayIO_Layout/adafruit_displayio_layout/widgets/switch_round.py
Line 767 in aa66d0f
position = (elapsed_time) / self._animation_time # fraction from 0 to 1 |
Traceback:
Traceback (most recent call last):
[...]
File "adafruit_displayio_layout/widgets/switch_round.py", line 830, in value
File "adafruit_displayio_layout/widgets/switch_round.py", line 792, in selected
File "adafruit_displayio_layout/widgets/switch_round.py", line 767, in _animate_switch
Metadata
Metadata
Assignees
Labels
HacktoberfestDigitalOcean's HacktoberfestDigitalOcean's HacktoberfestbugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomers