pymammotion 0.2.38__tar.gz → 0.2.39__tar.gz

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.
Files changed (124) hide show
  1. {pymammotion-0.2.38 → pymammotion-0.2.39}/PKG-INFO +1 -1
  2. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/aliyun/dataclass/regions_response.py +1 -2
  3. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/data/model/device.py +19 -23
  4. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/data/model/device_config.py +10 -6
  5. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/data/model/hash_list.py +17 -7
  6. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/data/model/location.py +8 -11
  7. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/data/model/region_data.py +6 -2
  8. pymammotion-0.2.39/pymammotion/data/model/report_info.py +84 -0
  9. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/data/mqtt/event.py +1 -1
  10. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/data/state_manager.py +3 -3
  11. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/mammotion/commands/messages/system.py +11 -10
  12. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/mammotion/devices/base.py +0 -4
  13. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/mammotion/devices/mammotion.py +4 -2
  14. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/proto/mctrl_nav.proto +4 -6
  15. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/proto/mctrl_nav.py +2 -3
  16. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/proto/mctrl_sys.proto +1 -0
  17. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/proto/mctrl_sys.py +1 -0
  18. {pymammotion-0.2.38 → pymammotion-0.2.39}/pyproject.toml +3 -3
  19. pymammotion-0.2.38/pymammotion/data/model/report_info.py +0 -146
  20. {pymammotion-0.2.38 → pymammotion-0.2.39}/LICENSE +0 -0
  21. {pymammotion-0.2.38 → pymammotion-0.2.39}/README.md +0 -0
  22. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/__init__.py +0 -0
  23. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/aliyun/__init__.py +0 -0
  24. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/aliyun/cloud_gateway.py +0 -0
  25. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/aliyun/cloud_service.py +0 -0
  26. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/aliyun/dataclass/aep_response.py +0 -0
  27. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/aliyun/dataclass/connect_response.py +0 -0
  28. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/aliyun/dataclass/dev_by_account_response.py +0 -0
  29. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/aliyun/dataclass/login_by_oauth_response.py +0 -0
  30. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/aliyun/dataclass/session_by_authcode_response.py +0 -0
  31. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/aliyun/tmp_constant.py +0 -0
  32. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/bluetooth/__init__.py +0 -0
  33. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/bluetooth/ble.py +0 -0
  34. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/bluetooth/ble_message.py +0 -0
  35. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/bluetooth/const.py +0 -0
  36. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/bluetooth/data/__init__.py +0 -0
  37. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/bluetooth/data/convert.py +0 -0
  38. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/bluetooth/data/framectrldata.py +0 -0
  39. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/bluetooth/data/notifydata.py +0 -0
  40. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/const.py +0 -0
  41. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/data/__init__.py +0 -0
  42. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/data/model/__init__.py +0 -0
  43. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/data/model/account.py +0 -0
  44. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/data/model/enums.py +0 -0
  45. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/data/model/excute_boarder_params.py +0 -0
  46. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/data/model/execute_boarder.py +0 -0
  47. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/data/model/generate_route_information.py +0 -0
  48. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/data/model/mowing_modes.py +0 -0
  49. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/data/model/plan.py +0 -0
  50. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/data/model/rapid_state.py +0 -0
  51. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/data/mqtt/__init__.py +0 -0
  52. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/data/mqtt/properties.py +0 -0
  53. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/data/mqtt/status.py +0 -0
  54. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/event/__init__.py +0 -0
  55. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/event/event.py +0 -0
  56. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/http/_init_.py +0 -0
  57. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/http/http.py +0 -0
  58. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/http/model/http.py +0 -0
  59. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/mammotion/__init__.py +0 -0
  60. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/mammotion/commands/__init__.py +0 -0
  61. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/mammotion/commands/abstract_message.py +0 -0
  62. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/mammotion/commands/mammotion_command.py +0 -0
  63. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/mammotion/commands/messages/__init__.py +0 -0
  64. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/mammotion/commands/messages/driver.py +0 -0
  65. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/mammotion/commands/messages/media.py +0 -0
  66. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/mammotion/commands/messages/navigation.py +0 -0
  67. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/mammotion/commands/messages/network.py +0 -0
  68. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/mammotion/commands/messages/ota.py +0 -0
  69. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/mammotion/commands/messages/video.py +0 -0
  70. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/mammotion/control/__init__.py +0 -0
  71. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/mammotion/control/joystick.py +0 -0
  72. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/mammotion/devices/__init__.py +0 -0
  73. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/mammotion/devices/mammotion_bluetooth.py +0 -0
  74. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/mammotion/devices/mammotion_cloud.py +0 -0
  75. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/mqtt/__init__.py +0 -0
  76. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/mqtt/mammotion_future.py +0 -0
  77. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/mqtt/mammotion_mqtt.py +0 -0
  78. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/proto/__init__.py +0 -0
  79. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/proto/basestation.proto +0 -0
  80. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/proto/basestation.py +0 -0
  81. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/proto/basestation_pb2.py +0 -0
  82. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/proto/basestation_pb2.pyi +0 -0
  83. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/proto/common.proto +0 -0
  84. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/proto/common.py +0 -0
  85. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/proto/common_pb2.py +0 -0
  86. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/proto/common_pb2.pyi +0 -0
  87. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/proto/dev_net.proto +0 -0
  88. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/proto/dev_net.py +0 -0
  89. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/proto/dev_net_pb2.py +0 -0
  90. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/proto/dev_net_pb2.pyi +0 -0
  91. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/proto/luba_msg.proto +0 -0
  92. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/proto/luba_msg.py +0 -0
  93. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/proto/luba_msg_pb2.py +0 -0
  94. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/proto/luba_msg_pb2.pyi +0 -0
  95. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/proto/luba_mul.proto +0 -0
  96. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/proto/luba_mul.py +0 -0
  97. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/proto/luba_mul_pb2.py +0 -0
  98. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/proto/luba_mul_pb2.pyi +0 -0
  99. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/proto/mctrl_driver.proto +0 -0
  100. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/proto/mctrl_driver.py +0 -0
  101. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/proto/mctrl_driver_pb2.py +0 -0
  102. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/proto/mctrl_driver_pb2.pyi +0 -0
  103. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/proto/mctrl_nav_pb2.py +0 -0
  104. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/proto/mctrl_nav_pb2.pyi +0 -0
  105. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/proto/mctrl_ota.proto +0 -0
  106. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/proto/mctrl_ota.py +0 -0
  107. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/proto/mctrl_ota_pb2.py +0 -0
  108. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/proto/mctrl_ota_pb2.pyi +0 -0
  109. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/proto/mctrl_pept.proto +0 -0
  110. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/proto/mctrl_pept.py +0 -0
  111. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/proto/mctrl_pept_pb2.py +0 -0
  112. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/proto/mctrl_pept_pb2.pyi +0 -0
  113. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/proto/mctrl_sys_pb2.py +0 -0
  114. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/proto/mctrl_sys_pb2.pyi +0 -0
  115. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/py.typed +0 -0
  116. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/utility/constant/__init__.py +0 -0
  117. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/utility/constant/device_constant.py +0 -0
  118. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/utility/conversions.py +0 -0
  119. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/utility/datatype_converter.py +0 -0
  120. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/utility/device_type.py +0 -0
  121. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/utility/map.py +0 -0
  122. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/utility/movement.py +0 -0
  123. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/utility/periodic.py +0 -0
  124. {pymammotion-0.2.38 → pymammotion-0.2.39}/pymammotion/utility/rocker_util.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pymammotion
