pymammotion 0.4.0a2__py3-none-any.whl → 0.5.51__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.

Potentially problematic release.


This version of pymammotion might be problematic. Click here for more details.

Files changed (133) hide show
  1. pymammotion/__init__.py +5 -4
  2. pymammotion/aliyun/client.py +235 -0
  3. pymammotion/aliyun/cloud_gateway.py +312 -64
  4. pymammotion/aliyun/model/aep_response.py +1 -2
  5. pymammotion/aliyun/model/dev_by_account_response.py +170 -23
  6. pymammotion/aliyun/model/login_by_oauth_response.py +2 -3
  7. pymammotion/aliyun/model/regions_response.py +3 -3
  8. pymammotion/aliyun/model/session_by_authcode_response.py +2 -2
  9. pymammotion/aliyun/model/thing_response.py +12 -0
  10. pymammotion/aliyun/regions.py +62 -0
  11. pymammotion/aliyun/tea/core.py +297 -0
  12. pymammotion/bluetooth/ble.py +7 -9
  13. pymammotion/bluetooth/ble_message.py +10 -14
  14. pymammotion/const.py +3 -0
  15. pymammotion/data/model/__init__.py +1 -2
  16. pymammotion/data/model/device.py +95 -27
  17. pymammotion/data/model/device_config.py +4 -4
  18. pymammotion/data/model/device_info.py +35 -0
  19. pymammotion/data/model/device_limits.py +10 -10
  20. pymammotion/data/model/enums.py +12 -2
  21. pymammotion/data/model/errors.py +12 -0
  22. pymammotion/data/model/events.py +14 -0
  23. pymammotion/data/model/generate_geojson.py +521 -0
  24. pymammotion/data/model/generate_route_information.py +2 -2
  25. pymammotion/data/model/hash_list.py +370 -57
  26. pymammotion/data/model/location.py +4 -4
  27. pymammotion/data/model/mowing_modes.py +17 -1
  28. pymammotion/data/model/raw_data.py +2 -10
  29. pymammotion/data/model/region_data.py +10 -11
  30. pymammotion/data/model/report_info.py +31 -5
  31. pymammotion/data/model/work.py +27 -0
  32. pymammotion/data/mower_state_manager.py +316 -0
  33. pymammotion/data/mqtt/event.py +73 -28
  34. pymammotion/data/mqtt/mammotion_properties.py +257 -0
  35. pymammotion/data/mqtt/properties.py +93 -78
  36. pymammotion/data/mqtt/status.py +18 -17
  37. pymammotion/event/event.py +27 -6
  38. pymammotion/homeassistant/__init__.py +3 -0
  39. pymammotion/homeassistant/mower_api.py +484 -0
  40. pymammotion/homeassistant/rtk_api.py +54 -0
  41. pymammotion/http/encryption.py +5 -6
  42. pymammotion/http/http.py +574 -28
  43. pymammotion/http/model/__init__.py +0 -0
  44. pymammotion/{aliyun/model/stream_subscription_response.py → http/model/camera_stream.py} +14 -2
  45. pymammotion/http/model/http.py +129 -4
  46. pymammotion/http/model/response_factory.py +61 -0
  47. pymammotion/http/model/rtk.py +16 -0
  48. pymammotion/mammotion/commands/abstract_message.py +7 -5
  49. pymammotion/mammotion/commands/mammotion_command.py +30 -1
  50. pymammotion/mammotion/commands/messages/basestation.py +43 -0
  51. pymammotion/mammotion/commands/messages/driver.py +61 -29
  52. pymammotion/mammotion/commands/messages/media.py +68 -15
  53. pymammotion/mammotion/commands/messages/navigation.py +61 -25
  54. pymammotion/mammotion/commands/messages/network.py +17 -23
  55. pymammotion/mammotion/commands/messages/ota.py +18 -18
  56. pymammotion/mammotion/commands/messages/system.py +32 -49
  57. pymammotion/mammotion/commands/messages/video.py +15 -16
  58. pymammotion/mammotion/devices/__init__.py +27 -3
  59. pymammotion/mammotion/devices/base.py +40 -131
  60. pymammotion/mammotion/devices/mammotion.py +436 -201
  61. pymammotion/mammotion/devices/mammotion_bluetooth.py +57 -47
  62. pymammotion/mammotion/devices/mammotion_cloud.py +134 -105
  63. pymammotion/mammotion/devices/mammotion_mower_ble.py +49 -0
  64. pymammotion/mammotion/devices/mammotion_mower_cloud.py +39 -0
  65. pymammotion/mammotion/devices/managers/managers.py +81 -0
  66. pymammotion/mammotion/devices/mower_device.py +124 -0
  67. pymammotion/mammotion/devices/mower_manager.py +107 -0
  68. pymammotion/mammotion/devices/rtk_ble.py +89 -0
  69. pymammotion/mammotion/devices/rtk_cloud.py +113 -0
  70. pymammotion/mammotion/devices/rtk_device.py +50 -0
  71. pymammotion/mammotion/devices/rtk_manager.py +122 -0
  72. pymammotion/mqtt/__init__.py +2 -1
  73. pymammotion/mqtt/aliyun_mqtt.py +232 -0
  74. pymammotion/mqtt/linkkit/__init__.py +5 -0
  75. pymammotion/mqtt/linkkit/h2client.py +585 -0
  76. pymammotion/mqtt/linkkit/linkkit.py +3023 -0
  77. pymammotion/mqtt/mammotion_mqtt.py +176 -169
  78. pymammotion/mqtt/mqtt_models.py +66 -0
  79. pymammotion/proto/__init__.py +4839 -4
  80. pymammotion/proto/basestation.proto +8 -0
  81. pymammotion/proto/basestation_pb2.py +11 -9
  82. pymammotion/proto/basestation_pb2.pyi +16 -2
  83. pymammotion/proto/dev_net.proto +79 -55
  84. pymammotion/proto/dev_net_pb2.py +60 -56
  85. pymammotion/proto/dev_net_pb2.pyi +49 -6
  86. pymammotion/proto/luba_msg.proto +2 -1
  87. pymammotion/proto/luba_msg_pb2.py +6 -6
  88. pymammotion/proto/luba_msg_pb2.pyi +1 -0
  89. pymammotion/proto/luba_mul.proto +62 -1
  90. pymammotion/proto/luba_mul_pb2.py +38 -22
  91. pymammotion/proto/luba_mul_pb2.pyi +94 -7
  92. pymammotion/proto/mctrl_driver.proto +44 -4
  93. pymammotion/proto/mctrl_driver_pb2.py +26 -14
  94. pymammotion/proto/mctrl_driver_pb2.pyi +66 -11
  95. pymammotion/proto/mctrl_nav.proto +93 -52
  96. pymammotion/proto/mctrl_nav_pb2.py +75 -67
  97. pymammotion/proto/mctrl_nav_pb2.pyi +142 -56
  98. pymammotion/proto/mctrl_ota.proto +40 -2
  99. pymammotion/proto/mctrl_ota_pb2.py +23 -13
  100. pymammotion/proto/mctrl_ota_pb2.pyi +67 -4
  101. pymammotion/proto/mctrl_pept.proto +8 -3
  102. pymammotion/proto/mctrl_pept_pb2.py +8 -6
  103. pymammotion/proto/mctrl_pept_pb2.pyi +14 -6
  104. pymammotion/proto/mctrl_sys.proto +325 -86
  105. pymammotion/proto/mctrl_sys_pb2.py +162 -98
  106. pymammotion/proto/mctrl_sys_pb2.pyi +451 -25
  107. pymammotion/proto/message_pool.py +3 -0
  108. pymammotion/proto/py.typed +0 -0
  109. pymammotion/utility/constant/device_constant.py +29 -5
  110. pymammotion/utility/datatype_converter.py +13 -12
  111. pymammotion/utility/device_config.py +522 -130
  112. pymammotion/utility/device_type.py +218 -21
  113. pymammotion/utility/map.py +238 -51
  114. pymammotion/utility/mur_mur_hash.py +159 -0
  115. {pymammotion-0.4.0a2.dist-info → pymammotion-0.5.51.dist-info}/METADATA +26 -31
  116. pymammotion-0.5.51.dist-info/RECORD +152 -0
  117. {pymammotion-0.4.0a2.dist-info → pymammotion-0.5.51.dist-info}/WHEEL +1 -1
  118. pymammotion/aliyun/cloud_service.py +0 -65
  119. pymammotion/data/model/plan.py +0 -58
  120. pymammotion/data/state_manager.py +0 -129
  121. pymammotion/proto/basestation.py +0 -59
  122. pymammotion/proto/common.py +0 -12
  123. pymammotion/proto/dev_net.py +0 -381
  124. pymammotion/proto/luba_msg.py +0 -81
  125. pymammotion/proto/luba_mul.py +0 -76
  126. pymammotion/proto/mctrl_driver.py +0 -100
  127. pymammotion/proto/mctrl_nav.py +0 -664
  128. pymammotion/proto/mctrl_ota.py +0 -48
  129. pymammotion/proto/mctrl_pept.py +0 -41
  130. pymammotion/proto/mctrl_sys.py +0 -574
  131. pymammotion-0.4.0a2.dist-info/RECORD +0 -131
  132. /pymammotion/http/{_init_.py → __init__.py} +0 -0
  133. {pymammotion-0.4.0a2.dist-info → pymammotion-0.5.51.dist-info/licenses}/LICENSE +0 -0
