pymammotion 0.3.7__py3-none-any.whl → 0.4.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 (69) hide show
  1. pymammotion/__init__.py +2 -2
  2. pymammotion/aliyun/cloud_gateway.py +12 -9
  3. pymammotion/aliyun/model/aep_response.py +1 -2
  4. pymammotion/aliyun/model/dev_by_account_response.py +7 -8
  5. pymammotion/aliyun/model/login_by_oauth_response.py +2 -3
  6. pymammotion/aliyun/model/regions_response.py +3 -3
  7. pymammotion/aliyun/model/session_by_authcode_response.py +1 -2
  8. pymammotion/aliyun/model/stream_subscription_response.py +1 -2
  9. pymammotion/bluetooth/ble.py +5 -5
  10. pymammotion/bluetooth/ble_message.py +9 -13
  11. pymammotion/data/model/device.py +31 -228
  12. pymammotion/data/model/device_config.py +0 -10
  13. pymammotion/data/model/device_info.py +13 -0
  14. pymammotion/data/model/device_limits.py +49 -0
  15. pymammotion/data/model/generate_route_information.py +1 -1
  16. pymammotion/data/model/hash_list.py +6 -2
  17. pymammotion/data/model/plan.py +0 -3
  18. pymammotion/data/model/raw_data.py +215 -0
  19. pymammotion/data/model/region_data.py +10 -11
  20. pymammotion/data/model/report_info.py +1 -1
  21. pymammotion/data/mqtt/event.py +18 -14
  22. pymammotion/data/mqtt/properties.py +1 -1
  23. pymammotion/data/mqtt/status.py +1 -1
  24. pymammotion/data/state_manager.py +83 -23
  25. pymammotion/http/encryption.py +220 -0
  26. pymammotion/http/http.py +92 -39
  27. pymammotion/http/model/http.py +4 -2
  28. pymammotion/mammotion/commands/abstract_message.py +2 -2
  29. pymammotion/mammotion/commands/messages/driver.py +28 -21
  30. pymammotion/mammotion/commands/messages/media.py +10 -14
  31. pymammotion/mammotion/commands/messages/navigation.py +14 -11
  32. pymammotion/mammotion/commands/messages/network.py +17 -14
  33. pymammotion/mammotion/commands/messages/ota.py +9 -14
  34. pymammotion/mammotion/commands/messages/system.py +32 -29
  35. pymammotion/mammotion/commands/messages/video.py +9 -14
  36. pymammotion/mammotion/devices/base.py +7 -14
  37. pymammotion/mammotion/devices/mammotion.py +22 -13
  38. pymammotion/mammotion/devices/mammotion_bluetooth.py +15 -4
  39. pymammotion/mammotion/devices/mammotion_cloud.py +30 -12
  40. pymammotion/mqtt/linkkit/__init__.py +5 -0
  41. pymammotion/mqtt/linkkit/h2client.py +585 -0
  42. pymammotion/mqtt/linkkit/linkkit.py +3020 -0
  43. pymammotion/mqtt/mammotion_mqtt.py +13 -9
  44. pymammotion/proto/__init__.py +2176 -1
  45. pymammotion/proto/luba_mul.proto +1 -0
  46. pymammotion/proto/luba_mul_pb2.py +8 -8
  47. pymammotion/proto/luba_mul_pb2.pyi +1 -0
  48. pymammotion/proto/mctrl_nav_pb2.py +69 -67
  49. pymammotion/proto/mctrl_nav_pb2.pyi +13 -5
  50. pymammotion/proto/mctrl_sys_pb2.py +41 -37
  51. pymammotion/proto/mctrl_sys_pb2.pyi +34 -11
  52. pymammotion/utility/constant/device_constant.py +14 -5
  53. pymammotion/utility/device_config.py +754 -0
  54. pymammotion/utility/device_type.py +64 -16
  55. {pymammotion-0.3.7.dist-info → pymammotion-0.4.0.dist-info}/METADATA +9 -9
  56. {pymammotion-0.3.7.dist-info → pymammotion-0.4.0.dist-info}/RECORD +58 -62
  57. {pymammotion-0.3.7.dist-info → pymammotion-0.4.0.dist-info}/WHEEL +1 -1
  58. pymammotion/aliyun/cloud_service.py +0 -65
  59. pymammotion/proto/basestation.py +0 -59
  60. pymammotion/proto/common.py +0 -12
  61. pymammotion/proto/dev_net.py +0 -381
  62. pymammotion/proto/luba_msg.py +0 -81
  63. pymammotion/proto/luba_mul.py +0 -76
  64. pymammotion/proto/mctrl_driver.py +0 -100
  65. pymammotion/proto/mctrl_nav.py +0 -664
  66. pymammotion/proto/mctrl_ota.py +0 -48
  67. pymammotion/proto/mctrl_pept.py +0 -41
  68. pymammotion/proto/mctrl_sys.py +0 -574
  69. {pymammotion-0.3.7.dist-info → pymammotion-0.4.0.dist-info}/LICENSE +0 -0
