pymammotion 0.2.90__tar.gz → 0.2.92__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 (125) hide show
  1. {pymammotion-0.2.90 → pymammotion-0.2.92}/PKG-INFO +1 -1
  2. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/aliyun/cloud_gateway.py +6 -6
  3. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/data/model/report_info.py +28 -5
  4. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/event/event.py +1 -1
  5. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/mammotion/commands/messages/network.py +17 -19
  6. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/mammotion/commands/messages/system.py +59 -42
  7. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/mammotion/commands/messages/video.py +7 -1
  8. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/utility/constant/device_constant.py +12 -1
  9. {pymammotion-0.2.90 → pymammotion-0.2.92}/pyproject.toml +3 -3
  10. {pymammotion-0.2.90 → pymammotion-0.2.92}/LICENSE +0 -0
  11. {pymammotion-0.2.90 → pymammotion-0.2.92}/README.md +0 -0
  12. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/__init__.py +0 -0
  13. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/aliyun/__init__.py +0 -0
  14. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/aliyun/cloud_service.py +0 -0
  15. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/aliyun/model/aep_response.py +0 -0
  16. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/aliyun/model/connect_response.py +0 -0
  17. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/aliyun/model/dev_by_account_response.py +0 -0
  18. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/aliyun/model/login_by_oauth_response.py +0 -0
  19. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/aliyun/model/regions_response.py +0 -0
  20. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/aliyun/model/session_by_authcode_response.py +0 -0
  21. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/aliyun/model/stream_subscription_response.py +0 -0
  22. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/aliyun/tmp_constant.py +0 -0
  23. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/bluetooth/__init__.py +0 -0
  24. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/bluetooth/ble.py +0 -0
  25. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/bluetooth/ble_message.py +0 -0
  26. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/bluetooth/const.py +0 -0
  27. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/bluetooth/data/__init__.py +0 -0
  28. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/bluetooth/data/convert.py +0 -0
  29. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/bluetooth/data/framectrldata.py +0 -0
  30. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/bluetooth/data/notifydata.py +0 -0
  31. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/const.py +0 -0
  32. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/data/__init__.py +0 -0
  33. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/data/model/__init__.py +0 -0
  34. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/data/model/account.py +0 -0
  35. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/data/model/device.py +0 -0
  36. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/data/model/device_config.py +0 -0
  37. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/data/model/device_info.py +0 -0
  38. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/data/model/enums.py +0 -0
  39. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/data/model/excute_boarder_params.py +0 -0
  40. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/data/model/execute_boarder.py +0 -0
  41. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/data/model/generate_route_information.py +0 -0
  42. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/data/model/hash_list.py +0 -0
  43. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/data/model/location.py +0 -0
  44. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/data/model/mowing_modes.py +0 -0
  45. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/data/model/plan.py +0 -0
  46. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/data/model/rapid_state.py +0 -0
  47. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/data/model/region_data.py +0 -0
  48. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/data/mqtt/__init__.py +0 -0
  49. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/data/mqtt/event.py +0 -0
  50. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/data/mqtt/properties.py +0 -0
  51. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/data/mqtt/status.py +0 -0
  52. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/data/state_manager.py +0 -0
  53. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/event/__init__.py +0 -0
  54. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/http/_init_.py +0 -0
  55. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/http/http.py +0 -0
  56. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/http/model/http.py +0 -0
  57. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/mammotion/__init__.py +0 -0
  58. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/mammotion/commands/__init__.py +0 -0
  59. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/mammotion/commands/abstract_message.py +0 -0
  60. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/mammotion/commands/mammotion_command.py +0 -0
  61. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/mammotion/commands/messages/__init__.py +0 -0
  62. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/mammotion/commands/messages/driver.py +0 -0
  63. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/mammotion/commands/messages/media.py +0 -0
  64. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/mammotion/commands/messages/navigation.py +0 -0
  65. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/mammotion/commands/messages/ota.py +0 -0
  66. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/mammotion/control/__init__.py +0 -0
  67. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/mammotion/control/joystick.py +0 -0
  68. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/mammotion/devices/__init__.py +0 -0
  69. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/mammotion/devices/base.py +0 -0
  70. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/mammotion/devices/mammotion.py +0 -0
  71. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/mammotion/devices/mammotion_bluetooth.py +0 -0
  72. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/mammotion/devices/mammotion_cloud.py +0 -0
  73. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/mqtt/__init__.py +0 -0
  74. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/mqtt/mammotion_future.py +0 -0
  75. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/mqtt/mammotion_mqtt.py +0 -0
  76. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/proto/__init__.py +0 -0
  77. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/proto/basestation.proto +0 -0
  78. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/proto/basestation.py +0 -0
  79. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/proto/basestation_pb2.py +0 -0
  80. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/proto/basestation_pb2.pyi +0 -0
  81. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/proto/common.proto +0 -0
  82. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/proto/common.py +0 -0
  83. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/proto/common_pb2.py +0 -0
  84. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/proto/common_pb2.pyi +0 -0
  85. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/proto/dev_net.proto +0 -0
  86. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/proto/dev_net.py +0 -0
  87. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/proto/dev_net_pb2.py +0 -0
  88. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/proto/dev_net_pb2.pyi +0 -0
  89. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/proto/luba_msg.proto +0 -0
  90. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/proto/luba_msg.py +0 -0
  91. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/proto/luba_msg_pb2.py +0 -0
  92. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/proto/luba_msg_pb2.pyi +0 -0
  93. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/proto/luba_mul.proto +0 -0
  94. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/proto/luba_mul.py +0 -0
  95. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/proto/luba_mul_pb2.py +0 -0
  96. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/proto/luba_mul_pb2.pyi +0 -0
  97. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/proto/mctrl_driver.proto +0 -0
  98. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/proto/mctrl_driver.py +0 -0
  99. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/proto/mctrl_driver_pb2.py +0 -0
  100. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/proto/mctrl_driver_pb2.pyi +0 -0
  101. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/proto/mctrl_nav.proto +0 -0
  102. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/proto/mctrl_nav.py +0 -0
  103. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/proto/mctrl_nav_pb2.py +0 -0
  104. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/proto/mctrl_nav_pb2.pyi +0 -0
  105. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/proto/mctrl_ota.proto +0 -0
  106. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/proto/mctrl_ota.py +0 -0
  107. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/proto/mctrl_ota_pb2.py +0 -0
  108. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/proto/mctrl_ota_pb2.pyi +0 -0
  109. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/proto/mctrl_pept.proto +0 -0
  110. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/proto/mctrl_pept.py +0 -0
  111. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/proto/mctrl_pept_pb2.py +0 -0
  112. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/proto/mctrl_pept_pb2.pyi +0 -0
  113. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/proto/mctrl_sys.proto +0 -0
  114. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/proto/mctrl_sys.py +0 -0
  115. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/proto/mctrl_sys_pb2.py +0 -0
  116. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/proto/mctrl_sys_pb2.pyi +0 -0
  117. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/py.typed +0 -0
  118. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/utility/constant/__init__.py +0 -0
  119. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/utility/conversions.py +0 -0
  120. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/utility/datatype_converter.py +0 -0
  121. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/utility/device_type.py +0 -0
  122. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/utility/map.py +0 -0
  123. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/utility/movement.py +0 -0
  124. {pymammotion-0.2.90 → pymammotion-0.2.92}/pymammotion/utility/periodic.py +0 -0
  125. {pymammotion-0.2.90 → pymammotion-0.2.92}/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.90