3
- Version: 0.2.38
3
+ Version: 0.2.39
4
4
  Summary:
5
5
  License: GNU-3.0
6
6
  Author: Michael Arthur
@@ -1,7 +1,6 @@
1
1
  from dataclasses import dataclass
2
2
  from typing import Optional, TypeVar
3
3
 
4
- from mashumaro import DataClassDictMixin
5
4
  from mashumaro.config import BaseConfig
6
5
  from mashumaro.mixins.orjson import DataClassORJSONMixin
7
6
 
@@ -20,7 +19,7 @@ class RegionResponseData(DataClassORJSONMixin):
20
19
 
21
20
 
22
21
  @dataclass
23
- class RegionResponse(DataClassDictMixin):
22
+ class RegionResponse(DataClassORJSONMixin):
24
23
  data: RegionResponseData
25
24
  code: int
26
25
  id: Optional[str] = None
@@ -1,8 +1,10 @@
1
1
  """MowingDevice class to wrap around the betterproto dataclasses."""
2
2
 
3
- from dataclasses import dataclass
3
+ from dataclasses import dataclass, field
4
+ from typing import Optional
4
5
 
5
6
  import betterproto
7
+ from mashumaro.mixins.orjson import DataClassORJSONMixin
6
8
 
7
9
  from pymammotion.data.model import HashList, RapidState
8
10
  from pymammotion.data.model.device_config import DeviceLimits
@@ -28,23 +30,17 @@ from pymammotion.utility.map import CoordinateConverter
28
30
 
