pymammotion 0.4.29__py3-none-any.whl → 0.4.31__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,7 +45,7 @@ def create_path_order(operation_mode: OperationSettings, device_name: str) -> st
45
45
  if DeviceType.is_yuka(device_name) and not DeviceType.is_yuka_mini(device_name):
46
46
  bArr[5] = calculate_yuka_mode(operation_mode)
47
47
  else:
48
- bArr[5] = 8 if DeviceType.is_luba_2(device_name) else 0
48
+ bArr[5] = 8 if DeviceType.is_luba_pro(device_name) else 0
49
49
 
50
50
  bArr[6] = int(operation_mode.collect_grass_frequency) if operation_mode.is_dump else 10
51
51
  if DeviceType.is_luba1(device_name):
pymammotion/http/http.py CHANGED
@@ -138,12 +138,12 @@ class MammotionHTTP:
138
138
  ) as resp:
139
139
  if resp.status != 200:
140
140
  print(resp.json())
141
- return Response.from_dict({"status": resp.status, "msg": "Login failed"})
141
+ return Response.from_dict({"code": resp.status, "msg": "Login failed"})
142
142
  data = await resp.json()
143
143
  login_response = Response[LoginResponseData].from_dict(data)
144
144
  if login_response.data is None:
145
145
  print(login_response)
146
- return Response.from_dict({"status": resp.status, "msg": "Login failed"})
146
+ return Response.from_dict({"code": resp.status, "msg": "Login failed"})
147
147
  self.login_info = LoginResponseData.from_dict(login_response.data)
148
148
  self._headers["Authorization"] = (
149
149
  f"Bearer {self.login_info.access_token}" if login_response.data else None
@@ -35,24 +35,24 @@ class MessageDriver(AbstractMessage, ABC):
35
35
  driver=driver,
36
36
  ).SerializeToString()
37
37
 
38
- def set_blade_height(self, height: int):
38
+ def set_blade_height(self, height: int) -> bytes:
39
39
  logger.debug(f"Send knife height height={height}")
40
40
  build = MctlDriver(todev_knife_height_set=DrvKnifeHeight(knife_height=height))
41
41
  logger.debug(f"Send command--Knife motor height setting height={height}")
42
42
  return self.send_order_msg_driver(build)
43
43
 
44
- def set_speed(self, speed: float):
44
+ def set_speed(self, speed: float) -> bytes:
45
45
  logger.debug(f"{self.get_device_name()} set speed, {speed}")
46
46
  build = MctlDriver(bidire_speed_read_set=DrvSrSpeed(speed=speed, rw=1))
47
47
  logger.debug(f"Send command--Speed setting speed={speed}")
48
48
  return self.send_order_msg_driver(build)
49
49
 
50
- def syn_nav_star_point_data(self, sat_system: int):
50
+ def syn_nav_star_point_data(self, sat_system: int) -> bytes:
51
51
  build = MctlDriver(rtk_sys_mask_query=RtkSysMaskQueryT(sat_system=sat_system))
52
52
  logger.debug(f"Send command--Navigation satellite frequency point synchronization={sat_system}")
53
53
  return self.send_order_msg_driver(build)
54
54
 
55
- def set_nav_star_point(self, cmd_req: str):
55
+ def set_nav_star_point(self, cmd_req: str) -> bytes:
56
56
  build = MctlDriver(rtk_cfg_req=RtkCfgReqT(cmd_req=cmd_req, cmd_length=len(cmd_req) - 1))
57
57
  logger.debug(f"Send command--Navigation satellite frequency point setting={cmd_req}")
58
58
  logger.debug(
@@ -60,7 +60,7 @@ class MessageDriver(AbstractMessage, ABC):
60
60
  )
61
61
  return self.send_order_msg_driver(build)
62
62
 
63
- def get_speed(self):
63
+ def get_speed(self) -> bytes:
64
64
  build = MctlDriver(bidire_speed_read_set=DrvSrSpeed(rw=0))
65
65
  logger.debug("Send command--Get speed value")
66
66
  return self.send_order_msg_driver(build)
@@ -71,7 +71,7 @@ class MessageDriver(AbstractMessage, ABC):
71
71
  cut_knife_ctrl: int,
72
72
  cut_knife_height: int,
73
73
  max_run_speed: float,
