pymammotion 0.2.91__tar.gz → 0.2.93__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.91 → pymammotion-0.2.93}/PKG-INFO +1 -1
  2. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/aliyun/cloud_gateway.py +6 -6
  3. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/data/model/report_info.py +28 -5
  4. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/event/event.py +1 -1
  5. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/mammotion/commands/messages/network.py +14 -19
  6. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/mammotion/commands/messages/system.py +48 -43
  7. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/mammotion/commands/messages/video.py +2 -2
  8. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/mammotion/devices/mammotion_cloud.py +6 -1
  9. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/utility/constant/device_constant.py +12 -1
  10. {pymammotion-0.2.91 → pymammotion-0.2.93}/pyproject.toml +3 -3
  11. {pymammotion-0.2.91 → pymammotion-0.2.93}/LICENSE +0 -0
  12. {pymammotion-0.2.91 → pymammotion-0.2.93}/README.md +0 -0
  13. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/__init__.py +0 -0
  14. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/aliyun/__init__.py +0 -0
  15. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/aliyun/cloud_service.py +0 -0
  16. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/aliyun/model/aep_response.py +0 -0
  17. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/aliyun/model/connect_response.py +0 -0
  18. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/aliyun/model/dev_by_account_response.py +0 -0
  19. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/aliyun/model/login_by_oauth_response.py +0 -0
  20. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/aliyun/model/regions_response.py +0 -0
  21. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/aliyun/model/session_by_authcode_response.py +0 -0
  22. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/aliyun/model/stream_subscription_response.py +0 -0
  23. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/aliyun/tmp_constant.py +0 -0
  24. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/bluetooth/__init__.py +0 -0
  25. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/bluetooth/ble.py +0 -0
  26. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/bluetooth/ble_message.py +0 -0
  27. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/bluetooth/const.py +0 -0
  28. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/bluetooth/data/__init__.py +0 -0
  29. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/bluetooth/data/convert.py +0 -0
  30. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/bluetooth/data/framectrldata.py +0 -0
  31. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/bluetooth/data/notifydata.py +0 -0
  32. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/const.py +0 -0
  33. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/data/__init__.py +0 -0
  34. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/data/model/__init__.py +0 -0
  35. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/data/model/account.py +0 -0
  36. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/data/model/device.py +0 -0
  37. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/data/model/device_config.py +0 -0
  38. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/data/model/device_info.py +0 -0
  39. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/data/model/enums.py +0 -0
  40. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/data/model/excute_boarder_params.py +0 -0
  41. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/data/model/execute_boarder.py +0 -0
  42. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/data/model/generate_route_information.py +0 -0
  43. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/data/model/hash_list.py +0 -0
  44. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/data/model/location.py +0 -0
  45. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/data/model/mowing_modes.py +0 -0
  46. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/data/model/plan.py +0 -0
  47. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/data/model/rapid_state.py +0 -0
  48. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/data/model/region_data.py +0 -0
  49. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/data/mqtt/__init__.py +0 -0
  50. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/data/mqtt/event.py +0 -0
  51. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/data/mqtt/properties.py +0 -0
  52. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/data/mqtt/status.py +0 -0
  53. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/data/state_manager.py +0 -0
  54. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/event/__init__.py +0 -0
  55. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/http/_init_.py +0 -0
  56. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/http/http.py +0 -0
  57. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/http/model/http.py +0 -0
  58. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/mammotion/__init__.py +0 -0
  59. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/mammotion/commands/__init__.py +0 -0
  60. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/mammotion/commands/abstract_message.py +0 -0
  61. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/mammotion/commands/mammotion_command.py +0 -0
  62. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/mammotion/commands/messages/__init__.py +0 -0
  63. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/mammotion/commands/messages/driver.py +0 -0
  64. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/mammotion/commands/messages/media.py +0 -0
  65. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/mammotion/commands/messages/navigation.py +0 -0
  66. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/mammotion/commands/messages/ota.py +0 -0
  67. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/mammotion/control/__init__.py +0 -0
  68. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/mammotion/control/joystick.py +0 -0
  69. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/mammotion/devices/__init__.py +0 -0
  70. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/mammotion/devices/base.py +0 -0
  71. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/mammotion/devices/mammotion.py +0 -0
  72. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/mammotion/devices/mammotion_bluetooth.py +0 -0
  73. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/mqtt/__init__.py +0 -0
  74. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/mqtt/mammotion_future.py +0 -0
  75. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/mqtt/mammotion_mqtt.py +0 -0
  76. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/proto/__init__.py +0 -0
  77. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/proto/basestation.proto +0 -0
  78. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/proto/basestation.py +0 -0
  79. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/proto/basestation_pb2.py +0 -0
  80. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/proto/basestation_pb2.pyi +0 -0
  81. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/proto/common.proto +0 -0
  82. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/proto/common.py +0 -0
  83. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/proto/common_pb2.py +0 -0
  84. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/proto/common_pb2.pyi +0 -0
  85. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/proto/dev_net.proto +0 -0
  86. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/proto/dev_net.py +0 -0
  87. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/proto/dev_net_pb2.py +0 -0
  88. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/proto/dev_net_pb2.pyi +0 -0
  89. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/proto/luba_msg.proto +0 -0
  90. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/proto/luba_msg.py +0 -0
  91. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/proto/luba_msg_pb2.py +0 -0
  92. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/proto/luba_msg_pb2.pyi +0 -0
  93. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/proto/luba_mul.proto +0 -0
  94. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/proto/luba_mul.py +0 -0
  95. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/proto/luba_mul_pb2.py +0 -0
  96. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/proto/luba_mul_pb2.pyi +0 -0
  97. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/proto/mctrl_driver.proto +0 -0
  98. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/proto/mctrl_driver.py +0 -0
  99. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/proto/mctrl_driver_pb2.py +0 -0
  100. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/proto/mctrl_driver_pb2.pyi +0 -0
  101. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/proto/mctrl_nav.proto +0 -0
  102. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/proto/mctrl_nav.py +0 -0
  103. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/proto/mctrl_nav_pb2.py +0 -0
  104. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/proto/mctrl_nav_pb2.pyi +0 -0
  105. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/proto/mctrl_ota.proto +0 -0
  106. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/proto/mctrl_ota.py +0 -0
  107. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/proto/mctrl_ota_pb2.py +0 -0
  108. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/proto/mctrl_ota_pb2.pyi +0 -0
  109. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/proto/mctrl_pept.proto +0 -0
  110. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/proto/mctrl_pept.py +0 -0
  111. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/proto/mctrl_pept_pb2.py +0 -0
  112. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/proto/mctrl_pept_pb2.pyi +0 -0
  113. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/proto/mctrl_sys.proto +0 -0
  114. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/proto/mctrl_sys.py +0 -0
  115. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/proto/mctrl_sys_pb2.py +0 -0
  116. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/proto/mctrl_sys_pb2.pyi +0 -0
  117. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/py.typed +0 -0
  118. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/utility/constant/__init__.py +0 -0
  119. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/utility/conversions.py +0 -0
  120. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/utility/datatype_converter.py +0 -0
  121. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/utility/device_type.py +0 -0
  122. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/utility/map.py +0 -0
  123. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/utility/movement.py +0 -0
  124. {pymammotion-0.2.91 → pymammotion-0.2.93}/pymammotion/utility/periodic.py +0 -0
  125. {pymammotion-0.2.91 → pymammotion-0.2.93}/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.91
