flashforge-python-api 3.0.0__tar.gz → 3.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.
Files changed (85) hide show
  1. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/CHANGELOG.md +403 -388
  2. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/PKG-INFO +1 -1
  3. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/docs/api_reference.md +92 -88
  4. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/docs/parity.md +38 -36
  5. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/flashforge/__init__.py +337 -337
  6. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/flashforge/discovery/discovery.py +836 -730
  7. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/pyproject.toml +175 -175
  8. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/.gitignore +0 -0
  9. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/LICENSE +0 -0
  10. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/README.md +0 -0
  11. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/docs/README.md +0 -0
  12. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/docs/advanced.md +0 -0
  13. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/docs/client.md +0 -0
  14. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/docs/models.md +0 -0
  15. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/docs/protocols.md +0 -0
  16. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/examples/advanced_tcp.py +0 -0
  17. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/examples/basic_connection.py +0 -0
  18. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/examples/discovery.py +0 -0
  19. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/examples/file_operations.py +0 -0
  20. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/examples/job_control.py +0 -0
  21. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/examples/led_control.py +0 -0
  22. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/examples/status_monitoring.py +0 -0
  23. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/examples/temperature_control.py +0 -0
  24. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/flashforge/_removed.py +0 -0
  25. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/flashforge/api/__init__.py +0 -0
  26. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/flashforge/api/constants/__init__.py +0 -0
  27. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/flashforge/api/constants/commands.py +0 -0
  28. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/flashforge/api/constants/endpoints.py +0 -0
  29. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/flashforge/api/filament/__init__.py +0 -0
  30. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/flashforge/api/filament/filament.py +0 -0
  31. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/flashforge/api/misc/__init__.py +0 -0
  32. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/flashforge/api/misc/redaction.py +0 -0
  33. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/flashforge/api/misc/scientific_notation.py +0 -0
  34. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/flashforge/api/misc/temperature.py +0 -0
  35. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/flashforge/api/network/__init__.py +0 -0
  36. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/flashforge/api/network/fnet_code.py +0 -0
  37. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/flashforge/api/network/utils.py +0 -0
  38. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/flashforge/backends/__init__.py +0 -0
  39. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/flashforge/backends/connect.py +0 -0
  40. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/flashforge/backends/creator5_backend.py +0 -0
  41. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/flashforge/backends/dual_api_backend.py +0 -0
  42. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/flashforge/backends/dual_api_models.py +0 -0
  43. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/flashforge/backends/http_core.py +0 -0
  44. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/flashforge/backends/http_printer_backend.py +0 -0
  45. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/flashforge/backends/legacy_backend.py +0 -0
  46. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/flashforge/backends/printer_backend.py +0 -0
  47. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/flashforge/backends/types.py +0 -0
  48. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/flashforge/capabilities/__init__.py +0 -0
  49. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/flashforge/capabilities/models.py +0 -0
  50. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/flashforge/capabilities/palettes/__init__.py +0 -0
  51. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/flashforge/capabilities/palettes/ad5x_palette.py +0 -0
  52. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/flashforge/capabilities/palettes/creator5_palette.py +0 -0
  53. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/flashforge/capabilities/palettes/palette.py +0 -0
  54. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/flashforge/capabilities/palettes/palette_snap.py +0 -0
  55. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/flashforge/capabilities/printer_capabilities.py +0 -0
  56. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/flashforge/capabilities/registry.py +0 -0
  57. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/flashforge/capabilities/resolve_model.py +0 -0
  58. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/flashforge/discovery/__init__.py +0 -0
  59. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/flashforge/exceptions.py +0 -0
  60. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/flashforge/models/__init__.py +0 -0
  61. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/flashforge/models/machine_info.py +0 -0
  62. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/flashforge/models/machine_info_parser.py +0 -0
  63. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/flashforge/models/responses.py +0 -0
  64. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/flashforge/status/__init__.py +0 -0
  65. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/flashforge/status/printer_snapshot.py +0 -0
  66. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/flashforge/tcp/__init__.py +0 -0
  67. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/flashforge/tcp/a3_client.py +0 -0
  68. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/flashforge/tcp/a4_client.py +0 -0
  69. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/flashforge/tcp/ff_client.py +0 -0
  70. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/flashforge/tcp/gcode/__init__.py +0 -0
  71. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/flashforge/tcp/gcode/a3_gcode_controller.py +0 -0
  72. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/flashforge/tcp/gcode/gcode_controller.py +0 -0
  73. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/flashforge/tcp/gcode/gcodes.py +0 -0
  74. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/flashforge/tcp/gcode/legacy_gcode_controller.py +0 -0
  75. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/flashforge/tcp/parsers/__init__.py +0 -0
  76. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/flashforge/tcp/parsers/endstop_status.py +0 -0
  77. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/flashforge/tcp/parsers/location_info.py +0 -0
  78. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/flashforge/tcp/parsers/print_status.py +0 -0
  79. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/flashforge/tcp/parsers/printer_info.py +0 -0
  80. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/flashforge/tcp/parsers/temp_info.py +0 -0
  81. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/flashforge/tcp/parsers/thumbnail_info.py +0 -0
  82. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/flashforge/tcp/tcp_client.py +0 -0
  83. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/flashforge/threemf/__init__.py +0 -0
  84. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/flashforge/threemf/parser.py +0 -0
  85. {flashforge_python_api-3.0.0 → flashforge_python_api-3.1.0}/flashforge/threemf/warnings.py +0 -0