3
+ Version: 0.2.92
4
4
  Summary:
5
5
  License: GNU-3.0
6
6
  Author: Michael Arthur
@@ -704,25 +704,25 @@ class CloudIOTGateway:
704
704
  self.mammotion_http = mammotion_http
705
705
 
706
706
  @property
707
- def region_response(self):
707
+ def region_response(self) -> RegionResponse:
708
708
  return self._region_response
709
709
 
710
710
  @property
711
- def aep_response(self):
711
+ def aep_response(self) -> AepResponse:
712
712
  return self._aep_response
713
713
 
714
714
  @property
715
- def session_by_authcode_response(self):
715
+ def session_by_authcode_response(self) -> SessionByAuthCodeResponse:
716
716
  return self._session_by_authcode_response
717
717
 
718
718
  @property
719
- def client_id(self):
719
+ def client_id(self) -> str:
720
720
  return self._client_id
721
721
 
722
722
  @property
723
- def login_by_oauth_response(self):
723
+ def login_by_oauth_response(self) -> LoginByOAuthResponse:
724
724
  return self._login_by_oauth_response
725
725
 
726
726
  @property
727
- def connect_response(self):
727
+ def connect_response(self) -> ConnectResponse:
728
728
  return self._connect_response
@@ -1,4 +1,4 @@
1
- from dataclasses import asdict, dataclass, field
1
+ from dataclasses import dataclass, field
2
2
 
