pymammotion 0.3.6__py3-none-any.whl → 0.3.8__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.
@@ -45,6 +45,7 @@ class MowingDevice(DataClassORJSONMixin):
45
45
  err_code_list: list = field(default_factory=list)
46
46
  err_code_list_time: Optional[list] = field(default_factory=list)
47
47
  limits: DeviceLimits = field(default_factory=DeviceLimits)
48
+ device: Optional[LubaMsg] = field(default_factory=LubaMsg)
48
49
  error_codes: dict[str, ErrorInfo] = field(default_factory=dict)
49
50
 
50
51
  @classmethod
pymammotion/http/http.py CHANGED
@@ -15,7 +15,7 @@ from pymammotion.http.model.http import ErrorInfo, LoginResponseData, Response
15
15
 
16
16
  class MammotionHTTP:
17
17
  def __init__(self, response: Response) -> None:
18
- self._headers = dict()
18
+ self._headers = {"User-Agent": "okhttp/3.14.9", "App-Version": "google Pixel 2 XL taimen-Android 11,1.11.332"}
19
19
  self.login_info = LoginResponseData.from_dict(response.data) if response.data else None
20
20
  self._headers["Authorization"] = f"Bearer {self.login_info.access_token}" if response.data else None
21
21
  self.response = response
@@ -55,6 +55,7 @@ class MammotionHTTP:
55
55
  headers={
56
56
  "Authorization": f"{self._headers.get('Authorization', "")}",
57
57
  "Content-Type": "application/json",
58
+ "User-Agent": "okhttp/3.14.9",
58
59
  },
59
60
  ) as resp:
60
61
  data = await resp.json()
@@ -66,6 +67,7 @@ class MammotionHTTP:
66
67
  async def login(cls, session: ClientSession, username: str, password: str) -> Response[LoginResponseData]:
