Skip to content

Commit 315c757

Browse files
Merge pull request #2 from kamaradclimber/division_by_zero
Always ask for one step in rgbw transitions
2 parents a0d81cd + 838fd33 commit 315c757

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

limitlessled/group/rgbw.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,8 @@ def _transition(self, duration, color, brightness):
162162
if color is not None:
163163
c_steps = abs(util.rgb_to_hue(*self.color)
164164
- util.rgb_to_hue(*color))
165-
# Compute ideal step amount.
166-
total = c_steps + b_steps
165+
# Compute ideal step amount (at least one).
166+
total = max(c_steps + b_steps, 1)
167167
# Calculate wait.
168168
wait = self._wait(duration, total)
169169
# Scale down steps if no wait time.

0 commit comments

Comments
 (0)