74
- ):
74
+ ) -> bytes:
75
75
  build = MctlDriver(
76
76
  mow_ctrl_by_hand=DrvMowCtrlByHand(
77
77
  main_ctrl=main_ctrl,
@@ -121,7 +121,7 @@ class MessageSystem(AbstractMessage, ABC):
121
121
  def allpowerfull_rw(self, rw_id: int, context: int, rw: int) -> bytes:
122
122
  if (
123
123
  rw_id == 6 or rw_id == 3 or rw_id == 7 or rw_id == 8 or rw_id == 10 or rw_id == 11
124
- ) and DeviceType.is_luba_2(self.get_device_name()):
124
+ ) and DeviceType.is_luba_pro(self.get_device_name()):
125
125
  return self.messageNavigation.allpowerfull_rw_adapter_x3(rw_id, context, rw)
126
126
  build = MctlSys(bidire_comm_cmd=SysCommCmd(id=rw_id, context=context, rw=rw))
127
127
  logger.debug(f"Send command - 9 general read and write command id={rw_id}, context={context}, rw={rw}")
@@ -190,7 +190,7 @@ class DeviceType(Enum):
190
190
  return device_type.get_value() == DeviceType.LUBA.get_value()
191
191
 
192
192
  @staticmethod
193
- def is_luba_2(device_name: str, product_key: str = ""):
193
+ def is_luba_pro(device_name: str, product_key: str = ""):
194
194
  """Check if the device type is LUBA 2 or higher based on the device name
195
195
  and optional product key.
196
196
 
@@ -211,6 +211,7 @@ class DeviceType(Enum):
211
211
  return (
212
212
  device_type.get_value() >= DeviceType.LUBA_2.get_value()
213
213
  and device_type.get_value() != DeviceType.SPINO.get_value()
214
+ and not DeviceType.is_rtk(device_name, product_key)
214
215
  )
215
216
 
216
217
  @staticmethod
@@ -273,7 +274,12 @@ class DeviceType(Enum):
273
274
  else:
274
275
  device_type = DeviceType.value_of_str(device_name, product_key)
275
276
 
276
- return DeviceType.RTK.get_value() <= device_type.get_value() < DeviceType.LUBA.get_value()
277
+ return (
278
+ DeviceType.RTK.get_value() == device_type.get_value()
279
+ or DeviceType.RTK3A0.get_value() == device_type.get_value()
280
+ or DeviceType.RTK3A1.get_value() == device_type.get_value()
281
+ or DeviceType.RTK3A2.get_value() == device_type.get_value()
282
+ )
277
283
 
278
284
  @staticmethod
279
285
  def contain_rtk_product_key(product_key) -> bool:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pymammotion
3
- Version: 0.4.29
3
+ Version: 0.4.31
4
4
  Summary:
5
5
  License: GPL-3.0
6
6
  Author: Michael Arthur
@@ -27,7 +27,7 @@ pymammotion/data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,
27
27
  pymammotion/data/model/__init__.py,sha256=aSyroxYQQS-WMRi6WmWm2js4wLa9nmsi160gx9tts4o,323
28
28
  pymammotion/data/model/account.py,sha256=vJM-KTf2q6eBfVC-UlNHBSmJvqHiCawZ40vnuhXhaz8,140
29
29
  pymammotion/data/model/device.py,sha256=GRKaXPocoetyekHo4DQtPKmJQH9v7ksZvGxe0XgmnLc,6892
30
- pymammotion/data/model/device_config.py,sha256=dfva6mErOepLaen1CrjGaEVbEPrxRTSWXJh-yIn5iMI,2636
30
+ pymammotion/data/model/device_config.py,sha256=1kFkztZk3_DXHaEUZN-j_4s0HT83m4qLVAg2uHCyzFg,2638
31
31
  pymammotion/data/model/device_info.py,sha256=Q0qJ6BflQycH_VFugwaFFXcvM69q2v9JAe2wWOcCggE,904
32
32
  pymammotion/data/model/device_limits.py,sha256=m8HdxD-RaAkPm7jHYb9GLxMEH9IfzBPz0ZypmsLnId4,1946
33
33
  pymammotion/data/model/enums.py,sha256=EpKmO8yVUZyEnTY4yH0DMMVKYNQM42zpW1maUu0i3IE,1582
@@ -51,19 +51,19 @@ pymammotion/event/__init__.py,sha256=mgATR6vPHACNQ-0zH5fi7NdzeTCDV1CZyaWPmtUusi8
51
51
  pymammotion/event/event.py,sha256=bj2RirSIRyBs0QvkcrOtwZWUX_8F3m1sySuHVyKmZLs,2143
52
52
  pymammotion/http/_init_.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
53
53
  pymammotion/http/encryption.py,sha256=lzXu3WwBdQlzjXxWnlJuRgkCrKdPbxx5drhMitVKIEk,8287
54
- pymammotion/http/http.py,sha256=doncq4jXGQt6jXzt2ZL6n8pne45jPFAVJKhGabi5LMw,7363
54
+ pymammotion/http/http.py,sha256=r8jvdh01OAQEBNYW8QHZ2v5MjzCFkv6FibE3kWRmdSg,7359
55
55
  pymammotion/http/model/http.py,sha256=tM5ikwVkWhRdXc2xi1NOLmWPH2mQEQelpaVgMlAEmlI,2333
56
56
  pymammotion/mammotion/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
57
57
  pymammotion/mammotion/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
58
58
  pymammotion/mammotion/commands/abstract_message.py,sha256=C1teY4Bd_BpBhAWWzKokoeXm7bjvDeV0sDL5CVpoyhI,829
59
59
  pymammotion/mammotion/commands/mammotion_command.py,sha256=3OFXQjF7HFwPd_j6utHVI2Kfwh7t6_6ff_9MKAWGTlk,2570
60
60
  pymammotion/mammotion/commands/messages/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
61
- pymammotion/mammotion/commands/messages/driver.py,sha256=7lVfk3bHymgNf3toVhqYmCq8KrLTk_OaNz3oTmT_xY8,3647
61
+ pymammotion/mammotion/commands/messages/driver.py,sha256=LAYGvAcDDXwwliQ1OfRwNBk1VpIdpURo1TlA64zpLA4,3701
62
62
  pymammotion/mammotion/commands/messages/media.py,sha256=NUmd6W5171sOZZ08GhUCqzpGMptVqXC36t-H3i42tOQ,1282
63
63
  pymammotion/mammotion/commands/messages/navigation.py,sha256=rvKxBAeH1fjLyabgpYX1FWAl98psvx4HiqZTHPbL9zs,23252
64
64
  pymammotion/mammotion/commands/messages/network.py,sha256=oO3PK6TKY563Jw-ZRpNmIzGCgkuk2SQm0BhcDL5claM,7595
65
65
  pymammotion/mammotion/commands/messages/ota.py,sha256=ZHLQRE5ETvLEIu2Vbj3m2XidIWT8uorYSHxkZd3pkRc,1376
66
- pymammotion/mammotion/commands/messages/system.py,sha256=ScXlurQAy8Z9WntXBRrxThnsVHFWfiNNltEWh-SVcvQ,14811
66
+ pymammotion/mammotion/commands/messages/system.py,sha256=P3ndyhvvJbYFjurwMi6LRObG4yTBlooZAxuwa4guYec,14813
67
67
  pymammotion/mammotion/commands/messages/video.py,sha256=Vn5F65ojr3chePBtfYjOg90EHmZnZyA-1t6U3XB1m6A,1189
68
68
  pymammotion/mammotion/control/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
69
69
  pymammotion/mammotion/control/joystick.py,sha256=QfBVxM_gxpWsZAGO90whtgxCI2tIZ3TTad9wHIPsU9s,5640
@@ -115,12 +115,12 @@ pymammotion/utility/constant/device_constant.py,sha256=g6QWBaP85h6PNxmk1cOqtP7Hv
115
115
  pymammotion/utility/conversions.py,sha256=v3YICy0zZwwBBzrUZgabI7GRfiDBnkiAX2qdtk3NxOY,89
116
116
  pymammotion/utility/datatype_converter.py,sha256=SPM_HuaaD_XOawlqEnA8qlRRZXGba3WjA8kGOZgeBlQ,4284
117
117
  pymammotion/utility/device_config.py,sha256=65Jl73-dQDs4yMXwYXZW_bsgSvnwpFBZDu8OQPEIgx8,27877
118
- pymammotion/utility/device_type.py,sha256=nl15OuM3x_iDc8lWijOqRv5UdWt6hkPtnEt9RMC4xPE,12306
118
+ pymammotion/utility/device_type.py,sha256=Lhvi8CLY8qr1EghZFlFK85hhzsmyE0LHVZO0qAmYod4,12582
119
119
  pymammotion/utility/map.py,sha256=GYscVMg2cX3IPlNpCBNHDW0S55yS1WGRf1iHnNZ7TfQ,2227
120
120
  pymammotion/utility/movement.py,sha256=N75oAoAgFydqoaOedYIxGUHmuTCtPzAOtb-d_29tpfI,615
121
121
  pymammotion/utility/periodic.py,sha256=MbeSb9cfhxzYmdT_RiE0dZe3H9IfbQW_zSqhmSX2RUc,3321
122
122
  pymammotion/utility/rocker_util.py,sha256=6tX7sS87qoQC_tsxbx3NLL-HgS08wtzXiZkhDiz7uo0,7179
123
- pymammotion-0.4.29.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
124
- pymammotion-0.4.29.dist-info/METADATA,sha256=h6vaXXvXFLpqhGmLw4HZJlrfNlqxIgSabzcVRFrZ-M0,3878
125
- pymammotion-0.4.29.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
126
- pymammotion-0.4.29.dist-info/RECORD,,
123
+ pymammotion-0.4.31.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
124
+ pymammotion-0.4.31.dist-info/METADATA,sha256=KmOCtXEg58cOCL2JClz50QKsSMIm2h0542JedHTFTf8,3878
125
+ pymammotion-0.4.31.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
126
+ pymammotion-0.4.31.dist-info/RECORD,,