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

@@ -55,6 +55,8 @@ class AuthRefreshException(Exception):
55
55
  class DeviceOfflineException(Exception):
56
56
  """Raise exception when device is offline."""
57
57
 
58
+ class LoginException(Exception):
59
+ """Raise exception when library cannot log in."""
58
60
 
59
61
  class CloudIOTGateway:
60
62
  """Class for interacting with Aliyun Cloud IoT Gateway."""
@@ -303,8 +305,11 @@ class CloudIOTGateway:
303
305
  params={"request": json.dumps(_bodyParam, separators=(",", ":"))},
304
306
  ) as resp:
305
307
  data = await resp.json()
306
- self._connect_response = ConnectResponse.from_dict(data)
307
308
  logger.debug(data)
309
+ if resp.status == 200:
310
+ self._connect_response = ConnectResponse.from_dict(data)
311
+ return self._connect_response
312
+ raise LoginException(data)
308
313
 
309
314
  async def login_by_oauth(self, country_code: str, auth_code: str):
310
315
  """Login by OAuth."""
@@ -372,8 +377,10 @@ class CloudIOTGateway:
372
377
  ) as resp:
373
378
  data = await resp.json()
374
379
  logger.debug(data)
375
-
376
- self._login_by_oauth_response = LoginByOAuthResponse.from_dict(data)
380
+ if resp.status == 200:
381
+ self._login_by_oauth_response = LoginByOAuthResponse.from_dict(data)
382
+ return self._login_by_oauth_response
383
+ raise LoginException(data)
377
384
 
378
385
  def session_by_auth_code(self):
379
386
  """Create a session by auth code."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pymammotion
3
- Version: 0.2.15
3
+ Version: 0.2.16
4
4
  Summary:
5
5
  License: GNU-3.0
6
6
  Author: Michael Arthur
@@ -1,6 +1,6 @@
1
1
  pymammotion/__init__.py,sha256=kmnjdt3AEMejIz5JK7h1tTJj5ZriAgKwZBa3ScA4-Ao,1516
2
2
  pymammotion/aliyun/__init__.py,sha256=T1lkX7TRYiL4nqYanG4l4MImV-SlavSbuooC-W-uUGw,29
3
- pymammotion/aliyun/cloud_gateway.py,sha256=FCQzc24PHAhdO0rovTNv1yax4fG60CsLK24CxJikP5Y,21856
3
+ pymammotion/aliyun/cloud_gateway.py,sha256=RzlfDGzhaIZcu6o8gzGbSJGiQ3al73jTp3dNb6mqZrk,22221
4
4
  pymammotion/aliyun/cloud_service.py,sha256=YWcKuKK6iRWy5mTnBYgHxcCusiRGGzQt3spSf7dGDss,2183
5
5
  pymammotion/aliyun/dataclass/aep_response.py,sha256=8f6GIP58ve8gd6AL3HBoXxsy0n2q4ygWvjELGnoOnVc,452
6
6
  pymammotion/aliyun/dataclass/connect_response.py,sha256=Yz-fEbDzgGPTo5Of2oAjmFkSv08T7ze80pQU4k-gKIU,824
@@ -111,7 +111,7 @@ pymammotion/utility/device_type.py,sha256=KYawu2glZMVlPmxRbA4kVFujXz3miHp3rJiOWR
111
111
  pymammotion/utility/map.py,sha256=aoi-Luzuph02hKynTofMoq3mnPstanx75MDAVv49CuY,2211
112
112
  pymammotion/utility/periodic.py,sha256=9wJMfwXPlx6Mbp3Fws7LLTI34ZDKphH1bva_Ggyk32g,3281
113
113
  pymammotion/utility/rocker_util.py,sha256=syPL0QN4zMzHiTIkUKS7RXBBptjdbkfNlPddwUD5V3A,7171
114
- pymammotion-0.2.15.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
115
- pymammotion-0.2.15.dist-info/METADATA,sha256=aep84UH19vOBx8r-xrONsANEUg9IeBOu3Fb4k42VoT8,3969
116
- pymammotion-0.2.15.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
117
- pymammotion-0.2.15.dist-info/RECORD,,
114
+ pymammotion-0.2.16.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
115
+ pymammotion-0.2.16.dist-info/METADATA,sha256=SxR4HOcpH2rHpm6h34W7PzbAxJlopexjYivgbWpZthc,3969
116
+ pymammotion-0.2.16.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
117
+ pymammotion-0.2.16.dist-info/RECORD,,