3
+ Version: 0.2.93
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,16 +1,19 @@
1
1
  # === sendOrderMsg_Net ===
2
2
  import time
3
+ from abc import ABC
3
4
 
4
5
  from pymammotion import logger
6
+ from pymammotion.mammotion.commands.abstract_message import AbstractMessage
5
7
  from pymammotion.mammotion.commands.messages.navigation import MessageNavigation
6
8
  from pymammotion.proto import dev_net_pb2, luba_msg_pb2
9
+ from pymammotion.proto.dev_net import DevNet
7
10
 
8
11
 
9
- class MessageNetwork:
12
+ class MessageNetwork(AbstractMessage, ABC):
10
13
  messageNavigation: MessageNavigation = MessageNavigation()
11
14
 
12
15
  @staticmethod
13
- def send_order_msg_net(build) -> bytes:
16
+ def send_order_msg_net(build: DevNet) -> bytes:
14
17
  luba_msg = luba_msg_pb2.LubaMsg(
15
18
  msgtype=luba_msg_pb2.MSG_CMD_TYPE_ESP,
16
19
  sender=luba_msg_pb2.DEV_MOBILEAPP,
@@ -183,20 +186,12 @@ class MessageNetwork:
183
186
  logger.debug("Send command - get memorized WiFi list upload command")
184
187
  return self.send_order_msg_net(build)
185
188
 
186
- def close_clear_connect_current_wifi(self, ssid: str, status: int, is_binary: bool) -> bytes:
187
- if is_binary:
188
- build = dev_net_pb2.DevNet(
189
- todev_ble_sync=1,
190
- todev_Wifi_Configuration=dev_net_pb2.DrvWifiSet(configParam=status, Confssid=ssid),
191
- )
192
- logger.debug(
193
- f"Send command - set network (disconnect, direct connect, forget, no operation reconnect) operation command (downlink ssid={ssid}, status={status})"
194
- )
195
- return self.send_order_msg_net(build)
196
- self.close_clear_connect_current_wifi2(ssid, status)
197
-
198
- # def close_clear_connect_current_wifi2(self, ssid: str, get_msg_cmd: int) -> None:
199
- # data = {"ssid": ssid, "getMsgCmd": get_msg_cmd}
200
- # self.messageNavigation.post_custom_data(
201
- # ToDo: Fix this
202
- # 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)
@@ -36,7 +36,7 @@ class MessageSystem(AbstractMessage, ABC):
36
36
  seqs=1,
37
37
  version=1,
38
38
  subtype=1,
39
- timestamp=round(time.time() * 1000)
39
+ timestamp=round(time.time() * 1000),
40
40
  )