29
31
 
30
32
  @dataclass
31
- class MowingDevice:
33
+ class MowingDevice(DataClassORJSONMixin):
32
34
  """Wraps the betterproto dataclasses, so we can bypass the groups for keeping all data."""
33
35
 
34
- device: LubaMsg
35
- map: HashList
36
- location: Location
37
- mowing_state: RapidState
38
-
39
- def __init__(self) -> None:
40
- self.device = LubaMsg()
41
- self.map = HashList(area={}, path={}, obstacle={}, hashlist=[])
42
- self.location = Location()
43
- self.report_data = ReportData()
44
- self.err_code_list = []
45
- self.err_code_list_time = []
46
- self.limits = DeviceLimits(30, 70, 0.2, 0.6)
47
- self.mowing_state = RapidState()
36
+ map: HashList = field(default_factory=HashList)
37
+ location: Location = field(default_factory=Location)
38
+ mowing_state: RapidState = field(default_factory=RapidState)
39
+ report_data: ReportData = field(default_factory=ReportData)
40
+ err_code_list: list = field(default_factory=list)
41
+ err_code_list_time: Optional[list] = field(default_factory=list)
42
+ limits: DeviceLimits = field(default_factory=DeviceLimits)
43
+ device: Optional[LubaMsg] = field(default_factory=LubaMsg)
48
44
 
49
45
  @classmethod
50
46
  def from_raw(cls, raw: dict) -> "MowingDevice":
@@ -161,7 +157,7 @@ class MowingDevice:
161
157
 
162
158
 
163
159
  @dataclass
164
- class DevNetData:
160
+ class DevNetData(DataClassORJSONMixin):
165
161
  """Wrapping class around LubaMsg to return a dataclass from the raw dict."""
166
162
 
167
163
  net: dict
@@ -184,7 +180,7 @@ class DevNetData:
184
180
 
185
181
 
186
182
  @dataclass
187
- class SysData:
183
+ class SysData(DataClassORJSONMixin):
188
184
  """Wrapping class around LubaMsg to return a dataclass from the raw dict."""
189
185
 
190
186
  sys: dict
@@ -207,7 +203,7 @@ class SysData:
207
203
 
208
204
 
209
205
  @dataclass
210
- class NavData:
206
+ class NavData(DataClassORJSONMixin):
211
207
  """Wrapping class around LubaMsg to return a dataclass from the raw dict."""
212
208
 
213
209
  nav: dict
@@ -230,7 +226,7 @@ class NavData:
230
226
 
231
227
 
232
228
  @dataclass
233
- class DriverData:
229
+ class DriverData(DataClassORJSONMixin):
234
230
  """Wrapping class around LubaMsg to return a dataclass from the raw dict."""
235
231
 
236
232
  driver: dict
@@ -253,7 +249,7 @@ class DriverData:
253
249
 
254
250
 
255
251
  @dataclass
256
- class MulData:
252
+ class MulData(DataClassORJSONMixin):
257
253
  """Wrapping class around LubaMsg to return a dataclass from the raw dict."""
258
254
 
259
255
  mul: dict
@@ -276,7 +272,7 @@ class MulData:
276
272
 
277
273
 
278
274
  @dataclass
279
- class OtaData:
275
+ class OtaData(DataClassORJSONMixin):
280
276
  """Wrapping class around LubaMsg to return a dataclass from the raw dict."""
281
277
 
282
278
  ota: dict
@@ -299,7 +295,7 @@ class OtaData:
299
295
 
300
296
 
301
297
  @dataclass
302
- class PeptData:
298
+ class PeptData(DataClassORJSONMixin):
303
299
  """Wrapping class around LubaMsg to return a dataclass from the raw dict."""
304
300
 
305
301
  pept: dict
@@ -1,18 +1,22 @@
1
1
  from dataclasses import dataclass, field
2
2
 
3
+ from mashumaro.mixins.orjson import DataClassORJSONMixin
4
+
3
5
  from pymammotion.utility.device_type import DeviceType
4
6
 
5
7
 
6
8
  @dataclass
7
- class DeviceLimits:
8
- blade_height_min: int
9
- blade_height_max: int
10
- working_speed_min: float
11
- working_speed_max: float
9
+ class DeviceLimits(DataClassORJSONMixin):
10
+ blade_height_min: int = 30
11
+ blade_height_max: int = 70
12
+ working_speed_min: float = 0.2
13
+ working_speed_max: float = 1.2
14
+ working_path_min: int = 15
15
+ working_path_max: int = 35
12
16
 
13
17
 