67
68
  async with session.post(
68
69
  "/oauth/token",
70
+ headers={"User-Agent": "okhttp/3.14.9", "App-Version": "google Pixel 2 XL taimen-Android 11,1.11.332"},
69
71
  params=dict(
70
72
  username=username,
71
73
  password=password,
@@ -38,6 +38,8 @@ class ErrorInfo(DataClassDictMixin):
38
38
  nl_solution: str
39
39
  da_implication: str
40
40
  da_solution: str
41
+ sr_implication: str
42
+ sr_solution: str
41
43
  sv_implication: str
42
44
  sv_solution: str
43
45
  sl_implication: str
@@ -48,13 +48,13 @@ class MessageNetwork(AbstractMessage, ABC):
48
48
  comm_esp = DevNet(todev_ble_sync=sync_type)
49
49
  return self.send_order_msg_net(comm_esp)
50
50
 
51
- def get_device_base_info(self) -> bytes:
51
+ def get_device_version_main(self) -> bytes:
52
52
  net = DevNet(todev_devinfo_req=DrvDevInfoReq())
53
53
  net.todev_devinfo_req.req_ids.append(DrvDevInfoReqId(id=1, type=6))
54
54
 
55
55
  return self.send_order_msg_net(net)
56
56
 
57
- def get_device_version_main(self) -> bytes:
57
+ def get_device_base_info(self) -> bytes:
58
58
  net = DevNet(todev_devinfo_req=DrvDevInfoReq())
59
59
 
60
60
  for i in range(1, 8):
@@ -62,7 +62,7 @@ class MessageSystem(AbstractMessage, ABC):
62
62
  logger.debug("Send command - send factory reset")
63
63
  return self.send_order_msg_sys(build)
64
64
 
65
- def set_blade_control(self, on_off: int):
65
+ def set_blade_control(self, on_off: int) -> bytes:
66
66
  mctlsys = MctlSys()
67
67
  sys_knife_control = SysKnifeControl()
68
68
  sys_knife_control.knife_status = on_off
@@ -70,10 +70,10 @@ class MessageSystem(AbstractMessage, ABC):
70
70
 
71
71
  return self.send_order_msg_sys(mctlsys)
72
72
 
73
- def get_device_product_model(self):
73
+ def get_device_product_model(self) -> bytes:
74
74
  return self.send_order_msg_sys(MctlSys(device_product_type_info=DeviceProductTypeInfoT(result=1)))
75
75
 
76
- def read_and_set_sidelight(self, is_sidelight: bool, operate: int):
76
+ def read_and_set_sidelight(self, is_sidelight: bool, operate: int) -> bytes:
77
77
  """Read state of sidelight as well as set it."""
78
78
  if is_sidelight:
79
79
  build = TimeCtrlLight(
@@ -197,7 +197,7 @@ class MessageSystem(AbstractMessage, ABC):
197
197
  # test_id}, testDuration={test_duration}", "Factory tool logger.debug222", True)
198
198
  # return self.send_order_msg_sys(build2)
199
199
 
200
- def send_sys_set_date_time(self):
200
+ def send_sys_set_date_time(self) -> bytes:
201
201
  calendar = datetime.datetime.now()
202
202
  i = calendar.year
203
203
  i2 = calendar.month
@@ -231,7 +231,7 @@ class MessageSystem(AbstractMessage, ABC):
231
231
  )
232
232
  return self.send_order_msg_sys(build)
233
233
 
234
- def get_device_version_info(self):
234
+ def get_device_version_info(self) -> bytes:
235
235
  return self.send_order_msg_sys(MctlSys(todev_get_dev_fw_info=1))
236
236
 
237
237
  def read_and_set_rtk_pairing_code(self, op: int, cfg: str) -> bytes:
@@ -273,7 +273,7 @@ class MessageSystem(AbstractMessage, ABC):
273
273
  timeout=1000,
274
274
  period=1000,
275
275
  no_change_period=2000,
276
- count=0,
276
+ count=3,
277
277
  )
278
278
 
279
279
  def get_report_cfg_stop(self, timeout: int = 10000, period: int = 1000, no_change_period: int = 1000):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pymammotion
3
- Version: 0.3.6
3
+ Version: 0.3.8
4
4
  Summary:
5
5
  License: GNU-3.0
6
6
  Author: Michael Arthur
@@ -24,7 +24,7 @@ pymammotion/const.py,sha256=lWRxvTVdXnNHuxqvRkjO5ziK0Ic-fZMM6J2dbe5M6Nc,385
24
24
  pymammotion/data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
25
25
  pymammotion/data/model/__init__.py,sha256=aSyroxYQQS-WMRi6WmWm2js4wLa9nmsi160gx9tts4o,323
26
26
  pymammotion/data/model/account.py,sha256=vJM-KTf2q6eBfVC-UlNHBSmJvqHiCawZ40vnuhXhaz8,140
27
- pymammotion/data/model/device.py,sha256=SMhk3kEohKb67nPtq8MIRfa3r6QWrjo_QrtTKI9OgbA,12370
27
+ pymammotion/data/model/device.py,sha256=GQH9pNPcqb4zdl55r8dYIHgvXlwdA8k3xHwMVzNalys,12433
28
28
  pymammotion/data/model/device_config.py,sha256=b3zmArKg10NIheNGSugwWruLM_H4ySBlQxDgXAiB2es,2852
29
29
  pymammotion/data/model/device_info.py,sha256=ahz2xILdSYdX6SIVuVzz8QCfSQLefbQnpXrsiDpBDbY,585
30
30
  pymammotion/data/model/enums.py,sha256=EpKmO8yVUZyEnTY4yH0DMMVKYNQM42zpW1maUu0i3IE,1582
@@ -46,8 +46,8 @@ pymammotion/data/state_manager.py,sha256=W6PjIMXHPObocYay6ZQ7ITju27MA5kK5udFptAy
46
46
  pymammotion/event/__init__.py,sha256=mgATR6vPHACNQ-0zH5fi7NdzeTCDV1CZyaWPmtUusi8,115
47
47
  pymammotion/event/event.py,sha256=bj2RirSIRyBs0QvkcrOtwZWUX_8F3m1sySuHVyKmZLs,2143
48
48
  pymammotion/http/_init_.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
49
- pymammotion/http/http.py,sha256=uPa6NeBKGbgw9FBIRfuSmFtp0nhsnK0NPtR1EBOkeEM,3678
50
- pymammotion/http/model/http.py,sha256=0yGswnzFtszFR9rseq6vlW6nJmTiy9dth1Xn3USaQyw,2301
49
+ pymammotion/http/http.py,sha256=h-h7pfLCbkyf1gsezTisvWdAjCRAKwyDTziylW0kq4A,3933
50
+ pymammotion/http/model/http.py,sha256=SxpAtwJFlCQl6YfRFwJjpeOsB4QfQdhoOAKQzM6uMVI,2346
51
51
  pymammotion/mammotion/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
52
52
  pymammotion/mammotion/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
53
53
  pymammotion/mammotion/commands/abstract_message.py,sha256=l2Wcyg7tIEjRGyQAk9T2rQVOLwilxG1hXTNf7811jGA,727
@@ -56,9 +56,9 @@ pymammotion/mammotion/commands/messages/__init__.py,sha256=47DEQpj8HBSa-_TImW-5J
56
56
  pymammotion/mammotion/commands/messages/driver.py,sha256=DlOAC_yi1ycO5hKr5rfCpLmrqao6Mb6Fv1JWwMISnKE,3766
57
57
  pymammotion/mammotion/commands/messages/media.py,sha256=l-m4l2Vp1ZOHPHyJTceuLaLvdgHOEfmykkbDncCDUI4,1359
58
58
  pymammotion/mammotion/commands/messages/navigation.py,sha256=Z6RQK-pMh8o7_K_1yTENx3lkNBFQTU_ojunolSre0oM,23241
59
- pymammotion/mammotion/commands/messages/network.py,sha256=AErasUL7U4lbFKRJPVzUZMHegP5K2Jo9wGmeWruOtUg,7623
59
+ pymammotion/mammotion/commands/messages/network.py,sha256=I3ot4rYxtI6saJWUe-6CYCnL35GpsJMi9O18D19KuyU,7623
60
60
  pymammotion/mammotion/commands/messages/ota.py,sha256=g937HT_-OQXV6A3zUiZ53b45cOX6y-rzs5m-4b0IcTk,1473
61
- pymammotion/mammotion/commands/messages/system.py,sha256=IXm0RxzPUvyXmvtLY59tS9oI2alWMGVNMSQSfog2A-c,14326
61
+ pymammotion/mammotion/commands/messages/system.py,sha256=6LWcucdt0nyzVkyd9BJjMLzR6D6wDwSQXinR5ItdDZk,14371
62
62
  pymammotion/mammotion/commands/messages/video.py,sha256=xili9khz4Op5NwjXfvIkeRYzQlQPIf8o8bnoYx-Ylpw,1319
63
63
  pymammotion/mammotion/control/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
64
64
  pymammotion/mammotion/control/joystick.py,sha256=QfBVxM_gxpWsZAGO90whtgxCI2tIZ3TTad9wHIPsU9s,5640
@@ -121,7 +121,7 @@ pymammotion/utility/map.py,sha256=GYscVMg2cX3IPlNpCBNHDW0S55yS1WGRf1iHnNZ7TfQ,22
121
121
  pymammotion/utility/movement.py,sha256=N75oAoAgFydqoaOedYIxGUHmuTCtPzAOtb-d_29tpfI,615
122
122
  pymammotion/utility/periodic.py,sha256=MbeSb9cfhxzYmdT_RiE0dZe3H9IfbQW_zSqhmSX2RUc,3321
123
123
  pymammotion/utility/rocker_util.py,sha256=6tX7sS87qoQC_tsxbx3NLL-HgS08wtzXiZkhDiz7uo0,7179
124
- pymammotion-0.3.6.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
125
- pymammotion-0.3.6.dist-info/METADATA,sha256=-D1Vd3AeRM3G_bJQZXPc7s2UtvKP8j6RhLlAG7tJaJE,3895
126
- pymammotion-0.3.6.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
127
- pymammotion-0.3.6.dist-info/RECORD,,
124
+ pymammotion-0.3.8.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
125
+ pymammotion-0.3.8.dist-info/METADATA,sha256=glLYK0gcdvYHjIw4xVAclhKSCaGqOjdHYcqR49DwpWE,3895
126
+ pymammotion-0.3.8.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
127
+ pymammotion-0.3.8.dist-info/RECORD,,