3
3
  from mashumaro.mixins.orjson import DataClassORJSONMixin
4
4
 
@@ -8,6 +8,7 @@ class ConnectData(DataClassORJSONMixin):
8
8
  connect_type: int = 0
9
9
  ble_rssi: int = 0
10
10
  wifi_rssi: int = 0
11
+ used_net: str = ''
11
12
 
12
13
 
13
14
  @dataclass
@@ -52,6 +53,24 @@ class LocationData(DataClassORJSONMixin):
52
53
  bol_hash: str = ""
53
54
 
54
55
 
56
+ @dataclass
57
+ class Maintain(DataClassORJSONMixin):
58
+ mileage: int = 0
59
+ work_time: int = 0
60
+ bat_cycles: int = 0
61
+
62
+
63
+ @dataclass
64
+ class VisionInfo(DataClassORJSONMixin):
65
+ x: float = 0.0
66
+ y: float = 0.0
67
+ heading: float = 0.0
68
+ vio_state: int = 0
69
+ brightness: int = 1
70
+ detect_feature_num: int = 0
71
+ track_feature_num: int = 0
72
+
73
+
55
74
  @dataclass
56
75
  class WorkData(DataClassORJSONMixin):
57
76
  path: int = 0
@@ -80,6 +99,8 @@ class WorkData(DataClassORJSONMixin):
80
99
  class ReportData(DataClassORJSONMixin):
81
100
  connect: ConnectData = field(default_factory=ConnectData)
82
101
  dev: DeviceData = field(default_factory=DeviceData)
102
+ maintenance: Maintain = field(default_factory=Maintain)
103
+ vision_info: VisionInfo = field(default_factory=VisionInfo)
83
104
  rtk: RTKData = field(default_factory=RTKData)
84
105
  locations: list[LocationData] = field(default_factory=list)
85
106
  work: WorkData = field(default_factory=WorkData)
@@ -89,8 +110,10 @@ class ReportData(DataClassORJSONMixin):
89
110
  if data.get("locations") is not None:
90
111
  locations = [LocationData.from_dict(loc) for loc in data.get("locations", [])]
91
112
 
92
- self.connect = ConnectData.from_dict(data.get("connect", asdict(self.connect)))
93
- self.dev = DeviceData.from_dict(data.get("dev", asdict(self.dev)))
94
- self.rtk = RTKData.from_dict(data.get("rtk", asdict(self.rtk)))
113
+ self.connect = ConnectData.from_dict(data.get("connect", self.connect.to_dict()))
114
+ self.dev = DeviceData.from_dict(data.get("dev", self.dev.to_dict()))
115
+ self.rtk = RTKData.from_dict(data.get("rtk", self.rtk.to_dict()))
116
+ self.maintenance = Maintain.from_dict(data.get("maintain", self.maintenance.to_dict()))
117
+ self.vision_info = VisionInfo.from_dict(data.get("vio_to_app_info", self.vision_info.to_dict()))
95
118
  self.locations = locations
96
- self.work = WorkData.from_dict(data.get("work", asdict(self.work)))
119
+ self.work = WorkData.from_dict(data.get("work", self.work.to_dict()))
@@ -14,7 +14,7 @@ class Event:
14
14
  self.__eventhandlers.remove(handler)
15
15
  return self
