pymammotion 0.2.62__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.
- pymammotion/__init__.py +9 -6
- pymammotion/aliyun/client.py +235 -0
- pymammotion/aliyun/cloud_gateway.py +320 -69
- pymammotion/aliyun/model/aep_response.py +1 -2
- pymammotion/aliyun/model/dev_by_account_response.py +170 -23
- pymammotion/aliyun/model/login_by_oauth_response.py +2 -3
- pymammotion/aliyun/model/regions_response.py +3 -3
- pymammotion/aliyun/model/session_by_authcode_response.py +2 -2
- pymammotion/aliyun/model/thing_response.py +12 -0
- pymammotion/aliyun/regions.py +62 -0
- pymammotion/aliyun/tea/core.py +297 -0
- pymammotion/bluetooth/ble.py +11 -15
- pymammotion/bluetooth/ble_message.py +389 -106
- pymammotion/bluetooth/model/atomic_integer.py +54 -0
- pymammotion/const.py +3 -0
- pymammotion/data/model/__init__.py +1 -2
- pymammotion/data/model/device.py +92 -240
- pymammotion/data/model/device_config.py +10 -24
- pymammotion/data/model/device_info.py +35 -0
- pymammotion/data/model/device_limits.py +49 -0
- pymammotion/data/model/enums.py +12 -2
- pymammotion/data/model/errors.py +12 -0
- pymammotion/data/model/events.py +14 -0
- pymammotion/data/model/generate_geojson.py +521 -0
- pymammotion/data/model/generate_route_information.py +3 -4
- pymammotion/data/model/hash_list.py +384 -48
- pymammotion/data/model/location.py +4 -4
- pymammotion/data/model/mowing_modes.py +24 -1
- pymammotion/data/model/raw_data.py +215 -0
- pymammotion/data/model/region_data.py +10 -11
- pymammotion/data/model/report_info.py +62 -6
- pymammotion/data/model/work.py +27 -0
- pymammotion/data/mower_state_manager.py +316 -0
- pymammotion/data/mqtt/event.py +73 -28
- pymammotion/data/mqtt/mammotion_properties.py +257 -0
- pymammotion/data/mqtt/properties.py +93 -78
- pymammotion/data/mqtt/status.py +18 -17
- pymammotion/event/event.py +32 -8
- pymammotion/homeassistant/__init__.py +3 -0
- pymammotion/homeassistant/mower_api.py +484 -0
- pymammotion/homeassistant/rtk_api.py +54 -0
- pymammotion/http/__init__.py +0 -0
- pymammotion/http/encryption.py +220 -0
- pymammotion/http/http.py +652 -44
- pymammotion/http/model/__init__.py +0 -0
- pymammotion/{aliyun/model/stream_subscription_response.py → http/model/camera_stream.py} +14 -2
- pymammotion/http/model/http.py +160 -9
- pymammotion/http/model/response_factory.py +61 -0
- pymammotion/http/model/rtk.py +16 -0
- pymammotion/mammotion/commands/abstract_message.py +7 -5
- pymammotion/mammotion/commands/mammotion_command.py +32 -3
- pymammotion/mammotion/commands/messages/basestation.py +43 -0
- pymammotion/mammotion/commands/messages/driver.py +61 -29
- pymammotion/mammotion/commands/messages/media.py +68 -15
- pymammotion/mammotion/commands/messages/navigation.py +61 -25
- pymammotion/mammotion/commands/messages/network.py +93 -100
- pymammotion/mammotion/commands/messages/ota.py +18 -18
- pymammotion/mammotion/commands/messages/system.py +97 -72
- pymammotion/mammotion/commands/messages/video.py +17 -12
- pymammotion/mammotion/devices/__init__.py +27 -3
- pymammotion/mammotion/devices/base.py +50 -127
- pymammotion/mammotion/devices/mammotion.py +447 -212
- pymammotion/mammotion/devices/mammotion_bluetooth.py +105 -60
- pymammotion/mammotion/devices/mammotion_cloud.py +157 -105
- pymammotion/mammotion/devices/mammotion_mower_ble.py +49 -0
- pymammotion/mammotion/devices/mammotion_mower_cloud.py +39 -0
- pymammotion/mammotion/devices/managers/managers.py +81 -0
- pymammotion/mammotion/devices/mower_device.py +124 -0
- pymammotion/mammotion/devices/mower_manager.py +107 -0
- pymammotion/mammotion/devices/rtk_ble.py +89 -0
- pymammotion/mammotion/devices/rtk_cloud.py +113 -0
- pymammotion/mammotion/devices/rtk_device.py +50 -0
- pymammotion/mammotion/devices/rtk_manager.py +122 -0
- pymammotion/mqtt/__init__.py +2 -1
- pymammotion/mqtt/aliyun_mqtt.py +232 -0
- pymammotion/mqtt/linkkit/__init__.py +5 -0
- pymammotion/mqtt/linkkit/h2client.py +585 -0
- pymammotion/mqtt/linkkit/linkkit.py +3023 -0
- pymammotion/mqtt/mammotion_mqtt.py +176 -169
- pymammotion/mqtt/mqtt_models.py +66 -0
- pymammotion/proto/__init__.py +4839 -4
- pymammotion/proto/basestation.proto +8 -0
- pymammotion/proto/basestation_pb2.py +11 -9
- pymammotion/proto/basestation_pb2.pyi +16 -2
- pymammotion/proto/dev_net.proto +79 -55
- pymammotion/proto/dev_net_pb2.py +60 -56
- pymammotion/proto/dev_net_pb2.pyi +49 -6
- pymammotion/proto/luba_msg.proto +2 -1
- pymammotion/proto/luba_msg_pb2.py +6 -6
- pymammotion/proto/luba_msg_pb2.pyi +1 -0
- pymammotion/proto/luba_mul.proto +62 -1
- pymammotion/proto/luba_mul_pb2.py +38 -22
- pymammotion/proto/luba_mul_pb2.pyi +94 -7
- pymammotion/proto/mctrl_driver.proto +44 -4
- pymammotion/proto/mctrl_driver_pb2.py +26 -14
- pymammotion/proto/mctrl_driver_pb2.pyi +66 -11
- pymammotion/proto/mctrl_nav.proto +97 -51
- pymammotion/proto/mctrl_nav_pb2.py +75 -67
- pymammotion/proto/mctrl_nav_pb2.pyi +142 -56
- pymammotion/proto/mctrl_ota.proto +40 -2
- pymammotion/proto/mctrl_ota_pb2.py +23 -13
- pymammotion/proto/mctrl_ota_pb2.pyi +67 -4
- pymammotion/proto/mctrl_pept.proto +8 -3
- pymammotion/proto/mctrl_pept_pb2.py +8 -6
- pymammotion/proto/mctrl_pept_pb2.pyi +14 -6
- pymammotion/proto/mctrl_sys.proto +325 -86
- pymammotion/proto/mctrl_sys_pb2.py +162 -98
- pymammotion/proto/mctrl_sys_pb2.pyi +451 -25
- pymammotion/proto/message_pool.py +3 -0
- pymammotion/proto/py.typed +0 -0
- pymammotion/utility/constant/device_constant.py +65 -21
- pymammotion/utility/datatype_converter.py +13 -12
- pymammotion/utility/device_config.py +755 -0
- pymammotion/utility/device_type.py +218 -21
- pymammotion/utility/map.py +238 -51
- pymammotion/utility/mur_mur_hash.py +159 -0
- {pymammotion-0.2.62.dist-info → pymammotion-0.5.51.dist-info}/METADATA +27 -31
- pymammotion-0.5.51.dist-info/RECORD +152 -0
- {pymammotion-0.2.62.dist-info → pymammotion-0.5.51.dist-info}/WHEEL +1 -1
- pymammotion/aliyun/cloud_service.py +0 -65
- pymammotion/data/model/plan.py +0 -58
- pymammotion/data/state_manager.py +0 -130
- pymammotion/proto/basestation.py +0 -59
- pymammotion/proto/common.py +0 -12
- pymammotion/proto/dev_net.py +0 -381
- pymammotion/proto/luba_msg.py +0 -81
- pymammotion/proto/luba_mul.py +0 -76
- pymammotion/proto/mctrl_driver.py +0 -100
- pymammotion/proto/mctrl_nav.py +0 -660
- pymammotion/proto/mctrl_ota.py +0 -48
- pymammotion/proto/mctrl_pept.py +0 -41
- pymammotion/proto/mctrl_sys.py +0 -574
- pymammotion-0.2.62.dist-info/RECORD +0 -125
- /pymammotion/{http/_init_.py → bluetooth/model/__init__.py} +0 -0
- {pymammotion-0.2.62.dist-info → pymammotion-0.5.51.dist-info/licenses}/LICENSE +0 -0
|
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
|
|
@@ -186,33 +188,63 @@ class SystemTardStateTunnel:
|
|
|
186
188
|
|
|
187
189
|
|
|
188
190
|
class WorkMode:
|
|
189
|
-
MODE_BOUNDARY_JUMP = 38
|
|
190
|
-
MODE_CHANNEL_DRAW = 34
|
|
191
|
-
MODE_CHARGING = 15
|
|
192
|
-
MODE_DISABLE = 8
|
|
193
|
-
MODE_EDIT_BOUNDARY = 36
|
|
194
|
-
MODE_ERASER_DRAW = 35
|
|
195
|
-
MODE_INITIALIZATION = 10
|
|
196
|
-
MODE_JOB_DRAW = 31
|
|
197
|
-
MODE_LOCATION_ERROR = 37
|
|
198
|
-
MODE_LOCK = 17
|
|
199
|
-
MODE_MANUAL_MOWING = 20
|
|
200
191
|
MODE_NOT_ACTIVE = 0
|
|
201
|
-
MODE_OBSTACLE_DRAW = 32
|
|
202
|
-
MODE_OFFLINE = 2
|
|
203
192
|
MODE_ONLINE = 1
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
193
|
+
MODE_OFFLINE = 2
|
|
194
|
+
MODE_DISABLE = 8
|
|
195
|
+
MODE_INITIALIZATION = 10
|
|
207
196
|
MODE_READY = 11
|
|
197
|
+
MODE_WORKING = 13
|
|
208
198
|
MODE_RETURNING = 14
|
|
209
|
-
|
|
210
|
-
MODE_UPDATE_SUCCESS = 22
|
|
199
|
+
MODE_CHARGING = 15
|
|
211
200
|
MODE_UPDATING = 16
|
|
212
|
-
|
|
201
|
+
MODE_LOCK = 17
|
|
202
|
+
MODE_PAUSE = 19
|
|
203
|
+
MODE_MANUAL_MOWING = 20
|
|
204
|
+
MODE_UPDATE_SUCCESS = 22
|
|
205
|
+
MODE_OTA_UPGRADE_FAIL = 23
|
|
206
|
+
MODE_JOB_DRAW = 31
|
|
207
|
+
MODE_OBSTACLE_DRAW = 32
|
|
208
|
+
MODE_CHANNEL_DRAW = 34
|
|
209
|
+
MODE_ERASER_DRAW = 35
|
|
210
|
+
MODE_EDIT_BOUNDARY = 36
|
|
211
|
+
MODE_LOCATION_ERROR = 37
|
|
212
|
+
MODE_BOUNDARY_JUMP = 38
|
|
213
|
+
MODE_CHARGING_PAUSE = 39
|
|
214
|
+
|
|
215
|
+
|
|
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
|
+
)
|
|
213
227
|
|
|
214
228
|
|
|
215
|
-
def
|
|
229
|
+
def device_connection(connect: ConnectData) -> str:
|
|
230
|
+
"""Return string representation of device connection."""
|
|
231
|
+
|
|
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:
|
|
236
|
+
return "WIFI"
|
|
237
|
+
|
|
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"
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
def device_mode(value: int) -> str:
|
|
216
248
|
"""Return the mode corresponding to the given value.
|
|
217
249
|
|
|
218
250
|
This function takes a value and returns the corresponding mode from a
|
|
@@ -251,6 +283,7 @@ def device_mode(value) -> str:
|
|
|
251
283
|
36: "MODE_EDIT_BOUNDARY",
|
|
252
284
|
37: "MODE_LOCATION_ERROR",
|
|
253
285
|
38: "MODE_BOUNDARY_JUMP",
|
|
286
|
+
39: "MODE_CHARGING_PAUSE",
|
|
254
287
|
}
|
|
255
288
|
return modes.get(value, "Invalid mode")
|
|
256
289
|
|
|
@@ -261,11 +294,22 @@ class PosType(IntEnum):
|
|
|
261
294
|
AREA_BORDER_ON = 7
|
|
262
295
|
AREA_INSIDE = 1
|
|
263
296
|
AREA_OUT = 0
|
|
264
|
-
|
|
297
|
+
CHANNEL_AREA_OVERLAP = 9
|
|
265
298
|
CHANNEL_ON = 3
|
|
266
299
|
CHARGE_ON = 5
|
|
267
300
|
DUMPING_AREA_INSIDE = 8
|
|
268
301
|
DUMPING_OUTSIDE = 10
|
|
302
|
+
ABNORMAL_POSITIONING = 11
|
|
303
|
+
NO_AREAS = 100
|
|
269
304
|
OBS_ON = 2
|
|
270
305
|
TURN_AREA_INSIDE = 4
|
|
271
306
|
VIRTUAL_INSIDE = 6
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
def camera_brightness(value: int) -> str:
|
|
310
|
+
"""Return the brightness corresponding to the given value."""
|
|
311
|
+
modes = {
|
|
312
|
+
0: "Dark",
|
|
313
|
+
1: "Light",
|
|
314
|
+
}
|
|
315
|
+
return modes.get(value, "Invalid mode")
|
|
@@ -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
|
-
|
|
23
|
+
c_arr: list[str | int] = [0] * 64
|
|
24
24
|
for num in range(26):
|
|
25
|
-
|
|
25
|
+
c_arr[num] = chr(num + 65)
|
|
26
26
|
for num_2 in range(26, 52):
|
|
27
|
-
|
|
27
|
+
c_arr[num_2] = chr(num_2 - 26 + 97)
|
|
28
28
|
for num_3 in range(52, 62):
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
DatatypeConverter.encode_map =
|
|
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
|