pymammotion 0.4.14__py3-none-any.whl → 0.4.15__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.
@@ -146,6 +146,10 @@ class CloudIOTGateway:
146
146
 
147
147
  def get_region(self, country_code: str, auth_code: str):
148
148
  """Get the region based on country code and auth code."""
149
+
150
+ if self._region_response is not None:
151
+ return self._region_response
152
+
149
153
  config = Config(
150
154
  app_key=self._app_key,
151
155
  app_secret=self._app_secret,
@@ -269,13 +269,23 @@ class HashList(DataClassORJSONMixin):
269
269
  return missing_numbers
270
270
 
271
271
  @staticmethod
272
- def _add_hash_data(hash_dict: dict, hash_data: NavGetCommData | SvgMessage) -> bool:
272
+ def _add_hash_data(hash_dict: dict[int, FrameList], hash_data: NavGetCommData | SvgMessage) -> bool:
273
273
  if isinstance(hash_data, SvgMessage):
274
274
  if hash_dict.get(hash_data.data_hash) is None:
275
275
  hash_dict[hash_data.data_hash] = FrameList(total_frame=hash_data.total_frame, data=[hash_data])
276
276
  return True
277
277
 
278
278
  if hash_data not in hash_dict[hash_data.data_hash].data:
279
+ exists = next(
280
+ (
281
+ rhl
282
+ for rhl in hash_dict[hash_data.data_hash].data
283
+ if rhl.current_frame == hash_data.current_frame
284
+ ),
285
+ None,
286
+ )
287
+ if exists:
288
+ return True
279
289
  hash_dict[hash_data.data_hash].data.append(hash_data)
280
290
  return True
281
291
  return False
@@ -285,6 +295,12 @@ class HashList(DataClassORJSONMixin):
285
295
  return True
286
296
 
287
297
  if hash_data not in hash_dict[hash_data.hash].data:
298
+ exists = next(
299
+ (rhl for rhl in hash_dict[hash_data.hash].data if rhl.current_frame == hash_data.current_frame),
300
+ None,
301
+ )
302
+ if exists:
303
+ return True
288
304
  hash_dict[hash_data.hash].data.append(hash_data)
289
305
  return True
290
306
  return False
@@ -1,5 +1,5 @@
1
1
  import asyncio
2
- from asyncio import TimerHandle
2
+ from asyncio import InvalidStateError, TimerHandle
3
3
  import base64
4
4
  from collections import deque
5
5
  from collections.abc import Awaitable, Callable
@@ -87,7 +87,11 @@ class MammotionCloud:
87
87
  future.set_result(result)
88
88
  except Exception as ex:
89
89
  # Set the exception on the future if something goes wrong
90
- future.set_exception(ex)
90
+ try:
91
+ future.set_exception(ex)
92
+ except InvalidStateError:
93
+ """Dead end, log an error."""
94
+ _LOGGER.exception("InvalidStateError while trying to bubble up exception")
91
95
  finally:
92
96
  # Mark the task as done
93
97
  self.command_queue.task_done()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pymammotion
3
- Version: 0.4.14
3
+ Version: 0.4.15
4
4
  Summary:
5
5
  License: GPL-3.0
6
6
  Author: Michael Arthur
@@ -1,6 +1,6 @@
1
1
  pymammotion/__init__.py,sha256=u1OHuD8Uj0qCOH4I7Lt5d7T-TPt1R0pY-bv8S6UfVxM,1587
2
2
  pymammotion/aliyun/__init__.py,sha256=T1lkX7TRYiL4nqYanG4l4MImV-SlavSbuooC-W-uUGw,29
3
- pymammotion/aliyun/cloud_gateway.py,sha256=mafX63IuRhbSLNv5WjwhbDY4HJGHRCYAMJseVOQebJE,26605
3
+ pymammotion/aliyun/cloud_gateway.py,sha256=_t9PDpsULxMd5a3xnUrb2jr9_0Hj6V7bXcoGnl0nZq8,26694
4
4
  pymammotion/aliyun/model/aep_response.py,sha256=EY4uMTJ4F9rvbcXnAOc5YKi7q__9kIVgfDwfyr65Gk0,421
5
5
  pymammotion/aliyun/model/connect_response.py,sha256=Yz-fEbDzgGPTo5Of2oAjmFkSv08T7ze80pQU4k-gKIU,824
6
6
  pymammotion/aliyun/model/dev_by_account_response.py,sha256=P9yYy4Z2tLkJSqXA_5XGaCUliSSVa5ILl7VoMtL_tCA,977
@@ -31,7 +31,7 @@ pymammotion/data/model/enums.py,sha256=EpKmO8yVUZyEnTY4yH0DMMVKYNQM42zpW1maUu0i3
31
31
  pymammotion/data/model/excute_boarder_params.py,sha256=9CpUqrygcle1C_1hDW-riLmm4map4ZbE842NXjcomEI,1394
32
32
  pymammotion/data/model/execute_boarder.py,sha256=9rd_h4fbcsXxgnLOd2rO2hWyD1abnTGc47QTEpp8DD0,1103
33
33
  pymammotion/data/model/generate_route_information.py,sha256=pgjqURwmEIzjCMbl4Z5JDDkfxyUAdry1KhPfyir3-mU,777
34
- pymammotion/data/model/hash_list.py,sha256=nN_FndIkPK61EaQEY8c3bC1DyGoQmuoAENOOOcc2IdY,9921
34
+ pymammotion/data/model/hash_list.py,sha256=oe4vSj3Xf_JWrD9vDGrxtjDF0vp6tR8htNFIR3mKpwM,10514
35
35
  pymammotion/data/model/location.py,sha256=PwmITejfI4pm7PI4rzqSuuHetwle6IJr_CV95435s2M,871
36
36
  pymammotion/data/model/mowing_modes.py,sha256=bBbRhDe-imZsXDR0TN0emQv6BiIkAlXJFb5isPEjgDk,1078
37
37
  pymammotion/data/model/plan.py,sha256=wGlcJT-w0EdbWK9jI838TCOm_MABFg7WoR664VB8RWg,2880
@@ -68,7 +68,7 @@ pymammotion/mammotion/devices/__init__.py,sha256=f2qQFPgLGmV85W2hSlMUh5BYuht9o_A
68
68
  pymammotion/mammotion/devices/base.py,sha256=urFR2c_kZGoUJ6e0KPY7I5OU-sfrINxuLAIyML_jGAY,10482
69
69
  pymammotion/mammotion/devices/mammotion.py,sha256=Zz2tUIdGA-jFSHLM3aO8tBMvVl7sBIBiqC9Kg7f-lm8,13190
70
70
  pymammotion/mammotion/devices/mammotion_bluetooth.py,sha256=0c-HXawLQVHz28s0HKaSCNq4wmLWJZZ3ATDVnCXdSrc,19579
71
- pymammotion/mammotion/devices/mammotion_cloud.py,sha256=xCoO57Az6Rkq2e4uAohL4DoNnDHTYpBb9YX5tj0GVp8,14526
71
+ pymammotion/mammotion/devices/mammotion_cloud.py,sha256=A1irPnfyb1xnhnnABUTZkJUm3-SYNbjEYRI5lDjPTI8,14757
72
72
  pymammotion/mqtt/__init__.py,sha256=Ocs5e-HLJvTuDpVXyECEsWIvwsUaxzj7lZ9mSYutNDY,105
73
73
  pymammotion/mqtt/linkkit/__init__.py,sha256=ENgc3ynd2kd9gMQR3-kgmCu6Ed9Y6XCIzU0zFReUlkk,80
74
74
  pymammotion/mqtt/linkkit/h2client.py,sha256=w9Nvi_nY4CLD_fw-pHtYChwQf7e2TiAGeqkY_sF4cf0,19659
@@ -117,7 +117,7 @@ pymammotion/utility/map.py,sha256=GYscVMg2cX3IPlNpCBNHDW0S55yS1WGRf1iHnNZ7TfQ,22
117
117
  pymammotion/utility/movement.py,sha256=N75oAoAgFydqoaOedYIxGUHmuTCtPzAOtb-d_29tpfI,615
118
118
  pymammotion/utility/periodic.py,sha256=MbeSb9cfhxzYmdT_RiE0dZe3H9IfbQW_zSqhmSX2RUc,3321
119
119
  pymammotion/utility/rocker_util.py,sha256=6tX7sS87qoQC_tsxbx3NLL-HgS08wtzXiZkhDiz7uo0,7179
120
- pymammotion-0.4.14.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
121
- pymammotion-0.4.14.dist-info/METADATA,sha256=NRlymDDBNkVkm09-tl8lTVuJ46QRYtJe7SIB8URO6qg,3834
122
- pymammotion-0.4.14.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
123
- pymammotion-0.4.14.dist-info/RECORD,,
120
+ pymammotion-0.4.15.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
121
+ pymammotion-0.4.15.dist-info/METADATA,sha256=GZAoKgk5WReOioLw-xTy2aj5hk6eyr8kPo3FFQ_uMes,3834
122
+ pymammotion-0.4.15.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
123
+ pymammotion-0.4.15.dist-info/RECORD,,