@@ -1,388 +1,403 @@
1
- # Changelog
2
-
3
- All notable changes to this project will be documented in this file.
4
-
5
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
-
8
- ## [Unreleased]
9
-
10
- ## [3.0.0] - 2026-11-28
11
-
12
- This is a major release with breaking changes. Code written for 1.x must change: see the table under "Changed (breaking)". The project moved to GitLab: https://gitlab.com/GhostTypes/ff-5mp-api-py.
13
-
14
- ### Home Assistant users
15
-
16
- The FlashForge integration (ff-5mp-hass) 1.6.1 and earlier does not work with this version. Integration 1.6.2 and later installs only `flashforge-python-api` 1.x, so it is not affected. If your integration shows an error that says a name "was removed in flashforge-python-api 3.0":
17
-
18
- 1. In HACS, remove the old GhostTypes repository.
19
- 2. Add `https://github.com/Parallel-7/ff-5mp-hass` as a custom repository.
20
- 3. Update the integration to 1.6.2 or later and restart Home Assistant.
21
-
22
- ### Added (migration)
23
-
24
- - **Removed names raise a clear error.** An import of a name that 3.0 removed (`FlashForgeClient`, `FiveMClient`, `FiveMClientConnectionOptions`, `Control`, `JobControl`, `TempControl`, `Files`, `Info`, `PrinterModel`, and the AD5X and Creator 5 job parameter types) raises `RemovedInVersion3Error`, a subclass of `ImportError`. The message names the replacement and links to this changelog. Before, Python only said "cannot import name".
25
-
26
- ### Changed (breaking)
27
-
28
- - **One backend per printer family replaces `FlashForgeClient`.** `FlashForgeClient` (also exported as `FiveMClient`), `FiveMClientConnectionOptions`, `Control`, `JobControl`, `TempControl`, `Files` and `Info` are removed. There is no compatibility layer. Use `connect_printer()`. It returns a ready backend for the printer:
29
- - `Adventurer5MBackend`, `Adventurer5MProBackend` and `AD5XBackend` (dual-API family: HTTP and TCP).
30
- - `Creator5Backend` (HTTP-only family: Creator 5 and Creator 5 Pro). It has no TCP code and is not a dual-API subclass.
31
- - `LegacyBackend` (Adventurer 3, Adventurer 4 and other TCP-only printers). It uses `FlashForgeA3Client`, `FlashForgeA4Client` or the generic TCP `FlashForgeClient`. The `force_legacy` connect option keeps the force-legacy mode.
32
- - **Model resolution.** With a discovery result, the model comes from the discovery product ID, and the connection only checks the serial number and check code. Without one (manual IP, saved printer), the model comes from the `/detail` response of that check: PID first, then the factory model name. A legacy printer without a discovery result is identified with M115.
33
- - **Operations that the printer cannot do raise `NotSupportedError`.** They no longer return `False` or send the command anyway. Read `backend.capabilities` to decide what to show. Parameter errors (for example a slot ID of 0) raise `InvalidParameterError` and send nothing. A failed connection raises `PrinterConnectionError` with a plain-language reason. This replaces `FlashForgeClient.last_connection_error` and `Info.last_detail_rejection`.
34
- - **Capabilities come from one model registry.** Chamber control is Creator 5 Pro only. Filtration control is Adventurer 5M Pro only: it comes from the model, not from `/product`. The AD5X and the base 5M have no filtration control. `backend.capabilities` gives `available`, `controllable` and a `reason` for each feature. `led_control_override` and `set_feature_overrides()` are removed.
35
- - **The light is controllable on every modern printer.** `capabilities.led` comes from the model: HTTP `lightControl_cmd` on the 5M, 5M Pro, AD5X and Creator 5 series, TCP on legacy printers. The printer drives a light with this command also when the user fitted the light and `/product` reports `lightCtrlState: 0` (the base 5M and the AD5X always report 0). There is no custom-light connect option and no TCP light path for modern printers.
36
- - **Slot IDs are the printer's native 1-based IDs everywhere** (mappings, `configure_slot`, `slot_action`, the status model).
37
- - **`FFMachineInfo.model_id` replaces `is_pro`, `is_ad5x`, `is_creator5` and `is_creator5_pro`.** `MachineInfoParser` moved to `flashforge.models`. `DiscoveredPrinter.model` is now a `PrinterModelId` (for example `"ad5x"`). The discovery `PrinterModel` enum is removed.
38
- - **One parameter type per operation.** `UploadJobParams`, `LocalJobParams` and `MaterialMapping` replace `AD5XUploadParams`, `AD5XLocalJobParams`, `AD5XSingleColorJobParams`, `AD5XMaterialMapping`, `Creator5UploadParams` and `Creator5JobParams`. `upload_file()` and `start_local_job()` work on every family. On the AD5X, mappings start a multi-color print; without them the print is single-color.
39
- - **A Creator 5 upload with mappings and `start_print=False` raises `InvalidParameterError`.** Before, it logged a warning and left the mappings out.
40
- - **The AD5X slot color snaps to the AD5X palette and keeps the `#`.** `configure_slot` on the AD5X sent freeform hex with the `#` removed. The printer then stored and reported the bare value, so a later mapping with that color failed validation. This matches the TypeScript library. The palettes moved to `flashforge.capabilities.palettes`, and `Creator5PaletteColor` is now `PaletteColor`.
41
- - **5M firmware with a "v" prefix uses the new upload format.** The printers report the version as `v3.1.3`. An empty or unreadable version also uses the new format.
42
-
43
- | Before | Now |
44
- |---|---|
45
- | `FlashForgeClient(ip, sn, code)` + `initialize()` + `init_control()` | `await connect_printer(target, ConnectOptions(check_code=...))` |
46
- | `client.info.get()` | `await backend.get_machine_info()` or `await backend.get_status()` |
47
- | `client.job_control.pause_print_job()` / `resume_print_job()` / `cancel_print_job()` | `backend.pause_job()` / `resume_job()` / `cancel_job()` |
48
- | `upload_file` / `upload_file_ad5x` / `upload_file_creator5` | `backend.upload_file(UploadJobParams(...))` |
49
- | `print_local_file` / `start_ad5x_multi_color_job` / `start_ad5x_single_color_job` / `start_creator5_job` | `backend.start_local_job(LocalJobParams(...))` |
50
- | `client.control.set_led_on()` / `set_led_off()` | `backend.set_led(on)` |
51
- | `set_external_filtration_on` / `set_internal_filtration_on` / `set_filtration_off` | `backend.set_filtration("external" / "internal" / "off")` |
52
- | `turn_camera_on()` / `turn_camera_off()` | `backend.set_camera(on)` |
53
- | `set_speed_override` / `set_z_axis_override` / `set_*_fan_speed` | `backend.set_print_overrides(PrintOverrides(...))` |
54
- | `client.temp_control.*` | `backend.set_extruder_temp()`, `set_bed_temp()`, `set_tool_temp()`, `set_chamber_temp()`, ... |
55
- | `client.files.get_local_file_list()` / `get_recent_file_list()` / `get_gcode_thumbnail()` | `backend.get_local_files()` / `get_recent_files()` / `get_thumbnail()` |
56
- | `client.tcp_client.send_raw_cmd()` | `backend.send_gcode()` |
57
- | `client.is_pro` / `is_ad5x` / `is_creator5` / `http_only` / `led_control` / `filtration_control` | `backend.model`, `backend.family`, `backend.capabilities` |
58
-
59
- ### Added
60
-
61
- - **A manual IP with a check code also finds a legacy printer.** When the HTTP API does not answer at all (network error or an HTTP error status) and the model is not known, `connect_printer` tries the legacy TCP probe. If that also fails, the original HTTP error is raised. A known modern model or a printer that rejects `/detail` never probes TCP.
62
- - **A cancelled or timed-out connect closes the connection.** When the caller cancels `connect_printer` (for example with `asyncio.wait_for`) during the TCP login, the backend or probe client is closed first, and the cancel completes at once, also when the printer does not answer the TCP login. A closed TCP client does not connect again. Before, an abandoned `~M601` login kept the socket open and held the printer's control lock.
63
- - **Client filament palettes.** `get_palette_for_model(model)` returns a `Palette` (`colors`, `materials`, `nearest_color()`, `nearest_material()`) for a client UI: the Creator 5 palette for the Creator 5 series, else the AD5X palette. New: `CREATOR5_MATERIALS` (21 materials), `AD5X_FILAMENT_PALETTE` and `CREATOR5_FILAMENT_PALETTE`. Same API as the TypeScript and Kotlin libraries.
64
- - **Hex colors with an alpha channel.** The palette snap accepts `#RRGGBBAA` and ignores the alpha. Before, it fell back to White.
65
- - **`capabilities.air_quality_sensor`.** True when the status has a real air-quality (TVOC) reading: the Adventurer 5M Pro only. The base 5M and the Creator 5 series always send `tvoc: 0`, so `PrinterSnapshot.filtration.tvoc_level` is 0 for them. Use this flag to decide whether to show the reading.
66
- - **`PrinterSnapshot` status model.** `backend.get_status()` returns one normalized status for every family: run state, temperatures (per tool, chamber only when present), fans, filtration, job progress, material station (native slot IDs), light, door (only with a real door sensor) and lifetime totals.
67
- - **AD5X material station operations.** `AD5XBackend.slot_action()` (`ms_cmd` load, unload and cancel) and the AD5X palette (`AD5X_PALETTE`, `AD5X_MATERIALS`, `snap_to_ad5x_palette()`). The Python library did not have them before.
68
- - **Filament load flow on the dual-API family.** `prepare_filament_load()`, `load_filament()` and `finish_filament_load()`, ported from the TypeScript library.
69
- - **`scripts/emulator_smoke.py`** runs every backend against flashforge-emulator-v2.
70
-
71
- ### Removed
72
-
73
- - **TCP commands that the printers do not support.** The 5M, 5M Pro and AD5X do not support M405, M406, M240, M109 or M190. They acknowledge these commands and do nothing. These are removed:
74
- - `turn_runout_sensor_on()` and `turn_runout_sensor_off()` on the TCP `FlashForgeClient`.
75
- - The `wait_for` option of `set_extruder_temp()` and `set_bed_temp()` on the TCP `FlashForgeClient` and `GCodeController`. It sent M109 or M190 instead of M104 or M140, so the printer did not get the target temperature. To wait, set the temperature and then call `GCodeController.wait_for_extruder_temp()` or `wait_for_bed_temp()`. These read the temperature and work on all models.
76
- - The `GCodes` constants `CMD_RUNOUT_SENSOR_ON`, `CMD_RUNOUT_SENSOR_OFF`, `TAKE_PICTURE`, `WAIT_FOR_HOTEND_TEMP` and `WAIT_FOR_BED_TEMP`.
77
- - The Adventurer 3 and Adventurer 4 clients keep the `wait_for` option. They now use the new `LegacyGCodeController`. Support on these printers is not verified.
78
-
79
- ### Fixed
80
-
81
- - **A tool that is mapped more than once is refused.** Material mapping validation now refuses two entries with the same `toolId` and sends nothing. The printers accept such a list without an error, but keep only one of the entries (the AD5X keeps the last, the Creator 5 series the first), so the print used a slot that the caller did not expect. Several tools can still use the same slot: the printers accept this.
82
- - **Closing a TCP client is fast.** `dispose()` sent the logout and waited for the reply. A printer that did not answer kept the socket, and the printer's control lock, open for 5 seconds. A cancelled connect then took about 10 seconds to complete, and the reply timeout opened a new connection. `dispose()` now writes the logout and closes the socket without waiting for a reply. A reply that is still pending ends when the socket closes. After `dispose()`, the client does not open a socket again.
83
- - **A legacy upload with the wrong size is reported as a failure.** On a size mismatch the printer answers `M29` with `File Is Not Aviable` (its spelling). The upload check looked only for the correct spelling, so a damaged upload counted as a success. The check now also compares the `filesize` and `tofile.size` values in the reply.
84
- - **A refused `/detail` request is no longer reported as a library bug.** When the printer refuses the request (LAN-only mode off, wrong serial number, wrong check code), the body has an error code and no `detail` object. `get_detail_response()` sent that body to validation, which failed, so it raised `FlashForgeResponseError` and logged "This is NOT a connectivity problem - please report it". Home Assistant then told the user to report an integration bug. A refusal is now reported as a refusal (`PrinterConnectionError` at connect, with the code and message), not as a parse failure. A body with no integer `code` still raises `FlashForgeResponseError`.
85
- - **The Creator 5 backend never opens a TCP connection.** The Creator 5 has no TCP server. Before, `init_control()` called the TCP login after the product command, which failed.
86
- - **Print setting changes no longer reset the other settings.** `printerCtl_cmd` sends the print speed, the Z offset and two fan speeds in one command. Each setter sent defaults for the fields it did not change: 100 % speed, 100 % fans and a Z offset of 0. So `set_speed_override(80)` also set both fans to 100 % and reset the Z offset. Below layer 2, every call also turned both fans off. The setters now send -200 for each field the caller did not set. The printer ignores this value, so the other settings stay as they are. The layer-2 fan override is removed.
87
- - **`set_z_axis_override` documentation.** The offset is relative to the job's starting offset. It is not cumulative. The printer applies values from -5.0 to +5.0 only. Not yet verified on hardware.
88
- - **The left cooling fan value is sent only when set.** The command always sent `coolingLeftFan: 0`. `set_print_overrides(PrintOverrides(left_cooling_fan_speed=...))` sets it on the AD5X. Other calls do not send it.
89
- - **Chamber temperature documentation.** The documentation said that the printer limits the chamber target to 80 °C. The printer applies no limit to the value. Keep the value in a safe range.
90
- - **More printer statuses are recognized.** The printers send status values that the library did not know: `canceling` (all models), `loading` (Creator 5 series filament load and unload), and `cloud_slicing`, `sending` and `unzipping` (5M and 5M Pro 5.x, Creator 5 1.9.2 and later). Each one became `MachineState.UNKNOWN` and logged a warning on every poll. They now map to `MachineState.BUSY`, because they are short transitional states. `canceling` does not map to `CANCELLED`, because some consumers treat `CANCELLED` as a final state.
91
-
92
- ## [1.6.0] - 2026-09-27
93
-
94
- This release adds a parser for sliced `.3mf` files, so you can learn which tools and materials a print uses before you upload it. It also fixes uploads that blocked the event loop or stopped after five minutes. No public signature changed, so the upgrade is safe for all users.
95
-
96
- ### Added
97
-
98
- - **Sliced 3MF parsing: `parse_3mf()` and the new `flashforge.threemf` subpackage.** The Creator 5 series does not report which tools a stored file uses. For that family, the only way to build correct material mappings is to read the 3MF before upload. `parse_3mf(source, *, file_name=None)` accepts a path or a binary file object and returns a frozen `ThreeMFFile`. The result holds the filaments the plate uses (`ThreeMFFilament`: material, `#RRGGBB` color, length and weight), the plate thumbnail, time and weight estimates, layer count, nozzle diameters, object names, the slicer name and version, the printer model the file was sliced for, and any slicer warnings. Each filament keeps its slicer number as `filament_id` (1-based) and carries `tool_id = filament_id - 1`, the 0-based tool id that `AD5XMaterialMapping` expects. The list holds only the filaments the plate actually uses: a file that uses only filament 3 gives one entry with `tool_id` 2. The data comes from the slice metadata in the archive, with the plate G-code header as a fallback. Tested with output from Orca-FlashForge, OrcaSlicer, Flash Studio, and Snapmaker Orca.
99
-
100
- - **Clear errors for files a printer cannot print as one job.** All 3MF errors subclass `ThreeMFError`, which subclasses `FlashForgeError`. `ThreeMFFormatError` means the file is not a readable archive, has a corrupt entry, or has malformed or oversized slice metadata. `ThreeMFNotSlicedError` means the file is a project file with no sliced G-code. `ThreeMFMultiplePlatesError` means the file holds more than one sliced plate; it carries `plate_count`. Nobody knows which plate the printer prints from such a file, so the parser rejects it. Export a single plate from the slicer instead. A missing path raises `FileNotFoundError`.
101
-
102
- - **`PrinterFamily` and `printer_family_from_model_id()`.** `ThreeMFFile.printer_family` maps the slicer's printer-model id to `adventurer_5m`, `adventurer_5m_pro`, `ad5x`, `creator_5`, or `creator_5_pro`, so you can warn when a file was sliced for a different printer. An unknown id gives `None`.
103
-
104
- - **`translate_warning()`.** OrcaSlicer-family slicers store warnings as raw keys such as `bed_temperature_too_high_than_filament`. The parser turns each key into readable text in `ThreeMFWarning.message`, and `translate_warning()` is available on its own. An unknown key falls back to a readable form of the key. The table matches the one in the TypeScript `slicer-meta` package.
105
-
106
- - **Bounded reads.** The parser reads only the slice metadata (limit 4 MB), the plate thumbnail (limit 8 MB), and the start of the plate G-code (limit 1 MB). It never decompresses the whole G-code, so a large or hostile file costs a fixed amount of memory. The limits are available as `MAX_SLICE_INFO_BYTES`, `MAX_THUMBNAIL_BYTES`, and `MAX_GCODE_HEADER_BYTES`. The parser is synchronous: in asyncio code, call it with `await asyncio.to_thread(parse_3mf, path)`.
107
-
108
- ### Fixed
109
-
110
- - **Uploads no longer block the event loop.** `upload_file`, `upload_file_ad5x`, and `upload_file_creator5` opened and measured the local file on the event loop. That stalled every other task during the call, and Home Assistant reported it as a blocking `open()` call. The three methods now open and measure the file in a worker thread.
111
-
112
- - **Large uploads over printer Wi-Fi no longer stop after five minutes.** The upload methods used aiohttp's default timeout, which caps the whole request at five minutes. A large file over a slow Wi-Fi link could not finish in that time. Uploads now use `UPLOAD_TIMEOUT`, which has no total cap. A 30-second connect limit and a 300-second read limit still catch a printer that stops answering.
113
-
114
- - **A path that is not a regular file now returns `False`.** If you pass a directory (or any other non-file path) to an upload method, the method returns `False`, the same as for a missing file.
115
-
116
- ## [1.5.0] - 2026-09-26
117
-
118
- ### Added
119
-
120
- - **`Creator5UploadParams.material_mappings`.** The Creator 5 firmware reads a base64 `materialMappings` upload header, the same format as the AD5X, and applies it when the upload starts the print (confirmed by firmware analysis of 1.9.6 and 1.9.8, Creator 5 and Creator 5 Pro). `upload_file_creator5` now sends the header when `start_print` is true and the mappings are valid. With `start_print` false the mappings are not sent and a warning is logged: the firmware keeps upload mappings in memory until the next print ends, so they would apply to a later, unrelated print. The recommended flow is unchanged: upload without starting, then call `start_creator5_job` with the mappings.
121
-
122
- ### Changed
123
-
124
- - **Creator 5 documentation corrected.** The firmware only logs `useMatlStation` and `gcodeToolCnt` on upload. `/printGcode` applies mappings to any file on the printer, not only the last upload. Without mappings, each tool prints from the slot with the slicer's filament number (filament 1 prints from slot 1), whatever is loaded there, so send a mapping for every tool, including a single-tool print. Mappings take effect only for a `.3mf` file.
125
-
126
- ### Fixed
127
-
128
- - **Concurrent commands no longer interleave on the printer's HTTP API.** The Python port had no serialization on its command paths, so two commands sent at the same moment (say a light toggle racing a pause) could overlap in flight, and the printer — which handles one command at a time — could drop or mis-acknowledge one. Every command-submission POST (`/control`, `/product`, `/printGcode`) now holds one FIFO lock, so commands run one at a time, in the order callers sent them. Uploads (`/uploadGcode`) and read/poll requests (`/detail`, `/gcodeList`, `/gcodeThumb`, camera probes) stay outside the lock on purpose: an upload can run for minutes, and a pause or stop must never queue behind one. A command sent after a failing one still goes through; the lock releases on error. Matches the parallel fix in `ff-5mp-api-ts`. No public API changed.
129
-
130
- ## [1.4.0] - 2026-08-10
131
-
132
- ### Fixed
133
-
134
- - **`completion_time` no longer recedes while a print is paused.** It was derived as `datetime.now() + estimated_time` on every parse, which is only stable while the firmware is counting `estimatedTime` down. It isn't: the field freezes the moment the print stops advancing, so with the second term fixed and the first still moving, the derived timestamp stepped forward one minute per minute — after an hour of a clog pause it claimed the print would finish an hour later than it had when the pause began, and it never stopped receding. `completion_time` is now `None` unless `machine_state` is `PRINTING` — `HEATING` is excluded for the same reason as the paused states, since the pre-print warmup does not advance the job either and drifts identically, just for minutes rather than hours. Found while checking whether the Creator 5 Pro clog fix in 1.3.5 left the ETA sensible; the same derivation exists in `ff-5mp-api-ts` and in four display sites across FlashForgeUI-Electron and FlashForgeWebUI, all fixed alongside. It originates in the C# `ff-5mp-api` (`MachineInfo.cs:210`), which every port inherited it from.
135
-
136
- ### Changed
137
-
138
- - **BREAKING: `FFMachineInfo.completion_time` is now `datetime | None`** (was `datetime`, defaulting to `datetime.now()`). Consumers that read it without a `None` check need one. `print_eta` and `estimated_time` are unchanged and stay correct in every state — the remaining *duration* was never wrong, only its conversion to an absolute timestamp. Prefer them where a duration will do.
139
-
140
- ## [1.3.5] - 2026-08-08
141
-
142
- ### Fixed
143
-
144
- - **A paused Creator 5 Pro no longer reports as "unknown".** The printer sends `status: "pause"`, while the mapping only knew the documented `"pausing"` and `"paused"` — so every pause fell through to `MachineState.UNKNOWN`. In Home Assistant that is the one state that says nothing, and it appeared at exactly the wrong moment: the printer pauses itself when it detects a clog, so the sensor went blank precisely when the user needed to know why the print had stopped. Found in a Home Assistant log carrying 84 `Unknown machine status received: 'pause'` warnings over a single day (pid 41, firmware 1.9.4). `"pause"` now maps to `PAUSED`; `"paused"` still does, because firmware reporting one is no reason to drop the other.
145
-
146
- - **`status: "downloading"` is mapped too.** Reported while a file is being transferred to the printer, and likewise unmapped until now. It maps to `BUSY` rather than to a new enum member on purpose: a consumer that pins this enum to a fixed list breaks when a member appears, and mapping onto an existing state cannot break anyone. (`ff-5mp-hass` is not such a consumer — its `device_class=ENUM` sensor derives its `options` from `MachineState` itself, so a new member would reach it for free.) A dedicated `DOWNLOADING` state is worth discussing on its merits; it is not a bugfix, and it does not belong in a patch release.
147
-
148
- ## [1.3.4] - 2026-07-26
149
-
150
- ### Fixed
151
-
152
- - **A single out-of-range field no longer costs the caller the entire `/detail` response.** A Creator 5 with no heated chamber reports `chamberTemp: -108` — the firmware's "this sensor does not exist" sentinel, a sibling of the `-100` this library itself sends as `TEMP_OFF`. `FFPrinterDetail.chamber_temp` carried `ge=-50`, so that one value failed validation for the whole model, `get_detail_response` returned `None`, and `ff-5mp-hass` reported an unreachable printer. Three releases went into `ff-5mp-hass#18` on the assumption it was a network or credential problem. The temperature fields now map any value at or below `-50` to `None`, so "no sensor" reads as "not reported" rather than as a `-108 °C` reading or a hard failure; `MachineInfoParser` exposes this as the new `FFMachineInfo.has_chamber_sensor`, which consumers should gate chamber entities on instead of the Creator 5 model family (the chamber is an option within it, not a family trait).
153
-
154
- - **Every remaining range constraint was removed from inbound models, not just the one that was reported.** Fixing `chamberTemp` alone would only have relocated the next outage: `tvoc`, `printSpeedAdjust`, `zAxisCompensation`, `fillAmount`, `remainingDiskSpace`, `nozzleCnt` and ~20 more each carried a `ge`/`le` that could fail the entire response on a firmware revision or an unusual state. Pydantic validates a model all-or-nothing, so a constraint on a field nobody reads is enough to take a consumer down. `FFPrinterDetail`, `Temperature`, `SlotInfo`, `MatlStationInfo`, `IndepMatlInfo`, `FFGcodeToolData`, and `FFGcodeFileEntry` now validate types but not value ranges. Outbound request models (`AD5X*Params`, `Creator5*Params`, `FilamentArgs`, `AD5XMaterialMapping`) keep their constraints, where a bad value is our own bug rather than a firmware difference. This matches the TypeScript client (`ff-5mp-api-ts`), which takes what it needs from a response and has never hit this class of failure.
155
-
156
- - **Nested inbound models no longer fail the parent over a missing or unusual field.** `SlotInfo` required `hasFilament`, `materialColor`, `materialName`, and `slotId`, so one absent attribute on one slot failed the whole `/detail` response; all four are now defaulted. Its hex-color validator *raised* on anything that was not `#RRGGBB` or empty — it now normalizes (expanding `#RGB`, adding a missing `#`) and degrades to an empty string, because an unrecognized color should cost a swatch its color, not cost the caller every entity. `MatlStationInfo.slot_infos` carried `min_length=1`, which made an explicitly empty `slotInfos: []` — a station with nothing loaded — invalid, and `max_length=4`, which would have failed on any future larger station.
157
-
158
- ### Added
159
-
160
- - **`FlashForgeResponseError`, so callers can tell "unreadable answer" from "no answer".** Every failure path returned `None`, which meant a schema mismatch was indistinguishable from an unreachable printer — the reason `ff-5mp-hass#18` spent three releases pointing its reporter at the network. `get_detail_response()` now *raises* when the printer answered with a body that failed validation, and still returns `None` when the request never got through. `info.get()` raises the same error when a validated payload cannot be converted into `FFMachineInfo`. The convenience wrappers (`is_printing`, `get_status`, `get_machine_state`) keep their documented fallback returns and absorb it, so only callers that asked for the distinction have to handle it.
161
-
162
- - **`Info.get_detail_raw()`**, returning the decoded `/detail` JSON with no model validation. This lets a consumer read identity fields — above all `pid` — without first validating ~50 unrelated fields, so a supported printer can no longer be rejected because of a field that has nothing to do with whether it is supported.
163
-
164
- - **`FFMachineInfo.has_chamber_sensor`**, set from whether the printer actually reported a chamber temperature.
165
-
166
- ### Changed
167
-
168
- - **`__init__.py` reported `__version__ = "1.3.1"` while `pyproject.toml` said `1.3.3`.** Both now read `1.3.4`.
169
-
170
- - **`CLAUDE.md`'s "Why TCP Bootstrap Is Still Required for Modern Printers" section described behavior the library deliberately does not have.** It claimed `client.initialize()` performs a TCP `M115` alongside the authenticated `/detail` call, but `verify_connection()` has decided `http_only` from the parsed model *before* touching TCP since the Creator 5 work — that family exposes no service on 8899, where an `M115` would hang until the connect timeout rather than fail fast. Model detection is PID-based end to end: the UDP discovery packet before pairing, `/detail` after. Rewritten as "Model Detection Without TCP", with the `http_only` guard stated as the rule and the two remaining ungated legacy call sites (`init_control`, `get_temperatures`, neither used by `ff-5mp-hass`) flagged. No code change — the guard and `tests/test_http_only_guard.py` were already correct; the document that exists to stop agents reintroducing TCP was the thing telling them to.
171
-
172
- ## [1.3.3] - 2026-07-26
173
-
174
- ### Changed
175
-
176
- - **Diagnostic output now goes to the `logging` module instead of `print()`.** 95 `print()` calls across 10 modules were the library's only record of why an operation failed — and under Home Assistant, the largest consumer, stdout reaches nowhere the user can see. Every silent failure therefore looked identical from the outside: a `/detail` response the library could not parse, an unreachable printer, and a rejected check code all produced the same bare `None` or `False` with no explanation anywhere. That is the ambiguity behind both reports on `ff-5mp-hass#18`, where one reporter concluded their check code was wrong and another concluded the integration needed TCP port 8899; neither could see the actual cause. Failures and refused commands now log at `WARNING`, request/response tracing at `DEBUG`, under per-module loggers (`flashforge.api.controls.info`, `…job_control`, and so on) so consumers can raise the level for one area alone. Two intentional exceptions remain on stdout: `FlashForgePrinterDiscovery.print_debug_info()`, whose entire purpose is to dump a hex/ASCII view for a human, and the `_async_main` CLI demo.
177
-
178
- ### Security
179
-
180
- - **Credentials, network identifiers, and cloud registration codes are redacted from logs.** Moving diagnostics into `logging` would otherwise have written secrets to a file users routinely paste into bug reports. The upload paths logged their full HTTP headers — including `serialNumber` and `checkCode`, which together are complete control of the printer over the LAN API — and `send_control_command` printed its whole payload, credentials included, on *every single command*. The new `flashforge.api.misc.redaction` helpers mask `serialNumber`, `checkCode`, `macAddr`, `ipAddr`, `flashRegisterCode`, and `polarRegisterCode` (in both firmware camelCase and library snake_case, recursing into nested structures) before any value can be formatted into a log record. The key set deliberately matches what `ff-5mp-hass` already strips from its diagnostics download, so a log paste and a diagnostics upload cannot disagree about what is safe to share.
181
-
182
- ## [1.3.2] - 2026-07-26
183
-
184
- ### Fixed
185
-
186
- - **A firmware field this library has not seen no longer presents to the user as a wrong check code.** `Product`, `ProductResponse`, `ThumbnailResponse`, and `GenericResponse` — the envelope every inbound response inherits — were `extra="forbid"`, so one unrecognized key raised `ValidationError`. `send_product_command` caught it and returned a bare `False`, which is exactly what a printer refusing the credentials returns; `ff-5mp-hass` turns that into "the check code is incorrect". The same trap sat one level deeper on `/detail`: `FFPrinterDetail` has been `extra="allow"` since 1.3.0, but its children `MatlStationInfo`, `SlotInfo`, `IndepMatlInfo`, and `FFGcodeToolData` still forbade extras, and a child that rejects a field fails the whole response — most likely on a 4-head Creator 5 Pro reporting four loaded slots, the model least covered by existing fixtures. All inbound models now allow extras. Outbound request-parameter models (`AD5X*Params`, `Creator5*Params`, `FilamentArgs`) and the internally constructed `FFMachineInfo` / `Temperature` keep `extra="forbid"`, where it catches our own typos rather than a firmware revision. `send_product_command` now logs the `ValidationError` distinctly instead of letting an unparsed response impersonate rejected credentials. Reported as `ff-5mp-hass#18`.
187
-
188
- - **`FFMachineInfo.has_matl_station` no longer misses the Material Station on the Creator 5 series.** It was a straight copy of the raw `hasMatlStation` value from `/detail`, which is an AD5X-only field — a Creator 5 Pro omits it entirely (verified on real hardware, pid 41, firmware 1.9.4) while reporting a fully populated `matlStationInfo` with four loaded slots. It therefore parsed as `None`, and consumers gating on it saw no station on exactly the models that have one. The parser already computed the correct value for its own AD5X heuristic (flag `is True` OR `slot_cnt > 0` OR non-empty `slot_infos`) and then discarded it; that derived value is now what the property exposes. Its type narrows from `bool | None` to `bool` — a capability has no "unknown" state, and offering one is what allowed an unreported flag to read as absent hardware. `FFPrinterDetail.has_matl_station` still carries the untouched firmware value.
189
-
190
- - **`/gcodeList` no longer loses every file's metadata when the firmware adds a field.** `GCodeListResponse` and `FFGcodeFileEntry` were `extra="forbid"`, and `Files.get_recent_file_list()` caught the resulting `ValidationError` and fell back to a names-only list — `printing_time=0` and every other field `None`, for every file. One unrecognized key anywhere in the payload was therefore enough to silently strip print time, filament weight, and the per-tool material data on all models, and the result is byte-for-byte what a printer that genuinely reports names only looks like. Both models now use `extra="allow"` (matching `FFPrinterDetail`), and the remaining fallback logs a warning naming what was lost instead of degrading in silence.
191
-
192
- ## [1.3.1] - 2026-06-28
193
-
194
- ### Fixed
195
-
196
- - **README "Supported Printers" table now lists the Creator 5 and Creator 5 Pro** that shipped in 1.3.0 (the table predated the Creator 5 work and omitted them). The Capabilities section now also reflects per-nozzle and chamber temperature control and the shared AD5X / Creator 5 material-station surface.
197
-
198
- ## [1.3.0] - 2026-06-28
199
-
200
- ### Added
201
-
202
- - **Creator 5 / Creator 5 Pro support.** The library now detects and fully drives the Creator 5 and Creator 5 Pro (firmware PIDs `40` / `41`) over HTTP, bringing the Python port to parity with `ff-5mp-api-ts` v1.6.1 for these models. The port previously detected these printers via USB product ID during discovery but could not control them.
203
- - **HTTP-only mode** for printers without a legacy TCP/8899 service (Creator 5 family). `FlashForgeClient` now exposes `is_creator5`, `is_creator5_pro`, and `http_only`; on an HTTP-only printer it skips the TCP bootstrap handshake and guards TCP-delegating control/temperature methods (`can_use_tcp`) so they no-op cleanly instead of hanging on a dead socket.
204
- - **Structured Creator 5 machine info.** `FFMachineInfo` now surfaces `model`, `tool_temps` (per-nozzle), `nozzle_count`, `chamber`, and capability flags `has_camera`, `has_lidar`, and `has_door_sensor`; raw `/detail` fields `nozzle_temps`, `nozzle_target_temps`, and `lidar` are parsed on `FFPrinterDetail`.
205
- - **HTTP temperature control transport** (`temperatureCtl_cmd`) for modern printers: `set_tool_temp`, `set_tool_temps`, `cancel_tool_temp` (per-nozzle, via the `nozzles[]` array), and `set_chamber_temp` / `cancel_chamber_temp` (Creator 5 only).
206
- - **`creator5_palette`** — 24-entry Creator 5 color palette with CIEDE2000 nearest-color snapping (`snap_to_creator5_palette`). The color math was fuzz-verified against the TypeScript reference build across 4000 random RGB inputs with zero mismatches.
207
- - **`configure_slot`** (`msConfig_cmd`) for material-station slot configuration, with model-gated color formatting: the Creator 5 snaps the color to its palette (sending `#RRGGBB` with the `#`), while the AD5X sends freeform `#`-stripped hex as before.
208
- - **Creator 5 print-start and upload flows:** `start_creator5_job` (`/printGcode`) and `upload_file_creator5` (`/uploadGcode`) with the C5-native request shapes (no `firstLayerInspection`; booleans as the strings `"true"`/`"false"`; materials mapped at print-start rather than upload). New `Creator5JobParams` and `Creator5UploadParams` models.
209
-
210
- ### Fixed
211
-
212
- - **`_is_new_firmware_version` no longer misreads the Creator 5 (and AD5X) as "old firmware".** These models always use the new payload/header format and their firmware versioning (e.g. the C5 reports `1.9.2`) isn't comparable to the 5M family's `3.x` line, so the numeric `3.1.3` threshold now short-circuits to the new format for them. Previously a Creator 5 would send a malformed legacy `/printGcode` body.
213
- - **`get_file_list` / `get_local_file_list` no longer hang on HTTP-only printers.** They now fall back to the HTTP `/gcodeList` recent-file list (mirroring `Files.ts`) instead of blocking for ~10s on the dead TCP/8899 socket.
214
- - **Creator 5 Pro is no longer mis-classified as a 5M Pro** by the legacy `"Pro" in name` heuristic when no firmware `pid` is present; the Creator 5 family is now checked first.
215
-
216
- ### Changed
217
-
218
- - `AD5XMaterialMapping` is reused as the shared material-mapping type for both the AD5X and Creator 5 flows (both use the same 5-field wire shape). The two per-model validators now delegate to a single shared `_validate_mappings` helper.
219
- - `set_chamber_temp` / `cancel_chamber_temp` are gated to Creator 5 / Creator 5 Pro (they return `False` on other models). This is a deliberate, documented divergence from the TypeScript client, which sends the chamber command unconditionally; see `docs/parity.md`.
220
- ## [1.2.3] - 2026-05-08
221
-
222
- ### Fixed
223
-
224
- - Printer model detection (`is_pro`, `is_ad5x` on `FFMachineInfo`) now reads the firmware-set integer `pid` field on `/detail` instead of string-matching the user-mutable `name` field. Renaming an Adventurer 5M / 5M Pro / AD5X via the LCD or cloud no longer breaks model detection in downstream consumers (Home Assistant, Electron UI, Web UI). Falls back to the legacy name+capability heuristic when `pid` is absent so older firmware still works. Reported in [ff-5mp-hass#13](https://github.com/GhostTypes/ff-5mp-hass/issues/13).
225
-
226
- ### Added
227
-
228
- - `FFMachineInfo.pid: int | None` — the raw firmware PID exposed for consumers that want to do their own model-class gating. Known modern HTTP-capable PIDs: `35` (Adventurer 5M), `36` (5M Pro), `38` (AD5X).
229
-
230
- ## [1.2.2] - 2026-04-27
231
-
232
- ### Fixed
233
-
234
- - Replaced `netifaces` (source-only on PyPI) with `ifaddr` (pure-Python, wheels everywhere) for network interface enumeration. Fixes installation failure on Python 3.14 / Home Assistant 2026.4.x where `netifaces==0.11.0` cannot build, which previously caused `from flashforge import ...` to raise `ImportError` at module load and broke the Home Assistant config flow with "Invalid handler specified" — even for manual setup paths that didn't use discovery. Reported in [ff-5mp-hass#10](https://github.com/GhostTypes/ff-5mp-hass/issues/10).
235
- - Synced `flashforge.__version__` with `pyproject.toml` (was stuck at `1.1.1`).
236
-
237
- ### Changed
238
-
239
- - Added Python 3.14 to the supported versions classifier list.
240
-
241
- ## [1.2.1] - 2026-03-23
242
-
243
- ### Fixed
244
-
245
- - Increased `currentPrintSpeed` and `printSpeedAdjust` validation limit from 200 to 1000 to support AD5X printers reporting speeds up to 500 (contributed by @spawnegit)
246
- - Replaced per-request `aiohttp.ClientSession()` creation with shared HTTP session across all control modules (`control.py`, `files.py`, `info.py`, `job_control.py`), fixing connection churn and respecting the configured timeout
247
- - Increased default HTTP timeout from 5s to 15s to prevent timeouts during print operations
248
-
249
- ### Changed
250
-
251
- - Extracted duplicate `try/except aiohttp.ContentTypeError` JSON parsing pattern into a shared `json_from_response()` helper in `api/network/utils.py`
252
- - Release workflow now includes curated changelog entry alongside auto-generated commit notes in GitHub Releases
253
-
254
- ## [1.2.0] - 2026-03-21
255
-
256
- ### Added
257
-
258
- - `CAMERA_STREAM_PORT` - exported constant for the known FlashForge OEM MJPEG stream port
259
- - `FlashForgeClient.detect_camera_stream()` - probes `http://<printer-ip>:8080/?action=stream` and falls back from `HEAD` to `GET` when firmware does not report `camera_stream_url`
260
- - Pytest coverage for camera stream probing success, `HEAD` timeout fallback, and no-camera behavior
261
- - `FlashForgeA4Client` - dedicated Adventurer 4 Lite / Pro TCP client aligned with the documented M601 and M115 protocol behavior
262
- - `A4BuildVolume`, `A4FileEntry`, and `A4PrinterInfo` for typed Adventurer 4 responses
263
-
264
- ### Changed
265
-
266
- - Discovery PID fallback now recognizes Adventurer 4 Lite (`0x0016`) as well as Adventurer 4 Pro (`0x001E`)
267
- - README guidance now points Adventurer 3 / 4 users at the dedicated TCP clients instead of only the generic legacy layer
268
-
269
- ## [1.1.1] - 2026-03-09
270
-
271
- ### Fixed
272
-
273
- - Fixed AD5X `/detail` response parsing for newer firmware fields including `camera`, `clearFanStatus`, `coordinate`, `extrudeCtrl`, and `moveCtrl`
274
- - Made raw printer detail parsing tolerant of additional future firmware fields instead of failing validation
275
- - Added regression coverage for extended AD5X detail payloads
276
-
277
- ## [1.1.0] - 2026-03-08
278
-
279
- ### Added
280
-
281
- - `FlashForgeA3Client` — full Adventurer 3 TCP client with dedicated G-code protocol support
282
- - `A3GCodeController` — A3-specific G-code command controller
283
- - `FlashForgeClient.camera_stream_url` — caches the OEM camera stream URL reported by the printer in machine-info responses
284
- - `thumbnail_info` parser for handling printer thumbnail responses
285
- - New G-code commands in `gcodes.py` for broader printer compatibility
286
- - Test coverage for A3 client, camera stream URL caching, and machine-info model parity
287
- - mypy exclude configuration for tests and examples
288
-
289
- ### Changed
290
-
291
- - Major refactor of `discovery.py` for improved reliability and cross-printer compatibility
292
- - `tcp_client.py` substantially reworked for better connection handling and parser coverage
293
- - Parsers (`endstop_status`, `location_info`, `print_status`, `printer_info`, `temp_info`) updated for improved type safety and correctness
294
- - `client.py` extended with camera stream URL caching from machine-info responses
295
- - `control.py` updated with refined API surface
296
- - `info.py` refactored for cleaner response handling
297
- - Ruff linter configuration updated to use `[tool.ruff.lint]` table (ruff >=0.1.0 syntax)
298
- - Package exports in `__init__.py` updated to include new A3 types and client
299
- - TCP module exports updated to expose A3 client and controller
300
-
301
- ### Fixed
302
-
303
- - Discovery reliability improvements from `discovery.py` refactor
304
- - TCP client parser edge cases addressed across all response types
305
-
306
- ## [1.0.2] - 2025-12-26
307
-
308
- ### Added
309
-
310
- - Added LAN-only mode requirement notice in README Quick Start section with link to official FlashForge documentation
311
- - Added dependency badges for aiohttp, pydantic, netifaces, requests, and pillow to README header
312
- - Added readme-generator skill for maintaining consistent documentation formatting
313
- - Added comprehensive developer documentation sections to CLAUDE.md
314
-
315
- ### Changed
316
-
317
- - Completely rewrote main README.md with modern centered table-based formatting
318
- - Modernized docs/README.md as comprehensive documentation hub entry point
319
- - Expanded CLAUDE.md from basic PyPI notes to comprehensive developer guide with architecture documentation
320
- - Updated supported printers table with clearer protocol and feature breakdown
321
- - Reorganized README with four detailed quick start examples (discovery, control, monitoring, files)
322
- - Simplified release workflow to use linear git history instead of timestamp versioning
323
- - Made version input required (X.Y.Z format) for releases
324
-
325
- ### Fixed
326
-
327
- - Fixed release workflow changelog duplication issue caused by orphaned timestamped commits
328
- - Fixed `format_time_from_seconds` function to properly handle float values for `estimated_time`
329
-
330
- ### Removed
331
-
332
- - Removed redundant Architecture and Requirements sections from README
333
- - Removed complex timestamp versioning logic from release workflow
334
- - Deleted orphaned timestamped tag `v1.0.0-20251122005123`
335
-
336
- ## [1.0.1] - 2025-12-24
337
-
338
- ### Fixed
339
-
340
- - Fixed Pydantic validation error for `estimated_time` field in `FFPrinterDetail` and `FFMachineInfo` models. Changed type from `int` to `float` to handle printer API responses that return fractional time values.
341
-
342
- ## [1.0.0] - 2025-01-02
343
-
344
- ### Added
345
-
346
- - Initial release of FlashForge Python API
347
- - HTTP API client for modern FlashForge printers
348
- - TCP/G-code client for legacy communication
349
- - UDP-based printer discovery service
350
- - Comprehensive async/await support throughout
351
- - Full type safety with Pydantic models
352
- - Control modules:
353
- - `Control` - Movement, LED, filtration, camera control
354
- - `JobControl` - Print job management (start/pause/resume/cancel)
355
- - `Info` - Status and machine information retrieval
356
- - `Files` - File upload/download/management
357
- - `TempControl` - Temperature settings
358
- - Support for FlashForge Adventurer 5M Series and Adventurer 4
359
- - Model-specific feature detection (LED, filtration, camera)
360
- - Comprehensive error handling and logging
361
- - Example scripts and documentation
362
-
363
- ### Documentation
364
-
365
- - Complete README with usage examples
366
- - API reference documentation
367
- - Type hints for all public APIs
368
- - Inline code documentation
369
-
370
- [Unreleased]: https://gitlab.com/GhostTypes/ff-5mp-api-py/-/compare/v3.0.0...main
371
- [3.0.0]: https://gitlab.com/GhostTypes/ff-5mp-api-py/-/compare/v1.6.0...v3.0.0
372
- [1.6.0]: https://gitlab.com/GhostTypes/ff-5mp-api-py/-/compare/v1.5.0...v1.6.0
373
- [1.5.0]: https://gitlab.com/GhostTypes/ff-5mp-api-py/-/compare/v1.4.0...v1.5.0
374
- [1.4.0]: https://gitlab.com/GhostTypes/ff-5mp-api-py/-/compare/v1.3.5...v1.4.0
375
- [1.3.5]: https://gitlab.com/GhostTypes/ff-5mp-api-py/-/compare/v1.3.4...v1.3.5
376
- [1.3.4]: https://gitlab.com/GhostTypes/ff-5mp-api-py/-/compare/v1.3.3...v1.3.4
377
- [1.3.3]: https://gitlab.com/GhostTypes/ff-5mp-api-py/-/compare/v1.3.2...v1.3.3
378
- [1.3.2]: https://gitlab.com/GhostTypes/ff-5mp-api-py/-/compare/v1.3.1...v1.3.2
379
- [1.3.1]: https://gitlab.com/GhostTypes/ff-5mp-api-py/-/compare/v1.3.0...v1.3.1
380
- [1.3.0]: https://gitlab.com/GhostTypes/ff-5mp-api-py/-/compare/v1.2.3...v1.3.0
381
- [1.2.3]: https://gitlab.com/GhostTypes/ff-5mp-api-py/-/compare/v1.2.2...v1.2.3
382
- [1.2.2]: https://gitlab.com/GhostTypes/ff-5mp-api-py/-/compare/v1.2.1...v1.2.2
383
- [1.2.1]: https://gitlab.com/GhostTypes/ff-5mp-api-py/-/compare/v1.2.0...v1.2.1
384
- [1.2.0]: https://gitlab.com/GhostTypes/ff-5mp-api-py/-/compare/v1.1.1...v1.2.0
385
- [1.1.1]: https://gitlab.com/GhostTypes/ff-5mp-api-py/-/tags/v1.1.1
386
- [1.0.2]: https://gitlab.com/GhostTypes/ff-5mp-api-py/-/tags/v1.0.2
387
- [1.0.1]: https://gitlab.com/GhostTypes/ff-5mp-api-py/-/tags/v1.0.1
388
- [1.0.0]: https://gitlab.com/GhostTypes/ff-5mp-api-py/-/tags/v1.0.0
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ## [3.1.0] - 2026-11-29
11
+
12
+ Discovery works again on Python 3.11 and 3.12 (for example the Python that OrcaSlicer includes) and on Windows. Code that uses this library does not have to change.
13
+
14
+ ### Fixed
15
+
16
+ - **Printer discovery found no printers on Python 3.11 and 3.12.** Discovery packets are empty, and on these Python versions an asyncio datagram transport does not send empty data. Discovery now uses its own UDP socket, so it sends the packets on every supported Python version (3.13 and later were not affected).
17
+ - **Discovery on Windows stopped receiving after one error.** A packet sent to a closed port comes back as "port unreachable", and the Windows event loop then stopped reading. Discovery now ignores that error and goes on reading. A failed send to one address (for example a disconnected network adapter) no longer stops the other sends.
18
+
19
+ ### Added
20
+
21
+ - `PrinterDiscovery.probe(ip_address)` asks one address directly for its printer details (model, serial, name, ports). Use it when the user knows the IP address and the broadcast does not reach the printer.
22
+ - Discovery also asks `127.0.0.1`, like the TypeScript library, so it finds an emulator or bridge on the same computer.
23
+
24
+ ## [3.0.0] - 2026-11-28
25
+
26
+ This is a major release with breaking changes. Code written for 1.x must change: see the table under "Changed (breaking)". The project moved to GitLab: https://gitlab.com/GhostTypes/ff-5mp-api-py.
27
+
28
+ ### Home Assistant users
29
+
30
+ The FlashForge integration (ff-5mp-hass) 1.6.1 and earlier does not work with this version. Integration 1.6.2 and later installs only `flashforge-python-api` 1.x, so it is not affected. If your integration shows an error that says a name "was removed in flashforge-python-api 3.0":
31
+
32
+ 1. In HACS, remove the old GhostTypes repository.
33
+ 2. Add `https://github.com/Parallel-7/ff-5mp-hass` as a custom repository.
34
+ 3. Update the integration to 1.6.2 or later and restart Home Assistant.
35
+
36
+ ### Added (migration)
37
+
38
+ - **Removed names raise a clear error.** An import of a name that 3.0 removed (`FlashForgeClient`, `FiveMClient`, `FiveMClientConnectionOptions`, `Control`, `JobControl`, `TempControl`, `Files`, `Info`, `PrinterModel`, and the AD5X and Creator 5 job parameter types) raises `RemovedInVersion3Error`, a subclass of `ImportError`. The message names the replacement and links to this changelog. Before, Python only said "cannot import name".
39
+
40
+ ### Changed (breaking)
41
+
42
+ - **One backend per printer family replaces `FlashForgeClient`.** `FlashForgeClient` (also exported as `FiveMClient`), `FiveMClientConnectionOptions`, `Control`, `JobControl`, `TempControl`, `Files` and `Info` are removed. There is no compatibility layer. Use `connect_printer()`. It returns a ready backend for the printer:
43
+ - `Adventurer5MBackend`, `Adventurer5MProBackend` and `AD5XBackend` (dual-API family: HTTP and TCP).
44
+ - `Creator5Backend` (HTTP-only family: Creator 5 and Creator 5 Pro). It has no TCP code and is not a dual-API subclass.
45
+ - `LegacyBackend` (Adventurer 3, Adventurer 4 and other TCP-only printers). It uses `FlashForgeA3Client`, `FlashForgeA4Client` or the generic TCP `FlashForgeClient`. The `force_legacy` connect option keeps the force-legacy mode.
46
+ - **Model resolution.** With a discovery result, the model comes from the discovery product ID, and the connection only checks the serial number and check code. Without one (manual IP, saved printer), the model comes from the `/detail` response of that check: PID first, then the factory model name. A legacy printer without a discovery result is identified with M115.
47
+ - **Operations that the printer cannot do raise `NotSupportedError`.** They no longer return `False` or send the command anyway. Read `backend.capabilities` to decide what to show. Parameter errors (for example a slot ID of 0) raise `InvalidParameterError` and send nothing. A failed connection raises `PrinterConnectionError` with a plain-language reason. This replaces `FlashForgeClient.last_connection_error` and `Info.last_detail_rejection`.
48
+ - **Capabilities come from one model registry.** Chamber control is Creator 5 Pro only. Filtration control is Adventurer 5M Pro only: it comes from the model, not from `/product`. The AD5X and the base 5M have no filtration control. `backend.capabilities` gives `available`, `controllable` and a `reason` for each feature. `led_control_override` and `set_feature_overrides()` are removed.
49
+ - **The light is controllable on every modern printer.** `capabilities.led` comes from the model: HTTP `lightControl_cmd` on the 5M, 5M Pro, AD5X and Creator 5 series, TCP on legacy printers. The printer drives a light with this command also when the user fitted the light and `/product` reports `lightCtrlState: 0` (the base 5M and the AD5X always report 0). There is no custom-light connect option and no TCP light path for modern printers.
50
+ - **Slot IDs are the printer's native 1-based IDs everywhere** (mappings, `configure_slot`, `slot_action`, the status model).
51
+ - **`FFMachineInfo.model_id` replaces `is_pro`, `is_ad5x`, `is_creator5` and `is_creator5_pro`.** `MachineInfoParser` moved to `flashforge.models`. `DiscoveredPrinter.model` is now a `PrinterModelId` (for example `"ad5x"`). The discovery `PrinterModel` enum is removed.
52
+ - **One parameter type per operation.** `UploadJobParams`, `LocalJobParams` and `MaterialMapping` replace `AD5XUploadParams`, `AD5XLocalJobParams`, `AD5XSingleColorJobParams`, `AD5XMaterialMapping`, `Creator5UploadParams` and `Creator5JobParams`. `upload_file()` and `start_local_job()` work on every family. On the AD5X, mappings start a multi-color print; without them the print is single-color.
53
+ - **A Creator 5 upload with mappings and `start_print=False` raises `InvalidParameterError`.** Before, it logged a warning and left the mappings out.
54
+ - **The AD5X slot color snaps to the AD5X palette and keeps the `#`.** `configure_slot` on the AD5X sent freeform hex with the `#` removed. The printer then stored and reported the bare value, so a later mapping with that color failed validation. This matches the TypeScript library. The palettes moved to `flashforge.capabilities.palettes`, and `Creator5PaletteColor` is now `PaletteColor`.
55
+ - **5M firmware with a "v" prefix uses the new upload format.** The printers report the version as `v3.1.3`. An empty or unreadable version also uses the new format.
56
+
57
+ | Before | Now |
58
+ |---|---|
59
+ | `FlashForgeClient(ip, sn, code)` + `initialize()` + `init_control()` | `await connect_printer(target, ConnectOptions(check_code=...))` |
60
+ | `client.info.get()` | `await backend.get_machine_info()` or `await backend.get_status()` |
61
+ | `client.job_control.pause_print_job()` / `resume_print_job()` / `cancel_print_job()` | `backend.pause_job()` / `resume_job()` / `cancel_job()` |
62
+ | `upload_file` / `upload_file_ad5x` / `upload_file_creator5` | `backend.upload_file(UploadJobParams(...))` |
63
+ | `print_local_file` / `start_ad5x_multi_color_job` / `start_ad5x_single_color_job` / `start_creator5_job` | `backend.start_local_job(LocalJobParams(...))` |
64
+ | `client.control.set_led_on()` / `set_led_off()` | `backend.set_led(on)` |
65
+ | `set_external_filtration_on` / `set_internal_filtration_on` / `set_filtration_off` | `backend.set_filtration("external" / "internal" / "off")` |
66
+ | `turn_camera_on()` / `turn_camera_off()` | `backend.set_camera(on)` |
67
+ | `set_speed_override` / `set_z_axis_override` / `set_*_fan_speed` | `backend.set_print_overrides(PrintOverrides(...))` |
68
+ | `client.temp_control.*` | `backend.set_extruder_temp()`, `set_bed_temp()`, `set_tool_temp()`, `set_chamber_temp()`, ... |
69
+ | `client.files.get_local_file_list()` / `get_recent_file_list()` / `get_gcode_thumbnail()` | `backend.get_local_files()` / `get_recent_files()` / `get_thumbnail()` |
70
+ | `client.tcp_client.send_raw_cmd()` | `backend.send_gcode()` |
71
+ | `client.is_pro` / `is_ad5x` / `is_creator5` / `http_only` / `led_control` / `filtration_control` | `backend.model`, `backend.family`, `backend.capabilities` |
72
+
73
+ ### Added
74
+
75
+ - **A manual IP with a check code also finds a legacy printer.** When the HTTP API does not answer at all (network error or an HTTP error status) and the model is not known, `connect_printer` tries the legacy TCP probe. If that also fails, the original HTTP error is raised. A known modern model or a printer that rejects `/detail` never probes TCP.
76
+ - **A cancelled or timed-out connect closes the connection.** When the caller cancels `connect_printer` (for example with `asyncio.wait_for`) during the TCP login, the backend or probe client is closed first, and the cancel completes at once, also when the printer does not answer the TCP login. A closed TCP client does not connect again. Before, an abandoned `~M601` login kept the socket open and held the printer's control lock.
77
+ - **Client filament palettes.** `get_palette_for_model(model)` returns a `Palette` (`colors`, `materials`, `nearest_color()`, `nearest_material()`) for a client UI: the Creator 5 palette for the Creator 5 series, else the AD5X palette. New: `CREATOR5_MATERIALS` (21 materials), `AD5X_FILAMENT_PALETTE` and `CREATOR5_FILAMENT_PALETTE`. Same API as the TypeScript and Kotlin libraries.
78
+ - **Hex colors with an alpha channel.** The palette snap accepts `#RRGGBBAA` and ignores the alpha. Before, it fell back to White.
79
+ - **`capabilities.air_quality_sensor`.** True when the status has a real air-quality (TVOC) reading: the Adventurer 5M Pro only. The base 5M and the Creator 5 series always send `tvoc: 0`, so `PrinterSnapshot.filtration.tvoc_level` is 0 for them. Use this flag to decide whether to show the reading.
80
+ - **`PrinterSnapshot` status model.** `backend.get_status()` returns one normalized status for every family: run state, temperatures (per tool, chamber only when present), fans, filtration, job progress, material station (native slot IDs), light, door (only with a real door sensor) and lifetime totals.
81
+ - **AD5X material station operations.** `AD5XBackend.slot_action()` (`ms_cmd` load, unload and cancel) and the AD5X palette (`AD5X_PALETTE`, `AD5X_MATERIALS`, `snap_to_ad5x_palette()`). The Python library did not have them before.
82
+ - **Filament load flow on the dual-API family.** `prepare_filament_load()`, `load_filament()` and `finish_filament_load()`, ported from the TypeScript library.
83
+ - **`scripts/emulator_smoke.py`** runs every backend against flashforge-emulator-v2.
84
+
85
+ ### Removed
86
+
87
+ - **TCP commands that the printers do not support.** The 5M, 5M Pro and AD5X do not support M405, M406, M240, M109 or M190. They acknowledge these commands and do nothing. These are removed:
88
+ - `turn_runout_sensor_on()` and `turn_runout_sensor_off()` on the TCP `FlashForgeClient`.
89
+ - The `wait_for` option of `set_extruder_temp()` and `set_bed_temp()` on the TCP `FlashForgeClient` and `GCodeController`. It sent M109 or M190 instead of M104 or M140, so the printer did not get the target temperature. To wait, set the temperature and then call `GCodeController.wait_for_extruder_temp()` or `wait_for_bed_temp()`. These read the temperature and work on all models.
90
+ - The `GCodes` constants `CMD_RUNOUT_SENSOR_ON`, `CMD_RUNOUT_SENSOR_OFF`, `TAKE_PICTURE`, `WAIT_FOR_HOTEND_TEMP` and `WAIT_FOR_BED_TEMP`.
91
+ - The Adventurer 3 and Adventurer 4 clients keep the `wait_for` option. They now use the new `LegacyGCodeController`. Support on these printers is not verified.
92
+
93
+ ### Fixed
94
+
95
+ - **A tool that is mapped more than once is refused.** Material mapping validation now refuses two entries with the same `toolId` and sends nothing. The printers accept such a list without an error, but keep only one of the entries (the AD5X keeps the last, the Creator 5 series the first), so the print used a slot that the caller did not expect. Several tools can still use the same slot: the printers accept this.
96
+ - **Closing a TCP client is fast.** `dispose()` sent the logout and waited for the reply. A printer that did not answer kept the socket, and the printer's control lock, open for 5 seconds. A cancelled connect then took about 10 seconds to complete, and the reply timeout opened a new connection. `dispose()` now writes the logout and closes the socket without waiting for a reply. A reply that is still pending ends when the socket closes. After `dispose()`, the client does not open a socket again.
97
+ - **A legacy upload with the wrong size is reported as a failure.** On a size mismatch the printer answers `M29` with `File Is Not Aviable` (its spelling). The upload check looked only for the correct spelling, so a damaged upload counted as a success. The check now also compares the `filesize` and `tofile.size` values in the reply.
98
+ - **A refused `/detail` request is no longer reported as a library bug.** When the printer refuses the request (LAN-only mode off, wrong serial number, wrong check code), the body has an error code and no `detail` object. `get_detail_response()` sent that body to validation, which failed, so it raised `FlashForgeResponseError` and logged "This is NOT a connectivity problem - please report it". Home Assistant then told the user to report an integration bug. A refusal is now reported as a refusal (`PrinterConnectionError` at connect, with the code and message), not as a parse failure. A body with no integer `code` still raises `FlashForgeResponseError`.
99
+ - **The Creator 5 backend never opens a TCP connection.** The Creator 5 has no TCP server. Before, `init_control()` called the TCP login after the product command, which failed.
100
+ - **Print setting changes no longer reset the other settings.** `printerCtl_cmd` sends the print speed, the Z offset and two fan speeds in one command. Each setter sent defaults for the fields it did not change: 100 % speed, 100 % fans and a Z offset of 0. So `set_speed_override(80)` also set both fans to 100 % and reset the Z offset. Below layer 2, every call also turned both fans off. The setters now send -200 for each field the caller did not set. The printer ignores this value, so the other settings stay as they are. The layer-2 fan override is removed.
101
+ - **`set_z_axis_override` documentation.** The offset is relative to the job's starting offset. It is not cumulative. The printer applies values from -5.0 to +5.0 only. Not yet verified on hardware.
102
+ - **The left cooling fan value is sent only when set.** The command always sent `coolingLeftFan: 0`. `set_print_overrides(PrintOverrides(left_cooling_fan_speed=...))` sets it on the AD5X. Other calls do not send it.
103
+ - **Chamber temperature documentation.** The documentation said that the printer limits the chamber target to 80 °C. The printer applies no limit to the value. Keep the value in a safe range.
104
+ - **More printer statuses are recognized.** The printers send status values that the library did not know: `canceling` (all models), `loading` (Creator 5 series filament load and unload), and `cloud_slicing`, `sending` and `unzipping` (5M and 5M Pro 5.x, Creator 5 1.9.2 and later). Each one became `MachineState.UNKNOWN` and logged a warning on every poll. They now map to `MachineState.BUSY`, because they are short transitional states. `canceling` does not map to `CANCELLED`, because some consumers treat `CANCELLED` as a final state.
105
+
106
+ ## [1.6.0] - 2026-09-27
107
+
108
+ This release adds a parser for sliced `.3mf` files, so you can learn which tools and materials a print uses before you upload it. It also fixes uploads that blocked the event loop or stopped after five minutes. No public signature changed, so the upgrade is safe for all users.
109
+
110
+ ### Added
111
+
112
+ - **Sliced 3MF parsing: `parse_3mf()` and the new `flashforge.threemf` subpackage.** The Creator 5 series does not report which tools a stored file uses. For that family, the only way to build correct material mappings is to read the 3MF before upload. `parse_3mf(source, *, file_name=None)` accepts a path or a binary file object and returns a frozen `ThreeMFFile`. The result holds the filaments the plate uses (`ThreeMFFilament`: material, `#RRGGBB` color, length and weight), the plate thumbnail, time and weight estimates, layer count, nozzle diameters, object names, the slicer name and version, the printer model the file was sliced for, and any slicer warnings. Each filament keeps its slicer number as `filament_id` (1-based) and carries `tool_id = filament_id - 1`, the 0-based tool id that `AD5XMaterialMapping` expects. The list holds only the filaments the plate actually uses: a file that uses only filament 3 gives one entry with `tool_id` 2. The data comes from the slice metadata in the archive, with the plate G-code header as a fallback. Tested with output from Orca-FlashForge, OrcaSlicer, Flash Studio, and Snapmaker Orca.
113
+
114
+ - **Clear errors for files a printer cannot print as one job.** All 3MF errors subclass `ThreeMFError`, which subclasses `FlashForgeError`. `ThreeMFFormatError` means the file is not a readable archive, has a corrupt entry, or has malformed or oversized slice metadata. `ThreeMFNotSlicedError` means the file is a project file with no sliced G-code. `ThreeMFMultiplePlatesError` means the file holds more than one sliced plate; it carries `plate_count`. Nobody knows which plate the printer prints from such a file, so the parser rejects it. Export a single plate from the slicer instead. A missing path raises `FileNotFoundError`.
115
+
116
+ - **`PrinterFamily` and `printer_family_from_model_id()`.** `ThreeMFFile.printer_family` maps the slicer's printer-model id to `adventurer_5m`, `adventurer_5m_pro`, `ad5x`, `creator_5`, or `creator_5_pro`, so you can warn when a file was sliced for a different printer. An unknown id gives `None`.
117
+
118
+ - **`translate_warning()`.** OrcaSlicer-family slicers store warnings as raw keys such as `bed_temperature_too_high_than_filament`. The parser turns each key into readable text in `ThreeMFWarning.message`, and `translate_warning()` is available on its own. An unknown key falls back to a readable form of the key. The table matches the one in the TypeScript `slicer-meta` package.
119
+
120
+ - **Bounded reads.** The parser reads only the slice metadata (limit 4 MB), the plate thumbnail (limit 8 MB), and the start of the plate G-code (limit 1 MB). It never decompresses the whole G-code, so a large or hostile file costs a fixed amount of memory. The limits are available as `MAX_SLICE_INFO_BYTES`, `MAX_THUMBNAIL_BYTES`, and `MAX_GCODE_HEADER_BYTES`. The parser is synchronous: in asyncio code, call it with `await asyncio.to_thread(parse_3mf, path)`.
121
+
122
+ ### Fixed
123
+
124
+ - **Uploads no longer block the event loop.** `upload_file`, `upload_file_ad5x`, and `upload_file_creator5` opened and measured the local file on the event loop. That stalled every other task during the call, and Home Assistant reported it as a blocking `open()` call. The three methods now open and measure the file in a worker thread.
125
+
126
+ - **Large uploads over printer Wi-Fi no longer stop after five minutes.** The upload methods used aiohttp's default timeout, which caps the whole request at five minutes. A large file over a slow Wi-Fi link could not finish in that time. Uploads now use `UPLOAD_TIMEOUT`, which has no total cap. A 30-second connect limit and a 300-second read limit still catch a printer that stops answering.
127
+
128
+ - **A path that is not a regular file now returns `False`.** If you pass a directory (or any other non-file path) to an upload method, the method returns `False`, the same as for a missing file.
129
+
130
+ ## [1.5.0] - 2026-09-26
131
+
132
+ ### Added
133
+
134
+ - **`Creator5UploadParams.material_mappings`.** The Creator 5 firmware reads a base64 `materialMappings` upload header, the same format as the AD5X, and applies it when the upload starts the print (confirmed by firmware analysis of 1.9.6 and 1.9.8, Creator 5 and Creator 5 Pro). `upload_file_creator5` now sends the header when `start_print` is true and the mappings are valid. With `start_print` false the mappings are not sent and a warning is logged: the firmware keeps upload mappings in memory until the next print ends, so they would apply to a later, unrelated print. The recommended flow is unchanged: upload without starting, then call `start_creator5_job` with the mappings.
135
+
136
+ ### Changed
137
+
138
+ - **Creator 5 documentation corrected.** The firmware only logs `useMatlStation` and `gcodeToolCnt` on upload. `/printGcode` applies mappings to any file on the printer, not only the last upload. Without mappings, each tool prints from the slot with the slicer's filament number (filament 1 prints from slot 1), whatever is loaded there, so send a mapping for every tool, including a single-tool print. Mappings take effect only for a `.3mf` file.
139
+
140
+ ### Fixed
141
+
142
+ - **Concurrent commands no longer interleave on the printer's HTTP API.** The Python port had no serialization on its command paths, so two commands sent at the same moment (say a light toggle racing a pause) could overlap in flight, and the printer — which handles one command at a time — could drop or mis-acknowledge one. Every command-submission POST (`/control`, `/product`, `/printGcode`) now holds one FIFO lock, so commands run one at a time, in the order callers sent them. Uploads (`/uploadGcode`) and read/poll requests (`/detail`, `/gcodeList`, `/gcodeThumb`, camera probes) stay outside the lock on purpose: an upload can run for minutes, and a pause or stop must never queue behind one. A command sent after a failing one still goes through; the lock releases on error. Matches the parallel fix in `ff-5mp-api-ts`. No public API changed.
143
+
144
+ ## [1.4.0] - 2026-08-10
145
+
146
+ ### Fixed
147
+
148
+ - **`completion_time` no longer recedes while a print is paused.** It was derived as `datetime.now() + estimated_time` on every parse, which is only stable while the firmware is counting `estimatedTime` down. It isn't: the field freezes the moment the print stops advancing, so with the second term fixed and the first still moving, the derived timestamp stepped forward one minute per minute — after an hour of a clog pause it claimed the print would finish an hour later than it had when the pause began, and it never stopped receding. `completion_time` is now `None` unless `machine_state` is `PRINTING` — `HEATING` is excluded for the same reason as the paused states, since the pre-print warmup does not advance the job either and drifts identically, just for minutes rather than hours. Found while checking whether the Creator 5 Pro clog fix in 1.3.5 left the ETA sensible; the same derivation exists in `ff-5mp-api-ts` and in four display sites across FlashForgeUI-Electron and FlashForgeWebUI, all fixed alongside. It originates in the C# `ff-5mp-api` (`MachineInfo.cs:210`), which every port inherited it from.
149
+
150
+ ### Changed
151
+
152
+ - **BREAKING: `FFMachineInfo.completion_time` is now `datetime | None`** (was `datetime`, defaulting to `datetime.now()`). Consumers that read it without a `None` check need one. `print_eta` and `estimated_time` are unchanged and stay correct in every state — the remaining *duration* was never wrong, only its conversion to an absolute timestamp. Prefer them where a duration will do.
153
+
154
+ ## [1.3.5] - 2026-08-08
155
+
156
+ ### Fixed
157
+
158
+ - **A paused Creator 5 Pro no longer reports as "unknown".** The printer sends `status: "pause"`, while the mapping only knew the documented `"pausing"` and `"paused"` — so every pause fell through to `MachineState.UNKNOWN`. In Home Assistant that is the one state that says nothing, and it appeared at exactly the wrong moment: the printer pauses itself when it detects a clog, so the sensor went blank precisely when the user needed to know why the print had stopped. Found in a Home Assistant log carrying 84 `Unknown machine status received: 'pause'` warnings over a single day (pid 41, firmware 1.9.4). `"pause"` now maps to `PAUSED`; `"paused"` still does, because firmware reporting one is no reason to drop the other.
159
+
160
+ - **`status: "downloading"` is mapped too.** Reported while a file is being transferred to the printer, and likewise unmapped until now. It maps to `BUSY` rather than to a new enum member on purpose: a consumer that pins this enum to a fixed list breaks when a member appears, and mapping onto an existing state cannot break anyone. (`ff-5mp-hass` is not such a consumer — its `device_class=ENUM` sensor derives its `options` from `MachineState` itself, so a new member would reach it for free.) A dedicated `DOWNLOADING` state is worth discussing on its merits; it is not a bugfix, and it does not belong in a patch release.
161
+
162
+ ## [1.3.4] - 2026-07-26
163
+
164
+ ### Fixed
165
+
166
+ - **A single out-of-range field no longer costs the caller the entire `/detail` response.** A Creator 5 with no heated chamber reports `chamberTemp: -108` — the firmware's "this sensor does not exist" sentinel, a sibling of the `-100` this library itself sends as `TEMP_OFF`. `FFPrinterDetail.chamber_temp` carried `ge=-50`, so that one value failed validation for the whole model, `get_detail_response` returned `None`, and `ff-5mp-hass` reported an unreachable printer. Three releases went into `ff-5mp-hass#18` on the assumption it was a network or credential problem. The temperature fields now map any value at or below `-50` to `None`, so "no sensor" reads as "not reported" rather than as a `-108 °C` reading or a hard failure; `MachineInfoParser` exposes this as the new `FFMachineInfo.has_chamber_sensor`, which consumers should gate chamber entities on instead of the Creator 5 model family (the chamber is an option within it, not a family trait).
167
+
168
+ - **Every remaining range constraint was removed from inbound models, not just the one that was reported.** Fixing `chamberTemp` alone would only have relocated the next outage: `tvoc`, `printSpeedAdjust`, `zAxisCompensation`, `fillAmount`, `remainingDiskSpace`, `nozzleCnt` and ~20 more each carried a `ge`/`le` that could fail the entire response on a firmware revision or an unusual state. Pydantic validates a model all-or-nothing, so a constraint on a field nobody reads is enough to take a consumer down. `FFPrinterDetail`, `Temperature`, `SlotInfo`, `MatlStationInfo`, `IndepMatlInfo`, `FFGcodeToolData`, and `FFGcodeFileEntry` now validate types but not value ranges. Outbound request models (`AD5X*Params`, `Creator5*Params`, `FilamentArgs`, `AD5XMaterialMapping`) keep their constraints, where a bad value is our own bug rather than a firmware difference. This matches the TypeScript client (`ff-5mp-api-ts`), which takes what it needs from a response and has never hit this class of failure.
169
+
170
+ - **Nested inbound models no longer fail the parent over a missing or unusual field.** `SlotInfo` required `hasFilament`, `materialColor`, `materialName`, and `slotId`, so one absent attribute on one slot failed the whole `/detail` response; all four are now defaulted. Its hex-color validator *raised* on anything that was not `#RRGGBB` or empty — it now normalizes (expanding `#RGB`, adding a missing `#`) and degrades to an empty string, because an unrecognized color should cost a swatch its color, not cost the caller every entity. `MatlStationInfo.slot_infos` carried `min_length=1`, which made an explicitly empty `slotInfos: []` — a station with nothing loaded — invalid, and `max_length=4`, which would have failed on any future larger station.
171
+
172
+ ### Added
173
+
174
+ - **`FlashForgeResponseError`, so callers can tell "unreadable answer" from "no answer".** Every failure path returned `None`, which meant a schema mismatch was indistinguishable from an unreachable printer — the reason `ff-5mp-hass#18` spent three releases pointing its reporter at the network. `get_detail_response()` now *raises* when the printer answered with a body that failed validation, and still returns `None` when the request never got through. `info.get()` raises the same error when a validated payload cannot be converted into `FFMachineInfo`. The convenience wrappers (`is_printing`, `get_status`, `get_machine_state`) keep their documented fallback returns and absorb it, so only callers that asked for the distinction have to handle it.
175
+
176
+ - **`Info.get_detail_raw()`**, returning the decoded `/detail` JSON with no model validation. This lets a consumer read identity fields — above all `pid` — without first validating ~50 unrelated fields, so a supported printer can no longer be rejected because of a field that has nothing to do with whether it is supported.
177
+
178
+ - **`FFMachineInfo.has_chamber_sensor`**, set from whether the printer actually reported a chamber temperature.
179
+
180
+ ### Changed
181
+
182
+ - **`__init__.py` reported `__version__ = "1.3.1"` while `pyproject.toml` said `1.3.3`.** Both now read `1.3.4`.
183
+
184
+ - **`CLAUDE.md`'s "Why TCP Bootstrap Is Still Required for Modern Printers" section described behavior the library deliberately does not have.** It claimed `client.initialize()` performs a TCP `M115` alongside the authenticated `/detail` call, but `verify_connection()` has decided `http_only` from the parsed model *before* touching TCP since the Creator 5 work — that family exposes no service on 8899, where an `M115` would hang until the connect timeout rather than fail fast. Model detection is PID-based end to end: the UDP discovery packet before pairing, `/detail` after. Rewritten as "Model Detection Without TCP", with the `http_only` guard stated as the rule and the two remaining ungated legacy call sites (`init_control`, `get_temperatures`, neither used by `ff-5mp-hass`) flagged. No code change — the guard and `tests/test_http_only_guard.py` were already correct; the document that exists to stop agents reintroducing TCP was the thing telling them to.
185
+
186
+ ## [1.3.3] - 2026-07-26
187
+
188
+ ### Changed
189
+
190
+ - **Diagnostic output now goes to the `logging` module instead of `print()`.** 95 `print()` calls across 10 modules were the library's only record of why an operation failed — and under Home Assistant, the largest consumer, stdout reaches nowhere the user can see. Every silent failure therefore looked identical from the outside: a `/detail` response the library could not parse, an unreachable printer, and a rejected check code all produced the same bare `None` or `False` with no explanation anywhere. That is the ambiguity behind both reports on `ff-5mp-hass#18`, where one reporter concluded their check code was wrong and another concluded the integration needed TCP port 8899; neither could see the actual cause. Failures and refused commands now log at `WARNING`, request/response tracing at `DEBUG`, under per-module loggers (`flashforge.api.controls.info`, `…job_control`, and so on) so consumers can raise the level for one area alone. Two intentional exceptions remain on stdout: `FlashForgePrinterDiscovery.print_debug_info()`, whose entire purpose is to dump a hex/ASCII view for a human, and the `_async_main` CLI demo.
191
+
192
+ ### Security
193
+
194
+ - **Credentials, network identifiers, and cloud registration codes are redacted from logs.** Moving diagnostics into `logging` would otherwise have written secrets to a file users routinely paste into bug reports. The upload paths logged their full HTTP headers — including `serialNumber` and `checkCode`, which together are complete control of the printer over the LAN API — and `send_control_command` printed its whole payload, credentials included, on *every single command*. The new `flashforge.api.misc.redaction` helpers mask `serialNumber`, `checkCode`, `macAddr`, `ipAddr`, `flashRegisterCode`, and `polarRegisterCode` (in both firmware camelCase and library snake_case, recursing into nested structures) before any value can be formatted into a log record. The key set deliberately matches what `ff-5mp-hass` already strips from its diagnostics download, so a log paste and a diagnostics upload cannot disagree about what is safe to share.
195
+
196
+ ## [1.3.2] - 2026-07-26
197
+
198
+ ### Fixed
199
+
200
+ - **A firmware field this library has not seen no longer presents to the user as a wrong check code.** `Product`, `ProductResponse`, `ThumbnailResponse`, and `GenericResponse` — the envelope every inbound response inherits — were `extra="forbid"`, so one unrecognized key raised `ValidationError`. `send_product_command` caught it and returned a bare `False`, which is exactly what a printer refusing the credentials returns; `ff-5mp-hass` turns that into "the check code is incorrect". The same trap sat one level deeper on `/detail`: `FFPrinterDetail` has been `extra="allow"` since 1.3.0, but its children `MatlStationInfo`, `SlotInfo`, `IndepMatlInfo`, and `FFGcodeToolData` still forbade extras, and a child that rejects a field fails the whole response — most likely on a 4-head Creator 5 Pro reporting four loaded slots, the model least covered by existing fixtures. All inbound models now allow extras. Outbound request-parameter models (`AD5X*Params`, `Creator5*Params`, `FilamentArgs`) and the internally constructed `FFMachineInfo` / `Temperature` keep `extra="forbid"`, where it catches our own typos rather than a firmware revision. `send_product_command` now logs the `ValidationError` distinctly instead of letting an unparsed response impersonate rejected credentials. Reported as `ff-5mp-hass#18`.
201
+
202
+ - **`FFMachineInfo.has_matl_station` no longer misses the Material Station on the Creator 5 series.** It was a straight copy of the raw `hasMatlStation` value from `/detail`, which is an AD5X-only field — a Creator 5 Pro omits it entirely (verified on real hardware, pid 41, firmware 1.9.4) while reporting a fully populated `matlStationInfo` with four loaded slots. It therefore parsed as `None`, and consumers gating on it saw no station on exactly the models that have one. The parser already computed the correct value for its own AD5X heuristic (flag `is True` OR `slot_cnt > 0` OR non-empty `slot_infos`) and then discarded it; that derived value is now what the property exposes. Its type narrows from `bool | None` to `bool` — a capability has no "unknown" state, and offering one is what allowed an unreported flag to read as absent hardware. `FFPrinterDetail.has_matl_station` still carries the untouched firmware value.
203
+
204
+ - **`/gcodeList` no longer loses every file's metadata when the firmware adds a field.** `GCodeListResponse` and `FFGcodeFileEntry` were `extra="forbid"`, and `Files.get_recent_file_list()` caught the resulting `ValidationError` and fell back to a names-only list — `printing_time=0` and every other field `None`, for every file. One unrecognized key anywhere in the payload was therefore enough to silently strip print time, filament weight, and the per-tool material data on all models, and the result is byte-for-byte what a printer that genuinely reports names only looks like. Both models now use `extra="allow"` (matching `FFPrinterDetail`), and the remaining fallback logs a warning naming what was lost instead of degrading in silence.
205
+
206
+ ## [1.3.1] - 2026-06-28
207
+
208
+ ### Fixed
209
+
210
+ - **README "Supported Printers" table now lists the Creator 5 and Creator 5 Pro** that shipped in 1.3.0 (the table predated the Creator 5 work and omitted them). The Capabilities section now also reflects per-nozzle and chamber temperature control and the shared AD5X / Creator 5 material-station surface.
211
+
212
+ ## [1.3.0] - 2026-06-28
213
+
214
+ ### Added
215
+
216
+ - **Creator 5 / Creator 5 Pro support.** The library now detects and fully drives the Creator 5 and Creator 5 Pro (firmware PIDs `40` / `41`) over HTTP, bringing the Python port to parity with `ff-5mp-api-ts` v1.6.1 for these models. The port previously detected these printers via USB product ID during discovery but could not control them.
217
+ - **HTTP-only mode** for printers without a legacy TCP/8899 service (Creator 5 family). `FlashForgeClient` now exposes `is_creator5`, `is_creator5_pro`, and `http_only`; on an HTTP-only printer it skips the TCP bootstrap handshake and guards TCP-delegating control/temperature methods (`can_use_tcp`) so they no-op cleanly instead of hanging on a dead socket.
218
+ - **Structured Creator 5 machine info.** `FFMachineInfo` now surfaces `model`, `tool_temps` (per-nozzle), `nozzle_count`, `chamber`, and capability flags `has_camera`, `has_lidar`, and `has_door_sensor`; raw `/detail` fields `nozzle_temps`, `nozzle_target_temps`, and `lidar` are parsed on `FFPrinterDetail`.
219
+ - **HTTP temperature control transport** (`temperatureCtl_cmd`) for modern printers: `set_tool_temp`, `set_tool_temps`, `cancel_tool_temp` (per-nozzle, via the `nozzles[]` array), and `set_chamber_temp` / `cancel_chamber_temp` (Creator 5 only).
220
+ - **`creator5_palette`** — 24-entry Creator 5 color palette with CIEDE2000 nearest-color snapping (`snap_to_creator5_palette`). The color math was fuzz-verified against the TypeScript reference build across 4000 random RGB inputs with zero mismatches.
221
+ - **`configure_slot`** (`msConfig_cmd`) for material-station slot configuration, with model-gated color formatting: the Creator 5 snaps the color to its palette (sending `#RRGGBB` with the `#`), while the AD5X sends freeform `#`-stripped hex as before.
222
+ - **Creator 5 print-start and upload flows:** `start_creator5_job` (`/printGcode`) and `upload_file_creator5` (`/uploadGcode`) with the C5-native request shapes (no `firstLayerInspection`; booleans as the strings `"true"`/`"false"`; materials mapped at print-start rather than upload). New `Creator5JobParams` and `Creator5UploadParams` models.
223
+
224
+ ### Fixed
225
+
226
+ - **`_is_new_firmware_version` no longer misreads the Creator 5 (and AD5X) as "old firmware".** These models always use the new payload/header format and their firmware versioning (e.g. the C5 reports `1.9.2`) isn't comparable to the 5M family's `3.x` line, so the numeric `3.1.3` threshold now short-circuits to the new format for them. Previously a Creator 5 would send a malformed legacy `/printGcode` body.
227
+ - **`get_file_list` / `get_local_file_list` no longer hang on HTTP-only printers.** They now fall back to the HTTP `/gcodeList` recent-file list (mirroring `Files.ts`) instead of blocking for ~10s on the dead TCP/8899 socket.
228
+ - **Creator 5 Pro is no longer mis-classified as a 5M Pro** by the legacy `"Pro" in name` heuristic when no firmware `pid` is present; the Creator 5 family is now checked first.
229
+
230
+ ### Changed
231
+
232
+ - `AD5XMaterialMapping` is reused as the shared material-mapping type for both the AD5X and Creator 5 flows (both use the same 5-field wire shape). The two per-model validators now delegate to a single shared `_validate_mappings` helper.
233
+ - `set_chamber_temp` / `cancel_chamber_temp` are gated to Creator 5 / Creator 5 Pro (they return `False` on other models). This is a deliberate, documented divergence from the TypeScript client, which sends the chamber command unconditionally; see `docs/parity.md`.
234
+ ## [1.2.3] - 2026-05-08
235
+
236
+ ### Fixed
237
+
238
+ - Printer model detection (`is_pro`, `is_ad5x` on `FFMachineInfo`) now reads the firmware-set integer `pid` field on `/detail` instead of string-matching the user-mutable `name` field. Renaming an Adventurer 5M / 5M Pro / AD5X via the LCD or cloud no longer breaks model detection in downstream consumers (Home Assistant, Electron UI, Web UI). Falls back to the legacy name+capability heuristic when `pid` is absent so older firmware still works. Reported in [ff-5mp-hass#13](https://github.com/GhostTypes/ff-5mp-hass/issues/13).
239
+
240
+ ### Added
241
+
242
+ - `FFMachineInfo.pid: int | None` — the raw firmware PID exposed for consumers that want to do their own model-class gating. Known modern HTTP-capable PIDs: `35` (Adventurer 5M), `36` (5M Pro), `38` (AD5X).
243
+
244
+ ## [1.2.2] - 2026-04-27
245
+
246
+ ### Fixed
247
+
248
+ - Replaced `netifaces` (source-only on PyPI) with `ifaddr` (pure-Python, wheels everywhere) for network interface enumeration. Fixes installation failure on Python 3.14 / Home Assistant 2026.4.x where `netifaces==0.11.0` cannot build, which previously caused `from flashforge import ...` to raise `ImportError` at module load and broke the Home Assistant config flow with "Invalid handler specified" — even for manual setup paths that didn't use discovery. Reported in [ff-5mp-hass#10](https://github.com/GhostTypes/ff-5mp-hass/issues/10).
249
+ - Synced `flashforge.__version__` with `pyproject.toml` (was stuck at `1.1.1`).
250
+
251
+ ### Changed
252
+
253
+ - Added Python 3.14 to the supported versions classifier list.
254
+
255
+ ## [1.2.1] - 2026-03-23
256
+
257
+ ### Fixed
258
+
259
+ - Increased `currentPrintSpeed` and `printSpeedAdjust` validation limit from 200 to 1000 to support AD5X printers reporting speeds up to 500 (contributed by @spawnegit)
260
+ - Replaced per-request `aiohttp.ClientSession()` creation with shared HTTP session across all control modules (`control.py`, `files.py`, `info.py`, `job_control.py`), fixing connection churn and respecting the configured timeout
261
+ - Increased default HTTP timeout from 5s to 15s to prevent timeouts during print operations
262
+
263
+ ### Changed
264
+
265
+ - Extracted duplicate `try/except aiohttp.ContentTypeError` JSON parsing pattern into a shared `json_from_response()` helper in `api/network/utils.py`
266
+ - Release workflow now includes curated changelog entry alongside auto-generated commit notes in GitHub Releases
267
+
268
+ ## [1.2.0] - 2026-03-21
269
+
270
+ ### Added
271
+
272
+ - `CAMERA_STREAM_PORT` - exported constant for the known FlashForge OEM MJPEG stream port
273
+ - `FlashForgeClient.detect_camera_stream()` - probes `http://<printer-ip>:8080/?action=stream` and falls back from `HEAD` to `GET` when firmware does not report `camera_stream_url`
274
+ - Pytest coverage for camera stream probing success, `HEAD` timeout fallback, and no-camera behavior
275
+ - `FlashForgeA4Client` - dedicated Adventurer 4 Lite / Pro TCP client aligned with the documented M601 and M115 protocol behavior
276
+ - `A4BuildVolume`, `A4FileEntry`, and `A4PrinterInfo` for typed Adventurer 4 responses
277
+
278
+ ### Changed
279
+
280
+ - Discovery PID fallback now recognizes Adventurer 4 Lite (`0x0016`) as well as Adventurer 4 Pro (`0x001E`)
281
+ - README guidance now points Adventurer 3 / 4 users at the dedicated TCP clients instead of only the generic legacy layer
282
+
283
+ ## [1.1.1] - 2026-03-09
284
+
285
+ ### Fixed
286
+
287
+ - Fixed AD5X `/detail` response parsing for newer firmware fields including `camera`, `clearFanStatus`, `coordinate`, `extrudeCtrl`, and `moveCtrl`
288
+ - Made raw printer detail parsing tolerant of additional future firmware fields instead of failing validation
289
+ - Added regression coverage for extended AD5X detail payloads
290
+
291
+ ## [1.1.0] - 2026-03-08
292
+
293
+ ### Added
294
+
295
+ - `FlashForgeA3Client` — full Adventurer 3 TCP client with dedicated G-code protocol support
296
+ - `A3GCodeController` — A3-specific G-code command controller
297
+ - `FlashForgeClient.camera_stream_url` — caches the OEM camera stream URL reported by the printer in machine-info responses
298
+ - `thumbnail_info` parser for handling printer thumbnail responses
299
+ - New G-code commands in `gcodes.py` for broader printer compatibility
300
+ - Test coverage for A3 client, camera stream URL caching, and machine-info model parity
301
+ - mypy exclude configuration for tests and examples
302
+
303
+ ### Changed
304
+
305
+ - Major refactor of `discovery.py` for improved reliability and cross-printer compatibility
306
+ - `tcp_client.py` substantially reworked for better connection handling and parser coverage
307
+ - Parsers (`endstop_status`, `location_info`, `print_status`, `printer_info`, `temp_info`) updated for improved type safety and correctness
308
+ - `client.py` extended with camera stream URL caching from machine-info responses
309
+ - `control.py` updated with refined API surface
310
+ - `info.py` refactored for cleaner response handling
311
+ - Ruff linter configuration updated to use `[tool.ruff.lint]` table (ruff >=0.1.0 syntax)
312
+ - Package exports in `__init__.py` updated to include new A3 types and client
313
+ - TCP module exports updated to expose A3 client and controller
314
+
315
+ ### Fixed
316
+
317
+ - Discovery reliability improvements from `discovery.py` refactor
318
+ - TCP client parser edge cases addressed across all response types
319
+
320
+ ## [1.0.2] - 2025-12-26
321
+
322
+ ### Added
323
+
324
+ - Added LAN-only mode requirement notice in README Quick Start section with link to official FlashForge documentation
325
+ - Added dependency badges for aiohttp, pydantic, netifaces, requests, and pillow to README header
326
+ - Added readme-generator skill for maintaining consistent documentation formatting
327
+ - Added comprehensive developer documentation sections to CLAUDE.md
328
+
329
+ ### Changed
330
+
331
+ - Completely rewrote main README.md with modern centered table-based formatting
332
+ - Modernized docs/README.md as comprehensive documentation hub entry point
333
+ - Expanded CLAUDE.md from basic PyPI notes to comprehensive developer guide with architecture documentation
334
+ - Updated supported printers table with clearer protocol and feature breakdown
335
+ - Reorganized README with four detailed quick start examples (discovery, control, monitoring, files)
336
+ - Simplified release workflow to use linear git history instead of timestamp versioning
337
+ - Made version input required (X.Y.Z format) for releases
338
+
339
+ ### Fixed
340
+
341
+ - Fixed release workflow changelog duplication issue caused by orphaned timestamped commits
342
+ - Fixed `format_time_from_seconds` function to properly handle float values for `estimated_time`
343
+
344
+ ### Removed
345
+
346
+ - Removed redundant Architecture and Requirements sections from README
347
+ - Removed complex timestamp versioning logic from release workflow
348
+ - Deleted orphaned timestamped tag `v1.0.0-20251122005123`
349
+
350
+ ## [1.0.1] - 2025-12-24
351
+
352
+ ### Fixed
353
+
354
+ - Fixed Pydantic validation error for `estimated_time` field in `FFPrinterDetail` and `FFMachineInfo` models. Changed type from `int` to `float` to handle printer API responses that return fractional time values.
355
+
356
+ ## [1.0.0] - 2025-01-02
357
+
358
+ ### Added
359
+
360
+ - Initial release of FlashForge Python API
361
+ - HTTP API client for modern FlashForge printers
362
+ - TCP/G-code client for legacy communication
363
+ - UDP-based printer discovery service
364
+ - Comprehensive async/await support throughout
365
+ - Full type safety with Pydantic models
366
+ - Control modules:
367
+ - `Control` - Movement, LED, filtration, camera control
368
+ - `JobControl` - Print job management (start/pause/resume/cancel)
369
+ - `Info` - Status and machine information retrieval
370
+ - `Files` - File upload/download/management
371
+ - `TempControl` - Temperature settings
372
+ - Support for FlashForge Adventurer 5M Series and Adventurer 4
373
+ - Model-specific feature detection (LED, filtration, camera)
374
+ - Comprehensive error handling and logging
375
+ - Example scripts and documentation
376
+
377
+ ### Documentation
378
+
379
+ - Complete README with usage examples
380
+ - API reference documentation
381
+ - Type hints for all public APIs
382
+ - Inline code documentation
383
+
384
+ [Unreleased]: https://gitlab.com/GhostTypes/ff-5mp-api-py/-/compare/v3.1.0...main
385
+ [3.1.0]: https://gitlab.com/GhostTypes/ff-5mp-api-py/-/compare/v3.0.0...v3.1.0
386
+ [3.0.0]: https://gitlab.com/GhostTypes/ff-5mp-api-py/-/compare/v1.6.0...v3.0.0
387
+ [1.6.0]: https://gitlab.com/GhostTypes/ff-5mp-api-py/-/compare/v1.5.0...v1.6.0
388
+ [1.5.0]: https://gitlab.com/GhostTypes/ff-5mp-api-py/-/compare/v1.4.0...v1.5.0
389
+ [1.4.0]: https://gitlab.com/GhostTypes/ff-5mp-api-py/-/compare/v1.3.5...v1.4.0
390
+ [1.3.5]: https://gitlab.com/GhostTypes/ff-5mp-api-py/-/compare/v1.3.4...v1.3.5
391
+ [1.3.4]: https://gitlab.com/GhostTypes/ff-5mp-api-py/-/compare/v1.3.3...v1.3.4
392
+ [1.3.3]: https://gitlab.com/GhostTypes/ff-5mp-api-py/-/compare/v1.3.2...v1.3.3
393
+ [1.3.2]: https://gitlab.com/GhostTypes/ff-5mp-api-py/-/compare/v1.3.1...v1.3.2
394
+ [1.3.1]: https://gitlab.com/GhostTypes/ff-5mp-api-py/-/compare/v1.3.0...v1.3.1
395
+ [1.3.0]: https://gitlab.com/GhostTypes/ff-5mp-api-py/-/compare/v1.2.3...v1.3.0
396
+ [1.2.3]: https://gitlab.com/GhostTypes/ff-5mp-api-py/-/compare/v1.2.2...v1.2.3
397
+ [1.2.2]: https://gitlab.com/GhostTypes/ff-5mp-api-py/-/compare/v1.2.1...v1.2.2
398
+ [1.2.1]: https://gitlab.com/GhostTypes/ff-5mp-api-py/-/compare/v1.2.0...v1.2.1
399
+ [1.2.0]: https://gitlab.com/GhostTypes/ff-5mp-api-py/-/compare/v1.1.1...v1.2.0
400
+ [1.1.1]: https://gitlab.com/GhostTypes/ff-5mp-api-py/-/tags/v1.1.1
401
+ [1.0.2]: https://gitlab.com/GhostTypes/ff-5mp-api-py/-/tags/v1.0.2
402
+ [1.0.1]: https://gitlab.com/GhostTypes/ff-5mp-api-py/-/tags/v1.0.1
403
+ [1.0.0]: https://gitlab.com/GhostTypes/ff-5mp-api-py/-/tags/v1.0.0