16
16
 
17
- async def __call__(self, *args, **kwargs) -> None:
17
+ async def __call__(self, *args: Any, **kwargs: Any) -> None:
18
18
  await asyncio.gather(*[handler(*args, **kwargs) for handler in self.__eventhandlers])
19
19
 
20
20
 
@@ -1,14 +1,19 @@
1
1
  # === sendOrderMsg_Net ===
2
+ import time
3
+ from abc import ABC
4
+
2
5
  from pymammotion import logger
6
+ from pymammotion.mammotion.commands.abstract_message import AbstractMessage
3
7
  from pymammotion.mammotion.commands.messages.navigation import MessageNavigation
4
8
  from pymammotion.proto import dev_net_pb2, luba_msg_pb2
9
+ from pymammotion.proto.dev_net import DevNet
5
10
 
6
11
 
7
- class MessageNetwork:
12
+ class MessageNetwork(AbstractMessage, ABC):
8
13
  messageNavigation: MessageNavigation = MessageNavigation()
9
14
 
10
15
  @staticmethod
11
- def send_order_msg_net(build) -> bytes:
16
+ def send_order_msg_net(build: DevNet) -> bytes:
12
17
  luba_msg = luba_msg_pb2.LubaMsg(
13
18
  msgtype=luba_msg_pb2.MSG_CMD_TYPE_ESP,
14
19
  sender=luba_msg_pb2.DEV_MOBILEAPP,
@@ -18,6 +23,7 @@ class MessageNetwork:
18
23
  version=1,
19
24
  subtype=1,
20
25
  net=build,
26
+ timestamp=round(time.time() * 1000),
21
27
  )
22
28
 
23
29
  return luba_msg.SerializeToString()
@@ -180,20 +186,12 @@ class MessageNetwork:
180
186
  logger.debug("Send command - get memorized WiFi list upload command")
181
187
  return self.send_order_msg_net(build)
182
188
 
183
- def close_clear_connect_current_wifi(self, ssid: str, status: int, is_binary: bool) -> bytes:
184
- if is_binary:
185
- build = dev_net_pb2.DevNet(
186
- todev_ble_sync=1,
187
- todev_Wifi_Configuration=dev_net_pb2.DrvWifiSet(configParam=status, Confssid=ssid),
188
- )
189
- logger.debug(
190
- f"Send command - set network (disconnect, direct connect, forget, no operation reconnect) operation command (downlink ssid={ssid}, status={status})"
191
- )
192
- return self.send_order_msg_net(build)
193
- self.close_clear_connect_current_wifi2(ssid, status)
194
-
195
- # def close_clear_connect_current_wifi2(self, ssid: str, get_msg_cmd: int) -> None:
196
- # data = {"ssid": ssid, "getMsgCmd": get_msg_cmd}
197
- # self.messageNavigation.post_custom_data(
198
- # ToDo: Fix this
199
- # self.get_json_string(bleOrderCmd.close_clear_connect_current_wifi, data).encode())
189
+ def close_clear_connect_current_wifi(self, ssid: str, status: int) -> bytes:
190
+ build = dev_net_pb2.DevNet(
191
+ todev_ble_sync=1,
192
+ todev_Wifi_Configuration=dev_net_pb2.DrvWifiSet(configParam=status, Confssid=ssid),
193
+ )
194
+ logger.debug(
195
+ f"Send command - set network (disconnect, direct connect, forget, no operation reconnect) operation command (downlink ssid={ssid}, status={status})"
196
+ )
197
+ return self.send_order_msg_net(build)
@@ -1,5 +1,6 @@
1
1
  # === sendOrderMsg_Sys ===
2
2
  import datetime
3
+ import time
3
4
  from abc import ABC
4
5
 
5
6
  from pymammotion import logger
@@ -28,19 +29,30 @@ class MessageSystem(AbstractMessage, ABC):
28
29
  def send_order_msg_sys(self, sys):
