uwscli 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.
uwscli-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Study Hsueh
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
uwscli-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,169 @@
1
+ Metadata-Version: 2.4
2
+ Name: uwscli
3
+ Version: 0.1.0
4
+ Summary: Uni-Wireless-Sync: wireless control toolkit for TL LCD fan hubs
5
+ Author: Study Hsueh
6
+ License: MIT License
7
+
8
+ Copyright (c) 2025 Study Hsueh
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+ Project-URL: Homepage, https://github.com/phstudy/tlv2-lcd
28
+ Project-URL: Issues, https://github.com/phstudy/tlv2-lcd/issues
29
+ Keywords: lian-li,uni-fan,wireless,lcd
30
+ Classifier: Development Status :: 3 - Alpha
31
+ Classifier: Environment :: Console
32
+ Classifier: Intended Audience :: System Administrators
33
+ Classifier: License :: OSI Approved :: MIT License
34
+ Classifier: Operating System :: MacOS
35
+ Classifier: Operating System :: POSIX :: Linux
36
+ Classifier: Programming Language :: Python
37
+ Classifier: Programming Language :: Python :: 3
38
+ Classifier: Programming Language :: Python :: 3.10
39
+ Classifier: Programming Language :: Python :: 3.11
40
+ Classifier: Programming Language :: Python :: 3.12
41
+ Classifier: Topic :: System :: Hardware :: Universal Serial Bus (USB)
42
+ Requires-Python: >=3.10
43
+ Description-Content-Type: text/markdown
44
+ License-File: LICENSE
45
+ Requires-Dist: hidapi>=0.14
46
+ Requires-Dist: pyusb>=1.2
47
+ Requires-Dist: pycryptodomex>=3.17
48
+ Provides-Extra: dev
49
+ Requires-Dist: pytest>=7.0; extra == "dev"
50
+ Requires-Dist: pytest-cov>=4.0; extra == "dev"
51
+ Requires-Dist: ruff>=0.5; extra == "dev"
52
+ Requires-Dist: black>=24.0; extra == "dev"
53
+ Requires-Dist: mypy>=1.8; extra == "dev"
54
+ Provides-Extra: images
55
+ Requires-Dist: Pillow>=10.0; extra == "images"
56
+ Dynamic: license-file
57
+
58
+ # UWS CLI
59
+
60
+ Warning: This is an unofficial implementation; use at your own risk.
61
+
62
+ ## Overview
63
+
64
+ UWS CLI provides command-line utilities for managing Uni Fan Wireless controllers, L-Wireless receivers, and LCD panels. Each command re-opens the required USB or RF device so no background daemon is left running, and lower-level HID/USB errors are surfaced directly to simplify scripting.
65
+
66
+ ## Supported Hardware
67
+
68
+ - UNI FAN TL wireless LCD panels
69
+ - UNI FAN TL wireless fan hubs (non-LCD)
70
+
71
+ Other Uni Fan series are currently not supported.
72
+
73
+ ## Features
74
+
75
+ - Discover TL LCD USB devices and 2.4 GHz wireless fan controllers.
76
+ - Query LCD firmware and handshake data.
77
+ - Send JPEG frames or apply control settings (mode, brightness, rotation) to the LCD.
78
+ - Keep the wireless TL LCD awake by emitting periodic handshakes.
79
+ - List wireless fan hubs with metadata (MAC, master MAC, channel, device type, fan speeds, PWM targets).
80
+ - Send one-shot PWM commands to TL wireless fans over the 2.4 GHz dongle.
81
+ - Bind or unbind wireless hubs against the active master controller.
82
+ - Toggle motherboard PWM sync mode for one hub or every bound hub.
83
+
84
+ ## Roadmap
85
+
86
+ - Broadcast static RGB payloads to wireless hubs (CLI command not yet implemented).
87
+
88
+ ## Installation
89
+
90
+ ```bash
91
+ pip install uwscli
92
+ # optional image helpers
93
+ pip install uwscli[images]
94
+
95
+ python -m venv .venv
96
+ source .venv/bin/activate
97
+ pip install -e .
98
+ # or include dev extras
99
+ pip install -e .[dev]
100
+ ```
101
+
102
+ ## Usage Examples
103
+
104
+ ```bash
105
+ # Enumerate connected devices
106
+ uws lcd list
107
+ uws fan list
108
+
109
+ # Display operations
110
+ uws lcd info --serial <usb-serial>
111
+ uws lcd send-jpg --serial <usb-serial> --file assets/sample_lcd.jpg
112
+ uws lcd keep-alive --serial <usb-serial> --interval 5
113
+
114
+ # Fan hub operations
115
+ uws fan set-fan --mac aa:bb:cc:dd:ee:ff --pwm 120
116
+ uws fan bind --mac aa:bb:cc:dd:ee:ff
117
+ uws fan unbind --mac aa:bb:cc:dd:ee:ff
118
+ uws fan pwm-sync --all --enable
119
+ uws fan pwm-sync --mac aa:bb:cc:dd:ee:ff --disable --fallback-pwm 120
120
+ ```
121
+
122
+ `uws lcd list` prints JSON rows that include a `serial` field—copy that value when invoking other LCD subcommands.
123
+
124
+ ## Command Reference
125
+
126
+ - `uws lcd list` – enumerate TL LCD devices and show their USB serial numbers.
127
+ - `uws lcd info --serial <usb-serial>` – read firmware and handshake data.
128
+ - `uws lcd send-jpg --serial <usb-serial> --file <image.jpg>` – stream a JPEG asset.
129
+ - `uws lcd keep-alive --serial <usb-serial> [--interval seconds]` – emit periodic handshakes to prevent the wireless panel from dimming.
130
+ - `uws lcd control --serial <usb-serial> [--mode show-jpg|show-app-sync|lcd-test] [--index N] [--brightness 0-100] [--fps N] [--rotation 0|90|180|270] [--test-color R,G,B]` – send an `LCDControlSetting` payload.
131
+ - `uws fan list` – fetch a snapshot of bound wireless devices via the RF receiver.
132
+ - `uws fan set-fan --mac <aa:bb:..> --pwm <0-255>` – send a single shot PWM update to the matching wireless hub using the RF sender.
133
+ - `uws fan pwm-sync --all|--mac` – enable or disable motherboard PWM sync for bound hubs.
134
+
135
+ ## Dependencies
136
+
137
+ - `hidapi` (via `hid`) for TL LCD HID access.
138
+ - `pyusb` for the RF sender/receiver WinUSB endpoints.
139
+ - `pycryptodomex` for the DES-CBC transport used by the wireless LCD hub.
140
+ - `Pillow` is optional for JPEG frame validation.
141
+
142
+ Each command expects the TL LCD USB display (vendor 0x04FC or 0x1CBE) and the wireless transmitter/receiver pair (vendor 0x0416) to be attached when the command executes.
143
+
144
+ ## Linux udev Permissions
145
+
146
+ Grant non-root access to the TL wireless dongles by adding `/etc/udev/rules.d/99-tl-wireless.rules` with:
147
+
148
+ ```
149
+ # Winbond SLV3RX_V1.6 (receiver)
150
+ SUBSYSTEM=="usb", ATTR{idVendor}=="0416", ATTR{idProduct}=="8041", MODE="0666", GROUP="plugdev"
151
+ SUBSYSTEM=="usb_device", ATTR{idVendor}=="0416", ATTR{idProduct}=="8041", MODE="0666", GROUP="plugdev"
152
+ SUBSYSTEM=="usb_interface", ATTRS{idVendor}=="0416", ATTRS{idProduct}=="8041", MODE="0666", GROUP="plugdev"
153
+
154
+ # Winbond SLV3TX_V1.6 (transmitter)
155
+ SUBSYSTEM=="usb", ATTR{idVendor}=="0416", ATTR{idProduct}=="8040", MODE="0666", GROUP="plugdev"
156
+ SUBSYSTEM=="usb_device", ATTR{idVendor}=="0416", ATTR{idProduct}=="8040", MODE="0666", GROUP="plugdev"
157
+ SUBSYSTEM=="usb_interface", ATTRS{idVendor}=="0416", ATTRS{idProduct}=="8040", MODE="0666", GROUP="plugdev"
158
+ ```
159
+
160
+ Reload the rules and replug the dongles:
161
+
162
+ ```
163
+ sudo udevadm control --reload
164
+ sudo udevadm trigger
165
+ ```
166
+
167
+ ## License
168
+
169
+ Released under the MIT License. See `LICENSE` for details.
uwscli-0.1.0/README.md ADDED
@@ -0,0 +1,112 @@
1
+ # UWS CLI
2
+
3
+ Warning: This is an unofficial implementation; use at your own risk.
4
+
5
+ ## Overview
6
+
7
+ UWS CLI provides command-line utilities for managing Uni Fan Wireless controllers, L-Wireless receivers, and LCD panels. Each command re-opens the required USB or RF device so no background daemon is left running, and lower-level HID/USB errors are surfaced directly to simplify scripting.
8
+
9
+ ## Supported Hardware
10
+
11
+ - UNI FAN TL wireless LCD panels
12
+ - UNI FAN TL wireless fan hubs (non-LCD)
13
+
14
+ Other Uni Fan series are currently not supported.
15
+
16
+ ## Features
17
+
18
+ - Discover TL LCD USB devices and 2.4 GHz wireless fan controllers.
19
+ - Query LCD firmware and handshake data.
20
+ - Send JPEG frames or apply control settings (mode, brightness, rotation) to the LCD.
21
+ - Keep the wireless TL LCD awake by emitting periodic handshakes.
22
+ - List wireless fan hubs with metadata (MAC, master MAC, channel, device type, fan speeds, PWM targets).
23
+ - Send one-shot PWM commands to TL wireless fans over the 2.4 GHz dongle.
24
+ - Bind or unbind wireless hubs against the active master controller.
25
+ - Toggle motherboard PWM sync mode for one hub or every bound hub.
26
+
27
+ ## Roadmap
28
+
29
+ - Broadcast static RGB payloads to wireless hubs (CLI command not yet implemented).
30
+
31
+ ## Installation
32
+
33
+ ```bash
34
+ pip install uwscli
35
+ # optional image helpers
36
+ pip install uwscli[images]
37
+
38
+ python -m venv .venv
39
+ source .venv/bin/activate
40
+ pip install -e .
41
+ # or include dev extras
42
+ pip install -e .[dev]
43
+ ```
44
+
45
+ ## Usage Examples
46
+
47
+ ```bash
48
+ # Enumerate connected devices
49
+ uws lcd list
50
+ uws fan list
51
+
52
+ # Display operations
53
+ uws lcd info --serial <usb-serial>
54
+ uws lcd send-jpg --serial <usb-serial> --file assets/sample_lcd.jpg
55
+ uws lcd keep-alive --serial <usb-serial> --interval 5
56
+
57
+ # Fan hub operations
58
+ uws fan set-fan --mac aa:bb:cc:dd:ee:ff --pwm 120
59
+ uws fan bind --mac aa:bb:cc:dd:ee:ff
60
+ uws fan unbind --mac aa:bb:cc:dd:ee:ff
61
+ uws fan pwm-sync --all --enable
62
+ uws fan pwm-sync --mac aa:bb:cc:dd:ee:ff --disable --fallback-pwm 120
63
+ ```
64
+
65
+ `uws lcd list` prints JSON rows that include a `serial` field—copy that value when invoking other LCD subcommands.
66
+
67
+ ## Command Reference
68
+
69
+ - `uws lcd list` – enumerate TL LCD devices and show their USB serial numbers.
70
+ - `uws lcd info --serial <usb-serial>` – read firmware and handshake data.
71
+ - `uws lcd send-jpg --serial <usb-serial> --file <image.jpg>` – stream a JPEG asset.
72
+ - `uws lcd keep-alive --serial <usb-serial> [--interval seconds]` – emit periodic handshakes to prevent the wireless panel from dimming.
73
+ - `uws lcd control --serial <usb-serial> [--mode show-jpg|show-app-sync|lcd-test] [--index N] [--brightness 0-100] [--fps N] [--rotation 0|90|180|270] [--test-color R,G,B]` – send an `LCDControlSetting` payload.
74
+ - `uws fan list` – fetch a snapshot of bound wireless devices via the RF receiver.
75
+ - `uws fan set-fan --mac <aa:bb:..> --pwm <0-255>` – send a single shot PWM update to the matching wireless hub using the RF sender.
76
+ - `uws fan pwm-sync --all|--mac` – enable or disable motherboard PWM sync for bound hubs.
77
+
78
+ ## Dependencies
79
+
80
+ - `hidapi` (via `hid`) for TL LCD HID access.
81
+ - `pyusb` for the RF sender/receiver WinUSB endpoints.
82
+ - `pycryptodomex` for the DES-CBC transport used by the wireless LCD hub.
83
+ - `Pillow` is optional for JPEG frame validation.
84
+
85
+ Each command expects the TL LCD USB display (vendor 0x04FC or 0x1CBE) and the wireless transmitter/receiver pair (vendor 0x0416) to be attached when the command executes.
86
+
87
+ ## Linux udev Permissions
88
+
89
+ Grant non-root access to the TL wireless dongles by adding `/etc/udev/rules.d/99-tl-wireless.rules` with:
90
+
91
+ ```
92
+ # Winbond SLV3RX_V1.6 (receiver)
93
+ SUBSYSTEM=="usb", ATTR{idVendor}=="0416", ATTR{idProduct}=="8041", MODE="0666", GROUP="plugdev"
94
+ SUBSYSTEM=="usb_device", ATTR{idVendor}=="0416", ATTR{idProduct}=="8041", MODE="0666", GROUP="plugdev"
95
+ SUBSYSTEM=="usb_interface", ATTRS{idVendor}=="0416", ATTRS{idProduct}=="8041", MODE="0666", GROUP="plugdev"
96
+
97
+ # Winbond SLV3TX_V1.6 (transmitter)
98
+ SUBSYSTEM=="usb", ATTR{idVendor}=="0416", ATTR{idProduct}=="8040", MODE="0666", GROUP="plugdev"
99
+ SUBSYSTEM=="usb_device", ATTR{idVendor}=="0416", ATTR{idProduct}=="8040", MODE="0666", GROUP="plugdev"
100
+ SUBSYSTEM=="usb_interface", ATTRS{idVendor}=="0416", ATTRS{idProduct}=="8040", MODE="0666", GROUP="plugdev"
101
+ ```
102
+
103
+ Reload the rules and replug the dongles:
104
+
105
+ ```
106
+ sudo udevadm control --reload
107
+ sudo udevadm trigger
108
+ ```
109
+
110
+ ## License
111
+
112
+ Released under the MIT License. See `LICENSE` for details.
@@ -0,0 +1,57 @@
1
+ [project]
2
+ name = "uwscli"
3
+ version = "0.1.0"
4
+ description = "Uni-Wireless-Sync: wireless control toolkit for TL LCD fan hubs"
5
+ readme = "README.md"
6
+ requires-python = ">=3.10"
7
+ license = {file = "LICENSE"}
8
+ authors = [{name = "Study Hsueh"}]
9
+ keywords = ["lian-li", "uni-fan", "wireless", "lcd"]
10
+ classifiers = [
11
+ "Development Status :: 3 - Alpha",
12
+ "Environment :: Console",
13
+ "Intended Audience :: System Administrators",
14
+ "License :: OSI Approved :: MIT License",
15
+ "Operating System :: MacOS",
16
+ "Operating System :: POSIX :: Linux",
17
+ "Programming Language :: Python",
18
+ "Programming Language :: Python :: 3",
19
+ "Programming Language :: Python :: 3.10",
20
+ "Programming Language :: Python :: 3.11",
21
+ "Programming Language :: Python :: 3.12",
22
+ "Topic :: System :: Hardware :: Universal Serial Bus (USB)",
23
+ ]
24
+ dependencies = [
25
+ "hidapi>=0.14",
26
+ "pyusb>=1.2",
27
+ "pycryptodomex>=3.17",
28
+ ]
29
+
30
+ [project.optional-dependencies]
31
+ dev = [
32
+ "pytest>=7.0",
33
+ "pytest-cov>=4.0",
34
+ "ruff>=0.5",
35
+ "black>=24.0",
36
+ "mypy>=1.8",
37
+ ]
38
+ images = ["Pillow>=10.0"]
39
+
40
+ [project.urls]
41
+ Homepage = "https://github.com/phstudy/tlv2-lcd"
42
+ Issues = "https://github.com/phstudy/tlv2-lcd/issues"
43
+
44
+ [project.scripts]
45
+ uws = "uwscli.cli:main"
46
+
47
+ [tool.setuptools.packages.find]
48
+ where = ["src"]
49
+ include = ["uwscli", "uwscli.*"]
50
+
51
+ [tool.pytest.ini_options]
52
+ pythonpath = ["src"]
53
+ addopts = "-ra"
54
+
55
+ [build-system]
56
+ requires = ["setuptools>=68", "wheel"]
57
+ build-backend = "setuptools.build_meta"
uwscli-0.1.0/setup.cfg ADDED
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,11 @@
1
+ """UWS CLI package."""
2
+
3
+ __version__ = "0.1.0"
4
+
5
+ __all__ = [
6
+ "cli",
7
+ "lcd",
8
+ "wireless",
9
+ "structs",
10
+ "usbutil",
11
+ ]