pymammotion 0.2.95__py3-none-any.whl → 0.2.97__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.
- pymammotion/aliyun/cloud_gateway.py +1 -1
- pymammotion/data/model/device.py +2 -0
- pymammotion/http/http.py +6 -4
- pymammotion/utility/constant/device_constant.py +20 -20
- {pymammotion-0.2.95.dist-info → pymammotion-0.2.97.dist-info}/METADATA +1 -1
- {pymammotion-0.2.95.dist-info → pymammotion-0.2.97.dist-info}/RECORD +8 -8
- {pymammotion-0.2.95.dist-info → pymammotion-0.2.97.dist-info}/LICENSE +0 -0
- {pymammotion-0.2.95.dist-info → pymammotion-0.2.97.dist-info}/WHEEL +0 -0
@@ -700,7 +700,7 @@ class CloudIOTGateway:
|
|
700
700
|
def devices_by_account_response(self):
|
701
701
|
return self._devices_by_account_response
|
702
702
|
|
703
|
-
def set_http(self, mammotion_http) -> None:
|
703
|
+
def set_http(self, mammotion_http: MammotionHTTP) -> None:
|
704
704
|
self.mammotion_http = mammotion_http
|
705
705
|
|
706
706
|
@property
|
pymammotion/data/model/device.py
CHANGED
@@ -12,6 +12,7 @@ from pymammotion.data.model.device_info import MowerInfo
|
|
12
12
|
from pymammotion.data.model.location import Location
|
13
13
|
from pymammotion.data.model.report_info import ReportData
|
14
14
|
from pymammotion.data.mqtt.properties import ThingPropertiesMessage
|
15
|
+
from pymammotion.http.model.http import ErrorInfo
|
15
16
|
from pymammotion.proto.dev_net import DevNet
|
16
17
|
from pymammotion.proto.luba_msg import LubaMsg
|
17
18
|
from pymammotion.proto.luba_mul import SocMul
|
@@ -45,6 +46,7 @@ class MowingDevice(DataClassORJSONMixin):
|
|
45
46
|
err_code_list_time: Optional[list] = field(default_factory=list)
|
46
47
|
limits: DeviceLimits = field(default_factory=DeviceLimits)
|
47
48
|
device: Optional[LubaMsg] = field(default_factory=LubaMsg)
|
49
|
+
error_codes: dict[str, ErrorInfo] = field(default_factory=dict)
|
48
50
|
|
49
51
|
@classmethod
|
50
52
|
def from_raw(cls, raw: dict) -> "MowingDevice":
|
pymammotion/http/http.py
CHANGED
@@ -18,10 +18,11 @@ class MammotionHTTP:
|
|
18
18
|
self._headers = dict()
|
19
19
|
self.login_info = LoginResponseData.from_dict(response.data) if response.data else None
|
20
20
|
self._headers["Authorization"] = f"Bearer {self.login_info.access_token}" if response.data else None
|
21
|
+
self.response = response
|
21
22
|
self.msg = response.msg
|
22
23
|
self.code = response.code
|
23
24
|
|
24
|
-
async def get_all_error_codes(self) ->
|
25
|
+
async def get_all_error_codes(self) -> dict[str, ErrorInfo]:
|
25
26
|
async with ClientSession(MAMMOTION_API_DOMAIN) as session:
|
26
27
|
async with session.post(
|
27
28
|
"/user-server/v1/code/record/export-data",
|
@@ -29,9 +30,10 @@ class MammotionHTTP:
|
|
29
30
|
) as resp:
|
30
31
|
data = await resp.json()
|
31
32
|
reader = csv.DictReader(data.get("data", "").split("\n"), delimiter=",")
|
32
|
-
codes =
|
33
|
+
codes = dict()
|
33
34
|
for row in reader:
|
34
|
-
|
35
|
+
error_info = ErrorInfo(**cast(dict, row))
|
36
|
+
codes[error_info.code] = error_info
|
35
37
|
return codes
|
36
38
|
|
37
39
|
async def oauth_check(self) -> None:
|
@@ -73,7 +75,7 @@ class MammotionHTTP:
|
|
73
75
|
),
|
74
76
|
) as resp:
|
75
77
|
data = await resp.json()
|
76
|
-
response = Response.from_dict(data)
|
78
|
+
response = Response[LoginResponseData].from_dict(data)
|
77
79
|
# TODO catch errors from mismatch user / password elsewhere
|
78
80
|
# Assuming the data format matches the expected structure
|
79
81
|
return response
|
@@ -186,30 +186,29 @@ class SystemTardStateTunnel:
|
|
186
186
|
|
187
187
|
|
188
188
|
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
189
|
MODE_NOT_ACTIVE = 0
|
201
|
-
MODE_OBSTACLE_DRAW = 32
|
202
|
-
MODE_OFFLINE = 2
|
203
190
|
MODE_ONLINE = 1
|
204
|
-
|
205
|
-
|
206
|
-
|
191
|
+
MODE_OFFLINE = 2
|
192
|
+
MODE_DISABLE = 8
|
193
|
+
MODE_INITIALIZATION = 10
|
207
194
|
MODE_READY = 11
|
195
|
+
MODE_WORKING = 13
|
208
196
|
MODE_RETURNING = 14
|
209
|
-
|
210
|
-
MODE_UPDATE_SUCCESS = 22
|
197
|
+
MODE_CHARGING = 15
|
211
198
|
MODE_UPDATING = 16
|
212
|
-
|
199
|
+
MODE_LOCK = 17
|
200
|
+
MODE_PAUSE = 19
|
201
|
+
MODE_MANUAL_MOWING = 20
|
202
|
+
MODE_UPDATE_SUCCESS = 22
|
203
|
+
MODE_OTA_UPGRADE_FAIL = 23
|
204
|
+
MODE_JOB_DRAW = 31
|
205
|
+
MODE_OBSTACLE_DRAW = 32
|
206
|
+
MODE_CHANNEL_DRAW = 34
|
207
|
+
MODE_ERASER_DRAW = 35
|
208
|
+
MODE_EDIT_BOUNDARY = 36
|
209
|
+
MODE_LOCATION_ERROR = 37
|
210
|
+
MODE_BOUNDARY_JUMP = 38
|
211
|
+
MODE_CHARGING_PAUSE = 39
|
213
212
|
|
214
213
|
|
215
214
|
def device_connection(value: int, mnet_type: str) -> str:
|
@@ -262,6 +261,7 @@ def device_mode(value: int) -> str:
|
|
262
261
|
36: "MODE_EDIT_BOUNDARY",
|
263
262
|
37: "MODE_LOCATION_ERROR",
|
264
263
|
38: "MODE_BOUNDARY_JUMP",
|
264
|
+
39: "MODE_CHARGING_PAUSE",
|
265
265
|
}
|
266
266
|
return modes.get(value, "Invalid mode")
|
267
267
|
|
@@ -272,7 +272,7 @@ class PosType(IntEnum):
|
|
272
272
|
AREA_BORDER_ON = 7
|
273
273
|
AREA_INSIDE = 1
|
274
274
|
AREA_OUT = 0
|
275
|
-
|
275
|
+
CHANNEL_AREA_OVERLAP = 9
|
276
276
|
CHANNEL_ON = 3
|
277
277
|
CHARGE_ON = 5
|
278
278
|
DUMPING_AREA_INSIDE = 8
|
@@ -1,6 +1,6 @@
|
|
1
1
|
pymammotion/__init__.py,sha256=BcwrItywpSECTxrTPwEuBExi_ekOrG2M2tbphuotIlE,1617
|
2
2
|
pymammotion/aliyun/__init__.py,sha256=T1lkX7TRYiL4nqYanG4l4MImV-SlavSbuooC-W-uUGw,29
|
3
|
-
pymammotion/aliyun/cloud_gateway.py,sha256=
|
3
|
+
pymammotion/aliyun/cloud_gateway.py,sha256=k3gh0-YSTjMUhHoG38YWx5-GjlAIkDWf4YvrPDz-ef4,25784
|
4
4
|
pymammotion/aliyun/cloud_service.py,sha256=px7dUKow5Z7VyebjYzuKkzkm77XbUXYiFiYO_2e-UQ0,2207
|
5
5
|
pymammotion/aliyun/model/aep_response.py,sha256=8f6GIP58ve8gd6AL3HBoXxsy0n2q4ygWvjELGnoOnVc,452
|
6
6
|
pymammotion/aliyun/model/connect_response.py,sha256=Yz-fEbDzgGPTo5Of2oAjmFkSv08T7ze80pQU4k-gKIU,824
|
@@ -22,7 +22,7 @@ pymammotion/const.py,sha256=lWRxvTVdXnNHuxqvRkjO5ziK0Ic-fZMM6J2dbe5M6Nc,385
|
|
22
22
|
pymammotion/data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
23
23
|
pymammotion/data/model/__init__.py,sha256=aSyroxYQQS-WMRi6WmWm2js4wLa9nmsi160gx9tts4o,323
|
24
24
|
pymammotion/data/model/account.py,sha256=vJM-KTf2q6eBfVC-UlNHBSmJvqHiCawZ40vnuhXhaz8,140
|
25
|
-
pymammotion/data/model/device.py,sha256=
|
25
|
+
pymammotion/data/model/device.py,sha256=GQH9pNPcqb4zdl55r8dYIHgvXlwdA8k3xHwMVzNalys,12433
|
26
26
|
pymammotion/data/model/device_config.py,sha256=b3zmArKg10NIheNGSugwWruLM_H4ySBlQxDgXAiB2es,2852
|
27
27
|
pymammotion/data/model/device_info.py,sha256=ahz2xILdSYdX6SIVuVzz8QCfSQLefbQnpXrsiDpBDbY,585
|
28
28
|
pymammotion/data/model/enums.py,sha256=EpKmO8yVUZyEnTY4yH0DMMVKYNQM42zpW1maUu0i3IE,1582
|
@@ -44,7 +44,7 @@ pymammotion/data/state_manager.py,sha256=vtBT28-5DY58hJMi_kqOUKnOq6rJ4fx1zX8yU7N
|
|
44
44
|
pymammotion/event/__init__.py,sha256=mgATR6vPHACNQ-0zH5fi7NdzeTCDV1CZyaWPmtUusi8,115
|
45
45
|
pymammotion/event/event.py,sha256=bj2RirSIRyBs0QvkcrOtwZWUX_8F3m1sySuHVyKmZLs,2143
|
46
46
|
pymammotion/http/_init_.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
47
|
-
pymammotion/http/http.py,sha256=
|
47
|
+
pymammotion/http/http.py,sha256=uPa6NeBKGbgw9FBIRfuSmFtp0nhsnK0NPtR1EBOkeEM,3678
|
48
48
|
pymammotion/http/model/http.py,sha256=_hHqe9IfKDukUYKQDrZb_Tt_9rd5BNN1WKsaGIjsexM,1876
|
49
49
|
pymammotion/mammotion/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
50
50
|
pymammotion/mammotion/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -111,7 +111,7 @@ pymammotion/proto/mctrl_sys_pb2.py,sha256=DYemb514mlC7c27t-k1YqqBif0xxhLmnIWk8rX
|
|
111
111
|
pymammotion/proto/mctrl_sys_pb2.pyi,sha256=Dj_1UM86kZ5MfcVyNC76Z0gKrfl5YFsVWP2b-bKoZvk,38912
|
112
112
|
pymammotion/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
113
113
|
pymammotion/utility/constant/__init__.py,sha256=tcY0LDeD-qDDHx2LKt55KOyv9ZI0UfCNM6fknLCmm8s,110
|
114
|
-
pymammotion/utility/constant/device_constant.py,sha256=
|
114
|
+
pymammotion/utility/constant/device_constant.py,sha256=frRk_ie9-D7963NRQXfG_GusoVBQrW0Mb6Gziu7_09k,7380
|
115
115
|
pymammotion/utility/conversions.py,sha256=v3YICy0zZwwBBzrUZgabI7GRfiDBnkiAX2qdtk3NxOY,89
|
116
116
|
pymammotion/utility/datatype_converter.py,sha256=SPM_HuaaD_XOawlqEnA8qlRRZXGba3WjA8kGOZgeBlQ,4284
|
117
117
|
pymammotion/utility/device_type.py,sha256=xOgfIhOkzgcAtoKtlhlB1q8FpiKe1rVVV5BvN7K7zYc,9433
|
@@ -119,7 +119,7 @@ pymammotion/utility/map.py,sha256=GYscVMg2cX3IPlNpCBNHDW0S55yS1WGRf1iHnNZ7TfQ,22
|
|
119
119
|
pymammotion/utility/movement.py,sha256=N75oAoAgFydqoaOedYIxGUHmuTCtPzAOtb-d_29tpfI,615
|
120
120
|
pymammotion/utility/periodic.py,sha256=MbeSb9cfhxzYmdT_RiE0dZe3H9IfbQW_zSqhmSX2RUc,3321
|
121
121
|
pymammotion/utility/rocker_util.py,sha256=6tX7sS87qoQC_tsxbx3NLL-HgS08wtzXiZkhDiz7uo0,7179
|
122
|
-
pymammotion-0.2.
|
123
|
-
pymammotion-0.2.
|
124
|
-
pymammotion-0.2.
|
125
|
-
pymammotion-0.2.
|
122
|
+
pymammotion-0.2.97.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
123
|
+
pymammotion-0.2.97.dist-info/METADATA,sha256=8Gy8NdtB4I1lUX-eP4I0f6xb8i7rdWzGlsHSZ_WUyMg,3896
|
124
|
+
pymammotion-0.2.97.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
125
|
+
pymammotion-0.2.97.dist-info/RECORD,,
|
File without changes
|
File without changes
|