14
18
  @dataclass
15
- class OperationSettings:
19
+ class OperationSettings(DataClassORJSONMixin):
16
20
  """Operation settings for a device."""
17
21
 
18
22
  is_mow: bool = True
@@ -1,6 +1,8 @@
1
1
  from dataclasses import dataclass, field
2
2
  from enum import IntEnum
3
3
 
4
+ from mashumaro.mixins.orjson import DataClassORJSONMixin
5
+
4
6
  from pymammotion.proto.mctrl_nav import AreaHashName, NavGetCommDataAck
5
7
 
6
8
 
@@ -13,23 +15,31 @@ class PathType(IntEnum):
13
15
 
14
16
 
15
17
  @dataclass
16
- class FrameList:
18
+ class FrameList(DataClassORJSONMixin):
17
19
  total_frame: int
18
20
  data: list[NavGetCommDataAck]
19
21
 
20
22
 
21
23
  @dataclass
22
- class HashList:
24
+ class AreaHashNameList(DataClassORJSONMixin):
25
+ """Wrapper so we can serialize to and from dict."""
26
+
27
+ name: str
28
+ hash: int
29
+
30
+
31
+ @dataclass
32
+ class HashList(DataClassORJSONMixin):
23
33
  """stores our map data.
24
34
  [hashID, FrameList].
25
35
  hashlist for all our hashIDs for verification
26
36
  """
27
37
 
28
- area: dict # type 0
29
- path: dict # type 2
30
- obstacle: dict # type 1
31
- hashlist: list[int]
32
- area_name: list[AreaHashName] = field(default_factory=list)
38
+ area: dict = field(default_factory=dict) # type 0
39
+ path: dict = field(default_factory=dict) # type 2
40
+ obstacle: dict = field(default_factory=dict) # type 1
41
+ hashlist: list[int] = field(default_factory=list)
42
+ area_name: list[AreaHashNameList] = field(default_factory=list)
33
43
 
34
44
  def set_hashlist(self, hashlist: list[int]) -> None:
35
45
  self.hashlist = hashlist
@@ -1,10 +1,12 @@
1
1
  """Contains RTK models for robot location and RTK positions."""
2
2
 
3
- from dataclasses import dataclass
3
+ from dataclasses import dataclass, field
4
+
5
+ from mashumaro.mixins.orjson import DataClassORJSONMixin
4
6
 
5
7
 
6
8
  @dataclass
7
- class Point:
9
+ class Point(DataClassORJSONMixin):
8
10
  """Returns a lat long."""
9
11
 
10
12
  latitude: float = 0.0
@@ -23,17 +25,12 @@ class Dock(Point):
23
25
 
24
26
 
25
27
  @dataclass
26
- class Location:
28
+ class Location(DataClassORJSONMixin):
27
29
  """Stores/retrieves RTK GPS data."""
28
30
 
29
- device: Point
30
- RTK: Point
31
- dock: Dock
31
+ device: Point = field(default_factory=Point)
32
+ RTK: Point = field(default_factory=Point)
33
+ dock: Dock = field(default_factory=Dock)
32
34
  position_type: int = 0
33
35
  orientation: int = 0 # 360 degree rotation +-
34
36
  work_zone: int = 0
35
-
36
- def __init__(self) -> None:
37
- self.device = Point()
38
- self.RTK = Point()
39
- self.dock = Dock()
@@ -1,7 +1,11 @@
1
- from typing import List, Optional
1
+ from dataclasses import dataclass
2
+ from typing import Optional
2
3
 
4
+ from mashumaro.mixins.orjson import DataClassORJSONMixin
3
5
 
4
- class RegionData:
6
+
7
+ @dataclass
8
+ class RegionData(DataClassORJSONMixin):
5
9
  def __init__(self) -> None:
6
10
  self.hash: Optional[int] = None
7
11
  self.action: int = 0
