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,308 +1,292 @@
1
- """
2
- G-code controller for FlashForge 3D printers.
3
-
4
- This module provides high-level G-code command methods that build upon
5
- the basic TCP communication provided by FlashForgeTcpClient.
6
- """
7
-
8
- import asyncio
9
- import logging
10
- from typing import TYPE_CHECKING, Protocol
11
-
12
- from .gcodes import GCodes
13
-
14
- if TYPE_CHECKING:
15
- from ..parsers.temp_info import TempInfo
16
-
17
- logger = logging.getLogger(__name__)
18
-
19
-
20
- class SupportsGCodeClient(Protocol):
21
- """Client protocol implemented by both the legacy and Adventurer 3 TCP clients."""
22
-
23
- async def send_cmd_ok(self, cmd: str) -> bool: ...
24
-
25
- async def get_temp_info(self) -> "TempInfo | None": ...
26
-
27
-
28
- class GCodeController:
29
- """
30
- Controller for sending specific G-code commands to FlashForge printers.
31
-
32
- This class provides convenient methods for common printer operations
33
- like LED control, job management, movement, and temperature control.
34
- """
35
-
36
- def __init__(self, client: SupportsGCodeClient) -> None:
37
- """
38
- Initialize the G-code controller.
39
-
40
- Args:
41
- client: The FlashForgeClient instance for sending commands
42
- """
43
- self.client = client
44
-
45
- async def led_on(self) -> bool:
46
- """
47
- Turn the printer's LED lights on.
48
-
49
- Returns:
50
- True if the command was successful, False otherwise
51
- """
52
- return await self.client.send_cmd_ok(GCodes.CMD_LED_ON)
53
-
54
- async def led_off(self) -> bool:
55
- """
56
- Turn the printer's LED lights off.
57
-
58
- Returns:
59
- True if the command was successful, False otherwise
60
- """
61
- return await self.client.send_cmd_ok(GCodes.CMD_LED_OFF)
62
-
63
- async def pause_job(self) -> bool:
64
- """
65
- Pause the current print job.
66
-
67
- Returns:
68
- True if the command was successful, False otherwise
69
- """
70
- return await self.client.send_cmd_ok(GCodes.CMD_PAUSE_PRINT)
71
-
72
- async def resume_job(self) -> bool:
73
- """
74
- Resume a paused print job.
75
-
76
- Returns:
77
- True if the command was successful, False otherwise
78
- """
79
- return await self.client.send_cmd_ok(GCodes.CMD_RESUME_PRINT)
80
-
81
- async def stop_job(self) -> bool:
82
- """
83
- Stop the current print job.
84
-
85
- Returns:
86
- True if the command was successful, False otherwise
87
- """
88
- return await self.client.send_cmd_ok(GCodes.CMD_STOP_PRINT)
89
-
90
- async def start_job(self, filename: str) -> bool:
91
- """
92
- Start a print job from a file stored on the printer.
93
-
94
- Args:
95
- filename: The name of the file to print (typically without path)
96
-
97
- Returns:
98
- True if the command was successful, False otherwise
99
- """
100
- cmd = GCodes.CMD_START_PRINT.replace("%%filename%%", filename)
101
- return await self.client.send_cmd_ok(cmd)
102
-
103
- async def home(self) -> bool:
104
- """
105
- Home all axes (X, Y, Z) of the printer.
106
-
107
- Returns:
108
- True if the command was successful, False otherwise
109
- """
110
- return await self.client.send_cmd_ok(GCodes.CMD_HOME_AXES)
111
-
112
- async def rapid_home(self) -> bool:
113
- """
114
- Perform a rapid homing of all axes.
115
-
116
- Note: This uses the same command as regular homing in the current implementation.
117
-
118
- Returns:
119
- True if the command was successful, False otherwise
120
- """
121
- # In the TypeScript implementation, this is the same as home()
122
- return await self.home()
123
-
124
- async def move(self, x: float, y: float, z: float, feedrate: int) -> bool:
125
- """
126
- Move the extruder to a specified X, Y, Z position.
127
-
128
- Args:
129
- x: The target X coordinate
130
- y: The target Y coordinate
131
- z: The target Z coordinate
132
- feedrate: The feedrate for the movement in mm/min
133
-
134
- Returns:
135
- True if the command was successful, False otherwise
136
- """
137
- cmd = f"~G1 X{x} Y{y} Z{z} F{feedrate}"
138
- return await self.client.send_cmd_ok(cmd)
139
-
140
- async def move_extruder(self, x: float, y: float, feedrate: int) -> bool:
141
- """
142
- Move the extruder to a specified X, Y position.
143
-
144
- Args:
145
- x: The target X coordinate
146
- y: The target Y coordinate
147
- feedrate: The feedrate for the movement in mm/min
148
-
149
- Returns:
150
- True if the command was successful, False otherwise
151
- """
152
- cmd = f"~G1 X{x} Y{y} F{feedrate}"
153
- return await self.client.send_cmd_ok(cmd)
154
-
155
- async def extrude(self, length: float, feedrate: int = 450) -> bool:
156
- """
157
- Command the extruder to extrude a specific length of filament.
158
-
159
- Args:
160
- length: The length of filament to extrude in millimeters
161
- feedrate: The feedrate for extrusion in mm/min (default: 450)
162
-
163
- Returns:
164
- True if the command was successful, False otherwise
165
- """
166
- cmd = f"~G1 E{length} F{feedrate}"
167
- return await self.client.send_cmd_ok(cmd)
168
-
169
- async def set_extruder_temp(self, temp: int, wait_for: bool = False) -> bool:
170
- """
171
- Set the target temperature for the extruder.
172
-
173
- Args:
174
- temp: The target temperature in Celsius
175
- wait_for: If True, wait until the target temperature is reached
176
-
177
- Returns:
178
- True if the command was successful, False otherwise
179
- """
180
- if wait_for:
181
- cmd = f"{GCodes.WAIT_FOR_HOTEND_TEMP} S{temp}"
182
- ok = await self.client.send_cmd_ok(cmd)
183
- if not ok:
184
- return False
185
- # Wait for temperature to be reached
186
- return await self.wait_for_extruder_temp(temp)
187
- else:
188
- cmd = f"~M104 S{temp}"
189
- return await self.client.send_cmd_ok(cmd)
190
-
191
- async def set_bed_temp(self, temp: int, wait_for: bool = False) -> bool:
192
- """
193
- Set the target temperature for the print bed.
194
-
195
- Args:
196
- temp: The target temperature in Celsius
197
- wait_for: If True, wait until the target temperature is reached
198
-
199
- Returns:
200
- True if the command was successful, False otherwise
201
- """
202
- if wait_for:
203
- cmd = f"{GCodes.WAIT_FOR_BED_TEMP} S{temp}"
204
- ok = await self.client.send_cmd_ok(cmd)
205
- if not ok:
206
- return False
207
- # Wait for temperature to be reached
208
- return await self.wait_for_bed_temp(temp)
209
- else:
210
- cmd = f"~M140 S{temp}"
211
- return await self.client.send_cmd_ok(cmd)
212
-
213
- async def cancel_extruder_temp(self) -> bool:
214
- """
215
- Cancel extruder heating and set its target temperature to 0.
216
-
217
- Returns:
218
- True if the command was successful, False otherwise
219
- """
220
- cmd = "~M104 S0"
221
- ok = await self.client.send_cmd_ok(cmd)
222
- return ok
223
-
224
- async def cancel_bed_temp(self, wait_for_cool: bool = False) -> bool:
225
- """
226
- Cancel print bed heating and set its target temperature to 0.
227
-
228
- Args:
229
- wait_for_cool: If True, wait for the bed to cool down after canceling
230
-
231
- Returns:
232
- True if the command was successful, False otherwise
233
- """
234
- cmd = "~M140 S0"
235
- ok = await self.client.send_cmd_ok(cmd)
236
- if not ok:
237
- return False
238
-
239
- if wait_for_cool:
240
- # Wait for bed to cool down to a reasonable temperature
241
- return await self.wait_for_bed_temp(40, cooling=True)
242
-
243
- return True
244
-
245
- async def wait_for_bed_temp(
246
- self, target_temp: int, cooling: bool = False, timeout: int = 600
247
- ) -> bool:
248
- """
249
- Wait for the bed temperature to reach the target.
250
-
251
- Args:
252
- target_temp: The target temperature to wait for
253
- cooling: If True, wait for temperature to drop below target; otherwise wait to reach target
254
- timeout: Maximum time to wait in seconds (default: 600)
255
-
256
- Returns:
257
- True if target temperature was reached, False on timeout or error
258
- """
259
- start_time = asyncio.get_event_loop().time()
260
- timeout_time = start_time + timeout
261
-
262
- while asyncio.get_event_loop().time() < timeout_time:
263
- temp_info = await self.client.get_temp_info()
264
- if temp_info:
265
- bed_temp = temp_info.get_bed_temp()
266
- if bed_temp:
267
- current_temp = bed_temp.get_current()
268
- if cooling:
269
- if current_temp <= target_temp:
270
- return True
271
- else:
272
- if abs(current_temp - target_temp) <= 2: # Within 2°C tolerance
273
- return True
274
-
275
- await asyncio.sleep(5) # Check every 5 seconds
276
-
277
- logger.warning(
278
- f"Timeout waiting for bed temperature {'cooling to' if cooling else 'heating to'} {target_temp}°C"
279
- )
280
- return False
281
-
282
- async def wait_for_extruder_temp(self, target_temp: int, timeout: int = 600) -> bool:
283
- """
284
- Wait for the extruder temperature to reach the target.
285
-
286
- Args:
287
- target_temp: The target temperature to wait for
288
- timeout: Maximum time to wait in seconds (default: 600)
289
-
290
- Returns:
291
- True if target temperature was reached, False on timeout or error
292
- """
293
- start_time = asyncio.get_event_loop().time()
294
- timeout_time = start_time + timeout
295
-
296
- while asyncio.get_event_loop().time() < timeout_time:
297
- temp_info = await self.client.get_temp_info()
298
- if temp_info:
299
- extruder_temp = temp_info.get_extruder_temp()
300
- if extruder_temp:
301
- current_temp = extruder_temp.get_current()
302
- if abs(current_temp - target_temp) <= 2: # Within 2°C tolerance
303
- return True
304
-
305
- await asyncio.sleep(5) # Check every 5 seconds
306
-
307
- logger.warning(f"Timeout waiting for extruder temperature to reach {target_temp}°C")
308
- return False
1
+ """
2
+ G-code controller for FlashForge 3D printers.
3
+
4
+ This module provides high-level G-code command methods that build upon
5
+ the basic TCP communication provided by FlashForgeTcpClient.
6
+ """
7
+
8
+ import asyncio
9
+ import logging
10
+ from typing import TYPE_CHECKING, Protocol
11
+
12
+ from .gcodes import GCodes
13
+
14
+ if TYPE_CHECKING:
15
+ from ..parsers.temp_info import TempInfo
16
+
17
+ logger = logging.getLogger(__name__)
18
+
19
+
20
+ class SupportsGCodeClient(Protocol):
21
+ """Client protocol implemented by both the legacy and Adventurer 3 TCP clients."""
22
+
23
+ async def send_cmd_ok(self, cmd: str) -> bool: ...
24
+
25
+ async def get_temp_info(self) -> "TempInfo | None": ...
26
+
27
+
28
+ class GCodeController:
29
+ """
30
+ Controller for sending specific G-code commands to FlashForge printers.
31
+
32
+ This class provides convenient methods for common printer operations
33
+ like LED control, job management, movement, and temperature control.
34
+ """
35
+
36
+ def __init__(self, client: SupportsGCodeClient) -> None:
37
+ """
38
+ Initialize the G-code controller.
39
+
40
+ Args:
41
+ client: The FlashForgeClient instance for sending commands
42
+ """
43
+ self.client = client
44
+
45
+ async def led_on(self) -> bool:
46
+ """
47
+ Turn the printer's LED lights on.
48
+
49
+ Returns:
50
+ True if the command was successful, False otherwise
51
+ """
52
+ return await self.client.send_cmd_ok(GCodes.CMD_LED_ON)
53
+
54
+ async def led_off(self) -> bool:
55
+ """
56
+ Turn the printer's LED lights off.
57
+
58
+ Returns:
59
+ True if the command was successful, False otherwise
60
+ """
61
+ return await self.client.send_cmd_ok(GCodes.CMD_LED_OFF)
62
+
63
+ async def pause_job(self) -> bool:
64
+ """
65
+ Pause the current print job.
66
+
67
+ Returns:
68
+ True if the command was successful, False otherwise
69
+ """
70
+ return await self.client.send_cmd_ok(GCodes.CMD_PAUSE_PRINT)
71
+
72
+ async def resume_job(self) -> bool:
73
+ """
74
+ Resume a paused print job.
75
+
76
+ Returns:
77
+ True if the command was successful, False otherwise
78
+ """
79
+ return await self.client.send_cmd_ok(GCodes.CMD_RESUME_PRINT)
80
+
81
+ async def stop_job(self) -> bool:
82
+ """
83
+ Stop the current print job.
84
+
85
+ Returns:
86
+ True if the command was successful, False otherwise
87
+ """
88
+ return await self.client.send_cmd_ok(GCodes.CMD_STOP_PRINT)
89
+
90
+ async def start_job(self, filename: str) -> bool:
91
+ """
92
+ Start a print job from a file stored on the printer.
93
+
94
+ Args:
95
+ filename: The name of the file to print (typically without path)
96
+
97
+ Returns:
98
+ True if the command was successful, False otherwise
99
+ """
100
+ cmd = GCodes.CMD_START_PRINT.replace("%%filename%%", filename)
101
+ return await self.client.send_cmd_ok(cmd)
102
+
103
+ async def home(self) -> bool:
104
+ """
105
+ Home all axes (X, Y, Z) of the printer.
106
+
107
+ Returns:
108
+ True if the command was successful, False otherwise
109
+ """
110
+ return await self.client.send_cmd_ok(GCodes.CMD_HOME_AXES)
111
+
112
+ async def rapid_home(self) -> bool:
113
+ """
114
+ Perform a rapid homing of all axes.
115
+
116
+ Note: This uses the same command as regular homing in the current implementation.
117
+
118
+ Returns:
119
+ True if the command was successful, False otherwise
120
+ """
121
+ # In the TypeScript implementation, this is the same as home()
122
+ return await self.home()
123
+
124
+ async def move(self, x: float, y: float, z: float, feedrate: int) -> bool:
125
+ """
126
+ Move the extruder to a specified X, Y, Z position.
127
+
128
+ Args:
129
+ x: The target X coordinate
130
+ y: The target Y coordinate
131
+ z: The target Z coordinate
132
+ feedrate: The feedrate for the movement in mm/min
133
+
134
+ Returns:
135
+ True if the command was successful, False otherwise
136
+ """
137
+ cmd = f"~G1 X{x} Y{y} Z{z} F{feedrate}"
138
+ return await self.client.send_cmd_ok(cmd)
139
+
140
+ async def move_extruder(self, x: float, y: float, feedrate: int) -> bool:
141
+ """
142
+ Move the extruder to a specified X, Y position.
143
+
144
+ Args:
145
+ x: The target X coordinate
146
+ y: The target Y coordinate
147
+ feedrate: The feedrate for the movement in mm/min
148
+
149
+ Returns:
150
+ True if the command was successful, False otherwise
151
+ """
152
+ cmd = f"~G1 X{x} Y{y} F{feedrate}"
153
+ return await self.client.send_cmd_ok(cmd)
154
+
155
+ async def extrude(self, length: float, feedrate: int = 450) -> bool:
156
+ """
157
+ Command the extruder to extrude a specific length of filament.
158
+
159
+ Args:
160
+ length: The length of filament to extrude in millimeters
161
+ feedrate: The feedrate for extrusion in mm/min (default: 450)
162
+
163
+ Returns:
164
+ True if the command was successful, False otherwise
165
+ """
166
+ cmd = f"~G1 E{length} F{feedrate}"
167
+ return await self.client.send_cmd_ok(cmd)
168
+
169
+ async def set_extruder_temp(self, temp: int) -> bool:
170
+ """
171
+ Set the target temperature for the extruder (M104).
172
+
173
+ To wait for the temperature, call ``wait_for_extruder_temp`` afterwards.
174
+
175
+ Args:
176
+ temp: The target temperature in Celsius
177
+
178
+ Returns:
179
+ True if the command was successful, False otherwise
180
+ """
181
+ return await self.client.send_cmd_ok(f"~M104 S{temp}")
182
+
183
+ async def set_bed_temp(self, temp: int) -> bool:
184
+ """
185
+ Set the target temperature for the print bed (M140).
186
+
187
+ To wait for the temperature, call ``wait_for_bed_temp`` afterwards.
188
+
189
+ Args:
190
+ temp: The target temperature in Celsius
191
+
192
+ Returns:
193
+ True if the command was successful, False otherwise
194
+ """
195
+ return await self.client.send_cmd_ok(f"~M140 S{temp}")
196
+
197
+ async def cancel_extruder_temp(self) -> bool:
198
+ """
199
+ Cancel extruder heating and set its target temperature to 0.
200
+
201
+ Returns:
202
+ True if the command was successful, False otherwise
203
+ """
204
+ cmd = "~M104 S0"
205
+ ok = await self.client.send_cmd_ok(cmd)
206
+ return ok
207
+
208
+ async def cancel_bed_temp(self, wait_for_cool: bool = False) -> bool:
209
+ """
210
+ Cancel print bed heating and set its target temperature to 0.
211
+
212
+ Args:
213
+ wait_for_cool: If True, wait for the bed to cool down after canceling
214
+
215
+ Returns:
216
+ True if the command was successful, False otherwise
217
+ """
218
+ cmd = "~M140 S0"
219
+ ok = await self.client.send_cmd_ok(cmd)
220
+ if not ok:
221
+ return False
222
+
223
+ if wait_for_cool:
224
+ # Wait for bed to cool down to a reasonable temperature
225
+ return await self.wait_for_bed_temp(40, cooling=True)
226
+
227
+ return True
228
+
229
+ async def wait_for_bed_temp(
230
+ self, target_temp: int, cooling: bool = False, timeout: int = 600
231
+ ) -> bool:
232
+ """
233
+ Wait for the bed temperature to reach the target.
234
+
235
+ Args:
236
+ target_temp: The target temperature to wait for
237
+ cooling: If True, wait for temperature to drop below target; otherwise wait to reach target
238
+ timeout: Maximum time to wait in seconds (default: 600)
239
+
240
+ Returns:
241
+ True if target temperature was reached, False on timeout or error
242
+ """
243
+ start_time = asyncio.get_event_loop().time()
244
+ timeout_time = start_time + timeout
245
+
246
+ while asyncio.get_event_loop().time() < timeout_time:
247
+ temp_info = await self.client.get_temp_info()
248
+ if temp_info:
249
+ bed_temp = temp_info.get_bed_temp()
250
+ if bed_temp:
251
+ current_temp = bed_temp.get_current()
252
+ if cooling:
253
+ if current_temp <= target_temp:
254
+ return True
255
+ else:
256
+ if abs(current_temp - target_temp) <= 2: # Within 2°C tolerance
257
+ return True
258
+
259
+ await asyncio.sleep(5) # Check every 5 seconds
260
+
261
+ logger.warning(
262
+ f"Timeout waiting for bed temperature {'cooling to' if cooling else 'heating to'} {target_temp}°C"
263
+ )
264
+ return False
265
+
266
+ async def wait_for_extruder_temp(self, target_temp: int, timeout: int = 600) -> bool:
267
+ """
268
+ Wait for the extruder temperature to reach the target.
269
+
270
+ Args:
271
+ target_temp: The target temperature to wait for
272
+ timeout: Maximum time to wait in seconds (default: 600)
273
+
274
+ Returns:
275
+ True if target temperature was reached, False on timeout or error
276
+ """
277
+ start_time = asyncio.get_event_loop().time()
278
+ timeout_time = start_time + timeout
279
+
280
+ while asyncio.get_event_loop().time() < timeout_time:
281
+ temp_info = await self.client.get_temp_info()
282
+ if temp_info:
283
+ extruder_temp = temp_info.get_extruder_temp()
284
+ if extruder_temp:
285
+ current_temp = extruder_temp.get_current()
286
+ if abs(current_temp - target_temp) <= 2: # Within 2°C tolerance
287
+ return True
288
+
289
+ await asyncio.sleep(5) # Check every 5 seconds
290
+
291
+ logger.warning(f"Timeout waiting for extruder temperature to reach {target_temp}°C")
292
+ return False