Added 2 more keys, stripped unused cruft, and added more docs.

This commit is contained in:
Kyle Brown
2019-02-24 22:32:13 -08:00
parent 5c8c2e97fd
commit f65ea1e841
6 changed files with 86 additions and 20 deletions

View File

@@ -77,7 +77,7 @@ class RGB:
return ret
def time_ms(self):
return floor(time.monotonic() * 10)
return floor(time.monotonic() * 1000)
def hsv_to_rgb(self, hue, sat, val):
"""
@@ -247,6 +247,26 @@ class RGB:
else:
self.val -= step
def increase_ani(self):
"""
Increases animation speed by 1 amount stopping at 10
:param step:
"""
if (self.animation_speed + 1) >= 10:
self.animation_speed = 10
else:
self.val += 1
def decrease_ani(self):
"""
Decreases animation speed by 1 amount stopping at 0
:param step:
"""
if (self.val - 1) <= 0:
self.val = 0
else:
self.val -= 1
def off(self):
"""
Turns off all LEDs/Neopixels without changing stored values