pymammotion 0.4.13__tar.gz → 0.4.15__tar.gz

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.
Files changed (123) hide show
  1. {pymammotion-0.4.13 → pymammotion-0.4.15}/PKG-INFO +1 -1
  2. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/aliyun/cloud_gateway.py +4 -0
  3. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/data/model/hash_list.py +17 -1
  4. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/mammotion/devices/mammotion_cloud.py +11 -4
  5. {pymammotion-0.4.13 → pymammotion-0.4.15}/pyproject.toml +2 -2
  6. {pymammotion-0.4.13 → pymammotion-0.4.15}/LICENSE +0 -0
  7. {pymammotion-0.4.13 → pymammotion-0.4.15}/README.md +0 -0
  8. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/__init__.py +0 -0
  9. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/aliyun/__init__.py +0 -0
  10. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/aliyun/model/aep_response.py +0 -0
  11. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/aliyun/model/connect_response.py +0 -0
  12. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/aliyun/model/dev_by_account_response.py +0 -0
  13. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/aliyun/model/login_by_oauth_response.py +0 -0
  14. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/aliyun/model/regions_response.py +0 -0
  15. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/aliyun/model/session_by_authcode_response.py +0 -0
  16. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/aliyun/model/stream_subscription_response.py +0 -0
  17. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/aliyun/tmp_constant.py +0 -0
  18. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/bluetooth/__init__.py +0 -0
  19. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/bluetooth/ble.py +0 -0
  20. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/bluetooth/ble_message.py +0 -0
  21. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/bluetooth/const.py +0 -0
  22. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/bluetooth/data/__init__.py +0 -0
  23. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/bluetooth/data/convert.py +0 -0
  24. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/bluetooth/data/framectrldata.py +0 -0
  25. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/bluetooth/data/notifydata.py +0 -0
  26. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/bluetooth/model/__init__.py +0 -0
  27. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/bluetooth/model/atomic_integer.py +0 -0
  28. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/const.py +0 -0
  29. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/data/__init__.py +0 -0
  30. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/data/model/__init__.py +0 -0
  31. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/data/model/account.py +0 -0
  32. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/data/model/device.py +0 -0
  33. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/data/model/device_config.py +0 -0
  34. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/data/model/device_info.py +0 -0
  35. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/data/model/device_limits.py +0 -0
  36. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/data/model/enums.py +0 -0
  37. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/data/model/excute_boarder_params.py +0 -0
  38. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/data/model/execute_boarder.py +0 -0
  39. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/data/model/generate_route_information.py +0 -0
  40. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/data/model/location.py +0 -0
  41. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/data/model/mowing_modes.py +0 -0
  42. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/data/model/plan.py +0 -0
  43. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/data/model/rapid_state.py +0 -0
  44. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/data/model/raw_data.py +0 -0
  45. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/data/model/region_data.py +0 -0
  46. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/data/model/report_info.py +0 -0
  47. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/data/mqtt/__init__.py +0 -0
  48. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/data/mqtt/event.py +0 -0
  49. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/data/mqtt/properties.py +0 -0
  50. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/data/mqtt/status.py +0 -0
  51. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/data/state_manager.py +0 -0
  52. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/event/__init__.py +0 -0
  53. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/event/event.py +0 -0
  54. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/http/_init_.py +0 -0
  55. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/http/encryption.py +0 -0
  56. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/http/http.py +0 -0
  57. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/http/model/http.py +0 -0
  58. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/mammotion/__init__.py +0 -0
  59. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/mammotion/commands/__init__.py +0 -0
  60. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/mammotion/commands/abstract_message.py +0 -0
  61. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/mammotion/commands/mammotion_command.py +0 -0
  62. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/mammotion/commands/messages/__init__.py +0 -0
  63. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/mammotion/commands/messages/driver.py +0 -0
  64. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/mammotion/commands/messages/media.py +0 -0
  65. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/mammotion/commands/messages/navigation.py +0 -0
  66. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/mammotion/commands/messages/network.py +0 -0
  67. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/mammotion/commands/messages/ota.py +0 -0
  68. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/mammotion/commands/messages/system.py +0 -0
  69. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/mammotion/commands/messages/video.py +0 -0
  70. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/mammotion/control/__init__.py +0 -0
  71. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/mammotion/control/joystick.py +0 -0
  72. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/mammotion/devices/__init__.py +0 -0
  73. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/mammotion/devices/base.py +0 -0
  74. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/mammotion/devices/mammotion.py +0 -0
  75. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/mammotion/devices/mammotion_bluetooth.py +0 -0
  76. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/mqtt/__init__.py +0 -0
  77. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/mqtt/linkkit/__init__.py +0 -0
  78. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/mqtt/linkkit/h2client.py +0 -0
  79. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/mqtt/linkkit/linkkit.py +0 -0
  80. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/mqtt/mammotion_future.py +0 -0
  81. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/mqtt/mammotion_mqtt.py +0 -0
  82. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/proto/__init__.py +0 -0
  83. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/proto/basestation.proto +0 -0
  84. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/proto/basestation_pb2.py +0 -0
  85. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/proto/basestation_pb2.pyi +0 -0
  86. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/proto/common.proto +0 -0
  87. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/proto/common_pb2.py +0 -0
  88. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/proto/common_pb2.pyi +0 -0
  89. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/proto/dev_net.proto +0 -0
  90. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/proto/dev_net_pb2.py +0 -0
  91. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/proto/dev_net_pb2.pyi +0 -0
  92. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/proto/luba_msg.proto +0 -0
  93. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/proto/luba_msg_pb2.py +0 -0
  94. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/proto/luba_msg_pb2.pyi +0 -0
  95. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/proto/luba_mul.proto +0 -0
  96. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/proto/luba_mul_pb2.py +0 -0
  97. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/proto/luba_mul_pb2.pyi +0 -0
  98. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/proto/mctrl_driver.proto +0 -0
  99. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/proto/mctrl_driver_pb2.py +0 -0
  100. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/proto/mctrl_driver_pb2.pyi +0 -0
  101. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/proto/mctrl_nav.proto +0 -0
  102. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/proto/mctrl_nav_pb2.py +0 -0
  103. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/proto/mctrl_nav_pb2.pyi +0 -0
  104. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/proto/mctrl_ota.proto +0 -0
  105. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/proto/mctrl_ota_pb2.py +0 -0
  106. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/proto/mctrl_ota_pb2.pyi +0 -0
  107. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/proto/mctrl_pept.proto +0 -0
  108. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/proto/mctrl_pept_pb2.py +0 -0
  109. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/proto/mctrl_pept_pb2.pyi +0 -0
  110. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/proto/mctrl_sys.proto +0 -0
  111. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/proto/mctrl_sys_pb2.py +0 -0
  112. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/proto/mctrl_sys_pb2.pyi +0 -0
  113. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/py.typed +0 -0
  114. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/utility/constant/__init__.py +0 -0
  115. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/utility/constant/device_constant.py +0 -0
  116. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/utility/conversions.py +0 -0
  117. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/utility/datatype_converter.py +0 -0
  118. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/utility/device_config.py +0 -0
  119. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/utility/device_type.py +0 -0
  120. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/utility/map.py +0 -0
  121. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/utility/movement.py +0 -0
  122. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/utility/periodic.py +0 -0
  123. {pymammotion-0.4.13 → pymammotion-0.4.15}/pymammotion/utility/rocker_util.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pymammotion
