pymammotion 0.0.55__py3-none-any.whl → 0.0.56__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.
Potentially problematic release.
This version of pymammotion might be problematic. Click here for more details.
- pymammotion/mammotion/commands/abstract_message.py +3 -0
- pymammotion/mammotion/commands/mammotion_command.py +11 -0
- pymammotion/mammotion/commands/messages/navigation.py +9 -15
- pymammotion/mammotion/devices/mammotion.py +4 -0
- {pymammotion-0.0.55.dist-info → pymammotion-0.0.56.dist-info}/METADATA +1 -1
- {pymammotion-0.0.55.dist-info → pymammotion-0.0.56.dist-info}/RECORD +8 -8
- {pymammotion-0.0.55.dist-info → pymammotion-0.0.56.dist-info}/LICENSE +0 -0
- {pymammotion-0.0.55.dist-info → pymammotion-0.0.56.dist-info}/WHEEL +0 -0
|
@@ -4,18 +4,29 @@ from pymammotion.mammotion.commands.messages.ota import MessageOta
|
|
|
4
4
|
from pymammotion.mammotion.commands.messages.system import MessageSystem
|
|
5
5
|
from pymammotion.mammotion.commands.messages.video import MessageVideo
|
|
6
6
|
from pymammotion.proto import dev_net_pb2, luba_msg_pb2
|
|
7
|
+
from pymammotion.utility.device_type import DeviceType
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
class MammotionCommand(MessageSystem, MessageNavigation, MessageNetwork, MessageOta, MessageVideo):
|
|
10
11
|
"""MQTT commands for Luba."""
|
|
11
12
|
|
|
13
|
+
|
|
14
|
+
|
|
12
15
|
def __init__(self, device_name: str) -> None:
|
|
13
16
|
self._device_name = device_name
|
|
17
|
+
self._product_key = ""
|
|
14
18
|
|
|
15
19
|
def get_device_name(self) -> str:
|
|
16
20
|
"""Get device name."""
|
|
17
21
|
return self._device_name
|
|
18
22
|
|
|
23
|
+
def get_device_product_key(self) -> str:
|
|
24
|
+
return self._product_key
|
|
25
|
+
|
|
26
|
+
def set_device_product_key(self, product_key: str) -> None:
|
|
27
|
+
self._product_key = product_key
|
|
28
|
+
|
|
29
|
+
|
|
19
30
|
"""BLE commands for Luba."""
|
|
20
31
|
|
|
21
32
|
def send_todev_ble_sync(self, sync_type: int) -> bytes:
|
|
@@ -14,6 +14,7 @@ from pymammotion.proto.mctrl_nav import (
|
|
|
14
14
|
MctlNav,
|
|
15
15
|
NavGetCommData,
|
|
16
16
|
NavGetHashList,
|
|
17
|
+
NavMapNameMsg,
|
|
17
18
|
NavPlanJobSet,
|
|
18
19
|
NavPlanTaskExecute,
|
|
19
20
|
NavReqCoverPath,
|
|
@@ -23,7 +24,7 @@ from pymammotion.proto.mctrl_nav import (
|
|
|
23
24
|
NavUploadZigZagResultAck,
|
|
24
25
|
SimulationCmdData,
|
|
25
26
|
WorkReportCmdData,
|
|
26
|
-
WorkReportUpdateCmd,
|
|
27
|
+
WorkReportUpdateCmd,
|
|
27
28
|
)
|
|
28
29
|
from pymammotion.utility.device_type import DeviceType
|
|
29
30
|
|
|
@@ -31,10 +32,9 @@ logger = logging.getLogger(__name__)
|
|
|
31
32
|
|
|
32
33
|
|
|
33
34
|
class MessageNavigation(AbstractMessage, ABC):
|
|
34
|
-
|
|
35
35
|
def get_msg_device(self, msg_type: MsgCmdType, msg_device: MsgDevice) -> MsgDevice:
|
|
36
36
|
"""Changes the rcver name if it's not a luba1."""
|
|
37
|
-
if DeviceType.is_luba1(self.get_device_name()) and msg_type == MsgCmdType.MSG_CMD_TYPE_NAV:
|
|
37
|
+
if not DeviceType.is_luba1(self.get_device_name(), self.get_device_product_key()) and msg_type == MsgCmdType.MSG_CMD_TYPE_NAV:
|
|
38
38
|
return MsgDevice.DEV_NAVIGATION
|
|
39
39
|
return msg_device
|
|
40
40
|
|
|
@@ -265,10 +265,10 @@ class MessageNavigation(AbstractMessage, ABC):
|
|
|
265
265
|
# Build the NavMapNameMsg with the specified parameters
|
|
266
266
|
mctl_nav = MctlNav(
|
|
267
267
|
toapp_map_name_msg=NavMapNameMsg(
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
268
|
+
hash=0,
|
|
269
|
+
result=0,
|
|
270
|
+
device_id=device_id, # iotId or ???
|
|
271
|
+
rw=0,
|
|
272
272
|
)
|
|
273
273
|
)
|
|
274
274
|
|
|
@@ -279,13 +279,7 @@ class MessageNavigation(AbstractMessage, ABC):
|
|
|
279
279
|
def set_area_name(self, device_id, hash_id: int, name: str) -> bytes:
|
|
280
280
|
# Build the NavMapNameMsg with the specified parameters
|
|
281
281
|
mctl_nav = MctlNav(
|
|
282
|
-
toapp_map_name_msg=NavMapNameMsg(
|
|
283
|
-
hash=hash_id,
|
|
284
|
-
name=name,
|
|
285
|
-
result=0,
|
|
286
|
-
device_id=device_id,
|
|
287
|
-
rw=1
|
|
288
|
-
)
|
|
282
|
+
toapp_map_name_msg=NavMapNameMsg(hash=hash_id, name=name, result=0, device_id=device_id, rw=1)
|
|
289
283
|
)
|
|
290
284
|
|
|
291
285
|
# Send the message with the specified ID and acknowledge flag
|
|
@@ -392,7 +386,7 @@ class MessageNavigation(AbstractMessage, ABC):
|
|
|
392
386
|
channel_mode=generate_route_information.channel_mode,
|
|
393
387
|
toward=generate_route_information.toward,
|
|
394
388
|
toward_included_angle=generate_route_information.toward_included_angle, # luba 2 yuka only
|
|
395
|
-
toward_mode=generate_route_information.toward_mode,
|
|
389
|
+
toward_mode=generate_route_information.toward_mode, # luba 2 yuka only
|
|
396
390
|
reserved=generate_route_information.path_order,
|
|
397
391
|
)
|
|
398
392
|
logger.debug(f"{self.get_device_name()}Generate route====={build}")
|
|
@@ -545,6 +545,10 @@ class MammotionBaseBLEDevice(MammotionBaseDevice):
|
|
|
545
545
|
new_msg = LubaMsg().parse(data)
|
|
546
546
|
if betterproto.serialized_on_wire(new_msg.net):
|
|
547
547
|
if new_msg.net.todev_ble_sync != 0 or has_field(new_msg.net.toapp_wifi_iot_status):
|
|
548
|
+
|
|
549
|
+
if has_field(new_msg.net.toapp_wifi_iot_status) and self._commands.get_device_product_key() == "":
|
|
550
|
+
self._commands.set_device_product_key(new_msg.net.toapp_wifi_iot_status.productkey)
|
|
551
|
+
|
|
548
552
|
return
|
|
549
553
|
|
|
550
554
|
# may or may not be correct, some work could be done here to correctly match responses
|
|
@@ -43,12 +43,12 @@ pymammotion/http/_init_.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
43
43
|
pymammotion/http/http.py,sha256=t9jO1U3Kjy30TzHkzQViv5BtmCKnNfyxrurAvXSghok,2284
|
|
44
44
|
pymammotion/mammotion/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
45
45
|
pymammotion/mammotion/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
46
|
-
pymammotion/mammotion/commands/abstract_message.py,sha256=
|
|
47
|
-
pymammotion/mammotion/commands/mammotion_command.py,sha256=
|
|
46
|
+
pymammotion/mammotion/commands/abstract_message.py,sha256=nw6r7694yzl7iJKqRqhLmAPRjd_TL_Xo_-JXq2_a_ug,222
|
|
47
|
+
pymammotion/mammotion/commands/mammotion_command.py,sha256=5WwD-V0XBkaYIRhxe-kVTTNpeA0XMYZLvmU_pj9rgdc,1548
|
|
48
48
|
pymammotion/mammotion/commands/messages/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
49
49
|
pymammotion/mammotion/commands/messages/driver.py,sha256=IFtmp9gJ3p3U2xtTgWVpKBMbnVnUht6Ioih17po6Hr4,3783
|
|
50
50
|
pymammotion/mammotion/commands/messages/media.py,sha256=ps0l06CXy5Ej--gTNCsyKttwo7yHLVrJUpn-wNJYecs,1150
|
|
51
|
-
pymammotion/mammotion/commands/messages/navigation.py,sha256=
|
|
51
|
+
pymammotion/mammotion/commands/messages/navigation.py,sha256=c7C6Dru-Xwtq-epzS9vKsy_6QlQ7ozKq9QDhFn2IRHU,23181
|
|
52
52
|
pymammotion/mammotion/commands/messages/network.py,sha256=1a0BIhaBhBuhqYaK5EUqLbDgfzjzsIGrXS32wMKtxOU,8316
|
|
53
53
|
pymammotion/mammotion/commands/messages/ota.py,sha256=XkeuWBZtpYMMBze6r8UN7dJXbe2FxUNGNnjwBpXJKM0,1240
|
|
54
54
|
pymammotion/mammotion/commands/messages/system.py,sha256=qP6DwYPKTaRgqLZG4Ot8BLD2uzKxhLpCKYFIwek131k,10963
|
|
@@ -56,7 +56,7 @@ pymammotion/mammotion/commands/messages/video.py,sha256=_8lJsU4sLm2CGnc7RDkueA0A
|
|
|
56
56
|
pymammotion/mammotion/control/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
57
57
|
pymammotion/mammotion/control/joystick.py,sha256=EWV20MMzQuhbLlNlXbsyZKSEpeM7x1CQL7saU4Pn0-g,6165
|
|
58
58
|
pymammotion/mammotion/devices/__init__.py,sha256=T72jt0ejtMjo1rPmn_FeMF3pmp0LLeRRpc9WcDKEYYY,126
|
|
59
|
-
pymammotion/mammotion/devices/mammotion.py,sha256=
|
|
59
|
+
pymammotion/mammotion/devices/mammotion.py,sha256=s-ubE2PSWV58LxMerXFrVO6ek3EL6kZkWn04Dacbzb4,31131
|
|
60
60
|
pymammotion/mqtt/__init__.py,sha256=Ocs5e-HLJvTuDpVXyECEsWIvwsUaxzj7lZ9mSYutNDY,105
|
|
61
61
|
pymammotion/mqtt/mammotion_mqtt.py,sha256=EBnUwqah-mZNcAn5Hq2sV3NKXueIYWNhYPiaXwaXdHg,9084
|
|
62
62
|
pymammotion/proto/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -103,7 +103,7 @@ pymammotion/utility/datatype_converter.py,sha256=v6zym2Zu0upxQjR-xDqXwi3516zpntS
|
|
|
103
103
|
pymammotion/utility/device_type.py,sha256=KYawu2glZMVlPmxRbA4kVFujXz3miHp3rJiOWRVj-GI,8285
|
|
104
104
|
pymammotion/utility/periodic.py,sha256=9wJMfwXPlx6Mbp3Fws7LLTI34ZDKphH1bva_Ggyk32g,3281
|
|
105
105
|
pymammotion/utility/rocker_util.py,sha256=syPL0QN4zMzHiTIkUKS7RXBBptjdbkfNlPddwUD5V3A,7171
|
|
106
|
-
pymammotion-0.0.
|
|
107
|
-
pymammotion-0.0.
|
|
108
|
-
pymammotion-0.0.
|
|
109
|
-
pymammotion-0.0.
|
|
106
|
+
pymammotion-0.0.56.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
107
|
+
pymammotion-0.0.56.dist-info/METADATA,sha256=inWoWoU_uZ8bG46gGD7m7s2zVGXSc0NM_b2wNuL3lEE,3884
|
|
108
|
+
pymammotion-0.0.56.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
109
|
+
pymammotion-0.0.56.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|