forked from derkalle4/python3-idotmatrix-library
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathexample_effect.py
More file actions
46 lines (38 loc) · 969 Bytes
/
Copy pathexample_effect.py
File metadata and controls
46 lines (38 loc) · 969 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import asyncio
import logging
import time
from idotmatrix.client import IDotMatrixClient
from idotmatrix.screensize import ScreenSize
# set basic logging
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s :: %(levelname)s :: %(name)s :: %(message)s",
datefmt="%d.%m.%Y %H:%M:%S",
handlers=[logging.StreamHandler()],
)
# set log level of bleak
logging.getLogger("bleak").setLevel(logging.WARNING)
async def main():
client = IDotMatrixClient(
screen_size=ScreenSize.SIZE_64x64,
)
# default colours used in the app.
colours = [
"red",
"orange",
"yellow",
"green",
"darkblue",
"magenta",
"white"
]
# Effect
for i in range(0, 7):
for j in range(2, 8):
await client.effect.show(i, colours[:j])
time.sleep(5)
if __name__ == "__main__":
try:
asyncio.run(main())
except KeyboardInterrupt:
quit()