29
30
  luba_msg = LubaMsg(
30
31
  msgtype=MsgCmdType.MSG_CMD_TYPE_EMBED_SYS,
32
+ msgattr=MsgAttr.MSG_ATTR_REQ,
31
33
  sender=MsgDevice.DEV_MOBILEAPP,
32
34
  rcver=self.get_msg_device(MsgCmdType.MSG_CMD_TYPE_EMBED_SYS, MsgDevice.DEV_MAINCTL),
33
35
  sys=sys,
36
+ seqs=1,
37
+ version=1,
38
+ subtype=1,
39
+ timestamp=round(time.time() * 1000),
34
40
  )
35
41
 
36
42
  return luba_msg.SerializeToString()
37
43
 
38
- def send_order_msg_sys_legacy(self, sys):
44
+ @staticmethod
45
+ def send_order_msg_sys_legacy(sys):
39
46
  luba_msg = LubaMsg(
40
47
  msgtype=MsgCmdType.MSG_CMD_TYPE_EMBED_SYS,
48
+ msgattr=MsgAttr.MSG_ATTR_REQ,
41
49
  sender=MsgDevice.DEV_MOBILEAPP,
42
50
  rcver=MsgDevice.DEV_MAINCTL,
43
51
  sys=sys,
52
+ seqs=1,
53
+ version=1,
54
+ subtype=1,
55
+ timestamp=round(time.time() * 1000),
44
56
  )
45
57
 
46
58
  return luba_msg.SerializeToString()
@@ -239,7 +251,7 @@ class MessageSystem(AbstractMessage, ABC):
239
251
 
240
252
  def get_report_cfg_stop(self, timeout: int = 10000, period: int = 1000, no_change_period: int = 1000):
241
253
  # TODO use send_order_msg_sys_legacy
