pymammotion 0.5.32__py3-none-any.whl → 0.5.34__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
 
pymammotion/http/http.py CHANGED
@@ -13,12 +13,12 @@ from pymammotion.http.model.rtk import RTK
13
13
 
14
14
 
15
15
  class MammotionHTTP:
16
- def __init__(self) -> None:
16
+ def __init__(self, account: str | None = None, password: str | None = None) -> None:
17
17
  self.expires_in = 0
18
18
  self.code = 0
19
19
  self.msg = None
20
- self.account = None
21
- self._password = None
20
+ self.account = account
21
+ self._password = password
22
22
  self.response: Response | None = None
23
23
  self.login_info: LoginResponseData | None = None
24
24
  self._headers = {"User-Agent": "okhttp/4.9.3", "App-Version": "Home Assistant,1.14.2.29"}
@@ -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
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pymammotion
3
- Version: 0.5.32
3
+ Version: 0.5.34
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
@@ -53,7 +53,7 @@ pymammotion/event/event.py,sha256=Z8WYxv_-5khEqKjL1w4c_Et24G1Kdm8QFuIBylD3h3U,30
53
53
  pymammotion/http/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
54
54
  pymammotion/http/_init_.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
55
55
  pymammotion/http/encryption.py,sha256=lzXu3WwBdQlzjXxWnlJuRgkCrKdPbxx5drhMitVKIEk,8287
56
- pymammotion/http/http.py,sha256=vhk2oMZETsIYMaweL5mpRQQwxbssHmRZ-Bx0197yA-M,14649
56
+ pymammotion/http/http.py,sha256=SK0Sb4L6Kti6d_cFd4l9Qr_TgCR4MjHBuBCNZlPdur8,14713
57
57
  pymammotion/http/model/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
58
58
  pymammotion/http/model/camera_stream.py,sha256=ilxQNny_w9Frwt-m8kbHinvyjDv4Bx8C2swfZ2lTEDE,600
59
59
  pymammotion/http/model/http.py,sha256=VDBmi9nyY5Y2ns_HYvKIyzbkKRxhZ5elpq0lWXWzbGw,4123
@@ -75,7 +75,7 @@ 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=M-d71N7kERYVxkIG6bhxPTd7pu896gX086T7IGxDrR4,12030
78
+ pymammotion/mammotion/devices/base.py,sha256=GIkiSP_pNgM1HbciXXeOYEjFzx8OiimH9cL4rqshAsI,12018
79
79
  pymammotion/mammotion/devices/mammotion.py,sha256=b12tqRQOhnqaP6zcNsCHUnTCVPxD07GgXwqVDbABw9o,15837
80
80
  pymammotion/mammotion/devices/mammotion_bluetooth.py,sha256=u-uZKXwfk61a24n7Z9tJw6Vm0LHa7EZqVQ7SoS_YJAQ,19380
81
81
  pymammotion/mammotion/devices/mammotion_cloud.py,sha256=mo7zPKm5HNoMTID2rdHQM222xt4s_8hK97NRgQCl0Fo,16625
@@ -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.32.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
134
- pymammotion-0.5.32.dist-info/METADATA,sha256=3u5j8YS2qqHlMWR_t1fxeedzWFSqd1SL5xayab1ufkQ,3912
135
- pymammotion-0.5.32.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
136
- pymammotion-0.5.32.dist-info/RECORD,,
133
+ pymammotion-0.5.34.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
134
+ pymammotion-0.5.34.dist-info/METADATA,sha256=ZJCvduFIOT-gyzA0aj5iSjOoSvlCbnzwO261FtyFZOg,3912
135
+ pymammotion-0.5.34.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
136
+ pymammotion-0.5.34.dist-info/RECORD,,