OpenShock-AutoFlasher 0.2.1__tar.gz → 0.2.4__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.
Files changed (26) hide show
  1. {openshock_autoflasher-0.2.1 → openshock_autoflasher-0.2.4/OpenShock_AutoFlasher.egg-info}/PKG-INFO +21 -15
  2. {openshock_autoflasher-0.2.1/OpenShock_AutoFlasher.egg-info → openshock_autoflasher-0.2.4}/PKG-INFO +21 -15
  3. {openshock_autoflasher-0.2.1 → openshock_autoflasher-0.2.4}/README.md +16 -9
  4. {openshock_autoflasher-0.2.1 → openshock_autoflasher-0.2.4}/openshock_autoflasher/cli.py +8 -1
  5. {openshock_autoflasher-0.2.1 → openshock_autoflasher-0.2.4}/openshock_autoflasher/constants.py +16 -0
  6. {openshock_autoflasher-0.2.1 → openshock_autoflasher-0.2.4}/openshock_autoflasher/flasher.py +23 -7
  7. {openshock_autoflasher-0.2.1 → openshock_autoflasher-0.2.4}/pyproject.toml +9 -6
  8. {openshock_autoflasher-0.2.1 → openshock_autoflasher-0.2.4}/tests/test_cli.py +12 -0
  9. {openshock_autoflasher-0.2.1 → openshock_autoflasher-0.2.4}/tests/test_constants.py +2 -0
  10. {openshock_autoflasher-0.2.1 → openshock_autoflasher-0.2.4}/tests/test_flasher.py +55 -0
  11. {openshock_autoflasher-0.2.1 → openshock_autoflasher-0.2.4}/LICENSE +0 -0
  12. {openshock_autoflasher-0.2.1 → openshock_autoflasher-0.2.4}/MANIFEST.in +0 -0
  13. {openshock_autoflasher-0.2.1 → openshock_autoflasher-0.2.4}/OpenShock_AutoFlasher.egg-info/SOURCES.txt +0 -0
  14. {openshock_autoflasher-0.2.1 → openshock_autoflasher-0.2.4}/OpenShock_AutoFlasher.egg-info/dependency_links.txt +0 -0
  15. {openshock_autoflasher-0.2.1 → openshock_autoflasher-0.2.4}/OpenShock_AutoFlasher.egg-info/entry_points.txt +0 -0
  16. {openshock_autoflasher-0.2.1 → openshock_autoflasher-0.2.4}/OpenShock_AutoFlasher.egg-info/requires.txt +0 -0
  17. {openshock_autoflasher-0.2.1 → openshock_autoflasher-0.2.4}/OpenShock_AutoFlasher.egg-info/top_level.txt +0 -0
  18. {openshock_autoflasher-0.2.1 → openshock_autoflasher-0.2.4}/openshock_autoflasher/__init__.py +0 -0
  19. {openshock_autoflasher-0.2.1 → openshock_autoflasher-0.2.4}/openshock_autoflasher/__main__.py +0 -0
  20. {openshock_autoflasher-0.2.1 → openshock_autoflasher-0.2.4}/openshock_autoflasher/py.typed +0 -0
  21. {openshock_autoflasher-0.2.1 → openshock_autoflasher-0.2.4}/openshock_autoflasher/styles.py +0 -0
  22. {openshock_autoflasher-0.2.1 → openshock_autoflasher-0.2.4}/requirements-dev.txt +0 -0
  23. {openshock_autoflasher-0.2.1 → openshock_autoflasher-0.2.4}/requirements.txt +0 -0
  24. {openshock_autoflasher-0.2.1 → openshock_autoflasher-0.2.4}/setup.cfg +0 -0
  25. {openshock_autoflasher-0.2.1 → openshock_autoflasher-0.2.4}/tests/__init__.py +0 -0
  26. {openshock_autoflasher-0.2.1 → openshock_autoflasher-0.2.4}/tests/test_styles.py +0 -0
@@ -1,18 +1,17 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: OpenShock-AutoFlasher
3
- Version: 0.2.1
3
+ Version: 0.2.4
4
4
  Summary: Automatically flash OpenShock firmware to ESP32 devices
5
5
  Author: NanashiTheNameless
6
6
  Author-email: NanashiTheNameless <NanashiTheNameless@NamelessNanashi.dev>
7
7
  Maintainer: NanashiTheNameless
8
8
  Maintainer-email: NanashiTheNameless <NanashiTheNameless@NamelessNanashi.dev>
9
9
  License: AGPL-3.0