41
41
 
42
42
  return luba_msg.SerializeToString()
@@ -52,7 +52,7 @@ class MessageSystem(AbstractMessage, ABC):
52
52
  seqs=1,
53
53
  version=1,
54
54
  subtype=1,
55
- timestamp=round(time.time() * 1000)
55
+ timestamp=round(time.time() * 1000),
56
56
  )
57
57
 
58
58
  return luba_msg.SerializeToString()
@@ -251,7 +251,7 @@ class MessageSystem(AbstractMessage, ABC):
251
251
 
252
252
  def get_report_cfg_stop(self, timeout: int = 10000, period: int = 1000, no_change_period: int = 1000):
253
253
  # TODO use send_order_msg_sys_legacy
254
- mctlsys = MctlSys(
254
+ mctl_sys = MctlSys(
255
255
  todev_report_cfg=ReportInfoCfg(
256
256
  act=RptAct.RPT_STOP,
257
257
  timeout=timeout,
@@ -261,30 +261,33 @@ class MessageSystem(AbstractMessage, ABC):
261
261
  )
262
262
  )
263
263
 
264
- mctlsys.todev_report_cfg.sub.append(RptInfoType.RIT_CONNECT)
265
- mctlsys.todev_report_cfg.sub.append(RptInfoType.RIT_RTK)
266
- mctlsys.todev_report_cfg.sub.append(RptInfoType.RIT_DEV_LOCAL)
267
- mctlsys.todev_report_cfg.sub.append(RptInfoType.RIT_WORK)
268
- mctlsys.todev_report_cfg.sub.append(RptInfoType.RIT_DEV_STA)
269
- mctlsys.todev_report_cfg.sub.append(RptInfoType.RIT_MAINTAIN)
270
- mctlsys.todev_report_cfg.sub.append(RptInfoType.RIT_VISION_POINT)
271
- mctlsys.todev_report_cfg.sub.append(RptInfoType.RIT_VIO)
272
- 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)
273
273
 
274
- lubaMsg = LubaMsg()
275
- lubaMsg.msgtype = MsgCmdType.MSG_CMD_TYPE_EMBED_SYS
276
- lubaMsg.sender = MsgDevice.DEV_MOBILEAPP
277
- lubaMsg.rcver = MsgDevice.DEV_MAINCTL
278
- lubaMsg.msgattr = MsgAttr.MSG_ATTR_REQ
279
- lubaMsg.seqs = 1
280
- lubaMsg.version = 1
281
- lubaMsg.subtype = 1
282
- lubaMsg.sys = mctlsys
283
- 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()
284
287
 
