flashforge-python-api 1.6.0__py3-none-any.whl → 3.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. flashforge/__init__.py +337 -256
  2. flashforge/_removed.py +65 -0
  3. flashforge/api/__init__.py +12 -18
  4. flashforge/api/constants/__init__.py +11 -11
  5. flashforge/api/constants/commands.py +18 -15
  6. flashforge/api/constants/endpoints.py +11 -11
  7. flashforge/api/misc/__init__.py +8 -8
  8. flashforge/api/network/__init__.py +11 -11
  9. flashforge/api/network/utils.py +71 -71
  10. flashforge/backends/__init__.py +80 -0
  11. flashforge/backends/connect.py +275 -0
  12. flashforge/backends/creator5_backend.py +191 -0
  13. flashforge/backends/dual_api_backend.py +170 -0
  14. flashforge/backends/dual_api_models.py +145 -0
  15. flashforge/backends/http_core.py +431 -0
  16. flashforge/backends/http_printer_backend.py +254 -0
  17. flashforge/backends/legacy_backend.py +436 -0
  18. flashforge/backends/printer_backend.py +217 -0
  19. flashforge/backends/types.py +125 -0
  20. flashforge/capabilities/__init__.py +98 -0
  21. flashforge/capabilities/models.py +67 -0
  22. flashforge/capabilities/palettes/__init__.py +28 -0
  23. flashforge/capabilities/palettes/ad5x_palette.py +70 -0
  24. flashforge/capabilities/palettes/creator5_palette.py +78 -0
  25. flashforge/capabilities/palettes/palette.py +54 -0
  26. flashforge/{api/controls/creator5_palette.py → capabilities/palettes/palette_snap.py} +226 -258
  27. flashforge/capabilities/printer_capabilities.py +145 -0
  28. flashforge/capabilities/registry.py +125 -0
  29. flashforge/capabilities/resolve_model.py +61 -0
  30. flashforge/discovery/__init__.py +39 -39
  31. flashforge/discovery/discovery.py +730 -763
  32. flashforge/exceptions.py +90 -51
  33. flashforge/models/__init__.py +52 -55
  34. flashforge/models/machine_info.py +540 -543
  35. flashforge/{api/controls/info.py → models/machine_info_parser.py} +35 -242
  36. flashforge/models/responses.py +119 -254
  37. flashforge/status/__init__.py +43 -0
  38. flashforge/status/printer_snapshot.py +396 -0
  39. flashforge/tcp/__init__.py +55 -54
  40. flashforge/tcp/a3_client.py +427 -427
  41. flashforge/tcp/a4_client.py +304 -304
  42. flashforge/tcp/ff_client.py +609 -590
  43. flashforge/tcp/gcode/__init__.py +15 -13
  44. flashforge/tcp/gcode/a3_gcode_controller.py +109 -109
  45. flashforge/tcp/gcode/gcode_controller.py +292 -308
  46. flashforge/tcp/gcode/gcodes.py +81 -99
  47. flashforge/tcp/gcode/legacy_gcode_controller.py +56 -0
  48. flashforge/tcp/parsers/__init__.py +27 -27
  49. flashforge/tcp/parsers/endstop_status.py +248 -248
  50. flashforge/tcp/parsers/location_info.py +83 -83
  51. flashforge/tcp/parsers/print_status.py +180 -180
  52. flashforge/tcp/parsers/printer_info.py +146 -146
  53. flashforge/tcp/parsers/temp_info.py +218 -218
  54. flashforge/tcp/parsers/thumbnail_info.py +274 -274
  55. flashforge/tcp/tcp_client.py +52 -12
  56. flashforge/threemf/__init__.py +40 -40
  57. flashforge/threemf/parser.py +560 -560
  58. flashforge/threemf/warnings.py +58 -58
  59. {flashforge_python_api-1.6.0.dist-info → flashforge_python_api-3.0.0.dist-info}/METADATA +46 -47
  60. flashforge_python_api-3.0.0.dist-info/RECORD +69 -0
  61. {flashforge_python_api-1.6.0.dist-info → flashforge_python_api-3.0.0.dist-info}/WHEEL +1 -1
  62. {flashforge_python_api-1.6.0.dist-info → flashforge_python_api-3.0.0.dist-info}/licenses/LICENSE +21 -21
  63. flashforge/api/controls/__init__.py +0 -17
  64. flashforge/api/controls/control.py +0 -413
  65. flashforge/api/controls/files.py +0 -210
  66. flashforge/api/controls/job_control.py +0 -896
  67. flashforge/api/controls/temp_control.py +0 -309
  68. flashforge/client.py +0 -609
  69. flashforge_python_api-1.6.0.dist-info/RECORD +0 -52
  70. {flashforge_python_api-1.6.0.dist-info → flashforge_python_api-3.0.0.dist-info}/entry_points.txt +0 -0