10
- Project-URL: Repository, https://github.com/NanashiTheNameless/OpenShock-AutoFlasher
11
- Project-URL: Homepage, https://github.com/NanashiTheNameless/OpenShock-AutoFlasher
12
- Project-URL: Issues, https://github.com/NanashiTheNameless/OpenShock-AutoFlasher/issues
13
- Project-URL: GitHub Sponsor, https://github.com/sponsors/NanashiTheNameless
10
+ Project-URL: Repository, https://gitlab.com/NamelessNanashi/OpenShock-AutoFlasher
11
+ Project-URL: Homepage, https://gitlab.com/NamelessNanashi/OpenShock-AutoFlasher
12
+ Project-URL: Issues, https://gitlab.com/NamelessNanashi/OpenShock-AutoFlasher/-/issues
14
13
  Project-URL: Buy Me a Coffee, https://buymeacoffee.com/NamelessNanashi
15
- Project-URL: Author, https://github.com/NanashiTheNameless
14
+ Project-URL: Author, https://gitlab.com/NamelessNanashi
16
15
  Keywords: openshock,esp32,firmware,flasher
17
16
  Classifier: Development Status :: 4 - Beta
18
17
  Classifier: Environment :: Console
@@ -57,8 +56,8 @@ Dynamic: license-file
57
56
  [![PyPI - Implementation](https://img.shields.io/pypi/implementation/OpenShock-AutoFlasher)](https://pypi.org/project/OpenShock-AutoFlasher/)
58
57
  [![PyPI - Types](https://img.shields.io/pypi/types/OpenShock-AutoFlasher)](https://pypi.org/project/OpenShock-AutoFlasher/)
59
58
 
60
- [![Tests](https://github.com/NanashiTheNameless/OpenShock-AutoFlasher/workflows/Tests/badge.svg)](https://github.com/NanashiTheNameless/OpenShock-AutoFlasher/actions/workflows/test.yml)
61
- [![GitHub License](https://img.shields.io/github/license/NanashiTheNameless/OpenShock-AutoFlasher)](https://github.com/NanashiTheNameless/OpenShock-AutoFlasher/blob/main/LICENSE)
59
+ [![Tests](https://gitlab.com/NamelessNanashi/OpenShock-AutoFlasher/-/badges/main/pipeline.svg)](https://gitlab.com/NamelessNanashi/OpenShock-AutoFlasher/-/pipelines)
60
+ [![GitLab License](https://gitlab.com/NamelessNanashi/OpenShock-AutoFlasher/-/raw/main/LICENSE)](https://gitlab.com/NamelessNanashi/OpenShock-AutoFlasher/-/blob/main/LICENSE)
62
61
 
63
62
  Automatically flash OpenShock firmware to ESP32 devices when they are plugged in. Features color-coded terminal backgrounds to indicate the current status at a glance.
64
63
 
@@ -86,12 +85,12 @@ Automatically flash OpenShock firmware to ESP32 devices when they are plugged in
86
85
 
87
86
  ## Installation
88
87
 
89
- ### From GitHub with pipx (Recommended)
88
+ ### From GitLab with pipx (Recommended)
90
89
 
91
- Install directly from the latest GitHub version:
90
+ Install directly from the latest GitLab version:
92
91
 
93
92
  ```bash
94
- pipx install --force 'git+https://github.com/NanashiTheNameless/OpenShock-AutoFlasher@main'
93
+ pipx install --force 'git+https://gitlab.com/NamelessNanashi/OpenShock-AutoFlasher.git@main'
95
94
  ```
96
95
 
97
96
  This makes the `OPSH-AutoFlash` command available system-wide.
@@ -101,7 +100,7 @@ This makes the `OPSH-AutoFlash` command available system-wide.
101
100
  If you prefer a release from PyPI:
102
101
 
103
102
  ```bash
104
- pipx install OpenShock-AutoFlasher
103
+ pipx install --force 'git+https://gitlab.com/NamelessNanashi/OpenShock-AutoFlasher.git@main'
105
104
  ```
106
105
 
107
106
  ### From Source
@@ -109,7 +108,7 @@ pipx install OpenShock-AutoFlasher
109
108
  1. Clone this repository:
110
109
 
111
110
  ```bash
112
- git clone https://github.com/NanashiTheNameless/OpenShock-AutoFlasher.git
111
+ git clone https://gitlab.com/NamelessNanashi/OpenShock-AutoFlasher.git
113
112
  cd OpenShock-AutoFlasher
114
113
  ```
115
114
 
@@ -144,6 +143,7 @@ OPSH-AutoFlash -C develop --help # Shows boards for develop channel
144
143
  | `--channel` | `-C` | Firmware channel: `stable`, `beta`, or `develop` | `stable` |
145
144
  | `--version` | `-V` | Use specific firmware version (overrides channel) | - |
146
145
  | `--board` | `-B` | Board type (required) | - |
146
+ | `--chip` | - | Target chip for esptool | `auto` |
147
147
  | `--erase` | `-E` | Erase flash before flashing | `false` |
148
148
  | `--no-auto` | `-N` | Disable auto-flash (just detect devices) | `false` |
149
149
  | `--post-flash` | `-P` | Serial command to send after flashing (can use multiple times) | - |
@@ -170,6 +170,12 @@ OPSH-AutoFlash --version 1.5.0 --board Wemos-D1-Mini-ESP32
170
170
  OPSH-AutoFlash --channel beta --board Wemos-D1-Mini-ESP32 --erase
171
171
  ```
172
172
 
173
+ **Flash with an explicit esptool chip:**
174
+
175
+ ```bash
176
+ OPSH-AutoFlash --board Seeed-Xiao-ESP32C3 --chip esp32c3 --erase
177
+ ```
178
+
173
179
  **Flash and send post-flash commands to device:**
174
180
 
175
181
  ```bash
@@ -329,14 +335,14 @@ The codebase is modular and organized as follows:
329
335
 
330
336
  ### Continuous Integration
331
337
 
332
- The project uses GitHub Actions for CI/CD:
338
+ The project uses GitLab CI/CD for CI/CD:
333
339
 
334
340
  - **Tests Workflow** - Runs tests on Ubuntu, Windows, and macOS with Python 3.12-3.14
335
341
  - **Publish Workflow** - Publishes to PyPI on release
336
342
 
337
343
  ## License
338
344
 
339
- This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). See [LICENSE](<https://github.com/NanashiTheNameless/OpenShock-AutoFlasher/blob/main/LICENSE>)) file for details.
345
+ This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). See [LICENSE](<https://gitlab.com/NamelessNanashi/OpenShock-AutoFlasher/-/blob/main/LICENSE>)) file for details.
340
346
 
341
347
  ## Contributing
342
348
 
@@ -1,18 +1,17 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: OpenShock-AutoFlasher
3
- Version: 0.2.1
3
+ Version: 0.2.4
4
4
  Summary: Automatically flash OpenShock firmware to ESP32 devices
5
5
  Author: NanashiTheNameless
6
6
  Author-email: NanashiTheNameless <NanashiTheNameless@NamelessNanashi.dev>
7
7
  Maintainer: NanashiTheNameless
8
8
  Maintainer-email: NanashiTheNameless <NanashiTheNameless@NamelessNanashi.dev>
9
9
  License: AGPL-3.0
10
- Project-URL: Repository, https://github.com/NanashiTheNameless/OpenShock-AutoFlasher
11
- Project-URL: Homepage, https://github.com/NanashiTheNameless/OpenShock-AutoFlasher
12
- Project-URL: Issues, https://github.com/NanashiTheNameless/OpenShock-AutoFlasher/issues
13
- Project-URL: GitHub Sponsor, https://github.com/sponsors/NanashiTheNameless
10
+ Project-URL: Repository, https://gitlab.com/NamelessNanashi/OpenShock-AutoFlasher
11
+ Project-URL: Homepage, https://gitlab.com/NamelessNanashi/OpenShock-AutoFlasher
12
+ Project-URL: Issues, https://gitlab.com/NamelessNanashi/OpenShock-AutoFlasher/-/issues
14
13
  Project-URL: Buy Me a Coffee, https://buymeacoffee.com/NamelessNanashi
15
- Project-URL: Author, https://github.com/NanashiTheNameless
14
+ Project-URL: Author, https://gitlab.com/NamelessNanashi
16
15
  Keywords: openshock,esp32,firmware,flasher
17
16
  Classifier: Development Status :: 4 - Beta
18
17
  Classifier: Environment :: Console
@@ -57,8 +56,8 @@ Dynamic: license-file
57
56
  [![PyPI - Implementation](https://img.shields.io/pypi/implementation/OpenShock-AutoFlasher)](https://pypi.org/project/OpenShock-AutoFlasher/)
58
57
  [![PyPI - Types](https://img.shields.io/pypi/types/OpenShock-AutoFlasher)](https://pypi.org/project/OpenShock-AutoFlasher/)
59
58
 
60
- [![Tests](https://github.com/NanashiTheNameless/OpenShock-AutoFlasher/workflows/Tests/badge.svg)](https://github.com/NanashiTheNameless/OpenShock-AutoFlasher/actions/workflows/test.yml)
61
- [![GitHub License](https://img.shields.io/github/license/NanashiTheNameless/OpenShock-AutoFlasher)](https://github.com/NanashiTheNameless/OpenShock-AutoFlasher/blob/main/LICENSE)
59
+ [![Tests](https://gitlab.com/NamelessNanashi/OpenShock-AutoFlasher/-/badges/main/pipeline.svg)](https://gitlab.com/NamelessNanashi/OpenShock-AutoFlasher/-/pipelines)
60
+ [![GitLab License](https://gitlab.com/NamelessNanashi/OpenShock-AutoFlasher/-/raw/main/LICENSE)](https://gitlab.com/NamelessNanashi/OpenShock-AutoFlasher/-/blob/main/LICENSE)
62
61
 
63
62
  Automatically flash OpenShock firmware to ESP32 devices when they are plugged in. Features color-coded terminal backgrounds to indicate the current status at a glance.
64
63
 
@@ -86,12 +85,12 @@ Automatically flash OpenShock firmware to ESP32 devices when they are plugged in
86
85
 
87
86
  ## Installation
88
87
 
89
- ### From GitHub with pipx (Recommended)
88
+ ### From GitLab with pipx (Recommended)
90
89
 
91
- Install directly from the latest GitHub version:
90
+ Install directly from the latest GitLab version:
92
91
 
93
92
  ```bash
94
- pipx install --force 'git+https://github.com/NanashiTheNameless/OpenShock-AutoFlasher@main'
93
+ pipx install --force 'git+https://gitlab.com/NamelessNanashi/OpenShock-AutoFlasher.git@main'
95
94
  ```
96
95
 
97
96
  This makes the `OPSH-AutoFlash` command available system-wide.
@@ -101,7 +100,7 @@ This makes the `OPSH-AutoFlash` command available system-wide.
101
100
  If you prefer a release from PyPI:
102
101
 
103
102
  ```bash
104
- pipx install OpenShock-AutoFlasher
103
+ pipx install --force 'git+https://gitlab.com/NamelessNanashi/OpenShock-AutoFlasher.git@main'
105
104
  ```
106
105
 
107
106
  ### From Source
@@ -109,7 +108,7 @@ pipx install OpenShock-AutoFlasher
109
108
  1. Clone this repository:
110
109
 
111
110
  ```bash
112
- git clone https://github.com/NanashiTheNameless/OpenShock-AutoFlasher.git
111
+ git clone https://gitlab.com/NamelessNanashi/OpenShock-AutoFlasher.git
113
112
  cd OpenShock-AutoFlasher
114
113
  ```
115
114
 
@@ -144,6 +143,7 @@ OPSH-AutoFlash -C develop --help # Shows boards for develop channel
144
143
  | `--channel` | `-C` | Firmware channel: `stable`, `beta`, or `develop` | `stable` |
145
144
  | `--version` | `-V` | Use specific firmware version (overrides channel) | - |
146
145
  | `--board` | `-B` | Board type (required) | - |
146
+ | `--chip` | - | Target chip for esptool | `auto` |
147
147
  | `--erase` | `-E` | Erase flash before flashing | `false` |
148
148
  | `--no-auto` | `-N` | Disable auto-flash (just detect devices) | `false` |
149
149
  | `--post-flash` | `-P` | Serial command to send after flashing (can use multiple times) | - |
@@ -170,6 +170,12 @@ OPSH-AutoFlash --version 1.5.0 --board Wemos-D1-Mini-ESP32
170
170
  OPSH-AutoFlash --channel beta --board Wemos-D1-Mini-ESP32 --erase
171
171
  ```
172
172
 
173
+ **Flash with an explicit esptool chip:**
174
+
175
+ ```bash
176
+ OPSH-AutoFlash --board Seeed-Xiao-ESP32C3 --chip esp32c3 --erase
177
+ ```
178
+
173
179
  **Flash and send post-flash commands to device:**
174
180
 
175
181
  ```bash
@@ -329,14 +335,14 @@ The codebase is modular and organized as follows:
329
335
 
330
336
  ### Continuous Integration
331
337
 
332
- The project uses GitHub Actions for CI/CD:
338
+ The project uses GitLab CI/CD for CI/CD:
333
339
 
334
340
  - **Tests Workflow** - Runs tests on Ubuntu, Windows, and macOS with Python 3.12-3.14
335
341
  - **Publish Workflow** - Publishes to PyPI on release
336
342
 
337
343
  ## License
338
344
 
339
- This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). See [LICENSE](<https://github.com/NanashiTheNameless/OpenShock-AutoFlasher/blob/main/LICENSE>)) file for details.
345
+ This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). See [LICENSE](<https://gitlab.com/NamelessNanashi/OpenShock-AutoFlasher/-/blob/main/LICENSE>)) file for details.
340
346
 
341
347
  ## Contributing
342
348
 
@@ -5,8 +5,8 @@
5
5
  [![PyPI - Implementation](https://img.shields.io/pypi/implementation/OpenShock-AutoFlasher)](https://pypi.org/project/OpenShock-AutoFlasher/)
6
6
  [![PyPI - Types](https://img.shields.io/pypi/types/OpenShock-AutoFlasher)](https://pypi.org/project/OpenShock-AutoFlasher/)
7
7
 
8
- [![Tests](https://github.com/NanashiTheNameless/OpenShock-AutoFlasher/workflows/Tests/badge.svg)](https://github.com/NanashiTheNameless/OpenShock-AutoFlasher/actions/workflows/test.yml)
9
- [![GitHub License](https://img.shields.io/github/license/NanashiTheNameless/OpenShock-AutoFlasher)](https://github.com/NanashiTheNameless/OpenShock-AutoFlasher/blob/main/LICENSE)
8
+ [![Tests](https://gitlab.com/NamelessNanashi/OpenShock-AutoFlasher/-/badges/main/pipeline.svg)](https://gitlab.com/NamelessNanashi/OpenShock-AutoFlasher/-/pipelines)
9
+ [![GitLab License](https://gitlab.com/NamelessNanashi/OpenShock-AutoFlasher/-/raw/main/LICENSE)](https://gitlab.com/NamelessNanashi/OpenShock-AutoFlasher/-/blob/main/LICENSE)
10
10
 
11
11
  Automatically flash OpenShock firmware to ESP32 devices when they are plugged in. Features color-coded terminal backgrounds to indicate the current status at a glance.
12
12
 
@@ -34,12 +34,12 @@ Automatically flash OpenShock firmware to ESP32 devices when they are plugged in
34
34
 
35
35
  ## Installation
36
36
 
37
- ### From GitHub with pipx (Recommended)
37
+ ### From GitLab with pipx (Recommended)
38
38
 
39
- Install directly from the latest GitHub version:
39
+ Install directly from the latest GitLab version:
40
40
 
41
41
  ```bash
42
- pipx install --force 'git+https://github.com/NanashiTheNameless/OpenShock-AutoFlasher@main'
42
+ pipx install --force 'git+https://gitlab.com/NamelessNanashi/OpenShock-AutoFlasher.git@main'
43
43
  ```
44
44
 
45
45
  This makes the `OPSH-AutoFlash` command available system-wide.
@@ -49,7 +49,7 @@ This makes the `OPSH-AutoFlash` command available system-wide.
49
49
  If you prefer a release from PyPI:
50
50
 
51
51
  ```bash
52
- pipx install OpenShock-AutoFlasher
52
+ pipx install --force 'git+https://gitlab.com/NamelessNanashi/OpenShock-AutoFlasher.git@main'
53
53
  ```
54
54
 
55
55
  ### From Source
@@ -57,7 +57,7 @@ pipx install OpenShock-AutoFlasher
57
57
  1. Clone this repository:
58
58
 
59
59
  ```bash
60
- git clone https://github.com/NanashiTheNameless/OpenShock-AutoFlasher.git
60
+ git clone https://gitlab.com/NamelessNanashi/OpenShock-AutoFlasher.git
61
61
  cd OpenShock-AutoFlasher
62
62
  ```
63
63
 
@@ -92,6 +92,7 @@ OPSH-AutoFlash -C develop --help # Shows boards for develop channel
92
92
  | `--channel` | `-C` | Firmware channel: `stable`, `beta`, or `develop` | `stable` |
93
93
  | `--version` | `-V` | Use specific firmware version (overrides channel) | - |
94
94
  | `--board` | `-B` | Board type (required) | - |
95
+ | `--chip` | - | Target chip for esptool | `auto` |
95
96
  | `--erase` | `-E` | Erase flash before flashing | `false` |
96
97
  | `--no-auto` | `-N` | Disable auto-flash (just detect devices) | `false` |
97
98
  | `--post-flash` | `-P` | Serial command to send after flashing (can use multiple times) | - |
@@ -118,6 +119,12 @@ OPSH-AutoFlash --version 1.5.0 --board Wemos-D1-Mini-ESP32
118
119
  OPSH-AutoFlash --channel beta --board Wemos-D1-Mini-ESP32 --erase
119
120
  ```
120
121
 
122
+ **Flash with an explicit esptool chip:**
123
+
124
+ ```bash
125
+ OPSH-AutoFlash --board Seeed-Xiao-ESP32C3 --chip esp32c3 --erase
126
+ ```
127
+
121
128
  **Flash and send post-flash commands to device:**
122
129
 
123
130
  ```bash
@@ -277,14 +284,14 @@ The codebase is modular and organized as follows:
277
284
 
278
285
  ### Continuous Integration
279
286
 
280
- The project uses GitHub Actions for CI/CD:
287
+ The project uses GitLab CI/CD for CI/CD:
281
288
 
282
289
  - **Tests Workflow** - Runs tests on Ubuntu, Windows, and macOS with Python 3.12-3.14
283
290
  - **Publish Workflow** - Publishes to PyPI on release
284
291
 
285
292
  ## License
286
293
 
287
- This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). See [LICENSE](<https://github.com/NanashiTheNameless/OpenShock-AutoFlasher/blob/main/LICENSE>)) file for details.
294
+ This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). See [LICENSE](<https://gitlab.com/NamelessNanashi/OpenShock-AutoFlasher/-/blob/main/LICENSE>)) file for details.
288
295
 
289
296
  ## Contributing
290
297
 
@@ -10,7 +10,7 @@ from typing import List
10
10
  import requests
11
11
  from rich.style import Style
12
12
 
13
- from .constants import BASE_URL
13
+ from .constants import BASE_URL, SUPPORTED_CHIPS
14
14
  from .styles import console
15
15
  from .flasher import AutoFlasher
16
16
 
@@ -64,6 +64,12 @@ def create_argument_parser(channel: str = "stable") -> argparse.ArgumentParser:
64
64
  help="Use specific firmware version (overrides channel selection)",
65
65
  )
66
66
  parser.add_argument("--board", "-B", required=True, help="Board type (required)")
67
+ parser.add_argument(
68
+ "--chip",
69
+ choices=("auto", *SUPPORTED_CHIPS),
70
+ default="auto",
71
+ help="Target chip for esptool (default: auto)",
72
+ )
67
73
  parser.add_argument(
68
74
  "--erase",
69
75
  "-E",
@@ -146,6 +152,7 @@ def main() -> None:
146
152
  post_flash_delay=args.post_flash_delay,
147
153
  alert=args.alert,
148
154
  version=args.version,
155
+ chip=args.chip,
149
156
  )
150
157
 
151
158
  flasher.run()
@@ -11,6 +11,22 @@ BAUD_RATE: str = "460800"
11
11
  FLASH_MODE: str = "dio"
12
12
  FLASH_FREQ: str = "80m"
13
13
  FLASH_ADDRESS: str = "0x0000"
14
+ SUPPORTED_CHIPS: tuple[str, ...] = (
15
+ "esp32",
16
+ "esp32s2",
17
+ "esp32s3",
18
+ "esp32c3",
19
+ "esp32c2",
20
+ "esp32c6",
21
+ "esp32c61",
22
+ "esp32c5",
23
+ "esp32e22",
24
+ "esp32h2",
25
+ "esp32h21",
26
+ "esp32p4",
27
+ "esp32h4",
28
+ "esp32s31",
29
+ )
14
30
 
15
31
  # Polling settings
16
32
  INITIAL_POLL_INTERVAL: float = 0.5 # seconds
@@ -24,6 +24,7 @@ from .constants import (
24
24
  FLASH_MODE,
25
25
  FLASH_FREQ,
26
26
  FLASH_ADDRESS,
27
+ SUPPORTED_CHIPS,
27
28
  INITIAL_POLL_INTERVAL,
28
29
  MAX_POLL_INTERVAL,
29
30
  POLL_BACKOFF_THRESHOLD,
@@ -32,6 +33,18 @@ from .constants import (
32
33
  from .styles import StateColors, console
33
34
 
34
35
 
36
+ def normalize_chip(chip: Optional[str]) -> str:
37
+ """Normalize and validate an optional esptool chip value."""
38
+ if chip is None:
39
+ return "auto"
40
+
41
+ normalized_chip = chip.lower()
42
+ if normalized_chip != "auto" and normalized_chip not in SUPPORTED_CHIPS:
43
+ supported = ", ".join(("auto", *SUPPORTED_CHIPS))
44
+ raise ValueError(f"Unsupported chip '{chip}'. Supported chips: {supported}")
45
+ return normalized_chip
46
+
47
+
35
48
  class AutoFlasher:
36
49
  """Main auto-flashing controller for OpenShock devices"""
37
50
 
@@ -45,6 +58,7 @@ class AutoFlasher:
45
58
  post_flash_delay: float = 0.0,
46
59
  alert: bool = False,
47
60
  version: Optional[str] = None,
61
+ chip: Optional[str] = None,
48
62
  ) -> None:
49
63
  self.channel: str = channel
50
64
  self.board: Optional[str] = board
@@ -54,6 +68,7 @@ class AutoFlasher:
54
68
  self.post_flash_delay: float = post_flash_delay
55
69
  self.alert: bool = alert
56
70
  self.version: Optional[str] = version
71
+ self.chip: str = normalize_chip(chip)
57
72
  self.base_url: str = BASE_URL
58
73
  self.known_ports: Set[str] = set()
59
74
  self.state: str = "waiting"
@@ -321,6 +336,7 @@ class AutoFlasher:
321
336
  self.log(f"Starting flash process for {board}")
322
337
  self.log(f"Port: {port}")
323
338
  self.log(f"Version: {version}")
339
+ self.log(f"Chip: {self.chip}")
324
340
  self.log("=" * 60)
325
341
 
326
342
  # Download firmware
@@ -339,23 +355,23 @@ class AutoFlasher:
339
355
  temp_file.close()
340
356
 
341
357
  # Prepare esptool arguments
342
- args = [
358
+ base_args = [
359
+ "--chip",
360
+ self.chip,
343
361
  "--port",
344
362
  port,
345
363
  "--baud",
346
364
  BAUD_RATE,
347
- "--chip",
348
- "auto",
365
+ ]
366
+ args = [
367
+ *base_args,
349
368
  "write-flash",
350
369
  ]
351
370
 
352
371
  if self.erase_flash:
353
372
  self.log("Erasing flash...")
354
373
  erase_args = [
355
- "--port",
356
- port,
357
- "--baud",
358
- BAUD_RATE,
374
+ *base_args,
359
375
  "erase-flash",
360
376
  ]
361
377
 
@@ -1,6 +1,10 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
1
5
  [project]
2
6
  name = "OpenShock-AutoFlasher"
3
- version = "0.2.1"
7
+ version = "0.2.4"
4
8
  description = "Automatically flash OpenShock firmware to ESP32 devices"
5
9
  readme = "README.md"
6
10
  license = { text = "AGPL-3.0" }
@@ -54,12 +58,11 @@ dev = [
54
58
  ]
55
59
 
56
60
  [project.urls]
57
- Repository = "https://github.com/NanashiTheNameless/OpenShock-AutoFlasher"
58
- Homepage = "https://github.com/NanashiTheNameless/OpenShock-AutoFlasher"
59
- Issues = "https://github.com/NanashiTheNameless/OpenShock-AutoFlasher/issues"
60
- "GitHub Sponsor" = "https://github.com/sponsors/NanashiTheNameless"
61
+ Repository = "https://gitlab.com/NamelessNanashi/OpenShock-AutoFlasher"
62
+ Homepage = "https://gitlab.com/NamelessNanashi/OpenShock-AutoFlasher"
63
+ Issues = "https://gitlab.com/NamelessNanashi/OpenShock-AutoFlasher/-/issues"
61
64
  "Buy Me a Coffee" = "https://buymeacoffee.com/NamelessNanashi"
62
- Author = "https://github.com/NanashiTheNameless"
65
+ Author = "https://gitlab.com/NamelessNanashi"
63
66
 
64
67
  [project.scripts]
65
68
  OPSH-AutoFlash = "openshock_autoflasher.cli:main"
@@ -52,6 +52,7 @@ def test_create_argument_parser():
52
52
  assert args.no_auto is False
53
53
  assert args.post_flash is None
54
54
  assert args.post_flash_delay == 0.0
55
+ assert args.chip == "auto"
55
56
 
56
57
 
57
58
  def test_argument_parser_all_options():
@@ -102,6 +103,17 @@ def test_argument_parser_channel_choices():
102
103
  parser.parse_args(["--channel", "invalid", "--board", "test"])
103
104
 
104
105
 
106
+ def test_argument_parser_chip_option():
107
+ """Test parser with explicit esptool chip selection."""
108
+ parser = create_argument_parser()
109
+
110
+ args = parser.parse_args(["--board", "test-board", "--chip", "esp32c3"])
111
+ assert args.chip == "esp32c3"
112
+
113
+ with pytest.raises(SystemExit):
114
+ parser.parse_args(["--board", "test-board", "--chip", "invalid"])
115
+
116
+
105
117
  def test_argument_parser_post_flash_single():
106
118
  """Test parser with single post-flash command"""
107
119
  parser = create_argument_parser()
@@ -9,6 +9,7 @@ from openshock_autoflasher.constants import (
9
9
  FLASH_MODE,
10
10
  FLASH_FREQ,
11
11
  FLASH_ADDRESS,
12
+ SUPPORTED_CHIPS,
12
13
  INITIAL_POLL_INTERVAL,
13
14
  MAX_POLL_INTERVAL,
14
15
  POLL_BACKOFF_THRESHOLD,
@@ -24,6 +25,7 @@ def test_constants_are_defined():
24
25
  assert FLASH_MODE in ["qio", "qout", "dio", "dout"]
25
26
  assert FLASH_FREQ.endswith("m")
26
27
  assert FLASH_ADDRESS.startswith("0x")
28
+ assert "esp32" in SUPPORTED_CHIPS
27
29
 
28
30
 
29
31
  def test_polling_intervals():
@@ -5,6 +5,7 @@ Tests for flasher module
5
5
  import pytest
6
6
  from unittest.mock import Mock, patch, MagicMock
7
7
 
8
+ from openshock_autoflasher.constants import BAUD_RATE
8
9
  from openshock_autoflasher.flasher import AutoFlasher
9
10
 
10
11
 
@@ -337,6 +338,60 @@ def test_flasher_with_version_and_all_options():
337
338
  assert flasher.alert is True
338
339
 
339
340
 
341
+ def test_flasher_defaults_chip_to_auto():
342
+ """Test AutoFlasher defaults to esptool autodetection."""
343
+ flasher = AutoFlasher(channel="stable", board="test-board")
344
+
345
+ assert flasher.chip == "auto"
346
+
347
+
348
+ def test_flasher_with_explicit_chip():
349
+ """Test AutoFlasher stores explicit chip overrides."""
350
+ flasher = AutoFlasher(channel="stable", board="test-board", chip="ESP32S3")
351
+
352
+ assert flasher.chip == "esp32s3"
353
+
354
+
355
+ def test_flasher_rejects_unsupported_chip():
356
+ """Test unsupported esptool chip values fail early."""
357
+ with pytest.raises(ValueError, match="Unsupported chip"):
358
+ AutoFlasher(channel="stable", board="test-board", chip="invalid")
359
+
360
+
361
+ def test_flash_device_uses_default_auto_chip_for_erase_and_flash(flasher):
362
+ """Test erase and write commands both receive the default auto chip."""
363
+ flasher.erase_flash = True
364
+
365
+ with (
366
+ patch.object(flasher, "download_firmware", return_value=b"firmware"),
367
+ patch.object(flasher, "_run_esptool") as mock_run_esptool,
368
+ ):
369
+ flasher.flash_device("/dev/ttyUSB0", "1.0.0", "Seeed-Xiao-ESP32C3")
370
+
371
+ assert mock_run_esptool.call_count == 2
372
+ erase_args = mock_run_esptool.call_args_list[0][0][0]
373
+ write_args = mock_run_esptool.call_args_list[1][0][0]
374
+
375
+ assert erase_args == [
376
+ "--chip",
377
+ "auto",
378
+ "--port",
379
+ "/dev/ttyUSB0",
380
+ "--baud",
381
+ BAUD_RATE,
382
+ "erase-flash",
383
+ ]
384
+ assert write_args[:7] == [
385
+ "--chip",
386
+ "auto",
387
+ "--port",
388
+ "/dev/ttyUSB0",
389
+ "--baud",
390
+ BAUD_RATE,
391
+ "write-flash",
392
+ ]
393
+
394
+
340
395
  @patch("openshock_autoflasher.flasher.time.sleep")
341
396
  @patch("openshock_autoflasher.flasher.esptool.main")
342
397
  def test_run_esptool_retries_on_stopiteration(mock_esptool_main, mock_sleep, flasher):