@@ -0,0 +1,84 @@
1
+ from dataclasses import asdict, dataclass, field
2
+
3
+ from mashumaro.mixins.orjson import DataClassORJSONMixin
4
+
5
+
6
+ @dataclass
7
+ class ConnectData(DataClassORJSONMixin):
8
+ connect_type: int = 0
9
+ ble_rssi: int = 0
10
+ wifi_rssi: int = 0
11
+
12
+
13
+ @dataclass
14
+ class DeviceData(DataClassORJSONMixin):
15
+ sys_status: int = 0
16
+ charge_state: int = 0
17
+ battery_val: int = 0
18
+ sensor_status: int = 0
19
+ last_status: int = 0
20
+ sys_time_stamp: str = ""
21
+
22
+
23
+ @dataclass
24
+ class RTKData(DataClassORJSONMixin):
25
+ status: int = 0
26
+ pos_level: int = 0
27
+ gps_stars: int = 0
28
+ dis_status: str = ""
29
+ co_view_stars: int = 0
30
+
31
+
32
+ @dataclass
33
+ class LocationData(DataClassORJSONMixin):
34
+ real_pos_x: int = 0
35
+ real_pos_y: int = 0
36
+ real_toward: int = 0
37
+ pos_type: int = 0
38
+ bol_hash: str = ""
39
+
40
+
41
+ @dataclass
42
+ class WorkData(DataClassORJSONMixin):
43
+ path: int = 0
44
+ path_hash: str = ""
45
+ progress: int = 0
46
+ area: int = 0
47
+ bp_info: int = 0
48
+ bp_hash: str = ""
49
+ bp_pos_x: int = 0
50
+ bp_pos_y: int = 0
51
+ real_path_num: str = ""
52
+ path_pos_x: int = 0
53
+ path_pos_y: int = 0
54
+ ub_zone_hash: str = ""
55
+ ub_path_hash: str = ""
56
+ init_cfg_hash: str = ""
57
+ ub_ecode_hash: str = ""
58
+ nav_run_mode: int = 0
59
+ test_mode_status: int = 0
60
+ man_run_speed: int = 0
61
+ nav_edit_status: int = 0
62
+ knife_height: int = 0
63
+
64
+
65
+ @dataclass
66
+ class ReportData:
67
+ connect: ConnectData = field(default_factory=ConnectData)
68
+ dev: DeviceData = field(default_factory=DeviceData)
69
+ rtk: RTKData = field(default_factory=RTKData)
70
+ locations: list[LocationData] = field(default_factory=list)
71
+ work: WorkData = field(default_factory=WorkData)
72
+
73
+ def from_dict(self, data: dict):
74
+ locations = self.locations
75
+ if data.get("locations") is not None:
76
+ locations = [LocationData.from_dict(loc) for loc in data.get("locations", [])]
77
+
78
+ return ReportData(
79
+ connect=ConnectData.from_dict(data.get("connect", asdict(self.connect))),
80
+ dev=DeviceData.from_dict(data.get("dev", asdict(self.dev))),
81
+ rtk=RTKData.from_dict(data.get("rtk", asdict(self.rtk))),
82
+ locations=locations,
83
+ work=WorkData.from_dict(data.get("work", asdict(self.work))),
84
+ )
@@ -154,7 +154,7 @@ class ThingEventMessage(DataClassORJSONMixin):
154
154
  params_obj = DeviceWarningEventParams.from_dict(params_dict)
155
155
  elif identifier == "device_config_req_event":
156
156
  params_obj = payload.get("params", {})
157
- elif identifier == "device_notification_event":
157
+ elif identifier == "device_notification_event" or identifier == "device_warning_code_event":
158
158
  params_obj = DeviceNotificationEventParams.from_dict(params_dict)
159
159
  else:
160
160
  raise ValueError(f"Unknown identifier: {identifier} {params_dict}")
@@ -5,6 +5,7 @@ from typing import Any, Awaitable, Callable, Optional
5
5
  import betterproto
6
6
 
7
7
  from pymammotion.data.model.device import MowingDevice
8
+ from pymammotion.data.model.hash_list import AreaHashNameList
8
9
  from pymammotion.proto.luba_msg import LubaMsg
9
10
  from pymammotion.proto.mctrl_nav import AppGetAllAreaHashName, NavGetCommDataAck, NavGetHashListAck
10
11
 
@@ -65,7 +66,8 @@ class StateManager:
65
66
  await self.get_commondata_ack_callback(common_data)
66
67
  case "toapp_all_hash_name":
67
68
  hash_names: AppGetAllAreaHashName = nav_msg[1]
68
- self._device.map.area_name = hash_names.hashnames
69
+ converted_list = [AreaHashNameList(name=item.name, hash=item.hash) for item in hash_names.hashnames]
70
+ self._device.map.area_name = converted_list
69
71
 
70
72
  async def _update_sys_data(self, message) -> None:
71
73
  """Update system."""
@@ -75,8 +77,6 @@ class StateManager:
75
77
  self._device.buffer(sys_msg[1])
76
78
  case "toapp_report_data":
77
79
  self._device.update_report_data(sys_msg[1])
78
- if self.queue_command_callback:
79
- await self.queue_command_callback("get_report_cfg", stop=True)
80
80
  case "mow_to_app_info":