3
- Version: 0.4.13
3
+ Version: 0.4.15
4
4
  Summary:
5
5
  License: GPL-3.0
6
6
  Author: Michael Arthur
@@ -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
@@ -11,7 +11,7 @@ import betterproto
11
11
  from Tea.exceptions import UnretryableException
12
12
 
13
13
  from pymammotion import CloudIOTGateway, MammotionMQTT
14
- from pymammotion.aliyun.cloud_gateway import DeviceOfflineException
14
+ from pymammotion.aliyun.cloud_gateway import CheckSessionException, DeviceOfflineException, SetupException
15
15
  from pymammotion.aliyun.model.dev_by_account_response import Device
16
16
  from pymammotion.data.mqtt.event import ThingEventMessage
17
17
  from pymammotion.data.mqtt.properties import ThingPropertiesMessage
@@ -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()
@@ -239,7 +243,10 @@ class MammotionBaseCloudDevice(MammotionBaseDevice):
239
243
  async def _ble_sync(self) -> None:
240
244
  command_bytes = self._commands.send_todev_ble_sync(3)
241
245
  loop = asyncio.get_running_loop()
242
- await loop.run_in_executor(None, self._mqtt.send_command, self.iot_id, command_bytes)
246
+ try:
247
+ await loop.run_in_executor(None, self._mqtt.send_command, self.iot_id, command_bytes)
248
+ except (CheckSessionException, SetupException):
249
+ self._ble_sync_task.cancel()
243
250
 
244
251
  async def run_periodic_sync_task(self) -> None:
245
252
  """Send ble sync to robot."""
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
4
4
 
5
5
  [project]
6
6
  name = "pymammotion"
7
- version = "0.4.13"
7
+ version = "0.4.15"
8
8
  license = "GPL-3.0"
9
9
  description = ""
10
10
  readme = "README.md"
@@ -66,7 +66,7 @@ autotyping = "^24.3.0"
66
66
  ipython = "^9.0.2"
67
67
 
68
68
  [tool.bumpver]
69
- current_version = "0.4.13"
69
+ current_version = "0.4.15"
70
70
  version_pattern = "MAJOR.MINOR.PATCH"
71
71
  commit_message = "Bump version {old_version} -> {new_version}"
72
72
  commit = true
File without changes
File without changes