@@ -1,13 +1,15 @@
1
- """
2
- G-code related modules for FlashForge printer communication.
3
- """
4
-
5
- from .a3_gcode_controller import A3GCodeController
6
- from .gcode_controller import GCodeController
7
- from .gcodes import GCodes
8
-
9
- __all__ = [
10
- "GCodes",
11
- "GCodeController",
12
- "A3GCodeController",
13
- ]
1
+ """
2
+ G-code related modules for FlashForge printer communication.
3
+ """
4
+
5
+ from .a3_gcode_controller import A3GCodeController
6
+ from .gcode_controller import GCodeController
7
+ from .gcodes import GCodes
8
+ from .legacy_gcode_controller import LegacyGCodeController
9
+
10
+ __all__ = [
11
+ "GCodes",
12
+ "GCodeController",
13
+ "A3GCodeController",
14
+ "LegacyGCodeController",
15
+ ]
@@ -1,109 +1,109 @@
1
- """
2
- G-code controller for FlashForge Adventurer 3 printers.
3
- """
4
-
5
- from __future__ import annotations
6
-
7
- from typing import TYPE_CHECKING
8
-
9
- from .gcode_controller import GCodeController
10
-
11
- if TYPE_CHECKING:
12
- from ..a3_client import A3FileEntry, A3PrinterInfo, A3Thumbnail, FlashForgeA3Client
13
- from ..parsers import EndstopStatus, LocationInfo, PrintStatus
14
-
15
-
16
- class A3GCodeController(GCodeController):
17
- """High-level G-code controller for Adventurer 3 printers."""
18
-
19
- client: FlashForgeA3Client
20
-
21
- def __init__(self, client: FlashForgeA3Client) -> None:
22
- super().__init__(client)
23
- self.client = client
24
-
25
- async def set_printer_name(self, name: str) -> bool:
26
- return await self.client.set_printer_name(name)
27
-
28
- async def get_print_status(self) -> PrintStatus | None:
29
- return await self.client.get_print_status()
30
-
31
- async def list_files(self) -> list[A3FileEntry]:
32
- return await self.client.list_files()
33
-
34
- async def get_thumbnail(self, filename: str) -> A3Thumbnail | None:
35
- return await self.client.get_thumbnail(filename)
36
-
37
- async def select_file(self, filename: str) -> bool:
38
- return await self.client.select_file(filename)
39
-
40
- async def start_job(self, filename: str) -> bool:
41
- if not await self.client.select_file(filename):
42
- return False
43
- return await self.client.start_print()
44
-
45
- async def get_current_position(self) -> LocationInfo | None:
46
- return await self.client.get_position()
47
-
48
- async def get_endstop_status(self) -> EndstopStatus | None:
49
- return await self.client.get_endstop_status()
50
-
51
- async def enable_motors(self) -> bool:
52
- return await self.client.enable_motors()
53
-
54
- async def disable_motors(self) -> bool:
55
- return await self.client.disable_motors()
56
-
57
- async def emergency_stop(self) -> bool:
58
- return await self.client.emergency_stop()
59
-
60
- async def cancel_heat_wait(self) -> bool:
61
- return await self.client.cancel_heat_wait()
62
-
63
- async def led_control(self, params: str) -> bool:
64
- return await self.client.led_control(params)
65
-
66
- async def custom_m144(self, params: str | None = None) -> str | None:
67
- return await self.client.custom_m144(params)
68
-
69
- async def custom_m145(self, params: str | None = None) -> str | None:
70
- return await self.client.custom_m145(params)
71
-
72
- async def get_printer_model(self) -> str | None:
73
- info = await self.client.get_printer_info()
74
- return info.machine_type if info else None
75
-
76
- async def custom_m651(self) -> str | None:
77
- return await self.client.custom_m651()
78
-
79
- async def custom_m652(self) -> str | None:
80
- return await self.client.custom_m652()
81
-
82
- async def custom_m653(self, params: str) -> bool:
83
- return await self.client.custom_m653(params)
84
-
85
- async def custom_m654(self, params: str) -> bool:
86
- return await self.client.custom_m654(params)
87
-
88
- async def custom_m611(self) -> str | None:
89
- return await self.client.custom_m611()
90
-
91
- async def custom_m612(self) -> str | None:
92
- return await self.client.custom_m612()
93
-
94
- async def get_printer_info(self) -> A3PrinterInfo | None:
95
- return await self.client.get_printer_info()
96
-
97
- async def is_adventurer_3(self) -> bool:
98
- info = await self.get_printer_info()
99
- if not info:
100
- return False
101
- machine_type = info.machine_type.lower()
102
- return (
103
- "adventurer3" in machine_type
104
- or "adventurer 3" in machine_type
105
- or "adventurer iii" in machine_type
106
- )
107
-
108
- async def get_detailed_position(self) -> LocationInfo | None:
109
- return await self.client.get_position_xyze()
1
+ """
2
+ G-code controller for FlashForge Adventurer 3 printers.
3
+ """
4
+
5
+ from __future__ import annotations
6
+
7
+ from typing import TYPE_CHECKING
8
+
9
+ from .legacy_gcode_controller import LegacyGCodeController
10
+
11
+ if TYPE_CHECKING:
12
+ from ..a3_client import A3FileEntry, A3PrinterInfo, A3Thumbnail, FlashForgeA3Client
13
+ from ..parsers import EndstopStatus, LocationInfo, PrintStatus
14
+
15
+
16
+ class A3GCodeController(LegacyGCodeController):
17
+ """High-level G-code controller for Adventurer 3 printers."""
18
+
19
+ client: FlashForgeA3Client
20
+
21
+ def __init__(self, client: FlashForgeA3Client) -> None:
22
+ super().__init__(client)
23
+ self.client = client
24
+
25
+ async def set_printer_name(self, name: str) -> bool:
26
+ return await self.client.set_printer_name(name)
27
+
28
+ async def get_print_status(self) -> PrintStatus | None:
29
+ return await self.client.get_print_status()
30
+
31
+ async def list_files(self) -> list[A3FileEntry]:
32
+ return await self.client.list_files()
33
+
34
+ async def get_thumbnail(self, filename: str) -> A3Thumbnail | None:
35
+ return await self.client.get_thumbnail(filename)
36
+
37
+ async def select_file(self, filename: str) -> bool:
38
+ return await self.client.select_file(filename)
39
+
40
+ async def start_job(self, filename: str) -> bool:
41
+ if not await self.client.select_file(filename):
42
+ return False
43
+ return await self.client.start_print()
44
+
45
+ async def get_current_position(self) -> LocationInfo | None:
46
+ return await self.client.get_position()
47
+
48
+ async def get_endstop_status(self) -> EndstopStatus | None:
49
+ return await self.client.get_endstop_status()
50
+
51
+ async def enable_motors(self) -> bool:
52
+ return await self.client.enable_motors()
53
+
54
+ async def disable_motors(self) -> bool:
55
+ return await self.client.disable_motors()
56
+
57
+ async def emergency_stop(self) -> bool:
58
+ return await self.client.emergency_stop()
59
+
60
+ async def cancel_heat_wait(self) -> bool:
61
+ return await self.client.cancel_heat_wait()
62
+
63
+ async def led_control(self, params: str) -> bool:
64
+ return await self.client.led_control(params)
65
+
66
+ async def custom_m144(self, params: str | None = None) -> str | None:
67
+ return await self.client.custom_m144(params)
68
+
69
+ async def custom_m145(self, params: str | None = None) -> str | None:
70
+ return await self.client.custom_m145(params)
71
+
72
+ async def get_printer_model(self) -> str | None:
73
+ info = await self.client.get_printer_info()
74
+ return info.machine_type if info else None
75
+
76
+ async def custom_m651(self) -> str | None:
77
+ return await self.client.custom_m651()
78
+
79
+ async def custom_m652(self) -> str | None:
80
+ return await self.client.custom_m652()
81
+
82
+ async def custom_m653(self, params: str) -> bool:
83
+ return await self.client.custom_m653(params)
84
+
85
+ async def custom_m654(self, params: str) -> bool:
86
+ return await self.client.custom_m654(params)
87
+
88
+ async def custom_m611(self) -> str | None:
89
+ return await self.client.custom_m611()
90
+
91
+ async def custom_m612(self) -> str | None:
92
+ return await self.client.custom_m612()
93
+
94
+ async def get_printer_info(self) -> A3PrinterInfo | None:
95
+ return await self.client.get_printer_info()
96
+
97
+ async def is_adventurer_3(self) -> bool:
98
+ info = await self.get_printer_info()
99
+ if not info:
100
+ return False
101
+ machine_type = info.machine_type.lower()
102
+ return (
103
+ "adventurer3" in machine_type
104
+ or "adventurer 3" in machine_type
105
+ or "adventurer iii" in machine_type
106
+ )
107
+
108
+ async def get_detailed_position(self) -> LocationInfo | None:
109
+ return await self.client.get_position_xyze()