pymammotion 0.5.7__py3-none-any.whl → 0.5.9__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.

@@ -0,0 +1,12 @@
1
+ from dataclasses import dataclass, field
2
+
3
+ from mashumaro.mixins.orjson import DataClassORJSONMixin
4
+
5
+ from pymammotion.http.model.http import ErrorInfo
6
+
7
+
8
+ @dataclass
9
+ class DeviceErrors(DataClassORJSONMixin):
10
+ err_code_list: list[int] = field(default_factory=list)
11
+ err_code_list_time: list[int] | None = field(default_factory=list)
12
+ error_codes: dict[str, ErrorInfo] = field(default_factory=dict)
@@ -153,7 +153,15 @@ class DeviceLogProgressEventParams(GeneralParams):
153
153
  class ThingEventMessage(DataClassORJSONMixin):
154
154
  method: Literal["thing.events", "thing.properties"]
155
155
  id: str
156
- params: DeviceProtobufMsgEventParams | DeviceWarningEventParams | dict
156
+ params: (
157
+ DeviceProtobufMsgEventParams
158
+ | DeviceWarningEventParams
159
+ | DeviceNotificationEventParams
160
+ | DeviceLogProgressEventParams
161
+ | DeviceBizReqEventParams
162
+ | DeviceConfigurationRequestEvent
163
+ | dict
164
+ )
157
165
  version: Literal["1.0"]
158
166
 
159
167
  @classmethod
pymammotion/http/http.py CHANGED
@@ -32,7 +32,12 @@ class MammotionHTTP:
32
32
  async with ClientSession(MAMMOTION_API_DOMAIN) as session:
33
33
  async with session.post(
34
34
  "/user-server/v1/code/record/export-data",
35
- headers=self._headers,
35
+ headers={
36
+ **self._headers,
37
+ "Authorization": f"Bearer {self.login_info.access_token}",
38
+ "Content-Type": "application/json",
39
+ "User-Agent": "okhttp/4.9.3",
40
+ },
36
41
  ) as resp:
37
42
  data = await resp.json()
38
43
  reader = csv.DictReader(data.get("data", "").split("\n"), delimiter=",")
@@ -179,14 +179,14 @@ class MammotionMQTT:
179
179
  future = asyncio.run_coroutine_threadsafe(self.on_message(topic, payload, iot_id), self.loop)
180
180
  asyncio.wrap_future(future, loop=self.loop)
181
181
 
182
- def _thing_on_connect(self, userdata, flags, reason_code, properties) -> None:
182
+ def _thing_on_connect(self, session_flag, rc, user_data) -> None:
183
183
  """Is called on thing connect."""
184
184
  self.is_connected = True
185
185
  if self.on_connected is not None:
186
186
  future = asyncio.run_coroutine_threadsafe(self.on_connected(), self.loop)
187
187
  asyncio.wrap_future(future, loop=self.loop)
188
188
 
189
- logger.debug("on_connect, session_flag:%d, rc:%d", flags, reason_code)
189
+ logger.debug("on_connect, session_flag:%d, rc:%d", session_flag, rc)
190
190
 
191
191
  # self._linkkit_client.subscribe_topic(f"/sys/{self._product_key}/{self._device_name}/#")
192
192
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pymammotion
3
- Version: 0.5.7
3
+ Version: 0.5.9
4
4
  Summary:
5
5
  License: GPL-3.0
6
6
  Author: Michael Arthur
@@ -30,6 +30,7 @@ pymammotion/data/model/device_config.py,sha256=DTnoePsMwJrKVXqGeKvbZQjs8Zab61U5T
30
30
  pymammotion/data/model/device_info.py,sha256=Q5PbPdTfd948ZWc8EHjN5zwU6pha5MCr47ZEXzCYKNY,1148
31
31
  pymammotion/data/model/device_limits.py,sha256=m8HdxD-RaAkPm7jHYb9GLxMEH9IfzBPz0ZypmsLnId4,1946
32
32
  pymammotion/data/model/enums.py,sha256=NLImBbeqwbwBLbABC_NbBzk4M8OxhUTcto6QcGZVNOc,1707
33
+ pymammotion/data/model/errors.py,sha256=EEUpcw-S3Q6n-4TFiWgTv7hS5id1BLTvLQCkmyivEbg,403
33
34
  pymammotion/data/model/excute_boarder_params.py,sha256=9CpUqrygcle1C_1hDW-riLmm4map4ZbE842NXjcomEI,1394
34
35
  pymammotion/data/model/execute_boarder.py,sha256=9rd_h4fbcsXxgnLOd2rO2hWyD1abnTGc47QTEpp8DD0,1103
35
36
  pymammotion/data/model/generate_route_information.py,sha256=pgjqURwmEIzjCMbl4Z5JDDkfxyUAdry1KhPfyir3-mU,777
@@ -42,7 +43,7 @@ pymammotion/data/model/region_data.py,sha256=VokMRqB_o4OFL1TWAM90Fvm-1z4jcYrw3X2
42
43
  pymammotion/data/model/report_info.py,sha256=3nXBFRfdKWnZj4YfBcrPwhBRpq58ICMQlrESfI1tTMg,3808
43
44
  pymammotion/data/model/work.py,sha256=AfKMItFqnRtAlVHzKCfYY-BQy-WFDYZBzdj-9Yc03bo,655
