pymammotion 0.5.8__py3-none-any.whl → 0.5.10__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/data/model/errors.py +6 -6
- pymammotion/data/mqtt/event.py +9 -1
- pymammotion/http/http.py +6 -1
- pymammotion/mammotion/commands/messages/media.py +34 -1
- pymammotion/mqtt/mammotion_mqtt.py +2 -2
- {pymammotion-0.5.8.dist-info → pymammotion-0.5.10.dist-info}/METADATA +1 -1
- {pymammotion-0.5.8.dist-info → pymammotion-0.5.10.dist-info}/RECORD +9 -9
- {pymammotion-0.5.8.dist-info → pymammotion-0.5.10.dist-info}/LICENSE +0 -0
- {pymammotion-0.5.8.dist-info → pymammotion-0.5.10.dist-info}/WHEEL +0 -0
pymammotion/data/model/errors.py
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
from dataclasses import
|
|
1
|
+
from dataclasses import dataclass, field
|
|
2
2
|
|
|
3
3
|
from mashumaro.mixins.orjson import DataClassORJSONMixin
|
|
4
4
|
|
|
5
5
|
from pymammotion.http.model.http import ErrorInfo
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
@dataclass
|
|
9
|
-
class DeviceErrors:
|
|
10
|
-
err_code_list: list = field(default_factory=list)
|
|
11
|
-
err_code_list_time: list | None = field(default_factory=list)
|
|
12
|
-
error_codes: dict[str, ErrorInfo] = field(default_factory=dict)
|
|
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)
|
pymammotion/data/mqtt/event.py
CHANGED
|
@@ -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:
|
|
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=
|
|
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=",")
|
|
@@ -5,12 +5,16 @@ from pymammotion.mammotion.commands.abstract_message import AbstractMessage
|
|
|
5
5
|
from pymammotion.proto import (
|
|
6
6
|
MUL_LANGUAGE,
|
|
7
7
|
MUL_SEX,
|
|
8
|
+
GetHeadlamp,
|
|
9
|
+
LampCtrlSta,
|
|
10
|
+
LampManualCtrlSta,
|
|
8
11
|
LubaMsg,
|
|
9
12
|
MsgAttr,
|
|
10
13
|
MsgCmdType,
|
|
11
14
|
MsgDevice,
|
|
12
15
|
MulSetAudio,
|
|
13
16
|
MulSetWiper,
|
|
17
|
+
SetHeadlamp,
|
|
14
18
|
SocMul,
|
|
15
19
|
)
|
|
16
20
|
|
|
@@ -45,4 +49,33 @@ class MessageMedia(AbstractMessage, ABC):
|
|
|
45
49
|
# 2
|
|
46
50
|
return self.send_order_msg_media(SocMul(set_wiper=MulSetWiper(round=round_num)))
|
|
47
51
|
|
|
48
|
-
|
|
52
|
+
def get_car_light(self, ids: int):
|
|
53
|
+
return self.send_order_msg_media(SocMul(get_lamp=GetHeadlamp(get_ids=ids)))
|
|
54
|
+
|
|
55
|
+
def set_car_light(self, on_off: bool = False):
|
|
56
|
+
"""Set mower light.
|
|
57
|
+
set whether light is on during the night during mowing
|
|
58
|
+
auto night on true, id=1121, power_ctrl=1
|
|
59
|
+
auto night off false, id=1121, power_ctrl=1
|
|
60
|
+
"""
|
|
61
|
+
|
|
62
|
+
ctrl_state = LampCtrlSta.power_ctrl_on if on_off else LampCtrlSta.power_off
|
|
63
|
+
return self.send_order_msg_media(
|
|
64
|
+
SocMul(
|
|
65
|
+
set_lamp=SetHeadlamp(
|
|
66
|
+
set_ids=1121, lamp_power_ctrl=1, lamp_ctrl=ctrl_state, ctrl_lamp_bright=False, lamp_bright=0
|
|
67
|
+
)
|
|
68
|
+
)
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
def set_car_manual_light(self, manual_ctrl: bool = False):
|
|
72
|
+
"""Set mower light.
|
|
73
|
+
set whether light is on manually
|
|
74
|
+
manual on: true, id=1125, power_ctrl=2
|
|
75
|
+
manual off: false, id=1127, power_ctrl=2
|
|
76
|
+
"""
|
|
77
|
+
ids = 1125 if manual_ctrl else 1127
|
|
78
|
+
manual_light_ctrl = LampManualCtrlSta.manual_power_off if manual_ctrl else LampManualCtrlSta.manual_power_on
|
|
79
|
+
return self.send_order_msg_media(
|
|
80
|
+
SocMul(set_lamp=SetHeadlamp(set_ids=ids, lamp_power_ctrl=2, lamp_manual_ctrl=manual_light_ctrl))
|
|
81
|
+
)
|
|
@@ -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,
|
|
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",
|
|
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
|
|
|
@@ -30,7 +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=
|
|
33
|
+
pymammotion/data/model/errors.py,sha256=EEUpcw-S3Q6n-4TFiWgTv7hS5id1BLTvLQCkmyivEbg,403
|
|
34
34
|
pymammotion/data/model/excute_boarder_params.py,sha256=9CpUqrygcle1C_1hDW-riLmm4map4ZbE842NXjcomEI,1394
|
|
35
35
|
pymammotion/data/model/execute_boarder.py,sha256=9rd_h4fbcsXxgnLOd2rO2hWyD1abnTGc47QTEpp8DD0,1103
|
|
36
36
|
pymammotion/data/model/generate_route_information.py,sha256=pgjqURwmEIzjCMbl4Z5JDDkfxyUAdry1KhPfyir3-mU,777
|
|
@@ -43,7 +43,7 @@ pymammotion/data/model/region_data.py,sha256=VokMRqB_o4OFL1TWAM90Fvm-1z4jcYrw3X2
|
|
|
43
43
|
pymammotion/data/model/report_info.py,sha256=3nXBFRfdKWnZj4YfBcrPwhBRpq58ICMQlrESfI1tTMg,3808
|
|
44
44
|
pymammotion/data/model/work.py,sha256=AfKMItFqnRtAlVHzKCfYY-BQy-WFDYZBzdj-9Yc03bo,655
|
|
45
45
|
pymammotion/data/mqtt/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
46
|
-
pymammotion/data/mqtt/event.py,sha256=
|
|
46
|
+
pymammotion/data/mqtt/event.py,sha256=pj65y93ACcTzUIJkHZC6s_pRFBYaNMSU1wyYRhiGvw4,5571
|
|
47
47
|
pymammotion/data/mqtt/properties.py,sha256=laud9rE-JqBHWKZ44Dov2yMkp3Ld8ghpBwlZ4_3g9uQ,4321
|
|
48
48
|
pymammotion/data/mqtt/status.py,sha256=SgdrpE1Uldb01hybO6hYhgU1Sp1eILghC0UhMZMHrdQ,1091
|
|
49
49
|
pymammotion/data/state_manager.py,sha256=K3o__YsjBS5C5tEujANnxI-lgQpbXhPMUIy3sgVc3QI,12056
|
|
@@ -52,7 +52,7 @@ pymammotion/event/event.py,sha256=Z8WYxv_-5khEqKjL1w4c_Et24G1Kdm8QFuIBylD3h3U,30
|
|
|
52
52
|
pymammotion/http/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
53
53
|
pymammotion/http/_init_.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
54
54
|
pymammotion/http/encryption.py,sha256=lzXu3WwBdQlzjXxWnlJuRgkCrKdPbxx5drhMitVKIEk,8287
|
|
55
|
-
pymammotion/http/http.py,sha256=
|
|
55
|
+
pymammotion/http/http.py,sha256=7tIk7KzM6Wq4bWApcdAgsvQ139HEMvqfIX2STRVJTyM,12331
|
|
56
56
|
pymammotion/http/model/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
57
57
|
pymammotion/http/model/camera_stream.py,sha256=ilxQNny_w9Frwt-m8kbHinvyjDv4Bx8C2swfZ2lTEDE,600
|
|
58
58
|
pymammotion/http/model/http.py,sha256=VDBmi9nyY5Y2ns_HYvKIyzbkKRxhZ5elpq0lWXWzbGw,4123
|
|
@@ -63,7 +63,7 @@ pymammotion/mammotion/commands/abstract_message.py,sha256=P5FcjGkfoQ1O4Q9JKdq306
|
|
|
63
63
|
pymammotion/mammotion/commands/mammotion_command.py,sha256=3OFXQjF7HFwPd_j6utHVI2Kfwh7t6_6ff_9MKAWGTlk,2570
|
|
64
64
|
pymammotion/mammotion/commands/messages/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
65
65
|
pymammotion/mammotion/commands/messages/driver.py,sha256=LAYGvAcDDXwwliQ1OfRwNBk1VpIdpURo1TlA64zpLA4,3701
|
|
66
|
-
pymammotion/mammotion/commands/messages/media.py,sha256=
|
|
66
|
+
pymammotion/mammotion/commands/messages/media.py,sha256=BcKOtQn7aRChAw41Er4oxixOuNsIblOejQxrBGTER84,2822
|
|
67
67
|
pymammotion/mammotion/commands/messages/navigation.py,sha256=aEEpvDW5QukJ0QiWMhPjjz0eTTF1ndQuvv8a6hJlUg0,23257
|
|
68
68
|
pymammotion/mammotion/commands/messages/network.py,sha256=OrmW4-BP_o3piBjwXZ12WY0HqbXHQqeDXC0YaDPeBM8,7409
|
|
69
69
|
pymammotion/mammotion/commands/messages/ota.py,sha256=ZHLQRE5ETvLEIu2Vbj3m2XidIWT8uorYSHxkZd3pkRc,1376
|
|
@@ -81,7 +81,7 @@ pymammotion/mqtt/linkkit/__init__.py,sha256=ENgc3ynd2kd9gMQR3-kgmCu6Ed9Y6XCIzU0z
|
|
|
81
81
|
pymammotion/mqtt/linkkit/h2client.py,sha256=w9Nvi_nY4CLD_fw-pHtYChwQf7e2TiAGeqkY_sF4cf0,19659
|
|
82
82
|
pymammotion/mqtt/linkkit/linkkit.py,sha256=SGWny2_LKa8qg8RD0Bgd3a4S_fMqpYxJ7a9eFRvgcN0,132923
|
|
83
83
|
pymammotion/mqtt/mammotion_future.py,sha256=_OWqKOlUGl2yT1xOsXFQYpGd-1zQ63OxqXgy7KRQgYc,710
|
|
84
|
-
pymammotion/mqtt/mammotion_mqtt.py,sha256=
|
|
84
|
+
pymammotion/mqtt/mammotion_mqtt.py,sha256=p2efgd35ePi9bZxsGp2gtcS83BHiw7A1NR-utZx8Ijg,10183
|
|
85
85
|
pymammotion/proto/__init__.py,sha256=vUF-eieR8e4VfduqaQ3KfeCRhsMD56NTX2Kk6sS38IE,73466
|
|
86
86
|
pymammotion/proto/basestation.proto,sha256=YiSsDmT0DY_ep6DHay13SbhxGMhentYt0BmJrVQrwLQ,1198
|
|
87
87
|
pymammotion/proto/basestation_pb2.py,sha256=suenbpMz9JZCXdGJGdiPaapppRz9Cf4IDzAXUfdIG3w,3083
|
|
@@ -125,7 +125,7 @@ pymammotion/utility/movement.py,sha256=N75oAoAgFydqoaOedYIxGUHmuTCtPzAOtb-d_29tp
|
|
|
125
125
|
pymammotion/utility/mur_mur_hash.py,sha256=xEfOZVbqRawJj66eLgtnZ85OauDR47oIPr29OHelzPI,4468
|
|
126
126
|
pymammotion/utility/periodic.py,sha256=MbeSb9cfhxzYmdT_RiE0dZe3H9IfbQW_zSqhmSX2RUc,3321
|
|
127
127
|
pymammotion/utility/rocker_util.py,sha256=6tX7sS87qoQC_tsxbx3NLL-HgS08wtzXiZkhDiz7uo0,7179
|
|
128
|
-
pymammotion-0.5.
|
|
129
|
-
pymammotion-0.5.
|
|
130
|
-
pymammotion-0.5.
|
|
131
|
-
pymammotion-0.5.
|
|
128
|
+
pymammotion-0.5.10.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
129
|
+
pymammotion-0.5.10.dist-info/METADATA,sha256=R9J_whXYxCOIP_CxxXAMx6ZotbuPjgTZD_NNVB9fgFU,3871
|
|
130
|
+
pymammotion-0.5.10.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
131
|
+
pymammotion-0.5.10.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|