Skip to content

Commit

Permalink
fix variable collision with daycycle.py
Browse files Browse the repository at this point in the history
fixes #608
  • Loading branch information
NotAFile committed Mar 28, 2021
1 parent c4b3c68 commit d78b63c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions piqueserver/scripts/daycycle.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,12 @@ def reset_daycycle(self):
def update_day_color(self):
if self.current_time >= 24.00:
self.current_time = wrap(0.00, 24.00, self.current_time)
while (self.current_time < self.start_time or
while (self.current_time < self.daycycle_start_time or
self.current_time >= self.target_time):
self.next_color()
self.target_time = self.target_time or 24.00
t = ((self.current_time - self.start_time) /
(self.target_time - self.start_time))
t = ((self.current_time - self.daycycle_start_time) /
(self.target_time - self.daycycle_start_time))
if self.hsv_transition:
new_color = interpolate_hsb(self.start_color,
self.target_color, t)
Expand All @@ -122,7 +122,7 @@ def update_day_color(self):
self.current_time += self.time_step * self.time_multiplier

def next_color(self):
self.start_time, self.start_color, _ = (
self.daycycle_start_time, self.start_color, _ = (
self.day_colors[self.target_color_index])
self.target_color_index = ((self.target_color_index + 1) %
len(self.day_colors))
Expand Down

0 comments on commit d78b63c

Please sign in to comment.