lyte 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- lyte-0.1.0/PKG-INFO +53 -0
- lyte-0.1.0/README.md +44 -0
- lyte-0.1.0/lyte/__init__.py +87 -0
- lyte-0.1.0/lyte/bibliopixel.py +837 -0
- lyte-0.1.0/lyte/client.py +160 -0
- lyte-0.1.0/lyte/crypto.py +51 -0
- lyte-0.1.0/lyte/discovery.py +60 -0
- lyte-0.1.0/lyte/errors.py +17 -0
- lyte-0.1.0/lyte/hamiltonian.py +170 -0
- lyte-0.1.0/lyte/logging.py +20 -0
- lyte-0.1.0/lyte/random_walk.py +119 -0
- lyte-0.1.0/lyte/realtime.py +71 -0
- lyte-0.1.0/lyte/retry.py +57 -0
- lyte-0.1.0/lyte/session.py +95 -0
- lyte-0.1.0/lyte.egg-info/PKG-INFO +53 -0
- lyte-0.1.0/lyte.egg-info/SOURCES.txt +20 -0
- lyte-0.1.0/lyte.egg-info/dependency_links.txt +1 -0
- lyte-0.1.0/lyte.egg-info/requires.txt +2 -0
- lyte-0.1.0/lyte.egg-info/top_level.txt +1 -0
- lyte-0.1.0/pyproject.toml +17 -0
- lyte-0.1.0/setup.cfg +4 -0
- lyte-0.1.0/tests/test_lyte.py +1077 -0
lyte-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: lyte
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Small dependency-free Python client for Twinkly generation 2 lights
|
|
5
|
+
Requires-Python: >=3.11
|
|
6
|
+
Description-Content-Type: text/markdown
|
|
7
|
+
Requires-Dist: numpy>=2.4.6
|
|
8
|
+
Requires-Dist: pydantic
|
|
9
|
+
|
|
10
|
+
# lyte
|
|
11
|
+
|
|
12
|
+
Small, dependency-free Python client for Twinkly lights born
|
|
13
|
+
from personal frustration.
|
|
14
|
+
|
|
15
|
+
I was the principle developer on the classic Bibliopixel package but
|
|
16
|
+
the copyright holder decided to call it in, and so I left the project
|
|
17
|
+
but I want to preserve my animations for the lights I have.
|
|
18
|
+
|
|
19
|
+
But the only library for the Twinkly protocol uses all sorts of heavy dependencies,
|
|
20
|
+
in particular zeromq, which means only one client per network, which is silly.
|
|
21
|
+
|
|
22
|
+
This package uses the reverse engineering work of the xled package but in
|
|
23
|
+
a new a stripped build.
|
|
24
|
+
|
|
25
|
+
This is a proof of concept with:
|
|
26
|
+
|
|
27
|
+
- UDP discovery on port 5555
|
|
28
|
+
- HTTP authentication and JSON API calls on port 80
|
|
29
|
+
- generation 2 realtime UDP frames on port 7777
|
|
30
|
+
|
|
31
|
+
Run the diagnostic script from a checkout:
|
|
32
|
+
|
|
33
|
+
```sh
|
|
34
|
+
python3 scripts/lyte_diagnostic.py
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
If UDP discovery is blocked by the network, pass the light controller IP:
|
|
38
|
+
|
|
39
|
+
```sh
|
|
40
|
+
python3 scripts/lyte_diagnostic.py --host 192.168.1.50
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Run the Hamiltonian streamer:
|
|
44
|
+
|
|
45
|
+
```sh
|
|
46
|
+
python3 scripts/lyte_hamiltonian.py --host 192.168.1.50 --speed 80
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Increase playback speed:
|
|
50
|
+
|
|
51
|
+
```sh
|
|
52
|
+
python3 scripts/lyte_hamiltonian.py --host 192.168.1.50 --speed 80
|
|
53
|
+
```
|
lyte-0.1.0/README.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# lyte
|
|
2
|
+
|
|
3
|
+
Small, dependency-free Python client for Twinkly lights born
|
|
4
|
+
from personal frustration.
|
|
5
|
+
|
|
6
|
+
I was the principle developer on the classic Bibliopixel package but
|
|
7
|
+
the copyright holder decided to call it in, and so I left the project
|
|
8
|
+
but I want to preserve my animations for the lights I have.
|
|
9
|
+
|
|
10
|
+
But the only library for the Twinkly protocol uses all sorts of heavy dependencies,
|
|
11
|
+
in particular zeromq, which means only one client per network, which is silly.
|
|
12
|
+
|
|
13
|
+
This package uses the reverse engineering work of the xled package but in
|
|
14
|
+
a new a stripped build.
|
|
15
|
+
|
|
16
|
+
This is a proof of concept with:
|
|
17
|
+
|
|
18
|
+
- UDP discovery on port 5555
|
|
19
|
+
- HTTP authentication and JSON API calls on port 80
|
|
20
|
+
- generation 2 realtime UDP frames on port 7777
|
|
21
|
+
|
|
22
|
+
Run the diagnostic script from a checkout:
|
|
23
|
+
|
|
24
|
+
```sh
|
|
25
|
+
python3 scripts/lyte_diagnostic.py
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
If UDP discovery is blocked by the network, pass the light controller IP:
|
|
29
|
+
|
|
30
|
+
```sh
|
|
31
|
+
python3 scripts/lyte_diagnostic.py --host 192.168.1.50
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Run the Hamiltonian streamer:
|
|
35
|
+
|
|
36
|
+
```sh
|
|
37
|
+
python3 scripts/lyte_hamiltonian.py --host 192.168.1.50 --speed 80
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Increase playback speed:
|
|
41
|
+
|
|
42
|
+
```sh
|
|
43
|
+
python3 scripts/lyte_hamiltonian.py --host 192.168.1.50 --speed 80
|
|
44
|
+
```
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"""Small dependency-free Lyte client."""
|
|
2
|
+
|
|
3
|
+
from .bibliopixel import (
|
|
4
|
+
Alternates,
|
|
5
|
+
ColorChase,
|
|
6
|
+
ColorFade,
|
|
7
|
+
ColorFill,
|
|
8
|
+
ColorPattern,
|
|
9
|
+
ColorWipe,
|
|
10
|
+
FireFlies,
|
|
11
|
+
HalvesRainbow,
|
|
12
|
+
LarsonScanner,
|
|
13
|
+
LinearRainbow,
|
|
14
|
+
PartyMode,
|
|
15
|
+
PixelPingPong,
|
|
16
|
+
Pulse,
|
|
17
|
+
Rainbow,
|
|
18
|
+
RainbowCycle,
|
|
19
|
+
SaberBlade,
|
|
20
|
+
Searchlights,
|
|
21
|
+
Twinkle,
|
|
22
|
+
Wave,
|
|
23
|
+
WhiteTwinkle,
|
|
24
|
+
)
|
|
25
|
+
from .client import LyteClient
|
|
26
|
+
from .discovery import DiscoveredDevice, discover
|
|
27
|
+
from .errors import (
|
|
28
|
+
AuthenticationError,
|
|
29
|
+
DiscoveryError,
|
|
30
|
+
LyteError,
|
|
31
|
+
ProtocolError,
|
|
32
|
+
)
|
|
33
|
+
from .hamiltonian import HamiltonianCounter, HamiltonianStreamer, hamiltonian_colors
|
|
34
|
+
from .random_walk import RandomWalk
|
|
35
|
+
from .retry import RetryConfig, retry_call
|
|
36
|
+
from .session import (
|
|
37
|
+
authenticate_with_retry,
|
|
38
|
+
led_count_from_gestalt,
|
|
39
|
+
read_gestalt,
|
|
40
|
+
send_frame_with_retry,
|
|
41
|
+
set_mac_from_gestalt,
|
|
42
|
+
set_off_mode_with_retry,
|
|
43
|
+
set_realtime_mode_with_retry,
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
__all__ = [
|
|
47
|
+
"AuthenticationError",
|
|
48
|
+
"Alternates",
|
|
49
|
+
"ColorChase",
|
|
50
|
+
"ColorFade",
|
|
51
|
+
"ColorFill",
|
|
52
|
+
"ColorPattern",
|
|
53
|
+
"ColorWipe",
|
|
54
|
+
"FireFlies",
|
|
55
|
+
"HalvesRainbow",
|
|
56
|
+
"DiscoveredDevice",
|
|
57
|
+
"DiscoveryError",
|
|
58
|
+
"HamiltonianCounter",
|
|
59
|
+
"HamiltonianStreamer",
|
|
60
|
+
"hamiltonian_colors",
|
|
61
|
+
"LarsonScanner",
|
|
62
|
+
"LinearRainbow",
|
|
63
|
+
"PartyMode",
|
|
64
|
+
"PixelPingPong",
|
|
65
|
+
"ProtocolError",
|
|
66
|
+
"Pulse",
|
|
67
|
+
"Rainbow",
|
|
68
|
+
"RainbowCycle",
|
|
69
|
+
"RandomWalk",
|
|
70
|
+
"SaberBlade",
|
|
71
|
+
"Searchlights",
|
|
72
|
+
"LyteClient",
|
|
73
|
+
"LyteError",
|
|
74
|
+
"RetryConfig",
|
|
75
|
+
"Twinkle",
|
|
76
|
+
"Wave",
|
|
77
|
+
"WhiteTwinkle",
|
|
78
|
+
"authenticate_with_retry",
|
|
79
|
+
"discover",
|
|
80
|
+
"retry_call",
|
|
81
|
+
"led_count_from_gestalt",
|
|
82
|
+
"read_gestalt",
|
|
83
|
+
"send_frame_with_retry",
|
|
84
|
+
"set_off_mode_with_retry",
|
|
85
|
+
"set_mac_from_gestalt",
|
|
86
|
+
"set_realtime_mode_with_retry",
|
|
87
|
+
]
|