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.
- pymammotion/__init__.py +5 -4
- pymammotion/aliyun/client.py +235 -0
- pymammotion/aliyun/cloud_gateway.py +312 -64
- 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 +7 -9
- pymammotion/bluetooth/ble_message.py +10 -14
- pymammotion/const.py +3 -0
- pymammotion/data/model/__init__.py +1 -2
- pymammotion/data/model/device.py +95 -27
- pymammotion/data/model/device_config.py +4 -4
- pymammotion/data/model/device_info.py +35 -0
- pymammotion/data/model/device_limits.py +10 -10
- 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 +2 -2
- pymammotion/data/model/hash_list.py +370 -57
- pymammotion/data/model/location.py +4 -4
- pymammotion/data/model/mowing_modes.py +17 -1
- pymammotion/data/model/raw_data.py +2 -10
- pymammotion/data/model/region_data.py +10 -11
- pymammotion/data/model/report_info.py +31 -5
- 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 +27 -6
- pymammotion/homeassistant/__init__.py +3 -0
- pymammotion/homeassistant/mower_api.py +484 -0
- pymammotion/homeassistant/rtk_api.py +54 -0
- pymammotion/http/encryption.py +5 -6
- pymammotion/http/http.py +574 -28
- 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 +129 -4
- 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 +30 -1
- 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 +17 -23
- pymammotion/mammotion/commands/messages/ota.py +18 -18
- pymammotion/mammotion/commands/messages/system.py +32 -49
- pymammotion/mammotion/commands/messages/video.py +15 -16
- pymammotion/mammotion/devices/__init__.py +27 -3
- pymammotion/mammotion/devices/base.py +40 -131
- pymammotion/mammotion/devices/mammotion.py +436 -201
- pymammotion/mammotion/devices/mammotion_bluetooth.py +57 -47
- pymammotion/mammotion/devices/mammotion_cloud.py +134 -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 +93 -52
- 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 +29 -5
- pymammotion/utility/datatype_converter.py +13 -12
- pymammotion/utility/device_config.py +522 -130
- pymammotion/utility/device_type.py +218 -21
- pymammotion/utility/map.py +238 -51
- pymammotion/utility/mur_mur_hash.py +159 -0
- {pymammotion-0.4.0a2.dist-info → pymammotion-0.5.51.dist-info}/METADATA +26 -31
- pymammotion-0.5.51.dist-info/RECORD +152 -0
- {pymammotion-0.4.0a2.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 -129
- 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 -664
- pymammotion/proto/mctrl_ota.py +0 -48
- pymammotion/proto/mctrl_pept.py +0 -41
- pymammotion/proto/mctrl_sys.py +0 -574
- pymammotion-0.4.0a2.dist-info/RECORD +0 -131
- /pymammotion/http/{_init_.py → __init__.py} +0 -0
- {pymammotion-0.4.0a2.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
|
|
@@ -211,15 +213,35 @@ class WorkMode:
|
|
|
211
213
|
MODE_CHARGING_PAUSE = 39
|
|
212
214
|
|
|
213
215
|
|
|
214
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|