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

pymammotion/http/http.py CHANGED
@@ -18,9 +18,9 @@ DataT = TypeVar("DataT")
18
18
 
19
19
  @dataclass
20
20
  class Response(DataClassDictMixin, Generic[DataT]):
21
- data: DataT
22
21
  code: int
23
22
  msg: str
23
+ data: DataT | None = None
24
24
 
25
25
 
26
26
  @dataclass
@@ -64,11 +64,12 @@ class MammotionHTTP:
64
64
  grant_type="password",
65
65
  ),
66
66
  ) as resp:
67
- data = await resp.json()
68
- # TODO catch errors from mismatch user / password
69
- # Assuming the data format matches the expected structure
70
- login_response_data = LoginResponseData.from_dict(data["data"])
71
- return Response(data=login_response_data, code=data["code"], msg=data["msg"])
67
+ if resp.status == 200:
68
+ data = await resp.json()
69
+ response = Response.from_dict(data)
70
+ # TODO catch errors from mismatch user / password elsewhere
71
+ # Assuming the data format matches the expected structure
72
+ return response
72
73
 
73
74
 
74
75
  async def connect_http(username: str, password: str) -> MammotionHTTP:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pymammotion
3
- Version: 0.2.19
3
+ Version: 0.2.20
4
4
  Summary:
5
5
  License: GNU-3.0
6
6
  Author: Michael Arthur
@@ -42,7 +42,7 @@ pymammotion/data/state_manager.py,sha256=jkedK5qAVDTGqIzlPNCmPpE-Pc1V4e-ZHW6Ds1i
42
42
  pymammotion/event/__init__.py,sha256=mgATR6vPHACNQ-0zH5fi7NdzeTCDV1CZyaWPmtUusi8,115
43
43
  pymammotion/event/event.py,sha256=Fy5-I1p92AO_D67VW4eHQqA4pOt7MZsrP--tVfIVUz8,1820
44
44
  pymammotion/http/_init_.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
45
- pymammotion/http/http.py,sha256=is0PNnglB4hdOMxLi1w5nyOrz3i4N3_jk0XzF_BbAZY,2346
45
+ pymammotion/http/http.py,sha256=gY23HlrJKYhliZf4FJHIchJuxSUs-LvxyICkgRIG1qU,2335
46
46
  pymammotion/mammotion/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
47
47
  pymammotion/mammotion/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
48
48
  pymammotion/mammotion/commands/abstract_message.py,sha256=nw6r7694yzl7iJKqRqhLmAPRjd_TL_Xo_-JXq2_a_ug,222
@@ -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.19.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
115
- pymammotion-0.2.19.dist-info/METADATA,sha256=OAYBonVzuROxFpjnN4-v7Ny1iZhc3HJMvcU_GSYXYvY,3969
116
- pymammotion-0.2.19.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
117
- pymammotion-0.2.19.dist-info/RECORD,,
114
+ pymammotion-0.2.20.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
115
+ pymammotion-0.2.20.dist-info/METADATA,sha256=4x-B6uLX-AuU0YEfQF5b9PgTNGPsMVRppLj4BfXi8lo,3969
116
+ pymammotion-0.2.20.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
117
+ pymammotion-0.2.20.dist-info/RECORD,,