242
- mctlsys = MctlSys(
254
+ mctl_sys = MctlSys(
243
255
  todev_report_cfg=ReportInfoCfg(
244
256
  act=RptAct.RPT_STOP,
245
257
  timeout=timeout,
@@ -249,30 +261,33 @@ class MessageSystem(AbstractMessage, ABC):
249
261
  )
250
262
  )
251
263
 
252
- mctlsys.todev_report_cfg.sub.append(RptInfoType.RIT_CONNECT)
253
- mctlsys.todev_report_cfg.sub.append(RptInfoType.RIT_RTK)
254
- mctlsys.todev_report_cfg.sub.append(RptInfoType.RIT_DEV_LOCAL)
255
- mctlsys.todev_report_cfg.sub.append(RptInfoType.RIT_WORK)
256
- mctlsys.todev_report_cfg.sub.append(RptInfoType.RIT_DEV_STA)
257
- mctlsys.todev_report_cfg.sub.append(RptInfoType.RIT_MAINTAIN)
258
- mctlsys.todev_report_cfg.sub.append(RptInfoType.RIT_VISION_POINT)
259
- mctlsys.todev_report_cfg.sub.append(RptInfoType.RIT_VIO)
260
- mctlsys.todev_report_cfg.sub.append(RptInfoType.RIT_VISION_STATISTIC)
264
+ mctl_sys.todev_report_cfg.sub.append(RptInfoType.RIT_CONNECT)
265
+ mctl_sys.todev_report_cfg.sub.append(RptInfoType.RIT_RTK)
266
+ mctl_sys.todev_report_cfg.sub.append(RptInfoType.RIT_DEV_LOCAL)
267
+ mctl_sys.todev_report_cfg.sub.append(RptInfoType.RIT_WORK)
268
+ mctl_sys.todev_report_cfg.sub.append(RptInfoType.RIT_DEV_STA)
269
+ mctl_sys.todev_report_cfg.sub.append(RptInfoType.RIT_MAINTAIN)
270
+ mctl_sys.todev_report_cfg.sub.append(RptInfoType.RIT_VISION_POINT)
271
+ mctl_sys.todev_report_cfg.sub.append(RptInfoType.RIT_VIO)
272
+ mctl_sys.todev_report_cfg.sub.append(RptInfoType.RIT_VISION_STATISTIC)
261
273
 
262
- lubaMsg = LubaMsg()
263
- lubaMsg.msgtype = MsgCmdType.MSG_CMD_TYPE_EMBED_SYS
264
- lubaMsg.sender = MsgDevice.DEV_MOBILEAPP
265
- lubaMsg.rcver = MsgDevice.DEV_MAINCTL
266
- lubaMsg.msgattr = MsgAttr.MSG_ATTR_REQ
267
- lubaMsg.seqs = 1
268
- lubaMsg.version = 1
269
- lubaMsg.subtype = 1
270
- lubaMsg.sys = mctlsys
271
- return lubaMsg.SerializeToString()
274
+ luba_msg = LubaMsg(
275
+ msgtype=MsgCmdType.MSG_CMD_TYPE_EMBED_SYS,
276
+ sender=MsgDevice.DEV_MOBILEAPP,
277
+ rcver=MsgDevice.DEV_MAINCTL,
278
+ msgattr=MsgAttr.MSG_ATTR_REQ,
279
+ seqs=1,
280
+ version=1,
281
+ subtype=1,
282
+ sys=mctl_sys,
283
+ timestamp=round(time.time() * 1000),
284
+ )
285
+
286
+ return luba_msg.SerializeToString()
272
287
 
273
288
  def get_report_cfg(self, timeout: int = 10000, period: int = 1000, no_change_period: int = 2000):
274
289
  # TODO use send_order_msg_sys_legacy
275
- mctlsys = MctlSys(
290
+ mctl_sys = MctlSys(
276
291
  todev_report_cfg=ReportInfoCfg(
277
292
  act=RptAct.RPT_START,
278
293
  timeout=timeout,
@@ -282,24 +297,26 @@ class MessageSystem(AbstractMessage, ABC):
282
297
  )
283
298
  )
284
299
 
285
- mctlsys.todev_report_cfg.sub.append(RptInfoType.RIT_CONNECT)
286
- mctlsys.todev_report_cfg.sub.append(RptInfoType.RIT_RTK)
287
- mctlsys.todev_report_cfg.sub.append(RptInfoType.RIT_DEV_LOCAL)
288
- mctlsys.todev_report_cfg.sub.append(RptInfoType.RIT_WORK)
289
- mctlsys.todev_report_cfg.sub.append(RptInfoType.RIT_DEV_STA)
290
- mctlsys.todev_report_cfg.sub.append(RptInfoType.RIT_MAINTAIN)
291
- mctlsys.todev_report_cfg.sub.append(RptInfoType.RIT_VISION_POINT)
292
- mctlsys.todev_report_cfg.sub.append(RptInfoType.RIT_VIO)
293
- mctlsys.todev_report_cfg.sub.append(RptInfoType.RIT_VISION_STATISTIC)
294
- mctlsys.todev_report_cfg.sub.append(RptInfoType.RIT_BASESTATION_INFO)
300
+ mctl_sys.todev_report_cfg.sub.append(RptInfoType.RIT_CONNECT)
301
+ mctl_sys.todev_report_cfg.sub.append(RptInfoType.RIT_RTK)
302
+ mctl_sys.todev_report_cfg.sub.append(RptInfoType.RIT_DEV_LOCAL)
303
+ mctl_sys.todev_report_cfg.sub.append(RptInfoType.RIT_WORK)
304
+ mctl_sys.todev_report_cfg.sub.append(RptInfoType.RIT_DEV_STA)
305
+ mctl_sys.todev_report_cfg.sub.append(RptInfoType.RIT_MAINTAIN)
306
+ mctl_sys.todev_report_cfg.sub.append(RptInfoType.RIT_VISION_POINT)
307
+ mctl_sys.todev_report_cfg.sub.append(RptInfoType.RIT_VIO)
308
+ mctl_sys.todev_report_cfg.sub.append(RptInfoType.RIT_VISION_STATISTIC)
309
+ mctl_sys.todev_report_cfg.sub.append(RptInfoType.RIT_BASESTATION_INFO)
295
310
 
296
- lubaMsg = LubaMsg()
297
- lubaMsg.msgtype = MsgCmdType.MSG_CMD_TYPE_EMBED_SYS
298
- lubaMsg.sender = MsgDevice.DEV_MOBILEAPP
299
- lubaMsg.rcver = MsgDevice.DEV_MAINCTL
300
- lubaMsg.msgattr = MsgAttr.MSG_ATTR_REQ
301
- lubaMsg.seqs = 1
302
- lubaMsg.version = 1
303
- lubaMsg.subtype = 1
304
- lubaMsg.sys = mctlsys
305
- return lubaMsg.SerializeToString()
311
+ luba_msg = LubaMsg(
312
+ msgtype=MsgCmdType.MSG_CMD_TYPE_EMBED_SYS,
313
+ sender=MsgDevice.DEV_MOBILEAPP,
314
+ rcver=MsgDevice.DEV_MAINCTL,
315
+ msgattr=MsgAttr.MSG_ATTR_REQ,
316
+ seqs=1,
317
+ version=1,
318
+ subtype=1,
319
+ sys=mctl_sys,
320
+ timestamp=round(time.time() * 1000),
321
+ )
322
+ return luba_msg.SerializeToString()
@@ -1,9 +1,10 @@
1
1
  # === sendOrderMsg_Video ===
2
+ import time
2
3
  from abc import ABC
3
4
 
4
5
  from pymammotion.mammotion.commands.abstract_message import AbstractMessage
5
6
  from pymammotion.proto import luba_msg_pb2, luba_mul_pb2
6
- from pymammotion.proto.luba_msg import MsgCmdType, MsgDevice
7
+ from pymammotion.proto.luba_msg import MsgAttr, MsgCmdType, MsgDevice
7
8
  from pymammotion.utility.device_type import DeviceType
8
9
 
9
10
 
@@ -11,9 +12,14 @@ class MessageVideo(AbstractMessage, ABC):
11
12
  async def send_order_msg_video(self, mul):
12
13
  luba_msg = luba_msg_pb2.LubaMsg(
13
14
  msgtype=luba_msg_pb2.MSG_CMD_TYPE_MUL,
15
+ msgattr=MsgAttr.MSG_ATTR_REQ,
14
16
  sender=luba_msg_pb2.DEV_MOBILEAPP,
15
17
  rcver=self.get_msg_device(MsgCmdType.MSG_CMD_TYPE_MUL, MsgDevice.SOC_MODULE_MULTIMEDIA),
16
18
  mul=mul,
19
+ seqs=1,
20
+ version=1,
21
+ subtype=1,
22
+ timestamp=round(time.time() * 1000),
17
23
  )
18
24
 
19
25
  return luba_msg.SerializeToString()
@@ -212,7 +212,18 @@ class WorkMode:
212
212
  MODE_WORKING = 13
213
213
 
214
214
 
215
- def device_mode(value) -> str:
215
+ def device_connection(value: int, mnet_type: str) -> str:
216
+ """Return string representation of device connection."""
217
+ if value == 1:
218
+ return "BLE"
219
+
220
+ if mnet_type == 'NET_USED_TYPE_WIFI':
221
+ return "WIFI"
222
+
223
+ return "3G/4G"
224
+
225
+
226
+ def device_mode(value: int) -> str:
216
227
  """Return the mode corresponding to the given value.
217
228
 
218
229
  This function takes a value and returns the corresponding mode from a
@@ -1,10 +1,10 @@
1
1
  [project]
2
2
  name = "pymammotion"
3
- version = "0.2.90"
3
+ version = "0.2.92"
4
4
 
5
5
  [tool.poetry]
6
6
  name = "pymammotion"
7
- version = "0.2.90"
7
+ version = "0.2.92"
8
8
  license = "GNU-3.0"
9
9
  description = ""
10
10
  readme = "README.md"
@@ -61,7 +61,7 @@ mypy = "^1.11.2"
61
61
  autotyping = "^24.3.0"
62
62
 
63
63
  [tool.bumpver]
64
- current_version = "0.2.90"
64
+ current_version = "0.2.92"
65
65
  version_pattern = "MAJOR.MINOR.PATCH"
66
66
  commit_message = "Bump version {old_version} -> {new_version}"
67
67
  commit = true
File without changes
File without changes