neewer-cli 0.1.1__py3-none-any.whl
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.
- neewer_cli-0.1.1.dist-info/METADATA +251 -0
- neewer_cli-0.1.1.dist-info/RECORD +8 -0
- neewer_cli-0.1.1.dist-info/WHEEL +5 -0
- neewer_cli-0.1.1.dist-info/entry_points.txt +2 -0
- neewer_cli-0.1.1.dist-info/licenses/LICENSE +22 -0
- neewer_cli-0.1.1.dist-info/licenses/NOTICE +8 -0
- neewer_cli-0.1.1.dist-info/top_level.txt +1 -0
- neewer_cli.py +2098 -0
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: neewer-cli
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: Standalone Neewer BLE CLI utility
|
|
5
|
+
Author: Sergei Dubovsky
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/SergeDubovsky/neewer-cli
|
|
8
|
+
Project-URL: Repository, https://github.com/SergeDubovsky/neewer-cli
|
|
9
|
+
Project-URL: Issues, https://github.com/SergeDubovsky/neewer-cli/issues
|
|
10
|
+
Keywords: neewer,ble,bluetooth,lighting,cli
|
|
11
|
+
Classifier: Operating System :: OS Independent
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
+
Classifier: Environment :: Console
|
|
20
|
+
Classifier: Topic :: Utilities
|
|
21
|
+
Requires-Python: >=3.9
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
License-File: LICENSE
|
|
24
|
+
License-File: NOTICE
|
|
25
|
+
Requires-Dist: bleak>=0.20
|
|
26
|
+
Provides-Extra: yaml
|
|
27
|
+
Requires-Dist: PyYAML>=6.0; extra == "yaml"
|
|
28
|
+
Provides-Extra: dev
|
|
29
|
+
Requires-Dist: pytest>=8.0; extra == "dev"
|
|
30
|
+
Requires-Dist: pytest-asyncio>=0.23; extra == "dev"
|
|
31
|
+
Requires-Dist: build>=1.2; extra == "dev"
|
|
32
|
+
Requires-Dist: twine>=5.0; extra == "dev"
|
|
33
|
+
Requires-Dist: ruff>=0.6; extra == "dev"
|
|
34
|
+
Dynamic: license-file
|
|
35
|
+
|
|
36
|
+
# neewer-cli
|
|
37
|
+
|
|
38
|
+
[](https://github.com/SergeDubovsky/neewer-cli/actions/workflows/ci.yml)
|
|
39
|
+
[](https://github.com/SergeDubovsky/neewer-cli/actions/workflows/release.yml)
|
|
40
|
+
[](LICENSE)
|
|
41
|
+
|
|
42
|
+
Standalone Neewer BLE command-line utility focused on fast and reliable control without a GUI.
|
|
43
|
+
|
|
44
|
+
## Why This Tool
|
|
45
|
+
|
|
46
|
+
- CLI-only workflow for scripting and automation.
|
|
47
|
+
- Reliability controls for unstable BLE environments (retries, passes, bounded parallelism).
|
|
48
|
+
- Fast fixed-rig operation with config-driven `--skip-discovery`.
|
|
49
|
+
- Presets, groups, and per-light command overrides keyed by MAC.
|
|
50
|
+
|
|
51
|
+
## Attribution
|
|
52
|
+
|
|
53
|
+
This project is based on and derives protocol/model support from:
|
|
54
|
+
|
|
55
|
+
- **NeewerLite-Python** by **Zach Glenwright**
|
|
56
|
+
- https://github.com/taburineagle/NeewerLite-Python
|
|
57
|
+
|
|
58
|
+
## Requirements
|
|
59
|
+
|
|
60
|
+
- Python `3.9+`
|
|
61
|
+
- Bluetooth adapter with BLE support
|
|
62
|
+
|
|
63
|
+
The runtime BLE dependency (`bleak`) is installed automatically by package install commands below.
|
|
64
|
+
|
|
65
|
+
## Installation
|
|
66
|
+
|
|
67
|
+
Current recommended install (GitHub source):
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
# one-time install of pipx
|
|
71
|
+
python -m pip install --user pipx
|
|
72
|
+
python -m pipx ensurepath
|
|
73
|
+
|
|
74
|
+
# install neewer-cli from GitHub
|
|
75
|
+
pipx install git+https://github.com/SergeDubovsky/neewer-cli.git
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Alternative user install:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
python -m pip install --user git+https://github.com/SergeDubovsky/neewer-cli.git
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
After install:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
neewer-cli --help
|
|
88
|
+
neewer-cli --version
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
PyPI publishing is handled by GitHub Actions using Trusted Publishing (OIDC).
|
|
92
|
+
|
|
93
|
+
## Quick Start
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
# 1) discover lights
|
|
97
|
+
neewer-cli --list
|
|
98
|
+
|
|
99
|
+
# 2) copy example config to default config path
|
|
100
|
+
# Windows (PowerShell/CMD)
|
|
101
|
+
copy neewer.example.json %USERPROFILE%\.neewer
|
|
102
|
+
|
|
103
|
+
# macOS/Linux
|
|
104
|
+
cp neewer.example.json ~/.neewer
|
|
105
|
+
|
|
106
|
+
# 3) run presets
|
|
107
|
+
neewer-cli --preset all_on
|
|
108
|
+
neewer-cli --preset all_off
|
|
109
|
+
neewer-cli --preset key_cct_5600_30
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## Common Commands
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
# turn configured lights on/off quickly
|
|
116
|
+
neewer-cli --preset all_on
|
|
117
|
+
neewer-cli --preset all_off
|
|
118
|
+
|
|
119
|
+
# send direct command to specific MACs
|
|
120
|
+
neewer-cli --light D2:E2:75:8B:36:45,F8:46:85:EF:47:70 --mode CCT --temp 5600 --bri 30
|
|
121
|
+
|
|
122
|
+
# fast fixed-rig mode (no scan)
|
|
123
|
+
neewer-cli --light group:studio --preset all_on --skip-discovery
|
|
124
|
+
|
|
125
|
+
# persistent low-latency mode (keep connections open)
|
|
126
|
+
neewer-cli --serve --light group:studio --skip-discovery --debug
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
## Configuration
|
|
130
|
+
|
|
131
|
+
Default config path:
|
|
132
|
+
|
|
133
|
+
- `~/.neewer` (Windows: `%USERPROFILE%\.neewer`)
|
|
134
|
+
|
|
135
|
+
Top-level config keys:
|
|
136
|
+
|
|
137
|
+
- `defaults`: default CLI flags
|
|
138
|
+
- `lights`: per-MAC metadata (`name`, `cct_only`, `infinity_mode`, `hw_mac`, optional feature flags)
|
|
139
|
+
- `groups`: named MAC sets
|
|
140
|
+
- `presets`: reusable command sets
|
|
141
|
+
- `presets.<name>.per_light`: per-light command overrides in one run
|
|
142
|
+
|
|
143
|
+
Optional per-light feature flags in `lights`:
|
|
144
|
+
|
|
145
|
+
- `supports_status_query`: override model detection for `--status` query commands
|
|
146
|
+
- `supports_extended_scene`: override model detection for extended scene payloads
|
|
147
|
+
|
|
148
|
+
Reference material:
|
|
149
|
+
|
|
150
|
+
- Example config: [neewer.example.json](neewer.example.json)
|
|
151
|
+
- Wiki configuration guide: https://github.com/SergeDubovsky/neewer-cli/wiki/Configuration
|
|
152
|
+
|
|
153
|
+
## Reliability Tuning
|
|
154
|
+
|
|
155
|
+
For flaky BLE environments, tune:
|
|
156
|
+
|
|
157
|
+
- `--scan-attempts`
|
|
158
|
+
- `--resolve-timeout` (short BLE handle resolve scan for `--skip-discovery`)
|
|
159
|
+
- `--connect-retries`
|
|
160
|
+
- `--write-retries`
|
|
161
|
+
- `--passes` (adaptive retries for failed lights only)
|
|
162
|
+
- `--parallel`
|
|
163
|
+
|
|
164
|
+
For stable fixed setups, keep `lights` fully defined in config and use `--skip-discovery` to reduce latency.
|
|
165
|
+
|
|
166
|
+
## Advanced Protocol (Experimental)
|
|
167
|
+
|
|
168
|
+
Advanced commands are opt-in behind feature flags and still gated by per-model support.
|
|
169
|
+
|
|
170
|
+
Status query (power/channel):
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
neewer-cli --light group:studio --status --enable-status-query --skip-discovery
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
Extended scene arguments (supported models only):
|
|
177
|
+
|
|
178
|
+
```bash
|
|
179
|
+
neewer-cli --light group:studio --mode SCENE --scene 12 --bri 40 \
|
|
180
|
+
--scene-hue-min 20 --scene-hue-max 240 --scene-speed 7 \
|
|
181
|
+
--enable-extended-scene
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
If auto-detection is wrong for a specific light, set `supports_status_query` or
|
|
185
|
+
`supports_extended_scene` for that MAC in config.
|
|
186
|
+
|
|
187
|
+
### Serve Mode
|
|
188
|
+
|
|
189
|
+
`--serve` keeps BLE connections open and accepts commands from stdin:
|
|
190
|
+
|
|
191
|
+
```bash
|
|
192
|
+
neewer-cli --serve --light group:studio --skip-discovery --debug
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
Interactive commands:
|
|
196
|
+
|
|
197
|
+
- `on`
|
|
198
|
+
- `off`
|
|
199
|
+
- `cct <temp> <bri> [gm]`
|
|
200
|
+
- `hsi <hue> <sat> <bri>`
|
|
201
|
+
- `scene <effect> <bri>`
|
|
202
|
+
- `preset <name>`
|
|
203
|
+
- `help`
|
|
204
|
+
- `exit`
|
|
205
|
+
|
|
206
|
+
## Security
|
|
207
|
+
|
|
208
|
+
- Private vulnerability reporting is enabled.
|
|
209
|
+
- Code scanning (CodeQL) is enabled for `python` and `actions`.
|
|
210
|
+
- Secret scanning and push protection are enabled.
|
|
211
|
+
|
|
212
|
+
Please report security issues privately per [SECURITY.md](SECURITY.md).
|
|
213
|
+
|
|
214
|
+
## Releases
|
|
215
|
+
|
|
216
|
+
GitHub releases include wheel and source distribution artifacts:
|
|
217
|
+
|
|
218
|
+
- https://github.com/SergeDubovsky/neewer-cli/releases
|
|
219
|
+
|
|
220
|
+
Maintainer release flow:
|
|
221
|
+
|
|
222
|
+
1. Update `version` in `pyproject.toml`.
|
|
223
|
+
2. Run local checks (`ruff`, `pytest`, `build`, `twine check`).
|
|
224
|
+
3. Commit and push to `main`.
|
|
225
|
+
4. Tag and push (`git tag vX.Y.Z && git push origin vX.Y.Z`).
|
|
226
|
+
5. Release workflow:
|
|
227
|
+
- builds + tests
|
|
228
|
+
- publishes to TestPyPI (`testpypi` environment)
|
|
229
|
+
- publishes to PyPI (`pypi` environment)
|
|
230
|
+
- creates a GitHub Release with built artifacts
|
|
231
|
+
|
|
232
|
+
Trusted Publishing setup requirement:
|
|
233
|
+
|
|
234
|
+
- In both TestPyPI and PyPI project settings, add this repository/workflow as a Trusted Publisher for:
|
|
235
|
+
- owner/repo: `SergeDubovsky/neewer-cli`
|
|
236
|
+
- workflow: `.github/workflows/release.yml`
|
|
237
|
+
- environments: `testpypi` and `pypi`
|
|
238
|
+
|
|
239
|
+
## Project Docs
|
|
240
|
+
|
|
241
|
+
- Wiki home: https://github.com/SergeDubovsky/neewer-cli/wiki
|
|
242
|
+
- Developer guide: https://github.com/SergeDubovsky/neewer-cli/wiki/Developer-Guide
|
|
243
|
+
- Contributing: [CONTRIBUTING.md](CONTRIBUTING.md)
|
|
244
|
+
- Release process: [RELEASING.md](RELEASING.md)
|
|
245
|
+
- Security policy: [SECURITY.md](SECURITY.md)
|
|
246
|
+
- Support policy: [SUPPORT.md](SUPPORT.md)
|
|
247
|
+
- Code of conduct: [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md)
|
|
248
|
+
|
|
249
|
+
## License
|
|
250
|
+
|
|
251
|
+
MIT. See [LICENSE](LICENSE).
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
neewer_cli.py,sha256=d9IR1tz5uKcFLvxWxoqP1F4AYaoqU2Nu41NWPQ4H3Vo,72622
|
|
2
|
+
neewer_cli-0.1.1.dist-info/licenses/LICENSE,sha256=-Sntk_TxE7-TE0nHwnk0-h9fAIsh0EwObXkrO0mz22E,1112
|
|
3
|
+
neewer_cli-0.1.1.dist-info/licenses/NOTICE,sha256=ZE88yURko4383rkSaG_eENLjUqlMEPm5jboviT_UT5M,229
|
|
4
|
+
neewer_cli-0.1.1.dist-info/METADATA,sha256=z-Kr_ipy22yzjW4OXJgtP123OJDFK818AiB50hsAOtc,7437
|
|
5
|
+
neewer_cli-0.1.1.dist-info/WHEEL,sha256=YCfwYGOYMi5Jhw2fU4yNgwErybb2IX5PEwBKV4ZbdBo,91
|
|
6
|
+
neewer_cli-0.1.1.dist-info/entry_points.txt,sha256=UIjtuQ_yYE2Bbv_sHznWEkUFAkUCyUh8LgKn9xO_-kQ,47
|
|
7
|
+
neewer_cli-0.1.1.dist-info/top_level.txt,sha256=sBWnEsqDvncWtcIvfNUV8td_Dm5eA57oyClVE05jpkM,11
|
|
8
|
+
neewer_cli-0.1.1.dist-info/RECORD,,
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2021-2022 Zach Glenwright
|
|
4
|
+
Copyright (c) 2026 Sergei Dubovsky
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
neewer_cli
|