81
81
  self._device.mow_info(sys_msg[1])
82
82
  case "system_tard_state_tunnel":
@@ -227,7 +227,7 @@ class MessageSystem(AbstractMessage, ABC):
227
227
  return self.send_order_msg_sys(build)
228
228
 
229
229
  def get_report_cfg(
230
- self, timeout: int = 10000, period: int = 1000, no_change_period: int = 1000, stop: bool = False
230
+ self, timeout: int = 10000, period: int = 1000, no_change_period: int = 2000, stop: bool = False
231
231
  ):
232
232
  mctlsys = MctlSys(
233
233
  todev_report_cfg=ReportInfoCfg(
@@ -239,15 +239,16 @@ class MessageSystem(AbstractMessage, ABC):
239
239
  )
240
240
  )
241
241
 
242
- mctlsys.todev_report_cfg.sub.append(RptInfoType.RIT_CONNECT.value)
243
- mctlsys.todev_report_cfg.sub.append(RptInfoType.RIT_RTK.value)
244
- mctlsys.todev_report_cfg.sub.append(RptInfoType.RIT_DEV_LOCAL.value)
245
- mctlsys.todev_report_cfg.sub.append(RptInfoType.RIT_WORK.value)
246
- mctlsys.todev_report_cfg.sub.append(RptInfoType.RIT_DEV_STA.value)
247
- mctlsys.todev_report_cfg.sub.append(RptInfoType.RIT_MAINTAIN.value)
248
- mctlsys.todev_report_cfg.sub.append(RptInfoType.RIT_VISION_POINT.value)
249
- mctlsys.todev_report_cfg.sub.append(RptInfoType.RIT_VIO.value)
250
- mctlsys.todev_report_cfg.sub.append(RptInfoType.RIT_VISION_STATISTIC.value)
242
+ mctlsys.todev_report_cfg.sub.append(RptInfoType.RIT_CONNECT)
243
+ mctlsys.todev_report_cfg.sub.append(RptInfoType.RIT_RTK)
244
+ mctlsys.todev_report_cfg.sub.append(RptInfoType.RIT_DEV_LOCAL)
245
+ mctlsys.todev_report_cfg.sub.append(RptInfoType.RIT_WORK)
246
+ mctlsys.todev_report_cfg.sub.append(RptInfoType.RIT_DEV_STA)
247
+ mctlsys.todev_report_cfg.sub.append(RptInfoType.RIT_MAINTAIN)
248
+ mctlsys.todev_report_cfg.sub.append(RptInfoType.RIT_VISION_POINT)
249
+ mctlsys.todev_report_cfg.sub.append(RptInfoType.RIT_VIO)
250
+ mctlsys.todev_report_cfg.sub.append(RptInfoType.RIT_VISION_STATISTIC)
251
+ mctlsys.todev_report_cfg.sub.append(RptInfoType.RIT_BASESTATION)
251
252
 
252
253
  lubaMsg = LubaMsg()
253
254
  lubaMsg.msgtype = MsgCmdType.MSG_CMD_TYPE_EMBED_SYS
@@ -205,10 +205,6 @@ class MammotionBaseDevice:
205
205
 
206
206
  if self._cloud_device:
207
207
  await self.queue_command("get_area_name_list", device_id=self._cloud_device.iotId)
208
- elif has_field(self._mower.net.toapp_wifi_iot_status):
209
- await self.queue_command(
210
- "get_area_name_list", device_id=self._mower.net.toapp_wifi_iot_status.devicename
211
- )
212
208
  except Exception:
213
209
  """Do nothing for now."""
214
210
 
@@ -177,7 +177,7 @@ class Mammotion:
177
177
  return
178
178
 
179
179
  self.cloud_client = cloud_client
