pymammotion 0.5.31__py3-none-any.whl → 0.5.33__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.

@@ -600,6 +600,10 @@ class CloudIOTGateway:
600
600
  await self.sign_out()
601
601
  raise CheckSessionException("Error check or refresh token: " + response_body_dict.__str__())
602
602
 
603
+ if response_body_dict.get("code") == 2401:
604
+ await self.sign_out()
605
+ raise CheckSessionException("Error check or refresh token: " + response_body_dict.__str__())
606
+
603
607
  session = SessionByAuthCodeResponse.from_dict(response_body_dict)
604
608
  session_data = session.data
605
609
 
@@ -803,6 +807,10 @@ class CloudIOTGateway:
803
807
  if response_body_dict.get("code") == 6205:
804
808
  raise DeviceOfflineException(response_body_dict.get("code"), iot_id)
805
809
 
810
+ if response_body_dict.get("code") == 460:
811
+ logger.debug("iotToken expired, must re-login.")
812
+ raise CheckSessionException(response_body_dict.get("message"))
813
+
806
814
  if self.message_delay != 1:
807
815
  self.message_delay = 1
808
816
 
@@ -1,7 +1,6 @@
1
1
  from abc import abstractmethod
2
2
  import asyncio
3
3
  import logging
4
- import time
5
4
  from typing import Any
6
5
 
7
6
  import betterproto2
@@ -43,7 +42,6 @@ class MammotionBaseDevice:
43
42
  self._raw_mower_data: RawMowerData = RawMowerData()
44
43
  self._notify_future: asyncio.Future[bytes] | None = None
45
44
  self._cloud_device = cloud_device
46
- self.command_sent_time: float = time.time()
47
45
 
48
46
  async def datahash_response(self, hash_ack: NavGetHashListAck) -> None:
49
47
  """Handle datahash responses for root level hashs."""
@@ -76,6 +76,7 @@ class MammotionBaseBLEDevice(MammotionBaseDevice):
76
76
  ) -> None:
77
77
  """Initialize MammotionBaseBLEDevice."""
78
78
  super().__init__(state_manager, cloud_device)
79
+ self.command_sent_time = 0
79
80
  self._disconnect_strategy = True
80
81
  self._ble_sync_task = None
81
82
  self._prev_notification = None
@@ -33,6 +33,7 @@ class MammotionCloud:
33
33
  def __init__(self, mqtt_client: MammotionMQTT, cloud_client: CloudIOTGateway) -> None:
34
34
  """Initialize MammotionCloud."""
35
35
  self.cloud_client = cloud_client
36
+ self.command_sent_time = 0
36
37
  self.loop = asyncio.get_event_loop()
37
38
  self.is_ready = False
38
39
  self.command_queue = asyncio.Queue()
@@ -212,6 +213,10 @@ class MammotionBaseCloudDevice(MammotionBaseDevice):
212
213
  """Cleanup."""
213
214
  self._state_manager.cloud_queue_command_callback.remove_subscribers(self.queue_command)
214
215
 
216
+ @property
217
+ def command_sent_time(self) -> float:
218
+ return self._mqtt.command_sent_time
219
+
215
220
  def set_notification_callback(self, func: Callable[[tuple[str, Any | None]], Awaitable[None]]) -> None:
216
221
  self._state_manager.cloud_on_notification_callback.add_subscribers(func)
217
222
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pymammotion
3
- Version: 0.5.31
3
+ Version: 0.5.33
4
4
  Summary:
5
5
  License: GPL-3.0
6
6
  Author: Michael Arthur
@@ -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
3
  pymammotion/aliyun/client.py,sha256=gS15-fAYn3nViwFY3zMlS_2T9mZokFLUyuHADaXH-O8,9777
