Skip to content

Commit

Permalink
Merge pull request #121 from FoamyGuy/rainbow_period_property
Browse files Browse the repository at this point in the history
public property for rainbow.period
  • Loading branch information
FoamyGuy authored Dec 13, 2024
2 parents 389e401 + ee5301b commit bcdedb2
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions adafruit_led_animation/animation/rainbow.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,15 @@ def reset(self):
Resets the animation.
"""
self._generator = self._color_wheel_generator()

@property
def period(self) -> float:
"""
Period to cycle the rainbow over in seconds.
"""
return self._period

@period.setter
def period(self, new_value: float) -> None:
self._period = new_value
self.reset()

0 comments on commit bcdedb2

Please sign in to comment.