pymammotion 0.4.19__py3-none-any.whl → 0.4.21__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/http/http.py CHANGED
@@ -108,8 +108,12 @@ class MammotionHTTP:
108
108
  # Assuming the data format matches the expected structure
109
109
  return Response[StreamSubscriptionResponse].from_dict(data)
110
110
 
111
- async def refresh_login(self) -> Response[LoginResponseData]:
112
- return await self.login(self.account, self._password)
111
+ async def refresh_login(self, account: str, password: str | None = None) -> Response[LoginResponseData]:
112
+ if self._password is None and password is not None:
113
+ self._password = password
114
+ if self._password is None:
115
+ raise ValueError("Password is required for refresh login")
116
+ return await self.login(account, self._password)
113
117
 
114
118
  async def login(self, account: str, password: str) -> Response[LoginResponseData]:
115
119
  self.account = account
@@ -218,29 +218,32 @@ class MammotionBaseDevice:
218
218
 
219
219
  await self.queue_command("read_plan", sub_cmd=2, plan_index=0)
220
220
 
221
- if len(self.mower.map.root_hash_lists) == 0:
222
- await self.queue_command("get_all_boundary_hash_list", sub_cmd=0)
223
-
224
- for hash, frame in self.mower.map.area.items():
221
+ for hash, frame in list(self.mower.map.area.items()):
225
222
  missing_frames = self.mower.map.find_missing_frames(frame)
226
223
  if len(missing_frames) > 0:
227
224
  del self.mower.map.area[hash]
228
225
 
229
- for hash, frame in self.mower.map.path.items():
226
+ for hash, frame in list(self.mower.map.path.items()):
230
227
  missing_frames = self.mower.map.find_missing_frames(frame)
231
228
  if len(missing_frames) > 0:
232
229
  del self.mower.map.path[hash]
233
230
 
234
- for hash, frame in self.mower.map.obstacle.items():
231
+ for hash, frame in list(self.mower.map.obstacle.items()):
235
232
  missing_frames = self.mower.map.find_missing_frames(frame)
236
233
  if len(missing_frames) > 0:
237
234
  del self.mower.map.obstacle[hash]
238
235
 
236
+ # don't know why but total frame on svg is wrong
239
237
  # for hash, frame in self.mower.map.svg.items():
240
238
  # missing_frames = self.mower.map.find_missing_frames(frame)
241
239
  # if len(missing_frames) > 0:
242
240
  # del self.mower.map.svg[hash]
243
241
 
242
+ if len(self.mower.map.root_hash_lists) == 0:
243
+ await self.queue_command("get_all_boundary_hash_list", sub_cmd=0)
244
+ # add a small delay to allow result to come through if it does.
245
+ await asyncio.sleep(1)
246
+
244
247
  if len(self.mower.map.missing_hashlist()) > 0:
245
248
  data_hash = self.mower.map.missing_hashlist().pop()
246
249
  await self.queue_command("synchronize_hash_data", hash_num=data_hash)
@@ -187,14 +187,15 @@ class Mammotion:
187
187
  cloud_client = await self.login(account, password)
188
188
  await self.initiate_cloud_connection(account, cloud_client)
189
189
 
190
- async def refresh_login(self, account: str) -> None:
190
+ async def refresh_login(self, account: str, password: str | None = None) -> None:
191
191
  async with self._login_lock:
192
192
  exists: MammotionCloud | None = self.mqtt_list.get(account)
193
193
  if not exists:
194
194
  return
195
195
  mammotion_http = exists.cloud_client.mammotion_http
196
- await mammotion_http.refresh_login()
196
+ await mammotion_http.refresh_login(account, password)
197
197
  await self.connect_iot(mammotion_http, exists.cloud_client)
198
+
198
199
  if not exists.is_connected():
199
200
  loop = asyncio.get_running_loop()
200
201
  await loop.run_in_executor(None, exists.connect_async)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pymammotion
