Prettier
This commit is contained in:
parent
fa1dfe2354
commit
1f59d9cd9a
2 changed files with 9 additions and 11 deletions
12
dmx.py
12
dmx.py
|
|
@ -1,7 +1,7 @@
|
|||
import colorsys
|
||||
import socket
|
||||
import struct
|
||||
import threading
|
||||
import sys
|
||||
from threading import Thread
|
||||
from time import sleep, time
|
||||
|
||||
|
|
@ -59,7 +59,7 @@ class Steady:
|
|||
return (self.r, self.g, self.b)
|
||||
|
||||
def __str__(self):
|
||||
return f"steady({self.r}, {self.g}, {self.b})"
|
||||
return f"{type(self).__name__}({self.r}, {self.g}, {self.b})"
|
||||
|
||||
|
||||
class FadeTo(Steady):
|
||||
|
|
@ -74,7 +74,7 @@ class FadeTo(Steady):
|
|||
return (int(self.r * h), int(self.g * h), int(self.b * h))
|
||||
|
||||
def __str__(self):
|
||||
return f"fadeTo({self.r}, {self.g}, {self.b})"
|
||||
return f"{type(self).__name__}({self.r}, {self.g}, {self.b}, {self.t:.2f})"
|
||||
|
||||
|
||||
class RotatingRainbow:
|
||||
|
|
@ -94,7 +94,7 @@ class RotatingRainbow:
|
|||
return rgb
|
||||
|
||||
def __str__(self):
|
||||
return "RotatingRainbow"
|
||||
return "{type(self).__name__}"
|
||||
|
||||
|
||||
class Chase(Steady):
|
||||
|
|
@ -109,7 +109,7 @@ class Chase(Steady):
|
|||
return (int(self.r * l), int(self.g * l), int(self.b * l))
|
||||
|
||||
def __str__(self):
|
||||
return f"fadeTo({self.r}, {self.g}, {self.b})"
|
||||
return f"{type(self).__name__}({self.r}, {self.g}, {self.b}, {self.looptime:.2f})"
|
||||
|
||||
|
||||
class DMX:
|
||||
|
|
@ -169,4 +169,4 @@ class DMX:
|
|||
|
||||
def setAnimation(self, animation):
|
||||
self.animation = animation
|
||||
print(f"Animation: {animation}")
|
||||
print(f"Animation: {animation}", file=sys.stderr)
|
||||
Loading…
Add table
Add a link
Reference in a new issue