pymammotion 0.4.48__py3-none-any.whl → 0.4.50__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/client.py +1 -1
- pymammotion/aliyun/cloud_gateway.py +1 -1
- pymammotion/data/model/device.py +2 -1
- pymammotion/data/model/device_info.py +8 -0
- pymammotion/data/state_manager.py +9 -0
- pymammotion/mammotion/commands/messages/network.py +0 -5
- pymammotion/mammotion/devices/mammotion.py +16 -15
- {pymammotion-0.4.48.dist-info → pymammotion-0.4.50.dist-info}/METADATA +1 -1
- {pymammotion-0.4.48.dist-info → pymammotion-0.4.50.dist-info}/RECORD +11 -11
- {pymammotion-0.4.48.dist-info → pymammotion-0.4.50.dist-info}/LICENSE +0 -0
- {pymammotion-0.4.48.dist-info → pymammotion-0.4.50.dist-info}/WHEEL +0 -0
pymammotion/aliyun/client.py
CHANGED
@@ -183,7 +183,7 @@ class Client:
|
|
183
183
|
if _retry_times > 0:
|
184
184
|
_backoff_time = TeaCore.get_backoff_time(_runtime.get("backoff"), _retry_times)
|
185
185
|
if _backoff_time > 0:
|
186
|
-
TeaCore.
|
186
|
+
await TeaCore.sleep_async(_backoff_time)
|
187
187
|
_retry_times = _retry_times + 1
|
188
188
|
try:
|
189
189
|
_request = TeaRequest()
|
@@ -732,7 +732,7 @@ class CloudIOTGateway:
|
|
732
732
|
logger.debug(iot_id)
|
733
733
|
|
734
734
|
response_body_str = response.body.decode("utf-8")
|
735
|
-
response_body_dict = json.loads(response_body_str)
|
735
|
+
response_body_dict = json.loads(response_body_str) if response_body_str is not None else {}
|
736
736
|
|
737
737
|
if int(response_body_dict.get("code")) != 200:
|
738
738
|
logger.error(
|
pymammotion/data/model/device.py
CHANGED
@@ -6,7 +6,7 @@ import betterproto
|
|
6
6
|
from mashumaro.mixins.orjson import DataClassORJSONMixin
|
7
7
|
|
8
8
|
from pymammotion.data.model import HashList, RapidState
|
9
|
-
from pymammotion.data.model.device_info import DeviceFirmwares, MowerInfo
|
9
|
+
from pymammotion.data.model.device_info import DeviceFirmwares, DeviceNonWorkingHours, MowerInfo
|
10
10
|
from pymammotion.data.model.location import Location
|
11
11
|
from pymammotion.data.model.report_info import ReportData
|
12
12
|
from pymammotion.data.model.work import CurrentTaskSettings
|
@@ -38,6 +38,7 @@ class MowingDevice(DataClassORJSONMixin):
|
|
38
38
|
err_code_list: list = field(default_factory=list)
|
39
39
|
err_code_list_time: list | None = field(default_factory=list)
|
40
40
|
error_codes: dict[str, ErrorInfo] = field(default_factory=dict)
|
41
|
+
non_work_hours: DeviceNonWorkingHours = field(default_factory=DeviceNonWorkingHours)
|
41
42
|
|
42
43
|
def buffer(self, buffer_list: SystemUpdateBufMsg) -> None:
|
43
44
|
"""Update the device based on which buffer we are reading from."""
|
@@ -14,6 +14,12 @@ class SideLight(DataClassORJSONMixin):
|
|
14
14
|
action: int = 0
|
15
15
|
|
16
16
|
|
17
|
+
@dataclass
|
18
|
+
class DeviceNonWorkingHours(DataClassORJSONMixin):
|
19
|
+
start_time: str = ""
|
20
|
+
end_time: str = ""
|
21
|
+
|
22
|
+
|
17
23
|
@dataclass
|
18
24
|
class MowerInfo(DataClassORJSONMixin):
|
19
25
|
blade_status: bool = False
|
@@ -27,6 +33,8 @@ class MowerInfo(DataClassORJSONMixin):
|
|
27
33
|
product_key: str = ""
|
28
34
|
model_id: str = ""
|
29
35
|
sub_model_id: str = ""
|
36
|
+
ble_mac: str = ""
|
37
|
+
wifi_mac: str = ""
|
30
38
|
|
31
39
|
|
32
40
|
@dataclass
|
@@ -20,12 +20,14 @@ from pymammotion.proto import (
|
|
20
20
|
DeviceProductTypeInfoT,
|
21
21
|
DrvDevInfoResp,
|
22
22
|
DrvDevInfoResult,
|
23
|
+
GetNetworkInfoRsp,
|
23
24
|
LubaMsg,
|
24
25
|
NavGetCommDataAck,
|
25
26
|
NavGetHashListAck,
|
26
27
|
NavPlanJobSet,
|
27
28
|
NavReqCoverPath,
|
28
29
|
NavSysParamMsg,
|
30
|
+
NavUnableTimeSet,
|
29
31
|
SvgMessageAckT,
|
30
32
|
TimeCtrlLight,
|
31
33
|
WifiIotStatusReport,
|
@@ -183,6 +185,10 @@ class StateManager:
|
|
183
185
|
self._device.mower_state.turning_mode = settings.context
|
184
186
|
case 7:
|
185
187
|
self._device.mower_state.traversal_mode = settings.context
|
188
|
+
case "todev_unable_time_set":
|
189
|
+
nav_non_work_time: NavUnableTimeSet = nav_msg[1]
|
190
|
+
self._device.non_work_hours.start_time = nav_non_work_time.unable_start_time
|
191
|
+
self._device.non_work_hours.end_time = nav_non_work_time.unable_end_time
|
186
192
|
|
187
193
|
def _update_sys_data(self, message) -> None:
|
188
194
|
"""Update system."""
|
@@ -225,6 +231,9 @@ class StateManager:
|
|
225
231
|
if resp.res == DrvDevInfoResult.DRV_RESULT_SUC and resp.id == 1 and resp.type == 6:
|
226
232
|
self._device.mower_state.swversion = resp.info
|
227
233
|
self._device.device_firmwares.device_version = resp.info
|
234
|
+
case "toapp_networkinfo_rsp":
|
235
|
+
get_network_info_resp: GetNetworkInfoRsp = net_msg[1]
|
236
|
+
self._device.mower_state.wifi_mac = get_network_info_resp.wifi_mac
|
228
237
|
|
229
238
|
def _update_mul_data(self, message) -> None:
|
230
239
|
pass
|
@@ -192,11 +192,6 @@ class MessageNetwork(AbstractMessage, ABC):
|
|
192
192
|
logger.debug("Send command - get Wifi connection information")
|
193
193
|
return self.send_order_msg_net(build)
|
194
194
|
|
195
|
-
def wifi_connectinfo_update2(self) -> None:
|
196
|
-
hash_map = {"getMsgCmd": 1}
|
197
|
-
# self.post_custom_data(self.get_json_string(
|
198
|
-
# 68, hash_map)) # TODO: Fix this
|
199
|
-
|
200
195
|
def get_record_wifi_list(self) -> bytes:
|
201
196
|
build = DevNet(todev_ble_sync=1, todev_wifi_list_upload=DrvWifiList())
|
202
197
|
logger.debug("Send command - get memorized WiFi list upload command")
|
@@ -133,21 +133,22 @@ class MammotionDeviceManager:
|
|
133
133
|
return self.devices.get(mammotion_device_name)
|
134
134
|
|
135
135
|
async def remove_device(self, name: str) -> None:
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
136
|
+
if self.devices.get(name):
|
137
|
+
device_for_removal = self.devices.pop(name)
|
138
|
+
loop = asyncio.get_running_loop()
|
139
|
+
if device_for_removal.has_cloud():
|
140
|
+
should_disconnect = {
|
141
|
+
device
|
142
|
+
for key, device in self.devices.items()
|
143
|
+
if device.cloud() is not None and device.cloud().mqtt == device_for_removal.cloud().mqtt
|
144
|
+
}
|
145
|
+
if len(should_disconnect) == 0:
|
146
|
+
await loop.run_in_executor(None, device_for_removal.cloud().mqtt.disconnect)
|
147
|
+
await device_for_removal.cloud().stop()
|
148
|
+
if device_for_removal.has_ble():
|
149
|
+
await device_for_removal.ble().stop()
|
150
|
+
|
151
|
+
del device_for_removal
|
151
152
|
|
152
153
|
|
153
154
|
class Mammotion:
|
@@ -1,7 +1,7 @@
|
|
1
1
|
pymammotion/__init__.py,sha256=H-U94bNLp0LPC6hkRopVEUlUsZSR97n7WfKGPjK1GMg,1638
|
2
2
|
pymammotion/aliyun/__init__.py,sha256=T1lkX7TRYiL4nqYanG4l4MImV-SlavSbuooC-W-uUGw,29
|
3
|
-
pymammotion/aliyun/client.py,sha256=
|
4
|
-
pymammotion/aliyun/cloud_gateway.py,sha256=
|
3
|
+
pymammotion/aliyun/client.py,sha256=44YqBt0advxbYYXs25Jpq438lhEXrP6xaBWWMGBLdp4,9603
|
4
|
+
pymammotion/aliyun/cloud_gateway.py,sha256=_qwntXZjj2VzX5x_9LSeq-lW0CRsBYdGO0Wn8e5kIHk,28328
|
5
5
|
pymammotion/aliyun/model/aep_response.py,sha256=EY4uMTJ4F9rvbcXnAOc5YKi7q__9kIVgfDwfyr65Gk0,421
|
6
6
|
pymammotion/aliyun/model/connect_response.py,sha256=Yz-fEbDzgGPTo5Of2oAjmFkSv08T7ze80pQU4k-gKIU,824
|
7
7
|
pymammotion/aliyun/model/dev_by_account_response.py,sha256=P9yYy4Z2tLkJSqXA_5XGaCUliSSVa5ILl7VoMtL_tCA,977
|
@@ -25,9 +25,9 @@ pymammotion/const.py,sha256=lWRxvTVdXnNHuxqvRkjO5ziK0Ic-fZMM6J2dbe5M6Nc,385
|
|
25
25
|
pymammotion/data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
26
26
|
pymammotion/data/model/__init__.py,sha256=UVRbSXGOjYnWv30ZEvzT5QRpdVqAbyeToo-t0QBWyi4,292
|
27
27
|
pymammotion/data/model/account.py,sha256=vJM-KTf2q6eBfVC-UlNHBSmJvqHiCawZ40vnuhXhaz8,140
|
28
|
-
pymammotion/data/model/device.py,sha256=
|
28
|
+
pymammotion/data/model/device.py,sha256=v6CRWzAfRrwRwN--_6DGl6nKDvqO_16ZvTXu8w7bpL0,7621
|
29
29
|
pymammotion/data/model/device_config.py,sha256=DTnoePsMwJrKVXqGeKvbZQjs8Zab61U5T3b-c-w0WlM,2654
|
30
|
-
pymammotion/data/model/device_info.py,sha256=
|
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
33
|
pymammotion/data/model/excute_boarder_params.py,sha256=9CpUqrygcle1C_1hDW-riLmm4map4ZbE842NXjcomEI,1394
|
@@ -45,7 +45,7 @@ pymammotion/data/mqtt/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdr
|
|
45
45
|
pymammotion/data/mqtt/event.py,sha256=r14gzZVxmlGVAwFdZQ1CUsMZFHHwRKnbt2VHnjugP28,5123
|
46
46
|
pymammotion/data/mqtt/properties.py,sha256=pX5JRVmmpVO04CSPm5xAGcSWA_OeLd0JnBagLsfiSEc,3755
|
47
47
|
pymammotion/data/mqtt/status.py,sha256=SgdrpE1Uldb01hybO6hYhgU1Sp1eILghC0UhMZMHrdQ,1091
|
48
|
-
pymammotion/data/state_manager.py,sha256=
|
48
|
+
pymammotion/data/state_manager.py,sha256=aRpxgIxWwlMV-36YCbnIUwdcQbTrWM7p0YrQFem0wCs,10842
|
49
49
|
pymammotion/event/__init__.py,sha256=mgATR6vPHACNQ-0zH5fi7NdzeTCDV1CZyaWPmtUusi8,115
|
50
50
|
pymammotion/event/event.py,sha256=bj2RirSIRyBs0QvkcrOtwZWUX_8F3m1sySuHVyKmZLs,2143
|
51
51
|
pymammotion/http/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -63,7 +63,7 @@ pymammotion/mammotion/commands/messages/__init__.py,sha256=47DEQpj8HBSa-_TImW-5J
|
|
63
63
|
pymammotion/mammotion/commands/messages/driver.py,sha256=LAYGvAcDDXwwliQ1OfRwNBk1VpIdpURo1TlA64zpLA4,3701
|
64
64
|
pymammotion/mammotion/commands/messages/media.py,sha256=a6CY_1wEpepH9zg6-HfH1lt-jtC1sFy8hm7tFRgzlG4,1493
|
65
65
|
pymammotion/mammotion/commands/messages/navigation.py,sha256=aEEpvDW5QukJ0QiWMhPjjz0eTTF1ndQuvv8a6hJlUg0,23257
|
66
|
-
pymammotion/mammotion/commands/messages/network.py,sha256=
|
66
|
+
pymammotion/mammotion/commands/messages/network.py,sha256=OrmW4-BP_o3piBjwXZ12WY0HqbXHQqeDXC0YaDPeBM8,7409
|
67
67
|
pymammotion/mammotion/commands/messages/ota.py,sha256=ZHLQRE5ETvLEIu2Vbj3m2XidIWT8uorYSHxkZd3pkRc,1376
|
68
68
|
pymammotion/mammotion/commands/messages/system.py,sha256=XOEeyUAz1iNtPk37dzCbLrxx1pljUlGy1IKuof_Pko0,14244
|
69
69
|
pymammotion/mammotion/commands/messages/video.py,sha256=KN9Zj8h7EnVipVBOzHxWF4RXhU3MpueYe1GNErGHapg,1248
|
@@ -71,7 +71,7 @@ pymammotion/mammotion/control/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5N
|
|
71
71
|
pymammotion/mammotion/control/joystick.py,sha256=QfBVxM_gxpWsZAGO90whtgxCI2tIZ3TTad9wHIPsU9s,5640
|
72
72
|
pymammotion/mammotion/devices/__init__.py,sha256=f2qQFPgLGmV85W2hSlMUh5BYuht9o_Ar_JEAAMD4fsE,102
|
73
73
|
pymammotion/mammotion/devices/base.py,sha256=wM2c2vjfPjYPYmMTk77E833IN1ioearcU2pcLZUkP7I,12030
|
74
|
-
pymammotion/mammotion/devices/mammotion.py,sha256=
|
74
|
+
pymammotion/mammotion/devices/mammotion.py,sha256=c578d2i0dihHtrPtzyK4qWcYGPon-gJo0L0C4g7uzQ8,14563
|
75
75
|
pymammotion/mammotion/devices/mammotion_bluetooth.py,sha256=sgfL4sz6WkIlr2bvYplzxsudmzATNE-z3UGe0K1Csng,18919
|
76
76
|
pymammotion/mammotion/devices/mammotion_cloud.py,sha256=P352E-pcbG6wA-RXubI51EUJ3UUQcqJkxRDIqh3g-58,14217
|
77
77
|
pymammotion/mqtt/__init__.py,sha256=Ocs5e-HLJvTuDpVXyECEsWIvwsUaxzj7lZ9mSYutNDY,105
|
@@ -123,7 +123,7 @@ pymammotion/utility/movement.py,sha256=N75oAoAgFydqoaOedYIxGUHmuTCtPzAOtb-d_29tp
|
|
123
123
|
pymammotion/utility/mur_mur_hash.py,sha256=xEfOZVbqRawJj66eLgtnZ85OauDR47oIPr29OHelzPI,4468
|
124
124
|
pymammotion/utility/periodic.py,sha256=MbeSb9cfhxzYmdT_RiE0dZe3H9IfbQW_zSqhmSX2RUc,3321
|
125
125
|
pymammotion/utility/rocker_util.py,sha256=6tX7sS87qoQC_tsxbx3NLL-HgS08wtzXiZkhDiz7uo0,7179
|
126
|
-
pymammotion-0.4.
|
127
|
-
pymammotion-0.4.
|
128
|
-
pymammotion-0.4.
|
129
|
-
pymammotion-0.4.
|
126
|
+
pymammotion-0.4.50.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
127
|
+
pymammotion-0.4.50.dist-info/METADATA,sha256=ntu1e_YVRR2FH4-B0XS8jqUH7GBvs2DUISuxP04zbUY,3878
|
128
|
+
pymammotion-0.4.50.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
129
|
+
pymammotion-0.4.50.dist-info/RECORD,,
|
File without changes
|
File without changes
|