4
- pymammotion/aliyun/cloud_gateway.py,sha256=_4emfnKNye5CEn4fzfrWSTAlfYZupZrIBFBPx-OCkHE,32038
4
+ pymammotion/aliyun/cloud_gateway.py,sha256=MFtKG1cefV3s5eU7r7o8887Y482ZWz_O3LOYMvatoqs,32428
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
@@ -75,10 +75,10 @@ pymammotion/mammotion/commands/messages/video.py,sha256=5D5Azt6Q63K-OeC2eSPmmrGg
75
75
  pymammotion/mammotion/control/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
76
76
  pymammotion/mammotion/control/joystick.py,sha256=QfBVxM_gxpWsZAGO90whtgxCI2tIZ3TTad9wHIPsU9s,5640
77
77
  pymammotion/mammotion/devices/__init__.py,sha256=f2qQFPgLGmV85W2hSlMUh5BYuht9o_Ar_JEAAMD4fsE,102
78
- pymammotion/mammotion/devices/base.py,sha256=BPuikWg69cUqmRnphqEcS1HU-sNLAOkMjyZE_u5mp08,12082
78
+ pymammotion/mammotion/devices/base.py,sha256=GIkiSP_pNgM1HbciXXeOYEjFzx8OiimH9cL4rqshAsI,12018
79
79
  pymammotion/mammotion/devices/mammotion.py,sha256=b12tqRQOhnqaP6zcNsCHUnTCVPxD07GgXwqVDbABw9o,15837
80
- pymammotion/mammotion/devices/mammotion_bluetooth.py,sha256=lVqGice3fv-Xura10PuWUCMdtNXf84gtf3S1STw2hr4,19345
81
- pymammotion/mammotion/devices/mammotion_cloud.py,sha256=WGB3S4KW8DGZB3au-bTNE-FCu6LZYp2zFOktfHmix6A,16489
80
+ pymammotion/mammotion/devices/mammotion_bluetooth.py,sha256=u-uZKXwfk61a24n7Z9tJw6Vm0LHa7EZqVQ7SoS_YJAQ,19380
81
+ pymammotion/mammotion/devices/mammotion_cloud.py,sha256=mo7zPKm5HNoMTID2rdHQM222xt4s_8hK97NRgQCl0Fo,16625
82
82
  pymammotion/mqtt/__init__.py,sha256=Ocs5e-HLJvTuDpVXyECEsWIvwsUaxzj7lZ9mSYutNDY,105
83
83
  pymammotion/mqtt/linkkit/__init__.py,sha256=ENgc3ynd2kd9gMQR3-kgmCu6Ed9Y6XCIzU0zFReUlkk,80
84
84
  pymammotion/mqtt/linkkit/h2client.py,sha256=w9Nvi_nY4CLD_fw-pHtYChwQf7e2TiAGeqkY_sF4cf0,19659
@@ -130,7 +130,7 @@ pymammotion/utility/movement.py,sha256=N75oAoAgFydqoaOedYIxGUHmuTCtPzAOtb-d_29tp
130
130
  pymammotion/utility/mur_mur_hash.py,sha256=xEfOZVbqRawJj66eLgtnZ85OauDR47oIPr29OHelzPI,4468
131
131
  pymammotion/utility/periodic.py,sha256=MbeSb9cfhxzYmdT_RiE0dZe3H9IfbQW_zSqhmSX2RUc,3321
132
132
  pymammotion/utility/rocker_util.py,sha256=6tX7sS87qoQC_tsxbx3NLL-HgS08wtzXiZkhDiz7uo0,7179
133
- pymammotion-0.5.31.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
134
- pymammotion-0.5.31.dist-info/METADATA,sha256=g6jfhpGz1AW-oRGXkvDnprGUYitz8DJ-Ibm310TmKGs,3912
135
- pymammotion-0.5.31.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
136
- pymammotion-0.5.31.dist-info/RECORD,,
133
+ pymammotion-0.5.33.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
134
+ pymammotion-0.5.33.dist-info/METADATA,sha256=AzduzVw-y6wPLTZUgSFtdIm3cckQeCuGVX45i7eM2-U,3912
135
+ pymammotion-0.5.33.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
136
+ pymammotion-0.5.33.dist-info/RECORD,,