44
45
  pymammotion/data/mqtt/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
45
- pymammotion/data/mqtt/event.py,sha256=C8TGRJs9wNxwg9FFmr9qcsweDnl5v5kcVcwiHxtYzJw,5384
46
+ pymammotion/data/mqtt/event.py,sha256=pj65y93ACcTzUIJkHZC6s_pRFBYaNMSU1wyYRhiGvw4,5571
46
47
  pymammotion/data/mqtt/properties.py,sha256=laud9rE-JqBHWKZ44Dov2yMkp3Ld8ghpBwlZ4_3g9uQ,4321
47
48
  pymammotion/data/mqtt/status.py,sha256=SgdrpE1Uldb01hybO6hYhgU1Sp1eILghC0UhMZMHrdQ,1091
48
49
  pymammotion/data/state_manager.py,sha256=K3o__YsjBS5C5tEujANnxI-lgQpbXhPMUIy3sgVc3QI,12056
@@ -51,7 +52,7 @@ pymammotion/event/event.py,sha256=Z8WYxv_-5khEqKjL1w4c_Et24G1Kdm8QFuIBylD3h3U,30
51
52
  pymammotion/http/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
52
53
  pymammotion/http/_init_.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
53
54
  pymammotion/http/encryption.py,sha256=lzXu3WwBdQlzjXxWnlJuRgkCrKdPbxx5drhMitVKIEk,8287
54
- pymammotion/http/http.py,sha256=_Umuj6DKnTiDZ_y6C6DqPvHMRxKvqHqM0G_1QlsmHN8,12103
55
+ pymammotion/http/http.py,sha256=7tIk7KzM6Wq4bWApcdAgsvQ139HEMvqfIX2STRVJTyM,12331
55
56
  pymammotion/http/model/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
56
57
  pymammotion/http/model/camera_stream.py,sha256=ilxQNny_w9Frwt-m8kbHinvyjDv4Bx8C2swfZ2lTEDE,600
57
58
  pymammotion/http/model/http.py,sha256=VDBmi9nyY5Y2ns_HYvKIyzbkKRxhZ5elpq0lWXWzbGw,4123
@@ -80,7 +81,7 @@ pymammotion/mqtt/linkkit/__init__.py,sha256=ENgc3ynd2kd9gMQR3-kgmCu6Ed9Y6XCIzU0z
80
81
  pymammotion/mqtt/linkkit/h2client.py,sha256=w9Nvi_nY4CLD_fw-pHtYChwQf7e2TiAGeqkY_sF4cf0,19659
81
82
  pymammotion/mqtt/linkkit/linkkit.py,sha256=SGWny2_LKa8qg8RD0Bgd3a4S_fMqpYxJ7a9eFRvgcN0,132923
82
83
  pymammotion/mqtt/mammotion_future.py,sha256=_OWqKOlUGl2yT1xOsXFQYpGd-1zQ63OxqXgy7KRQgYc,710
83
- pymammotion/mqtt/mammotion_mqtt.py,sha256=4jNNV5tx6CCryjLSmAQA6u19bhRSuVkZem32JCpOakE,10198
84
+ pymammotion/mqtt/mammotion_mqtt.py,sha256=p2efgd35ePi9bZxsGp2gtcS83BHiw7A1NR-utZx8Ijg,10183
84
85
  pymammotion/proto/__init__.py,sha256=vUF-eieR8e4VfduqaQ3KfeCRhsMD56NTX2Kk6sS38IE,73466
85
86
  pymammotion/proto/basestation.proto,sha256=YiSsDmT0DY_ep6DHay13SbhxGMhentYt0BmJrVQrwLQ,1198
86
87
  pymammotion/proto/basestation_pb2.py,sha256=suenbpMz9JZCXdGJGdiPaapppRz9Cf4IDzAXUfdIG3w,3083
@@ -124,7 +125,7 @@ pymammotion/utility/movement.py,sha256=N75oAoAgFydqoaOedYIxGUHmuTCtPzAOtb-d_29tp
124
125
  pymammotion/utility/mur_mur_hash.py,sha256=xEfOZVbqRawJj66eLgtnZ85OauDR47oIPr29OHelzPI,4468
125
126
  pymammotion/utility/periodic.py,sha256=MbeSb9cfhxzYmdT_RiE0dZe3H9IfbQW_zSqhmSX2RUc,3321
126
127
  pymammotion/utility/rocker_util.py,sha256=6tX7sS87qoQC_tsxbx3NLL-HgS08wtzXiZkhDiz7uo0,7179
127
- pymammotion-0.5.7.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
128
- pymammotion-0.5.7.dist-info/METADATA,sha256=UAJpuhAZxf_jnb5I0uxjVpG-n05QuyduCKc9faQOdTo,3870
129
- pymammotion-0.5.7.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
130
- pymammotion-0.5.7.dist-info/RECORD,,
128
+ pymammotion-0.5.9.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
129
+ pymammotion-0.5.9.dist-info/METADATA,sha256=pFLjwxrtHDSS1DF3FeV_THnz5-OUOd8LWuAI_XeO_68,3870
130
+ pymammotion-0.5.9.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
131
+ pymammotion-0.5.9.dist-info/RECORD,,