@@ -0,0 +1,3 @@
1
+ import betterproto2
2
+
3
+ default_message_pool = betterproto2.MessagePool()
File without changes
@@ -1,5 +1,7 @@
1
1
  from enum import IntEnum
2
2
 
3
+ from pymammotion.data.model.report_info import ConnectData
4
+
3
5
 
4
6
  class bleOrderCmd:
5
7
  allpowerfullRW = 67
@@ -211,15 +213,35 @@ class WorkMode:
211
213
  MODE_CHARGING_PAUSE = 39
212
214
 
213
215
 
214
- def device_connection(value: int, mnet_type: str) -> str:
216
+ NO_REQUEST_MODES = (
217
+ WorkMode.MODE_JOB_DRAW,
218
+ WorkMode.MODE_OBSTACLE_DRAW,
219
+ WorkMode.MODE_CHANNEL_DRAW,
220
+ WorkMode.MODE_ERASER_DRAW,
221
+ WorkMode.MODE_UPDATING,
222
+ WorkMode.MODE_EDIT_BOUNDARY,
223
+ WorkMode.MODE_UPDATING,
224
+ WorkMode.MODE_LOCK,
225
+ WorkMode.MODE_MANUAL_MOWING,
226
+ )
227
+
228
+
229
+ def device_connection(connect: ConnectData) -> str:
215
230
  """Return string representation of device connection."""
