Skip to content

Commit bd18fe4

Browse files
committed
Ok, I did need it. Steady re-instated.
1 parent 3cc2b16 commit bd18fe4

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

busylight/effects/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@
66
from .blink import Blink
77
from .gradient import Gradient
88
from .spectrum import Spectrum
9+
from .steady import Steady
910

1011
__all__ = [
1112
"Effects",
1213
"Blink",
1314
"Gradient",
1415
"Spectrum",
16+
"Steady",
1517
]

busylight/effects/steady.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
"""
2+
"""
3+
4+
from typing import List
5+
6+
from ..color import ColorList, ColorTuple
7+
from .effect import BaseEffect
8+
9+
10+
class Steady(BaseEffect):
11+
def __init__(self, color: ColorTuple) -> None:
12+
self.color = color
13+
14+
def __repr__(self) -> str:
15+
return f"{self.name}(color={self.color!r})"
16+
17+
@property
18+
def duty_cycle(self) -> float:
19+
return 86400
20+
21+
@property
22+
def colors(self) -> ColorList:
23+
try:
24+
return self._colors
25+
except AttributeError:
26+
pass
27+
self._colors = [self.color]
28+
return self._colors

0 commit comments

Comments
 (0)