3
- Version: 0.4.19
3
+ Version: 0.4.21
4
4
  Summary:
5
5
  License: GPL-3.0
6
6
  Author: Michael Arthur
@@ -50,7 +50,7 @@ pymammotion/event/__init__.py,sha256=mgATR6vPHACNQ-0zH5fi7NdzeTCDV1CZyaWPmtUusi8
50
50
  pymammotion/event/event.py,sha256=bj2RirSIRyBs0QvkcrOtwZWUX_8F3m1sySuHVyKmZLs,2143
51
51
  pymammotion/http/_init_.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
52
52
  pymammotion/http/encryption.py,sha256=lzXu3WwBdQlzjXxWnlJuRgkCrKdPbxx5drhMitVKIEk,8287
53
- pymammotion/http/http.py,sha256=vNjdteOz7aDQBzTg406EUNP247nKrMBIepf2_Q-oRUI,7121
53
+ pymammotion/http/http.py,sha256=doncq4jXGQt6jXzt2ZL6n8pne45jPFAVJKhGabi5LMw,7363
54
54
  pymammotion/http/model/http.py,sha256=tM5ikwVkWhRdXc2xi1NOLmWPH2mQEQelpaVgMlAEmlI,2333
55
55
  pymammotion/mammotion/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
56
56
  pymammotion/mammotion/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -67,8 +67,8 @@ pymammotion/mammotion/commands/messages/video.py,sha256=YQGIxKx2prA0X01ovNmMkX6Y
67
67
  pymammotion/mammotion/control/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
68
68
  pymammotion/mammotion/control/joystick.py,sha256=QfBVxM_gxpWsZAGO90whtgxCI2tIZ3TTad9wHIPsU9s,5640
69
69
  pymammotion/mammotion/devices/__init__.py,sha256=f2qQFPgLGmV85W2hSlMUh5BYuht9o_Ar_JEAAMD4fsE,102
70
- pymammotion/mammotion/devices/base.py,sha256=uLxsMNKH0htMWqrtospSvWTiOxB36RbpQm6mY6tOglM,11715
71
- pymammotion/mammotion/devices/mammotion.py,sha256=BgbXT4afkOyDAX1E52vuHNkOpqrDLKlqt9TA0gPwRTo,13624
70
+ pymammotion/mammotion/devices/base.py,sha256=w7ZucgZkOBdpPajrJs-W4oZpoDRpTDYgCCdVlwOP-uo,11901
71
+ pymammotion/mammotion/devices/mammotion.py,sha256=ffzwsQqO9zDwMElWYMsxi-J5_rGaOOOHdAm5D3DXprc,13671
72
72
  pymammotion/mammotion/devices/mammotion_bluetooth.py,sha256=B1tpnC8vrbXGKhFq-l5LR86EcCvd6iHuW5kOkhpjwgY,19541
73
73
  pymammotion/mammotion/devices/mammotion_cloud.py,sha256=vh35qIT5hC6h6TwwejGa_GusU_oD7_dsX9b8b526irI,13720
74
74
  pymammotion/mqtt/__init__.py,sha256=Ocs5e-HLJvTuDpVXyECEsWIvwsUaxzj7lZ9mSYutNDY,105
@@ -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.4.19.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
123
- pymammotion-0.4.19.dist-info/METADATA,sha256=ciOG-_W-oTAo9LbeY71LjKI26f4PwS8TTVKF7p54AI0,3834
124
- pymammotion-0.4.19.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
125
- pymammotion-0.4.19.dist-info/RECORD,,
122
+ pymammotion-0.4.21.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
123
+ pymammotion-0.4.21.dist-info/METADATA,sha256=yevyvFzOc9oRwbm9Qm4-KAndb4D4VQGHwuB42tlH1gY,3834
124
+ pymammotion-0.4.21.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
125
+ pymammotion-0.4.21.dist-info/RECORD,,