180
- self.mqtt_list[account] = MammotionCloud(
180
+ mammotion_cloud = MammotionCloud(
181
181
  MammotionMQTT(
182
182
  region_id=cloud_client.region_response.data.regionId,
183
183
  product_key=cloud_client.aep_response.data.productKey,
@@ -189,7 +189,9 @@ class Mammotion:
189
189
  ),
190
190
  cloud_client,
191
191
  )
192
- self.add_cloud_devices(self.mqtt_list.get(account))
192
+ self.mqtt_list[account] = mammotion_cloud
193
+ self.add_cloud_devices(mammotion_cloud)
194
+
193
195
  loop = asyncio.get_running_loop()
194
196
  await loop.run_in_executor(None, self.mqtt_list[account].connect_async)
195
197
 
@@ -141,7 +141,7 @@ message NavGetCommData {
141
141
  int32 subCmd = 2;
142
142
  int32 action = 3;
143
143
  int32 type = 4;
144
- int64 Hash = 5;
144
+ fixed64 Hash = 5;
145
145
  int64 paternalHashA = 6;
146
146
  int64 paternalHashB = 7;
147
147
  int32 totalFrame = 8;
@@ -434,7 +434,7 @@ message NavTaskCtrlAck {
434
434
 
435
435
  message NavMapNameMsg {
436
436
  int32 rw = 1; // Represents RW field
437
- int64 hash = 2; // Represents HASH field
437
+ fixed64 hash = 2; // Represents HASH field
438
438
  string name = 3; // Represents NAME field
439
439
  int32 result = 4; // Represents RESULT field
440
440
  string device_id = 5; // Represents DEVICEID field
@@ -469,10 +469,8 @@ message SvgMessageAckT {
469
469
  }
470
470
 
471
471
  message AreaHashName {
472
- // Define fields for AreaHashName message here
473
- // For example:
474
- string name = 1; // Replace with actual field definitions
475
- int64 hash = 2; // Replace with actual field definitions
472
+ string name = 2;
473
+ fixed64 hash = 1;
476
474
  }
477
475
 
478
476
  message AppGetAllAreaHashName {
@@ -525,9 +525,8 @@ class SvgMessageAckT(betterproto.Message):
525
525
 
526
526
  @dataclass
527
527
  class AreaHashName(betterproto.Message):
528
- # Define fields for AreaHashName message here For example:
529
- name: str = betterproto.string_field(1)
530
- hash: int = betterproto.int64_field(2)
528
+ name: str = betterproto.string_field(2)
529
+ hash: int = betterproto.fixed64_field(1)
531
530
 
532
531
 
533
532
  @dataclass
@@ -478,6 +478,7 @@ enum rpt_info_type {
478
478
  RIT_VISION_POINT = 7;
479
479
  RIT_VIO = 8;
480
480
  RIT_VISION_STATISTIC = 9;
481
+ RIT_BASESTATION_INFO = 10;
481
482
  }
482
483
 
483
484
  enum rpt_act {
@@ -78,6 +78,7 @@ class RptInfoType(betterproto.Enum):
78
78
  RIT_VISION_POINT = 7
79
79
  RIT_VIO = 8
80
80
  RIT_VISION_STATISTIC = 9
81
+ RIT_BASESTATION_INFO = 10
81
82
 
82
83
 
83
84
  class RptAct(betterproto.Enum):
@@ -1,10 +1,10 @@
1
1
  [project]
2
2
  name = "pymammotion"
3
- version = "0.2.38"
3
+ version = "0.2.39"
4
4
 
5
5
  [tool.poetry]
6
6
  name = "pymammotion"
7
- version = "0.2.38"
7
+ version = "0.2.39"
8
8
  license = "GNU-3.0"
9
9
  description = ""
10
10
  readme = "README.md"
@@ -55,7 +55,7 @@ mypy = "^1.10.0"
55
55
  pre-commit = "^3.8.0"
56
56
 
57
57
  [tool.bumpver]
58
- current_version = "0.2.38"
58
+ current_version = "0.2.39"
59
59
  version_pattern = "MAJOR.MINOR.PATCH"
60
60
  commit_message = "Bump version {old_version} -> {new_version}"
61
61
  commit = true
@@ -1,146 +0,0 @@
1
- from dataclasses import asdict, dataclass, field
2
-
3
-
4
- @dataclass
5
- class ConnectData:
6
- connect_type: int = 0
7
- ble_rssi: int = 0
8
- wifi_rssi: int = 0
9
-
10
- @classmethod
11
- def from_dict(cls, data: dict) -> "ConnectData":
12
- return cls(
13
- connect_type=data.get("connect_type", 0),
14
- ble_rssi=data.get("ble_rssi", 0),
15
- wifi_rssi=data.get("wifi_rssi", 0),
16
- )
17
-
18
-
19
- @dataclass
20
- class DeviceData:
21
- sys_status: int = 0
22
- charge_state: int = 0
23
- battery_val: int = 0
24
- sensor_status: int = 0
25
- last_status: int = 0
26
- sys_time_stamp: str = ""
27
-
28
- @classmethod
29
- def from_dict(cls, data: dict):
30
- return cls(
31
- sys_status=data.get("sys_status", 0),
32
- charge_state=data.get("charge_state", 0),
33
- battery_val=data.get("battery_val", 0),
34
- sensor_status=data.get("sensor_status", 0),
35
- last_status=data.get("last_status", 0),
36
- sys_time_stamp=data.get("sys_time_stamp", ""),
37
- )
38
-
39
-
40
- @dataclass
41
- class RTKData:
42
- status: int = 0
43
- pos_level: int = 0
44
- gps_stars: int = 0
45
- dis_status: str = ""
46
- co_view_stars: int = 0
47
-
48
- @classmethod
49
- def from_dict(cls, data: dict):
50
- return cls(
51
- status=data.get("status", 0),
52
- pos_level=data.get("pos_level", 0),
53
- gps_stars=data.get("gps_stars", 0),
54
- dis_status=data.get("dis_status", ""),
55
- co_view_stars=data.get("co_view_stars", 0),
56
- )
57
-
58
-
59
- @dataclass
60
- class LocationData:
61
- real_pos_x: int = 0
62
- real_pos_y: int = 0
63
- real_toward: int = 0
64
- pos_type: int = 0
65
- bol_hash: str = ""
66
-
67
- @classmethod
68
- def from_dict(cls, data: dict):
69
- return cls(
70
- real_pos_x=data.get("real_pos_x", 0),
71
- real_pos_y=data.get("real_pos_y", 0),
72
- real_toward=data.get("real_toward", 0),
73
- pos_type=data.get("pos_type", 0),
74
- bol_hash=data.get("bol_hash", ""),
75
- )
76
-
77
-
78
- @dataclass
79
- class WorkData:
80
- path: int = 0
81
- path_hash: str = ""
82
- progress: int = 0
83
- area: int = 0
84
- bp_info: int = 0
85
- bp_hash: str = ""
86
- bp_pos_x: int = 0
87
- bp_pos_y: int = 0
88
- real_path_num: str = ""
89
- path_pos_x: int = 0
90
- path_pos_y: int = 0
91
- ub_zone_hash: str = ""
92
- ub_path_hash: str = ""
93
- init_cfg_hash: str = ""
94
- ub_ecode_hash: str = ""
95
- nav_run_mode: int = 0
96
- test_mode_status: int = 0
97
- man_run_speed: int = 0
98
- nav_edit_status: int = 0
99
- knife_height: int = 0
100
-
101
- @classmethod
102
- def from_dict(cls, data: dict):
103
- return cls(
104
- path=data.get("path", 0),
105
- path_hash=data.get("path_hash", ""),
106
- progress=data.get("progress", 0),
107
- area=data.get("area", 0),
108
- bp_info=data.get("bp_info", 0),
109
- bp_hash=data.get("bp_hash", ""),
110
- bp_pos_x=data.get("bp_pos_x", 0),
111
- bp_pos_y=data.get("bp_pos_y", 0),
112
- real_path_num=data.get("real_path_num", ""),
113
- path_pos_x=data.get("path_pos_x", 0),
114
- path_pos_y=data.get("path_pos_y", 0),
115
- ub_zone_hash=data.get("ub_zone_hash", ""),
116
- ub_path_hash=data.get("ub_path_hash", ""),
117
- init_cfg_hash=data.get("init_cfg_hash", ""),
118
- ub_ecode_hash=data.get("ub_ecode_hash", ""),
119
- nav_run_mode=data.get("nav_run_mode", 0),
120
- test_mode_status=data.get("test_mode_status", 0),
121
- man_run_speed=data.get("man_run_speed", 0),
122
- nav_edit_status=data.get("nav_edit_status", 0),
123
- knife_height=data.get("knife_height", 0),
124
- )
125
-
126
-
127
- @dataclass
128
- class ReportData:
129
- connect: ConnectData = field(default_factory=ConnectData)
130
- dev: DeviceData = field(default_factory=DeviceData)
131
- rtk: RTKData = field(default_factory=RTKData)
132
- locations: list[LocationData] = field(default_factory=list)
133
- work: WorkData = field(default_factory=WorkData)
134
-
135
- def from_dict(self, data: dict):
136
- locations = self.locations
137
- if data.get("locations") is not None:
138
- locations = [LocationData.from_dict(loc) for loc in data.get("locations", [])]
139
-
140
- return ReportData(
141
- connect=ConnectData.from_dict(data.get("connect", asdict(self.connect))),
142
- dev=DeviceData.from_dict(data.get("dev", asdict(self.dev))),
143
- rtk=RTKData.from_dict(data.get("rtk", asdict(self.rtk))),
144
- locations=locations,
145
- work=WorkData.from_dict(data.get("work", asdict(self.work))),
146
- )
File without changes
File without changes