@@ -0,0 +1,754 @@
1
+ from pymammotion.data.model.device_limits import DeviceLimits
2
+ from pymammotion.utility.device_type import DeviceType
3
+
4
+ default_luba_config = {
5
+ "cutter_height": {"min": 20, "max": 35},
6
+ "working_speed": {"min": 0.2, "max": 1.2},
7
+ "working_path": {"min": 8, "max": 14},
8
+ "work_area_num_max": 60,
9
+ "display_image_type": 0,
10
+ }
11
+
12
+ default_yuka_config = {
13
+ "cutter_height": {"min": 0, "max": 0},
14
+ "working_speed": {"min": 0.2, "max": 0.6},
15
+ "working_path": {"min": 8, "max": 30},
16
+ "work_area_num_max": 60,
17
+ "display_image_type": 0,
18
+ }
19
+
20
+
21
+ class DeviceConfig:
22
+ def __init__(self) -> None:
23
+ # Dictionary to store all device configurations
24
+
25
+ # Device mode configurations
26
+ self.default_list = {
27
+ "a1ZU6bdGjaM": {
28
+ "extMod": "LubaAWD1000723",
29
+ "cutter_height_min": 30,
30
+ "cutter_height_max": 70,
31
+ "working_speed_min": 0.2,
32
+ "working_speed_max": 0.4,
33
+ "work_area_num_max": 3,
34
+ "working_path_min": 20,
35
+ "working_path_max": 35,
36
+ "display_image_type": 1,
37
+ },
38
+ "a1nf9kRBWoH": {
39
+ "extMod": "LubaAWD3000723",
40
+ "cutter_height_min": 30,
41
+ "cutter_height_max": 70,
42
+ "working_speed_min": 0.2,
43
+ "working_speed_max": 0.4,
44
+ "work_area_num_max": 6,
45
+ "working_path_min": 20,
46
+ "working_path_max": 35,
47
+ "display_image_type": 1,
48
+ },
49
+ "a1ae1QnXZGf": {
50
+ "extMod": "LubaAWD1000743",
51
+ "cutter_height_min": 30,
52
+ "cutter_height_max": 70,
53
+ "working_speed_min": 0.2,
54
+ "working_speed_max": 0.4,
55
+ "work_area_num_max": 3,
56
+ "working_path_min": 20,
57
+ "working_path_max": 35,
58
+ "display_image_type": 1,
59
+ },
60
+ "a1K4Ki2L5rK": {
61
+ "extMod": "LubaAWD5000723",
62
+ "cutter_height_min": 30,
63
+ "cutter_height_max": 70,
64
+ "working_speed_min": 0.2,
65
+ "working_speed_max": 0.6,
66
+ "work_area_num_max": 10,
67
+ "working_path_min": 20,
68
+ "working_path_max": 35,
69
+ "display_image_type": 0,
70
+ },
71
+ "a1jOhAYOIG8": {
72
+ "extMod": "LubaAWD5000743LS",
73
+ "cutter_height_min": 30,
74
+ "cutter_height_max": 70,
75
+ "working_speed_min": 0.2,
76
+ "working_speed_max": 0.6,
77
+ "work_area_num_max": 10,
78
+ "working_path_min": 20,
79
+ "working_path_max": 35,
80
+ "display_image_type": 0,
81
+ },
82
+ "a1BmXWlsdbA": {
83
+ "extMod": "LubaAWD5000743",
84
+ "cutter_height_min": 30,
85
+ "cutter_height_max": 70,
86
+ "working_speed_min": 0.2,
87
+ "working_speed_max": 0.6,
88
+ "work_area_num_max": 10,
89
+ "working_path_min": 20,
90
+ "working_path_max": 35,
91
+ "display_image_type": 0,
92
+ },
93
+ "a1JFpmAV5Ur": {
94
+ "extMod": "Kumar-10",
95
+ "cutter_height_min": 30,
96
+ "cutter_height_max": 70,
97
+ "working_speed_min": 0.2,
98
+ "working_speed_max": 0.6,
99
+ "work_area_num_max": 10,
100
+ "working_path_min": 20,
101
+ "working_path_max": 35,
102
+ "display_image_type": 0,
103
+ },
104
+ "a1kweSOPylG": {
105
+ "extMod": "LubaAWD3000723",
106
+ "cutter_height_min": 30,
107
+ "cutter_height_max": 70,
108
+ "working_speed_min": 0.2,
109
+ "working_speed_max": 0.6,
110
+ "work_area_num_max": 6,
111
+ "working_path_min": 20,
112
+ "working_path_max": 35,
113
+ "display_image_type": 1,
114
+ },
115
+ "a1pvCnb3PPu": {
116
+ "extMod": "LubaAWD1000743",
117
+ "cutter_height_min": 30,
118
+ "cutter_height_max": 70,
119
+ "working_speed_min": 0.2,
120
+ "working_speed_max": 0.6,
121
+ "work_area_num_max": 3,
122
+ "working_path_min": 20,
123
+ "working_path_max": 35,
124
+ "display_image_type": 1,
125
+ },
126
+ "a1x0zHD3Xop": {
127
+ "extMod": "LubaAWD5000743LS",
128
+ "cutter_height_min": 30,
129
+ "cutter_height_max": 70,
130
+ "working_speed_min": 0.2,
131
+ "working_speed_max": 0.6,
132
+ "work_area_num_max": 10,
133
+ "working_path_min": 20,
134
+ "working_path_max": 35,
135
+ "display_image_type": 0,
136
+ },
137
+ "a1UBFdq6nNz": {
138
+ "extMod": "LubaAWD5000723",
139
+ "cutter_height_min": 30,
140
+ "cutter_height_max": 70,
141
+ "working_speed_min": 0.2,
142
+ "working_speed_max": 0.6,
143
+ "work_area_num_max": 10,
144
+ "working_path_min": 20,
145
+ "working_path_max": 35,
146
+ "display_image_type": 0,
147
+ },
148
+ "a1FbaU4Bqk5": {
149
+ "extMod": "LubaAWD5000743",
150
+ "cutter_height_min": 30,
151
+ "cutter_height_max": 70,
152
+ "working_speed_min": 0.2,
153
+ "working_speed_max": 0.6,
154
+ "work_area_num_max": 10,
155
+ "working_path_min": 20,
156
+ "working_path_max": 35,
157
+ "display_image_type": 0,
158
+ },
159
+ }
160
+
161
+ self.inner_list = {
162
+ "HM010060LBAWD10": {
163
+ "extMod": "LubaAWD1000",
164
+ "cutter_height_min": 30,
165
+ "cutter_height_max": 70,
166
+ "working_speed_min": 0.2,
167
+ "working_speed_max": 0.6,
168
+ "work_area_num_max": 3,
169
+ "working_path_min": 20,
170
+ "working_path_max": 35,
171
+ "display_image_type": 1,
172
+ },
173
+ "HM030080LBAWD30": {
174
+ "extMod": "LubaAWD3000",
175
+ "cutter_height_min": 30,
176
+ "cutter_height_max": 70,
177
+ "working_speed_min": 0.2,
178
+ "working_speed_max": 0.6,
179
+ "work_area_num_max": 6,
180
+ "working_path_min": 20,
181
+ "working_path_max": 35,
182
+ "display_image_type": 1,
183
+ },
184
+ "HM050080LBAWD50": {
185
+ "extMod": "LubaAWD5000",
186
+ "cutter_height_min": 30,
187
+ "cutter_height_max": 70,
188
+ "working_speed_min": 0.2,
189
+ "working_speed_max": 0.6,
190
+ "work_area_num_max": 10,
191
+ "working_path_min": 20,
192
+ "working_path_max": 35,
193
+ "display_image_type": 0,
194
+ },
195
+ "HM030060LBAWD50OMNI": {
196
+ "extMod": "LubaAWD5000",
197
+ "cutter_height_min": 30,
198
+ "cutter_height_max": 70,
199
+ "working_speed_min": 0.2,
200
+ "working_speed_max": 0.6,
201
+ "work_area_num_max": 10,
202
+ "working_path_min": 20,
203
+ "working_path_max": 35,
204
+ "display_image_type": 1,
205
+ },
206
+ "HM060100LBAWD50OMNIH": {
207
+ "extMod": "LubaAWD5000H",
208
+ "cutter_height_min": 60,
209
+ "cutter_height_max": 100,
210
+ "working_speed_min": 0.2,
211
+ "working_speed_max": 0.6,
212
+ "work_area_num_max": 10,
213
+ "working_path_min": 20,
214
+ "working_path_max": 35,
215
+ "display_image_type": 0,
216
+ },
217
+ "HM030070LBVAWD10OMNI": {
218
+ "extMod": "Luba2AWD1000",
219
+ "cutter_height_min": 25,
220
+ "cutter_height_max": 70,
221
+ "working_speed_min": 0.2,
222
+ "working_speed_max": 0.6,
223
+ "work_area_num_max": 10,
224
+ "working_path_min": 20,
225
+ "working_path_max": 35,
226
+ "display_image_type": 0,
227
+ },
228
+ "HM060100LBVAWD10OMNIH": {
229
+ "extMod": "Luba2AWD1000H",
230
+ "cutter_height_min": 55,
231
+ "cutter_height_max": 100,
232
+ "working_speed_min": 0.2,
233
+ "working_speed_max": 0.6,
234
+ "work_area_num_max": 10,
235
+ "working_path_min": 20,
236
+ "working_path_max": 35,
237
+ "display_image_type": 0,
238
+ },
239
+ "HM030070LBVAWD30OMNI": {
240
+ "extMod": "Luba2AWD3000",
241
+ "cutter_height_min": 25,
242
+ "cutter_height_max": 70,
243
+ "working_speed_min": 0.2,
244
+ "working_speed_max": 0.6,
245
+ "work_area_num_max": 20,
246
+ "working_path_min": 20,
247
+ "working_path_max": 35,
248
+ "display_image_type": 0,
249
+ },
250
+ "HM060100LBVAWD30OMNIH": {
251
+ "extMod": "Luba2AWD3000H",
252
+ "cutter_height_min": 55,
253
+ "cutter_height_max": 100,
254
+ "working_speed_min": 0.2,
255
+ "working_speed_max": 0.6,
256
+ "work_area_num_max": 20,
257
+ "working_path_min": 20,
258
+ "working_path_max": 35,
259
+ "display_image_type": 0,
260
+ },
261
+ "HM030070LBVAWD50OMNI": {
262
+ "extMod": "Luba2AWD5000",
263
+ "cutter_height_min": 25,
264
+ "cutter_height_max": 70,
265
+ "working_speed_min": 0.2,
266
+ "working_speed_max": 0.6,
267
+ "work_area_num_max": 30,
268
+ "working_path_min": 20,
269
+ "working_path_max": 35,
270
+ "display_image_type": 0,
271
+ },
272
+ "HM060100LBVAWD50OMNIH": {
273
+ "extMod": "Luba2AWD5000H",
274
+ "cutter_height_min": 55,
275
+ "cutter_height_max": 100,
276
+ "working_speed_min": 0.2,
277
+ "working_speed_max": 0.6,
278
+ "work_area_num_max": 30,
279
+ "working_path_min": 20,
280
+ "working_path_max": 35,
281
+ "display_image_type": 0,
282
+ },
283
+ "HM030070LBVAWD100OMNI": {
284
+ "extMod": "Luba2AWD10000",
285
+ "cutter_height_min": 25,
286
+ "cutter_height_max": 70,
287
+ "working_speed_min": 0.2,
288
+ "working_speed_max": 0.6,
289
+ "work_area_num_max": 60,
290
+ "working_path_min": 20,
291
+ "working_path_max": 35,
292
+ "display_image_type": 0,
293
+ },
294
+ "HM060100LBVAWD100OMNIH": {
295
+ "extMod": "Luba2AWD10000H",
296
+ "cutter_height_min": 55,
297
+ "cutter_height_max": 100,
298
+ "working_speed_min": 0.2,
299
+ "working_speed_max": 0.6,
300
+ "work_area_num_max": 60,
301
+ "working_path_min": 20,
302
+ "working_path_max": 35,
303
+ "display_image_type": 0,
304
+ },
305
+ "HM030070LB2PAWD30OMNI": {
306
+ "extMod": "Luba2ProAWD3000",
307
+ "cutter_height_min": 25,
308
+ "cutter_height_max": 70,
309
+ "working_speed_min": 0.2,
310
+ "working_speed_max": 0.8,
311
+ "work_area_num_max": 60,
312
+ "working_path_min": 20,
313
+ "working_path_max": 35,
314
+ "display_image_type": 0,
315
+ },
316
+ "HM060100LB2PAWD30OMNIH": {
317
+ "extMod": "Luba2ProAWD3000NA",
318
+ "cutter_height_min": 55,
319
+ "cutter_height_max": 100,
320
+ "working_speed_min": 0.2,
321
+ "working_speed_max": 0.8,
322
+ "work_area_num_max": 60,
323
+ "working_path_min": 20,
324
+ "working_path_max": 35,
325
+ "display_image_type": 0,
326
+ },
327
+ "HM030070LB2PAWD50OMNI": {
328
+ "extMod": "Luba2ProAWD5000",
329
+ "cutter_height_min": 25,
330
+ "cutter_height_max": 70,
331
+ "working_speed_min": 0.2,
332
+ "working_speed_max": 1.0,
333
+ "work_area_num_max": 60,
334
+ "working_path_min": 20,
335
+ "working_path_max": 35,
336
+ "display_image_type": 0,
337
+ },
338
+ "HM060100LB2PAWD50OMNIH": {
339
+ "extMod": "Luba2ProAWD5000NA",
340
+ "cutter_height_min": 55,
341
+ "cutter_height_max": 100,
342
+ "working_speed_min": 0.2,
343
+ "working_speed_max": 1.0,
344
+ "work_area_num_max": 60,
345
+ "working_path_min": 20,
346
+ "working_path_max": 35,
347
+ "display_image_type": 0,
348
+ },
349
+ "HM030070LB2PAWD100OMNI": {
350
+ "extMod": "Luba2ProAWD10000",
351
+ "cutter_height_min": 25,
352
+ "cutter_height_max": 70,
353
+ "working_speed_min": 0.2,
354
+ "working_speed_max": 1.0,
355
+ "work_area_num_max": 60,
356
+ "working_path_min": 20,
357
+ "working_path_max": 35,
358
+ "display_image_type": 0,
359
+ },
360
+ "HM060100LB2PAWD100OMNIH": {
361
+ "extMod": "Luba2ProAWD10000NA",
362
+ "cutter_height_min": 55,
363
+ "cutter_height_max": 100,
364
+ "working_speed_min": 0.2,
365
+ "working_speed_max": 1.0,
366
+ "work_area_num_max": 60,
367
+ "working_path_min": 20,
368
+ "working_path_max": 35,
369
+ "display_image_type": 0,
370
+ },
371
+ "HM020065LB2MINIAWD08OMNI": {
372
+ "extMod": "Luba2MiniAWD800",
373
+ "cutter_height_min": 20,
374
+ "cutter_height_max": 65,
375
+ "working_speed_min": 0.2,
376
+ "working_speed_max": 0.6,
377
+ "work_area_num_max": 60,
378
+ "working_path_min": 5,
379
+ "working_path_max": 20,
380
+ "display_image_type": 0,
381
+ },
382
+ "HM020065LB2MINIAWD15OMNI": {
383
+ "extMod": "Luba2MiniAWD1500",
384
+ "cutter_height_min": 20,
385
+ "cutter_height_max": 65,
386
+ "working_speed_min": 0.2,
387
+ "working_speed_max": 0.6,
388
+ "work_area_num_max": 60,
389
+ "working_path_min": 5,
390
+ "working_path_max": 20,
391
+ "display_image_type": 0,
392
+ },
393
+ "HM020065LB2MINIAWD15OMNILD": {
394
+ "extMod": "Luba2MiniAWD1500Lidar",
395
+ "cutter_height_min": 20,
396
+ "cutter_height_max": 65,
397
+ "working_speed_min": 0.2,
398
+ "working_speed_max": 0.6,
399
+ "work_area_num_max": 60,
400
+ "working_path_min": 5,
401
+ "working_path_max": 20,
402
+ "display_image_type": 0,
403
+ },
404
+ "HM055100LB2MINIAWD08OMNIH": {
405
+ "extMod": "Luba2MiniAWD800NA",
406
+ "cutter_height_min": 55,
407
+ "cutter_height_max": 100,
408
+ "working_speed_min": 0.2,
409
+ "working_speed_max": 0.6,
410
+ "work_area_num_max": 60,
411
+ "working_path_min": 5,
412
+ "working_path_max": 20,
413
+ "display_image_type": 0,
414
+ },
415
+ "HM055100LB2MINIAWD15OMNIH": {
416
+ "extMod": "Luba2MiniAWD1500NA",
417
+ "cutter_height_min": 55,
418
+ "cutter_height_max": 100,
419
+ "working_speed_min": 0.2,
420
+ "working_speed_max": 0.6,
421
+ "work_area_num_max": 60,
422
+ "working_path_min": 5,
423
+ "working_path_max": 20,
424
+ "display_image_type": 0,
425
+ },
426
+ "HM055100LB2MINIAWD15OMNIHLD": {
427
+ "extMod": "Luba2MiniAWD1500NALidar",
428
+ "cutter_height_min": 55,
429
+ "cutter_height_max": 100,
430
+ "working_speed_min": 0.2,
431
+ "working_speed_max": 0.6,
432
+ "work_area_num_max": 60,
433
+ "working_path_min": 5,
434
+ "working_path_max": 20,
435
+ "display_image_type": 0,
436
+ },
437
+ "HM030070YK06": {
438
+ "extMod": "Yuka600",
439
+ "cutter_height_min": 0,
440
+ "cutter_height_max": 0,
441
+ "working_speed_min": 0.2,
442
+ "working_speed_max": 0.6,
443
+ "work_area_num_max": 60,
444
+ "working_path_min": 15,
445
+ "working_path_max": 30,
446
+ "display_image_type": 0,
447
+ },
448
+ "HM030100YK06H": {
449
+ "extMod": "Yuka600NA",
450
+ "cutter_height_min": 0,
451
+ "cutter_height_max": 0,
452
+ "working_speed_min": 0.2,
453
+ "working_speed_max": 0.6,
454
+ "work_area_num_max": 60,
455
+ "working_path_min": 15,
456
+ "working_path_max": 30,
457
+ "display_image_type": 0,
458
+ },
459
+ "HM030070YK10": {
460
+ "extMod": "Yuka1000",
461
+ "cutter_height_min": 0,
462
+ "cutter_height_max": 0,
463
+ "working_speed_min": 0.2,
464
+ "working_speed_max": 0.6,
465
+ "work_area_num_max": 60,
466
+ "working_path_min": 15,
467
+ "working_path_max": 30,
468
+ "display_image_type": 0,
469
+ },
470
+ "HM030100YK10H": {
471
+ "extMod": "Yuka1000NA",
472
+ "cutter_height_min": 0,
473
+ "cutter_height_max": 0,
474
+ "working_speed_min": 0.2,
475
+ "working_speed_max": 0.6,
476
+ "work_area_num_max": 60,
477
+ "working_path_min": 15,
478
+ "working_path_max": 30,
479
+ "display_image_type": 0,
480
+ },
481
+ "HM030070YK15": {
482
+ "extMod": "Yuka1500",
483
+ "cutter_height_min": 0,
484
+ "cutter_height_max": 0,
485
+ "working_speed_min": 0.2,
486
+ "working_speed_max": 0.6,
487
+ "work_area_num_max": 60,
488
+ "working_path_min": 15,
489
+ "working_path_max": 30,
490
+ "display_image_type": 0,
491
+ },
492
+ "HM030100YK15H": {
493
+ "extMod": "Yuka1500NA",
494
+ "cutter_height_min": 0,
495
+ "cutter_height_max": 0,
496
+ "working_speed_min": 0.2,
497
+ "working_speed_max": 0.6,
498
+ "work_area_num_max": 60,
499
+ "working_path_min": 15,
500
+ "working_path_max": 30,
501
+ "display_image_type": 0,
502
+ },
503
+ "HM020090YK20": {
504
+ "extMod": "Yuka2000",
505
+ "cutter_height_min": 0,
506
+ "cutter_height_max": 0,
507
+ "working_speed_min": 0.2,
508
+ "working_speed_max": 0.6,
509
+ "work_area_num_max": 60,
510
+ "working_path_min": 15,
511
+ "working_path_max": 30,
512
+ "display_image_type": 0,
513
+ },
514
+ "HM030100YK20H": {
515
+ "extMod": "Yuka2000NA",
516
+ "cutter_height_min": 0,
517
+ "cutter_height_max": 0,
518
+ "working_speed_min": 0.2,
519
+ "working_speed_max": 0.6,
520
+ "work_area_num_max": 60,
521
+ "working_path_min": 15,
522
+ "working_path_max": 30,
523
+ "display_image_type": 0,
524
+ },
525
+ "HM020080YKMINI05": {
526
+ "extMod": "YukaMini500",
527
+ "cutter_height_min": 0,
528
+ "cutter_height_max": 0,
529
+ "working_speed_min": 0.2,
530
+ "working_speed_max": 0.6,
531
+ "work_area_num_max": 60,
532
+ "working_path_min": 8,
533
+ "working_path_max": 14,
534
+ "display_image_type": 0,
535
+ },
536
+ "HM050090YKMINI05H": {
537
+ "extMod": "YukaMini500NA",
538
+ "cutter_height_min": 0,
539
+ "cutter_height_max": 0,
540
+ "working_speed_min": 0.2,
541
+ "working_speed_max": 0.6,
542
+ "work_area_num_max": 60,
543
+ "working_path_min": 8,
544
+ "working_path_max": 14,
545
+ "display_image_type": 0,
546
+ },
547
+ "HM020080YKMINI08": {
548
+ "extMod": "YukaMini800",
549
+ "cutter_height_min": 0,
550
+ "cutter_height_max": 0,
551
+ "working_speed_min": 0.2,
552
+ "working_speed_max": 0.6,
553
+ "work_area_num_max": 60,
554
+ "working_path_min": 8,
555
+ "working_path_max": 14,
556
+ "display_image_type": 0,
557
+ },
558
+ "HM050090YKMINI08H": {
559
+ "extMod": "YukaMini800NA",
560
+ "cutter_height_min": 0,
561
+ "cutter_height_max": 0,
562
+ "working_speed_min": 0.2,
563
+ "working_speed_max": 0.6,
564
+ "work_area_num_max": 60,
565
+ "working_path_min": 8,
566
+ "working_path_max": 14,
567
+ "display_image_type": 0,
568
+ },
569
+ "HM020080YKMINI06": {
570
+ "extMod": "YukaMini600",
571
+ "cutter_height_min": 0,
572
+ "cutter_height_max": 0,
573
+ "working_speed_min": 0.2,
574
+ "working_speed_max": 0.6,
575
+ "work_area_num_max": 60,
576
+ "working_path_min": 8,
577
+ "working_path_max": 14,
578
+ "display_image_type": 0,
579
+ },
580
+ "HM020080YKMINI07": {
581
+ "extMod": "YukaMini700",
582
+ "cutter_height_min": 0,
583
+ "cutter_height_max": 0,
584
+ "working_speed_min": 0.2,
585
+ "working_speed_max": 0.6,
586
+ "work_area_num_max": 60,
587
+ "working_path_min": 8,
588
+ "working_path_max": 14,
589
+ "display_image_type": 0,
590
+ },
591
+ "HM050090YKMINI06H": {
592
+ "extMod": "YukaMini600NA",
593
+ "cutter_height_min": 0,
594
+ "cutter_height_max": 0,
595
+ "working_speed_min": 0.2,
596
+ "working_speed_max": 0.6,
597
+ "work_area_num_max": 60,
598
+ "working_path_min": 8,
599
+ "working_path_max": 14,
600
+ "display_image_type": 0,
601
+ },
602
+ "HM050090YKMINI07H": {
603
+ "extMod": "YukaMini700NA",
604
+ "cutter_height_min": 0,
605
+ "cutter_height_max": 0,
606
+ "working_speed_min": 0.2,
607
+ "working_speed_max": 0.6,
608
+ "work_area_num_max": 60,
609
+ "working_path_min": 8,
610
+ "working_path_max": 14,
611
+ "display_image_type": 0,
612
+ },
613
+ "HM020090YKPLUS15": {
614
+ "extMod": "YukaPlus1500",
615
+ "cutter_height_min": 0,
616
+ "cutter_height_max": 0,
617
+ "working_speed_min": 0.2,
618
+ "working_speed_max": 0.6,
619
+ "work_area_num_max": 60,
620
+ "working_path_min": 15,
621
+ "working_path_max": 30,
622
+ "display_image_type": 0,
623
+ },
624
+ "HM020090YKPLUS20": {
625
+ "extMod": "YukaPlus2000",
626
+ "cutter_height_min": 0,
627
+ "cutter_height_max": 0,
628
+ "working_speed_min": 0.2,
629
+ "working_speed_max": 0.6,
630
+ "work_area_num_max": 60,
631
+ "working_path_min": 15,
632
+ "working_path_max": 30,
633
+ "display_image_type": 0,
634
+ },
635
+ "HM030100YKPLUS15H": {
636
+ "extMod": "YukaPlus1500NA",
637
+ "cutter_height_min": 0,
638
+ "cutter_height_max": 0,
639
+ "working_speed_min": 0.2,
640
+ "working_speed_max": 0.6,
641
+ "work_area_num_max": 60,
642
+ "working_path_min": 15,
643
+ "working_path_max": 30,
644
+ "display_image_type": 0,
645
+ },
646
+ "HM030100YKPLUS20H": {
647
+ "extMod": "YukaPlus2000NA",
648
+ "cutter_height_min": 0,
649
+ "cutter_height_max": 0,
650
+ "working_speed_min": 0.2,
651
+ "working_speed_max": 0.6,
652
+ "work_area_num_max": 60,
653
+ "working_path_min": 15,
654
+ "working_path_max": 30,
655
+ "display_image_type": 0,
656
+ },
657
+ "HM020080MN23103": {
658
+ "extMod": "MN231_1",
659
+ "cutter_height_min": 0,
660
+ "cutter_height_max": 0,
661
+ "working_speed_min": 0.2,
662
+ "working_speed_max": 0.6,
663
+ "work_area_num_max": 60,
664
+ "working_path_min": 8,
665
+ "working_path_max": 14,
666
+ "display_image_type": 0,
667
+ },
668
+ }
669
+
670
+ def get_device_config(self, int_mod_or_key: str) -> dict:
671
+ """Look up device configuration by internal model code
672
+
673
+ Args:
674
+ int_mod (str): Internal model code
675
+
676
+ Returns:
677
+ dict: Device configuration or None if not found
678
+ :param int_mod_or_key:
679
+
680
+ """
681
+ if found := self.inner_list.get(int_mod_or_key):
682
+ return found
683
+ else:
684
+ return self.default_list.get(int_mod_or_key)
685
+
686
+ def get_external_model(self, int_mod: str):
687
+ """Get external model name for given internal model code
688
+
689
+ Args:
690
+ int_mod (str): Internal model code
691
+
692
+ Returns:
693
+ str: External model name or None if not found
694
+
695
+ """
696
+ config = self.get_device_config(int_mod)
697
+ return config.get("extMod") if config else None
698
+
699
+ def get_working_parameters(self, int_mod_or_key: str) -> DeviceLimits:
700
+ """Get working parameters for given internal model code
701
+
702
+ Args:
703
+ int_mod (str): Internal model code
704
+
705
+ Returns:
706
+ dict: Working parameters or None if not found
707
+
708
+ """
709
+ config = self.get_device_config(int_mod_or_key)
710
+ if not config:
711
+ return None
712
+
713
+ return DeviceLimits.from_dict(
714
+ {
715
+ "cutter_height": {"min": config["cutter_height_min"], "max": config["cutter_height_max"]},
716
+ "working_speed": {"min": config["working_speed_min"], "max": config["working_speed_max"]},
717
+ "working_path": {"min": config["working_path_min"], "max": config["working_path_max"]},
718
+ "work_area_num_max": config["work_area_num_max"],
719
+ "display_image_type": config["display_image_type"],
720
+ }
721
+ )
722
+
723
+ @staticmethod
724
+ def get_best_default(product_key: str) -> DeviceLimits:
725
+ """Basic fallback if device is offline."""
726
+
727
+ if DeviceType.contain_luba_product_key(product_key):
728
+ return DeviceLimits.from_dict(default_luba_config)
729
+ if DeviceType.contain_luba_2_product_key(product_key):
730
+ return DeviceLimits.from_dict(default_luba_config)
731
+
732
+ return DeviceLimits.from_dict(default_yuka_config)
733
+
734
+
735
+ # # Usage example:
736
+ # def main():
737
+ # device_config = DeviceConfig()
738
+ #
739
+ # # Look up a specific device
740
+ # model_code = "HM010060LBAWD10"
741
+ #
742
+ # # Get full configuration
743
+ # config = device_config.get_device_config(model_code)
744
+ # print(f"Full configuration for {model_code}:")
745
+ # print(config)
746
+ #
747
+ # # Get external model name
748
+ # ext_model = device_config.get_external_model(model_code)
749
+ # print(f"\nExternal model name: {ext_model}")
750
+ #
751
+ # # Get working parameters
752
+ # params = device_config.get_working_parameters(model_code)
753
+ # print(f"\nWorking parameters:")
754
+ # print(params)