216
- if value == 1:
217
- return "BLE"
218
231
 
219
- if mnet_type == "NET_USED_TYPE_WIFI":
232
+ if connect.wifi_rssi != 0 and connect.ble_rssi != 0:
233
+ return "WIFI/BLE"
234
+
235
+ if connect.connect_type == 2 or connect.used_net == "NET_USED_TYPE_WIFI" or connect.wifi_rssi != 0:
220
236
  return "WIFI"
221
237
 
222
- return "3G/4G"
238
+ if connect.connect_type == 1 or connect.used_net == "NET_USED_TYPE_MNET":
239
+ return "3G/4G"
240
+
241
+ if connect.ble_rssi != 0:
242
+ return "BLE"
243
+
244
+ return "None"
223
245
 
224
246
 
225
247
  def device_mode(value: int) -> str:
@@ -277,6 +299,8 @@ class PosType(IntEnum):
277
299
  CHARGE_ON = 5
278
300
  DUMPING_AREA_INSIDE = 8
279
301
  DUMPING_OUTSIDE = 10
302
+ ABNORMAL_POSITIONING = 11
303
+ NO_AREAS = 100
280
304
  OBS_ON = 2
281
305
  TURN_AREA_INSIDE = 4
282
306
  VIRTUAL_INSIDE = 6
@@ -2,7 +2,7 @@ import base64
2
2
 
3
3
 
4
4
  class DatatypeConverter:
5
- encode_map = None
5
+ encode_map: list[str | int] | None = None
6
6
 
7
7
  @staticmethod
8
8
  def init_encode_map():
@@ -20,24 +20,25 @@ class DatatypeConverter:
20
20
  """
21
21
 
22
22
  if DatatypeConverter.encode_map is None:
23
- cArr: list[str | int] = [0] * 64
23
+ c_arr: list[str | int] = [0] * 64
24
24
  for num in range(26):
25
- cArr[num] = chr(num + 65)
25
+ c_arr[num] = chr(num + 65)
26
26
  for num_2 in range(26, 52):
27
- cArr[num_2] = chr(num_2 - 26 + 97)
27
+ c_arr[num_2] = chr(num_2 - 26 + 97)
28
28
  for num_3 in range(52, 62):
29
- cArr[num_3] = chr(num_3 - 52 + 48)
30
- cArr[62] = "+"
31
- cArr[63] = "/"
32
- DatatypeConverter.encode_map = cArr
29
+ c_arr[num_3] = chr(num_3 - 52 + 48)
30
+ c_arr[62] = "+"
31
+ c_arr[63] = "/"
32
+ DatatypeConverter.encode_map = c_arr
33
33
  return DatatypeConverter.encode_map
34
34
 
35
35
  @staticmethod
36
- def parseBase64Binary(s):
36
+ def parseBase64Binary(s: str) -> bytes:
37
37
  return base64.b64decode(s)
38
38
 
39
39
  @staticmethod
40
- def printBase64Binary(bArr):
40
+ def printBase64Binary(bArr: bytes) -> str:
41
+ """Print the Base64 str representation of a byte array."""
41
42
  return DatatypeConverter._printBase64Binary(bArr)
42
43
 
43
44
  @staticmethod
@@ -45,7 +46,7 @@ class DatatypeConverter:
45
46
  return DatatypeConverter.encode_map[i & 63]
46
47
 
47
48
  @staticmethod
48
- def _printBase64Binary(bArr: bytes, i: int = 0, i2=None):
49
+ def _printBase64Binary(bArr: bytes, i: int = 0, i2=None) -> str:
49
50
  """Print the Base64 binary representation of a byte array.
50
51
 
51
52
  This function takes a byte array and optional start and end indices to
@@ -68,7 +69,7 @@ class DatatypeConverter:
68
69
  return "".join(cArr)
69
70
 
70
71
  @staticmethod
71
- def _printBase64Binary_core(bArr: bytes, i, i2, cArr, i3):
72
+ def _printBase64Binary_core(bArr: bytes, i, i2, cArr, i3) -> int:
72
73
  """Encode binary data into Base64 format.
73
74
 
74
75
  This function encodes binary data into Base64 format following the