285
288
  def get_report_cfg(self, timeout: int = 10000, period: int = 1000, no_change_period: int = 2000):
286
289
  # TODO use send_order_msg_sys_legacy
287
- mctlsys = MctlSys(
290
+ mctl_sys = MctlSys(
288
291
  todev_report_cfg=ReportInfoCfg(
289
292
  act=RptAct.RPT_START,
290
293
  timeout=timeout,
@@ -294,24 +297,26 @@ class MessageSystem(AbstractMessage, ABC):
294
297
  )
295
298
  )
296
299
 
297
- mctlsys.todev_report_cfg.sub.append(RptInfoType.RIT_CONNECT)
298
- mctlsys.todev_report_cfg.sub.append(RptInfoType.RIT_RTK)
299
- mctlsys.todev_report_cfg.sub.append(RptInfoType.RIT_DEV_LOCAL)
300
- mctlsys.todev_report_cfg.sub.append(RptInfoType.RIT_WORK)
301
- mctlsys.todev_report_cfg.sub.append(RptInfoType.RIT_DEV_STA)
302
- mctlsys.todev_report_cfg.sub.append(RptInfoType.RIT_MAINTAIN)
303
- mctlsys.todev_report_cfg.sub.append(RptInfoType.RIT_VISION_POINT)
304
- mctlsys.todev_report_cfg.sub.append(RptInfoType.RIT_VIO)
305
- mctlsys.todev_report_cfg.sub.append(RptInfoType.RIT_VISION_STATISTIC)
306
- 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)
307
310
 
308
- lubaMsg = LubaMsg()
309
- lubaMsg.msgtype = MsgCmdType.MSG_CMD_TYPE_EMBED_SYS
310
- lubaMsg.sender = MsgDevice.DEV_MOBILEAPP
311
- lubaMsg.rcver = MsgDevice.DEV_MAINCTL
312
- lubaMsg.msgattr = MsgAttr.MSG_ATTR_REQ
313
- lubaMsg.seqs = 1
314
- lubaMsg.version = 1
315
- lubaMsg.subtype = 1
316
- lubaMsg.sys = mctlsys
317
- 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()
@@ -4,7 +4,7 @@ from abc import ABC
4
4
 
5
5
  from pymammotion.mammotion.commands.abstract_message import AbstractMessage
6
6
  from pymammotion.proto import luba_msg_pb2, luba_mul_pb2
7
- from pymammotion.proto.luba_msg import MsgCmdType, MsgDevice, MsgAttr
7
+ from pymammotion.proto.luba_msg import MsgAttr, MsgCmdType, MsgDevice
8
8
  from pymammotion.utility.device_type import DeviceType
9
9
 
10
10
 
@@ -19,7 +19,7 @@ class MessageVideo(AbstractMessage, ABC):
19
19
  seqs=1,
20
20
  version=1,
21
21
  subtype=1,
22
- timestamp=round(time.time() * 1000)
22
+ timestamp=round(time.time() * 1000),
23
23
  )
24
24
 
25
25
  return luba_msg.SerializeToString()
@@ -244,7 +244,12 @@ class MammotionBaseCloudDevice(MammotionBaseDevice):
244
244
  command_bytes = getattr(self._commands, key)(**kwargs)
245
245
  await self._mqtt.command_queue.put((self.iot_id, key, command_bytes, future))
246
246
  # Wait for the future to be resolved
247
- return await future
247
+ try:
248
+ return await future
249
+ except asyncio.CancelledError:
250
+ """Try again once."""
251
+ future = asyncio.Future()
252
+ await self._mqtt.command_queue.put((self.iot_id, key, command_bytes, future))
248
253
 
249
254
  def _extract_message_id(self, payload: dict) -> str:
250
255
  """Extract the message ID from the payload."""
@@ -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.91"
3
+ version = "0.2.93"
4
4
 
5
5
  [tool.poetry]
6
6
  name = "pymammotion"
7
- version = "0.2.91"
7
+ version = "0.2.93"
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.91"
64
+ current_version = "0.2.93"
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