pymammotion 0.5.11__tar.gz → 0.5.12__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.
Potentially problematic release.
This version of pymammotion might be problematic. Click here for more details.
- {pymammotion-0.5.11 → pymammotion-0.5.12}/PKG-INFO +1 -1
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/data/state_manager.py +2 -1
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/http/http.py +1 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/mammotion/commands/abstract_message.py +2 -1
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/mammotion/commands/mammotion_command.py +8 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/mammotion/commands/messages/navigation.py +1 -1
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/mammotion/commands/messages/ota.py +5 -2
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/mammotion/commands/messages/system.py +0 -8
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/mammotion/devices/mammotion.py +4 -2
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/mammotion/devices/mammotion_cloud.py +23 -1
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/mqtt/mammotion_mqtt.py +1 -1
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pyproject.toml +2 -2
- {pymammotion-0.5.11 → pymammotion-0.5.12}/LICENSE +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/README.md +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/__init__.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/aliyun/__init__.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/aliyun/client.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/aliyun/cloud_gateway.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/aliyun/model/aep_response.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/aliyun/model/connect_response.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/aliyun/model/dev_by_account_response.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/aliyun/model/login_by_oauth_response.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/aliyun/model/regions_response.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/aliyun/model/session_by_authcode_response.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/aliyun/regions.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/aliyun/tea/core.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/aliyun/tmp_constant.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/bluetooth/__init__.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/bluetooth/ble.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/bluetooth/ble_message.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/bluetooth/const.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/bluetooth/data/__init__.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/bluetooth/data/convert.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/bluetooth/data/framectrldata.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/bluetooth/data/notifydata.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/bluetooth/model/__init__.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/bluetooth/model/atomic_integer.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/const.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/data/__init__.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/data/model/__init__.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/data/model/account.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/data/model/device.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/data/model/device_config.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/data/model/device_info.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/data/model/device_limits.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/data/model/enums.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/data/model/errors.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/data/model/excute_boarder_params.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/data/model/execute_boarder.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/data/model/generate_route_information.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/data/model/hash_list.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/data/model/location.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/data/model/mowing_modes.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/data/model/rapid_state.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/data/model/raw_data.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/data/model/region_data.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/data/model/report_info.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/data/model/work.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/data/mqtt/__init__.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/data/mqtt/event.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/data/mqtt/properties.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/data/mqtt/status.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/event/__init__.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/event/event.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/http/__init__.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/http/_init_.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/http/encryption.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/http/model/__init__.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/http/model/camera_stream.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/http/model/http.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/http/model/response_factory.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/mammotion/__init__.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/mammotion/commands/__init__.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/mammotion/commands/messages/__init__.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/mammotion/commands/messages/driver.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/mammotion/commands/messages/media.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/mammotion/commands/messages/network.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/mammotion/commands/messages/video.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/mammotion/control/__init__.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/mammotion/control/joystick.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/mammotion/devices/__init__.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/mammotion/devices/base.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/mammotion/devices/mammotion_bluetooth.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/mqtt/__init__.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/mqtt/linkkit/__init__.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/mqtt/linkkit/h2client.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/mqtt/linkkit/linkkit.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/mqtt/mammotion_future.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/proto/__init__.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/proto/basestation.proto +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/proto/basestation_pb2.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/proto/basestation_pb2.pyi +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/proto/common.proto +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/proto/common_pb2.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/proto/common_pb2.pyi +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/proto/dev_net.proto +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/proto/dev_net_pb2.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/proto/dev_net_pb2.pyi +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/proto/luba_msg.proto +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/proto/luba_msg_pb2.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/proto/luba_msg_pb2.pyi +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/proto/luba_mul.proto +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/proto/luba_mul_pb2.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/proto/luba_mul_pb2.pyi +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/proto/mctrl_driver.proto +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/proto/mctrl_driver_pb2.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/proto/mctrl_driver_pb2.pyi +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/proto/mctrl_nav.proto +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/proto/mctrl_nav_pb2.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/proto/mctrl_nav_pb2.pyi +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/proto/mctrl_ota.proto +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/proto/mctrl_ota_pb2.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/proto/mctrl_ota_pb2.pyi +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/proto/mctrl_pept.proto +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/proto/mctrl_pept_pb2.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/proto/mctrl_pept_pb2.pyi +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/proto/mctrl_sys.proto +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/proto/mctrl_sys_pb2.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/proto/mctrl_sys_pb2.pyi +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/py.typed +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/utility/constant/__init__.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/utility/constant/device_constant.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/utility/conversions.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/utility/datatype_converter.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/utility/device_config.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/utility/device_type.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/utility/map.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/utility/movement.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/utility/mur_mur_hash.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/utility/periodic.py +0 -0
- {pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/utility/rocker_util.py +0 -0
|
@@ -87,6 +87,7 @@ class StateManager:
|
|
|
87
87
|
await self.on_status_callback(thing_status)
|
|
88
88
|
|
|
89
89
|
async def device_event(self, device_event: ThingEventMessage) -> None:
|
|
90
|
+
"""Sets MQTT event and calls callback."""
|
|
90
91
|
self._device.mqtt_device_event = device_event
|
|
91
92
|
await self.on_device_event_callback(device_event)
|
|
92
93
|
|
|
@@ -121,7 +122,7 @@ class StateManager:
|
|
|
121
122
|
await self.status_callback.data_event(thing_status)
|
|
122
123
|
|
|
123
124
|
async def on_device_event_callback(self, device_event: ThingEventMessage) -> None:
|
|
124
|
-
"""
|
|
125
|
+
"""Executes the status callback if it is set."""
|
|
125
126
|
if self.device_event_callback:
|
|
126
127
|
await self.device_event_callback.data_event(device_event)
|
|
127
128
|
|
|
@@ -29,6 +29,7 @@ class MammotionHTTP:
|
|
|
29
29
|
return await self.login(email, password)
|
|
30
30
|
|
|
31
31
|
async def get_all_error_codes(self) -> dict[str, ErrorInfo]:
|
|
32
|
+
"""Retrieves and parses all error codes from the MAMMOTION API."""
|
|
32
33
|
async with ClientSession(MAMMOTION_API_DOMAIN) as session:
|
|
33
34
|
async with session.post(
|
|
34
35
|
"/user-server/v1/code/record/export-data",
|
{pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/mammotion/commands/abstract_message.py
RENAMED
|
@@ -7,12 +7,13 @@ from pymammotion.utility.device_type import DeviceType
|
|
|
7
7
|
|
|
8
8
|
class AbstractMessage:
|
|
9
9
|
seqs = AtomicInteger(0)
|
|
10
|
-
user_account: int
|
|
10
|
+
user_account: int
|
|
11
11
|
|
|
12
12
|
@abstractmethod
|
|
13
13
|
def get_device_name(self) -> str:
|
|
14
14
|
"""Get device name."""
|
|
15
15
|
|
|
16
|
+
@abstractmethod
|
|
16
17
|
def get_device_product_key(self) -> str:
|
|
17
18
|
"""Get device name."""
|
|
18
19
|
|
{pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/mammotion/commands/mammotion_command.py
RENAMED
|
@@ -5,6 +5,7 @@ from pymammotion.mammotion.commands.messages.network import MessageNetwork
|
|
|
5
5
|
from pymammotion.mammotion.commands.messages.ota import MessageOta
|
|
6
6
|
from pymammotion.mammotion.commands.messages.system import MessageSystem
|
|
7
7
|
from pymammotion.mammotion.commands.messages.video import MessageVideo
|
|
8
|
+
from pymammotion.utility.device_type import DeviceType
|
|
8
9
|
from pymammotion.utility.movement import get_percent, transform_both_speeds
|
|
9
10
|
|
|
10
11
|
|
|
@@ -22,6 +23,13 @@ class MammotionCommand(
|
|
|
22
23
|
"""Get device name."""
|
|
23
24
|
return self._device_name
|
|
24
25
|
|
|
26
|
+
def read_write_device(self, rw_id: int, context: int, rw: int):
|
|
27
|
+
if (
|
|
28
|
+
rw_id == 6 or rw_id == 3 or rw_id == 7 or rw_id == 8 or rw_id == 10 or rw_id == 11
|
|
29
|
+
) and DeviceType.is_luba_pro(self.get_device_name()):
|
|
30
|
+
return self.allpowerfull_rw_adapter_x3(rw_id, context, rw)
|
|
31
|
+
return self.allpowerfull_rw(rw_id, context, rw)
|
|
32
|
+
|
|
25
33
|
def get_device_product_key(self) -> str:
|
|
26
34
|
return self._product_key
|
|
27
35
|
|
{pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/mammotion/commands/messages/navigation.py
RENAMED
|
@@ -50,7 +50,7 @@ class MessageNavigation(AbstractMessage, ABC):
|
|
|
50
50
|
|
|
51
51
|
def allpowerfull_rw_adapter_x3(self, rw_id: int, context: int, rw: int) -> bytes:
|
|
52
52
|
build = MctlNav(nav_sys_param_cmd=NavSysParamMsg(id=rw_id, context=context, rw=rw))
|
|
53
|
-
logger.debug(f"Send command--
|
|
53
|
+
logger.debug(f"Send command--x3 general read and write command id={rw_id}, context={context}, rw={rw}")
|
|
54
54
|
return self.send_order_msg_nav(build)
|
|
55
55
|
|
|
56
56
|
def along_border(self) -> bytes:
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
# === sendOrderMsg_Ota ===
|
|
2
2
|
from abc import ABC
|
|
3
|
+
import logging
|
|
3
4
|
|
|
4
5
|
from pymammotion.mammotion.commands.abstract_message import AbstractMessage
|
|
5
6
|
from pymammotion.proto import GetInfoReq, InfoType, LubaMsg, MctlOta, MsgAttr, MsgCmdType, MsgDevice
|
|
6
7
|
|
|
8
|
+
_LOGGER = logging.getLogger(__name__)
|
|
9
|
+
|
|
7
10
|
|
|
8
11
|
class MessageOta(AbstractMessage, ABC):
|
|
9
12
|
"""Message OTA class."""
|
|
@@ -25,11 +28,11 @@ class MessageOta(AbstractMessage, ABC):
|
|
|
25
28
|
def get_device_ota_info(self, log_type: int):
|
|
26
29
|
todev_get_info_req = MctlOta(todev_get_info_req=GetInfoReq(type=InfoType.IT_OTA))
|
|
27
30
|
|
|
28
|
-
|
|
31
|
+
_LOGGER.debug("===Send command to get upgrade details===logType:" + str(log_type))
|
|
29
32
|
return self.send_order_msg_ota(todev_get_info_req)
|
|
30
33
|
|
|
31
34
|
def get_device_info_new(self) -> bytes:
|
|
32
35
|
"""New device call for OTA upgrade information."""
|
|
33
36
|
todev_get_info_req = MctlOta(todev_get_info_req=GetInfoReq(type=InfoType.IT_BASE))
|
|
34
|
-
|
|
37
|
+
_LOGGER.debug("Send to get OTA upgrade information", "Get device information")
|
|
35
38
|
return self.send_order_msg_ota(todev_get_info_req)
|
|
@@ -5,7 +5,6 @@ import time
|
|
|
5
5
|
|
|
6
6
|
from pymammotion import logger
|
|
7
7
|
from pymammotion.mammotion.commands.abstract_message import AbstractMessage
|
|
8
|
-
from pymammotion.mammotion.commands.messages.navigation import MessageNavigation
|
|
9
8
|
from pymammotion.proto import (
|
|
10
9
|
DeviceProductTypeInfoT,
|
|
11
10
|
LoraCfgReq,
|
|
@@ -23,12 +22,9 @@ from pymammotion.proto import (
|
|
|
23
22
|
SysSetDateTime,
|
|
24
23
|
TimeCtrlLight,
|
|
25
24
|
)
|
|
26
|
-
from pymammotion.utility.device_type import DeviceType
|
|
27
25
|
|
|
28
26
|
|
|
29
27
|
class MessageSystem(AbstractMessage, ABC):
|
|
30
|
-
messageNavigation: MessageNavigation = MessageNavigation()
|
|
31
|
-
|
|
32
28
|
def send_order_msg_sys(self, sys) -> bytes:
|
|
33
29
|
luba_msg = LubaMsg(
|
|
34
30
|
msgtype=MsgCmdType.EMBED_SYS,
|
|
@@ -119,10 +115,6 @@ class MessageSystem(AbstractMessage, ABC):
|
|
|
119
115
|
return self.send_order_msg_sys(MctlSys(todev_lora_cfg_req=LoraCfgReq(op=op, cfg=cgf)))
|
|
120
116
|
|
|
121
117
|
def allpowerfull_rw(self, rw_id: int, context: int, rw: int) -> bytes:
|
|
122
|
-
if (
|
|
123
|
-
rw_id == 6 or rw_id == 3 or rw_id == 7 or rw_id == 8 or rw_id == 10 or rw_id == 11
|
|
124
|
-
) and DeviceType.is_luba_pro(self.get_device_name()):
|
|
125
|
-
return self.messageNavigation.allpowerfull_rw_adapter_x3(rw_id, context, rw)
|
|
126
118
|
build = MctlSys(bidire_comm_cmd=SysCommCmd(id=rw_id, context=context, rw=rw))
|
|
127
119
|
logger.debug(f"Send command - 9 general read and write command id={rw_id}, context={context}, rw={rw}")
|
|
128
120
|
return self.send_order_msg_sys(build)
|
|
@@ -140,8 +140,10 @@ class MammotionDeviceManager:
|
|
|
140
140
|
exists.replace_ble(mammotion_device.ble())
|
|
141
141
|
|
|
142
142
|
def get_device(self, mammotion_device_name: str) -> MammotionMixedDeviceManager:
|
|
143
|
-
|
|
144
|
-
|
|
143
|
+
if device := self.devices[mammotion_device_name]:
|
|
144
|
+
return device
|
|
145
|
+
else:
|
|
146
|
+
raise KeyError
|
|
145
147
|
|
|
146
148
|
async def remove_device(self, name: str) -> None:
|
|
147
149
|
"""Remove a device."""
|
|
@@ -52,6 +52,7 @@ class MammotionCloud:
|
|
|
52
52
|
self._mqtt_client.on_ready = self.on_ready
|
|
53
53
|
|
|
54
54
|
async def on_ready(self) -> None:
|
|
55
|
+
"""Starts processing the queue and emits the ready event."""
|
|
55
56
|
loop = asyncio.get_event_loop()
|
|
56
57
|
loop.create_task(self.process_queue())
|
|
57
58
|
await self.on_ready_event.data_event(None)
|
|
@@ -116,7 +117,16 @@ class MammotionCloud:
|
|
|
116
117
|
await self._parse_mqtt_response(topic, payload)
|
|
117
118
|
|
|
118
119
|
async def _parse_mqtt_response(self, topic: str, payload: dict) -> None:
|
|
119
|
-
"""Parse
|
|
120
|
+
"""Parse and handle MQTT responses based on the topic.
|
|
121
|
+
|
|
122
|
+
This function processes different types of MQTT messages received from various
|
|
123
|
+
topics. It logs debug information and calls appropriate callback methods for
|
|
124
|
+
each event type.
|
|
125
|
+
|
|
126
|
+
Args:
|
|
127
|
+
topic (str): The MQTT topic from which the message was received.
|
|
128
|
+
payload (dict): The payload data of the MQTT message.
|
|
129
|
+
"""
|
|
120
130
|
if topic.endswith("/app/down/thing/events"):
|
|
121
131
|
_LOGGER.debug("Thing event received")
|
|
122
132
|
event = ThingEventMessage.from_dicts(payload)
|
|
@@ -323,11 +333,23 @@ class MammotionBaseCloudDevice(MammotionBaseDevice):
|
|
|
323
333
|
await self.state_manager.status(status)
|
|
324
334
|
|
|
325
335
|
async def _parse_device_event_for_device(self, status: ThingStatusMessage) -> None:
|
|
336
|
+
"""Process device event if it matches the device's IoT ID."""
|
|
326
337
|
if status.params.iotId != self.iot_id:
|
|
327
338
|
return
|
|
328
339
|
await self.state_manager.device_event(status)
|
|
329
340
|
|
|
330
341
|
async def _parse_message_for_device(self, event: ThingEventMessage) -> None:
|
|
342
|
+
"""Parses a message received from a device and updates internal state.
|
|
343
|
+
|
|
344
|
+
This function processes an incoming `ThingEventMessage`, checks if the message
|
|
345
|
+
is intended for this device, decodes the binary data, and updates raw data. It
|
|
346
|
+
then attempts to parse the binary data into a `LubaMsg`. If parsing fails, it
|
|
347
|
+
logs the exception. The function also handles setting the device product key if
|
|
348
|
+
not already set and processes specific sub-messages based on their types.
|
|
349
|
+
|
|
350
|
+
Args:
|
|
351
|
+
event (ThingEventMessage): The event message received from the device.
|
|
352
|
+
"""
|
|
331
353
|
params = event.params
|
|
332
354
|
new_msg = LubaMsg()
|
|
333
355
|
if event.params.iotId != self.iot_id:
|
|
@@ -180,7 +180,7 @@ class MammotionMQTT:
|
|
|
180
180
|
asyncio.wrap_future(future, loop=self.loop)
|
|
181
181
|
|
|
182
182
|
def _thing_on_connect(self, session_flag, rc, user_data) -> None:
|
|
183
|
-
"""
|
|
183
|
+
"""Handle connection event and execute callback if set."""
|
|
184
184
|
self.is_connected = True
|
|
185
185
|
if self.on_connected is not None:
|
|
186
186
|
future = asyncio.run_coroutine_threadsafe(self.on_connected(), self.loop)
|
|
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "pymammotion"
|
|
7
|
-
version = "0.5.
|
|
7
|
+
version = "0.5.12"
|
|
8
8
|
license = "GPL-3.0"
|
|
9
9
|
description = ""
|
|
10
10
|
readme = "README.md"
|
|
@@ -66,7 +66,7 @@ autotyping = "^24.3.0"
|
|
|
66
66
|
ipython = "^9.0.2"
|
|
67
67
|
|
|
68
68
|
[tool.bumpver]
|
|
69
|
-
current_version = "0.5.
|
|
69
|
+
current_version = "0.5.12"
|
|
70
70
|
version_pattern = "MAJOR.MINOR.PATCH"
|
|
71
71
|
commit_message = "Bump version {old_version} -> {new_version}"
|
|
72
72
|
commit = true
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/aliyun/model/dev_by_account_response.py
RENAMED
|
File without changes
|
{pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/aliyun/model/login_by_oauth_response.py
RENAMED
|
File without changes
|
|
File without changes
|
{pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/aliyun/model/session_by_authcode_response.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/data/model/generate_route_information.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/mammotion/commands/messages/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/mammotion/commands/messages/network.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pymammotion-0.5.11 → pymammotion-0.5.12}/pymammotion/mammotion/devices/mammotion_bluetooth.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|