pymammotion 0.0.37__tar.gz → 0.0.38__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.0.37 → pymammotion-0.0.38}/PKG-INFO +6 -6
- {pymammotion-0.0.37 → pymammotion-0.0.38}/README.md +5 -5
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/__init__.py +4 -4
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/aliyun/cloud_gateway.py +10 -8
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/bluetooth/ble.py +2 -2
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/bluetooth/ble_message.py +9 -9
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/bluetooth/data/convert.py +3 -2
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/data/model/__init__.py +0 -1
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/data/model/device.py +8 -8
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/data/model/enums.py +67 -67
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/data/mqtt/event.py +1 -1
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/http/http.py +5 -1
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/luba/base.py +2 -2
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/mammotion/commands/abstract_message.py +7 -7
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/mammotion/commands/mammotion_command.py +6 -6
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/mammotion/commands/messages/driver.py +108 -108
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/mammotion/commands/messages/media.py +36 -36
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/mammotion/commands/messages/navigation.py +535 -535
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/mammotion/commands/messages/network.py +236 -236
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/mammotion/commands/messages/ota.py +34 -34
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/mammotion/commands/messages/system.py +266 -266
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/mammotion/commands/messages/video.py +27 -27
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/mammotion/control/joystick.py +3 -3
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/mammotion/devices/luba.py +4 -6
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/mqtt/mqtt.py +7 -7
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/proto/common.py +1 -1
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/proto/common_pb2.py +3 -3
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/proto/dev_net.py +1 -1
- pymammotion-0.0.38/pymammotion/proto/dev_net_pb2.py +107 -0
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/proto/luba_msg.proto +7 -7
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/proto/luba_msg.py +1 -1
- pymammotion-0.0.38/pymammotion/proto/luba_msg_pb2.py +40 -0
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/proto/luba_msg_pb2.pyi +7 -7
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/proto/luba_mul.py +1 -1
- pymammotion-0.0.38/pymammotion/proto/luba_mul_pb2.py +45 -0
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/proto/mctrl_driver.py +1 -1
- pymammotion-0.0.38/pymammotion/proto/mctrl_driver_pb2.py +45 -0
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/proto/mctrl_nav.proto +1 -1
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/proto/mctrl_nav.py +1 -1
- pymammotion-0.0.38/pymammotion/proto/mctrl_nav_pb2.py +116 -0
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/proto/mctrl_nav_pb2.pyi +1 -1
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/proto/mctrl_ota.py +1 -1
- pymammotion-0.0.38/pymammotion/proto/mctrl_ota_pb2.py +35 -0
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/proto/mctrl_pept.py +1 -1
- pymammotion-0.0.38/pymammotion/proto/mctrl_pept_pb2.py +31 -0
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/proto/mctrl_sys.proto +1 -1
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/proto/mctrl_sys.py +1 -1
- pymammotion-0.0.38/pymammotion/proto/mctrl_sys_pb2.py +142 -0
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/proto/mctrl_sys_pb2.pyi +1 -1
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/utility/device_type.py +152 -152
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pyproject.toml +1 -1
- pymammotion-0.0.37/pymammotion/proto/dev_net_pb2.py +0 -107
- pymammotion-0.0.37/pymammotion/proto/luba_msg_pb2.py +0 -40
- pymammotion-0.0.37/pymammotion/proto/luba_mul_pb2.py +0 -45
- pymammotion-0.0.37/pymammotion/proto/mctrl_driver_pb2.py +0 -45
- pymammotion-0.0.37/pymammotion/proto/mctrl_nav_pb2.py +0 -116
- pymammotion-0.0.37/pymammotion/proto/mctrl_ota_pb2.py +0 -35
- pymammotion-0.0.37/pymammotion/proto/mctrl_pept_pb2.py +0 -31
- pymammotion-0.0.37/pymammotion/proto/mctrl_sys_pb2.py +0 -142
- {pymammotion-0.0.37 → pymammotion-0.0.38}/LICENSE +0 -0
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/aliyun/cloud_service.py +0 -0
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/aliyun/dataclass/aep_response.py +0 -0
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/aliyun/dataclass/connect_response.py +0 -0
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/aliyun/dataclass/dev_by_account_response.py +0 -0
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/aliyun/dataclass/login_by_oauth_response.py +0 -0
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/aliyun/dataclass/regions_response.py +0 -0
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/aliyun/dataclass/session_by_authcode_response.py +0 -0
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/aliyun/tmp_constant.py +0 -0
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/bluetooth/__init__.py +0 -0
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/bluetooth/const.py +0 -0
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/bluetooth/data/__init__.py +0 -0
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/bluetooth/data/framectrldata.py +0 -0
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/bluetooth/data/notifydata.py +0 -0
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/const.py +0 -0
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/data/__init__.py +0 -0
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/data/model/excute_boarder_params.py +0 -0
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/data/model/execute_boarder.py +0 -0
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/data/model/generate_route_information.py +0 -0
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/data/model/hash_list.py +0 -0
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/data/model/mowing_modes.py +0 -0
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/data/model/plan.py +0 -0
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/data/model/rapid_state.py +0 -0
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/data/model/region_data.py +0 -0
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/data/mqtt/__init__.py +0 -0
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/data/mqtt/properties.py +0 -0
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/data/mqtt/status.py +0 -0
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/event/__init__.py +0 -0
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/event/event.py +0 -0
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/http/_init_.py +0 -0
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/luba/_init_.py +0 -0
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/mammotion/__init__.py +0 -0
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/mammotion/commands/__init__.py +0 -0
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/mammotion/commands/messages/__init__.py +0 -0
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/mammotion/control/__init__.py +0 -0
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/mammotion/devices/__init__.py +0 -0
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/proto/__init__.py +0 -0
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/proto/common.proto +0 -0
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/proto/common_pb2.pyi +0 -0
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/proto/dev_net.proto +0 -0
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/proto/dev_net_pb2.pyi +0 -0
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/proto/luba_mul.proto +0 -0
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/proto/luba_mul_pb2.pyi +0 -0
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/proto/mctrl_driver.proto +0 -0
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/proto/mctrl_driver_pb2.pyi +0 -0
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/proto/mctrl_ota.proto +0 -0
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/proto/mctrl_ota_pb2.pyi +0 -0
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/proto/mctrl_pept.proto +0 -0
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/proto/mctrl_pept_pb2.pyi +0 -0
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/py.typed +0 -0
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/utility/constant/__init__.py +0 -0
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/utility/constant/device_constant.py +0 -0
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/utility/datatype_converter.py +0 -0
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/utility/periodic.py +0 -0
- {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/utility/rocker_util.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: pymammotion
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.38
|
|
4
4
|
Summary:
|
|
5
5
|
License: GNU-3.0
|
|
6
6
|
Author: Michael Arthur
|
|
@@ -36,13 +36,13 @@ Description-Content-Type: text/markdown
|
|
|
36
36
|
[![Supported Python Versions][img_pyversions]][url_pyversions]
|
|
37
37
|
|
|
38
38
|
[img_version]: https://img.shields.io/static/v1.svg?label=SemVer&message=0.0.1&color=blue
|
|
39
|
-
[url_version]: https://pypi.org/project/
|
|
39
|
+
[url_version]: https://pypi.org/project/pymammotion/
|
|
40
40
|
|
|
41
41
|
[img_pypi]: https://img.shields.io/badge/PyPI-wheels-green.svg
|
|
42
|
-
[url_pypi]: https://pypi.org/project/
|
|
42
|
+
[url_pypi]: https://pypi.org/project/pymammotion/#files
|
|
43
43
|
|
|
44
|
-
[img_pyversions]: https://img.shields.io/pypi/pyversions/
|
|
45
|
-
[url_pyversions]: https://pypi.python.org/pypi/
|
|
44
|
+
[img_pyversions]: https://img.shields.io/pypi/pyversions/pymammotion.svg
|
|
45
|
+
[url_pyversions]: https://pypi.python.org/pypi/pymammotion
|
|
46
46
|
|
|
47
47
|
💬 [Join us on Discord](https://discord.gg/vpZdWhJX8x)
|
|
48
48
|
|
|
@@ -59,7 +59,7 @@ This library is the foundation for the [Mammotion Home Assistant integration](ht
|
|
|
59
59
|
You can install PyMammotion using pip:
|
|
60
60
|
|
|
61
61
|
```bash
|
|
62
|
-
pip install
|
|
62
|
+
pip install pymammotion
|
|
63
63
|
```
|
|
64
64
|
|
|
65
65
|
## Development 🔧
|
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
[![Supported Python Versions][img_pyversions]][url_pyversions]
|
|
6
6
|
|
|
7
7
|
[img_version]: https://img.shields.io/static/v1.svg?label=SemVer&message=0.0.1&color=blue
|
|
8
|
-
[url_version]: https://pypi.org/project/
|
|
8
|
+
[url_version]: https://pypi.org/project/pymammotion/
|
|
9
9
|
|
|
10
10
|
[img_pypi]: https://img.shields.io/badge/PyPI-wheels-green.svg
|
|
11
|
-
[url_pypi]: https://pypi.org/project/
|
|
11
|
+
[url_pypi]: https://pypi.org/project/pymammotion/#files
|
|
12
12
|
|
|
13
|
-
[img_pyversions]: https://img.shields.io/pypi/pyversions/
|
|
14
|
-
[url_pyversions]: https://pypi.python.org/pypi/
|
|
13
|
+
[img_pyversions]: https://img.shields.io/pypi/pyversions/pymammotion.svg
|
|
14
|
+
[url_pyversions]: https://pypi.python.org/pypi/pymammotion
|
|
15
15
|
|
|
16
16
|
💬 [Join us on Discord](https://discord.gg/vpZdWhJX8x)
|
|
17
17
|
|
|
@@ -28,7 +28,7 @@ This library is the foundation for the [Mammotion Home Assistant integration](ht
|
|
|
28
28
|
You can install PyMammotion using pip:
|
|
29
29
|
|
|
30
30
|
```bash
|
|
31
|
-
pip install
|
|
31
|
+
pip install pymammotion
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
## Development 🔧
|
|
@@ -9,12 +9,12 @@ import logging
|
|
|
9
9
|
import os
|
|
10
10
|
|
|
11
11
|
# works outside HA on its own
|
|
12
|
-
from
|
|
13
|
-
from
|
|
12
|
+
from pymammotion.bluetooth.ble import LubaBLE
|
|
13
|
+
from pymammotion.http.http import LubaHTTP, connect_http
|
|
14
14
|
|
|
15
15
|
# TODO make a working device that will work outside HA too.
|
|
16
|
-
from
|
|
17
|
-
from
|
|
16
|
+
from pymammotion.mammotion.devices import MammotionBaseBLEDevice
|
|
17
|
+
from pymammotion.mqtt.mqtt import LubaMQTT, logger
|
|
18
18
|
|
|
19
19
|
# TODO provide interface to pick between mqtt/cloud/bluetooth
|
|
20
20
|
|
|
@@ -15,16 +15,18 @@ from alibabacloud_iot_api_gateway.models import CommonParams, Config, IoTApiRequ
|
|
|
15
15
|
from alibabacloud_tea_util.client import Client as UtilClient
|
|
16
16
|
from alibabacloud_tea_util.models import RuntimeOptions
|
|
17
17
|
|
|
18
|
-
from
|
|
19
|
-
from
|
|
20
|
-
from
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
from
|
|
18
|
+
from pymammotion.aliyun.dataclass.aep_response import AepResponse
|
|
19
|
+
from pymammotion.aliyun.dataclass.connect_response import ConnectResponse
|
|
20
|
+
from pymammotion.aliyun.dataclass.dev_by_account_response import (
|
|
21
|
+
ListingDevByAccountResponse,
|
|
22
|
+
)
|
|
23
|
+
from pymammotion.aliyun.dataclass.login_by_oauth_response import LoginByOAuthResponse
|
|
24
|
+
from pymammotion.aliyun.dataclass.regions_response import RegionResponse
|
|
25
|
+
from pymammotion.aliyun.dataclass.session_by_authcode_response import (
|
|
24
26
|
SessionByAuthCodeResponse,
|
|
25
27
|
)
|
|
26
|
-
from
|
|
27
|
-
from
|
|
28
|
+
from pymammotion.const import ALIYUN_DOMAIN, APP_KEY, APP_SECRET, APP_VERSION
|
|
29
|
+
from pymammotion.utility.datatype_converter import DatatypeConverter
|
|
28
30
|
|
|
29
31
|
logger = getLogger(__name__)
|
|
30
32
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
from bleak import BleakClient, BleakScanner, BLEDevice
|
|
2
2
|
from bleak.backends.characteristic import BleakGATTCharacteristic
|
|
3
3
|
|
|
4
|
-
from
|
|
4
|
+
from pymammotion.bluetooth.const import (
|
|
5
5
|
SERVICE_CHANGED_CHARACTERISTIC,
|
|
6
6
|
UUID_NOTIFICATION_CHARACTERISTIC,
|
|
7
7
|
)
|
|
8
|
-
from
|
|
8
|
+
from pymammotion.event.event import BleNotificationEvent
|
|
9
9
|
|
|
10
10
|
# TODO setup for each Luba
|
|
11
11
|
address = "90:38:0C:6E:EE:9E"
|
|
@@ -10,18 +10,18 @@ from io import BytesIO
|
|
|
10
10
|
from bleak import BleakClient
|
|
11
11
|
from jsonic.serializable import serialize
|
|
12
12
|
|
|
13
|
-
from
|
|
14
|
-
from
|
|
15
|
-
from
|
|
16
|
-
from
|
|
17
|
-
from
|
|
18
|
-
from
|
|
19
|
-
from
|
|
20
|
-
from
|
|
13
|
+
from pymammotion.aliyun.tmp_constant import tmp_constant
|
|
14
|
+
from pymammotion.bluetooth.const import UUID_WRITE_CHARACTERISTIC
|
|
15
|
+
from pymammotion.bluetooth.data.convert import parse_custom_data
|
|
16
|
+
from pymammotion.bluetooth.data.framectrldata import FrameCtrlData
|
|
17
|
+
from pymammotion.bluetooth.data.notifydata import BlufiNotifyData
|
|
18
|
+
from pymammotion.data.model.execute_boarder import ExecuteBorder
|
|
19
|
+
from pymammotion.mammotion.commands.messages.navigation import MessageNavigation
|
|
20
|
+
from pymammotion.proto import (
|
|
21
21
|
dev_net_pb2,
|
|
22
22
|
luba_msg_pb2,
|
|
23
23
|
)
|
|
24
|
-
from
|
|
24
|
+
from pymammotion.utility.constant.device_constant import bleOrderCmd
|
|
25
25
|
|
|
26
26
|
_LOGGER = logging.getLogger(__name__)
|
|
27
27
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from google.protobuf.message import DecodeError
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
from pymammotion.proto import luba_msg_pb2
|
|
3
4
|
|
|
4
5
|
|
|
5
6
|
def parse_custom_data(data: bytes):
|
|
@@ -23,4 +24,4 @@ def store_sys_data(sys):
|
|
|
23
24
|
)
|
|
24
25
|
chargeStateTemp = longValue9
|
|
25
26
|
longValue10 = tard_state_data_list[6]
|
|
26
|
-
longValue11 = tard_state_data_list[7]
|
|
27
|
+
longValue11 = tard_state_data_list[7]
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
from dataclasses import dataclass
|
|
4
4
|
|
|
5
|
-
from
|
|
6
|
-
from
|
|
7
|
-
from
|
|
8
|
-
from
|
|
9
|
-
from
|
|
10
|
-
from
|
|
11
|
-
from
|
|
12
|
-
from
|
|
5
|
+
from pymammotion.proto.dev_net import DevNet
|
|
6
|
+
from pymammotion.proto.luba_msg import LubaMsg
|
|
7
|
+
from pymammotion.proto.luba_mul import SocMul
|
|
8
|
+
from pymammotion.proto.mctrl_driver import MctlDriver
|
|
9
|
+
from pymammotion.proto.mctrl_nav import MctlNav
|
|
10
|
+
from pymammotion.proto.mctrl_ota import MctlOta
|
|
11
|
+
from pymammotion.proto.mctrl_pept import MctlPept
|
|
12
|
+
from pymammotion.proto.mctrl_sys import MctlSys
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
@dataclass
|
|
@@ -1,67 +1,67 @@
|
|
|
1
|
-
from enum import Enum
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class PositionMode(Enum):
|
|
5
|
-
FIX = 0
|
|
6
|
-
SINGLE = 1
|
|
7
|
-
FLOAT = 2
|
|
8
|
-
NONE = 3
|
|
9
|
-
UNKNOWN = 4
|
|
10
|
-
|
|
11
|
-
@staticmethod
|
|
12
|
-
def from_value(value):
|
|
13
|
-
if value == 0:
|
|
14
|
-
return PositionMode.FIX
|
|
15
|
-
elif value == 1:
|
|
16
|
-
return PositionMode.SINGLE
|
|
17
|
-
elif value == 2:
|
|
18
|
-
return PositionMode.FLOAT
|
|
19
|
-
elif value == 3:
|
|
20
|
-
return PositionMode.NONE
|
|
21
|
-
else:
|
|
22
|
-
return PositionMode.UNKNOWN
|
|
23
|
-
|
|
24
|
-
def __str__(self):
|
|
25
|
-
if self == PositionMode.FIX:
|
|
26
|
-
return "Fix"
|
|
27
|
-
elif self == PositionMode.SINGLE:
|
|
28
|
-
return "Single"
|
|
29
|
-
elif self == PositionMode.FLOAT:
|
|
30
|
-
return "Float"
|
|
31
|
-
elif self == PositionMode.NONE:
|
|
32
|
-
return "None"
|
|
33
|
-
else:
|
|
34
|
-
return "-"
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
class RTKStatus(Enum):
|
|
38
|
-
NONE = 0
|
|
39
|
-
SINGLE = 1
|
|
40
|
-
FIX = 4
|
|
41
|
-
FLOAT = 5
|
|
42
|
-
UNKNOWN = 6
|
|
43
|
-
|
|
44
|
-
@staticmethod
|
|
45
|
-
def from_value(value):
|
|
46
|
-
if value == 0:
|
|
47
|
-
return RTKStatus.NONE
|
|
48
|
-
elif value == 1 or value == 2:
|
|
49
|
-
return RTKStatus.SINGLE
|
|
50
|
-
elif value == 4:
|
|
51
|
-
return RTKStatus.FIX
|
|
52
|
-
elif value == 5:
|
|
53
|
-
return RTKStatus.FLOAT
|
|
54
|
-
else:
|
|
55
|
-
return RTKStatus.UNKNOWN
|
|
56
|
-
|
|
57
|
-
def __str__(self):
|
|
58
|
-
if self == RTKStatus.NONE:
|
|
59
|
-
return "None"
|
|
60
|
-
elif self == RTKStatus.SINGLE:
|
|
61
|
-
return "Single"
|
|
62
|
-
elif self == RTKStatus.FIX:
|
|
63
|
-
return "Fix"
|
|
64
|
-
elif self == RTKStatus.FLOAT:
|
|
65
|
-
return "Float"
|
|
66
|
-
else:
|
|
67
|
-
return "Unknown"
|
|
1
|
+
from enum import Enum
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class PositionMode(Enum):
|
|
5
|
+
FIX = 0
|
|
6
|
+
SINGLE = 1
|
|
7
|
+
FLOAT = 2
|
|
8
|
+
NONE = 3
|
|
9
|
+
UNKNOWN = 4
|
|
10
|
+
|
|
11
|
+
@staticmethod
|
|
12
|
+
def from_value(value):
|
|
13
|
+
if value == 0:
|
|
14
|
+
return PositionMode.FIX
|
|
15
|
+
elif value == 1:
|
|
16
|
+
return PositionMode.SINGLE
|
|
17
|
+
elif value == 2:
|
|
18
|
+
return PositionMode.FLOAT
|
|
19
|
+
elif value == 3:
|
|
20
|
+
return PositionMode.NONE
|
|
21
|
+
else:
|
|
22
|
+
return PositionMode.UNKNOWN
|
|
23
|
+
|
|
24
|
+
def __str__(self):
|
|
25
|
+
if self == PositionMode.FIX:
|
|
26
|
+
return "Fix"
|
|
27
|
+
elif self == PositionMode.SINGLE:
|
|
28
|
+
return "Single"
|
|
29
|
+
elif self == PositionMode.FLOAT:
|
|
30
|
+
return "Float"
|
|
31
|
+
elif self == PositionMode.NONE:
|
|
32
|
+
return "None"
|
|
33
|
+
else:
|
|
34
|
+
return "-"
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class RTKStatus(Enum):
|
|
38
|
+
NONE = 0
|
|
39
|
+
SINGLE = 1
|
|
40
|
+
FIX = 4
|
|
41
|
+
FLOAT = 5
|
|
42
|
+
UNKNOWN = 6
|
|
43
|
+
|
|
44
|
+
@staticmethod
|
|
45
|
+
def from_value(value):
|
|
46
|
+
if value == 0:
|
|
47
|
+
return RTKStatus.NONE
|
|
48
|
+
elif value == 1 or value == 2:
|
|
49
|
+
return RTKStatus.SINGLE
|
|
50
|
+
elif value == 4:
|
|
51
|
+
return RTKStatus.FIX
|
|
52
|
+
elif value == 5:
|
|
53
|
+
return RTKStatus.FLOAT
|
|
54
|
+
else:
|
|
55
|
+
return RTKStatus.UNKNOWN
|
|
56
|
+
|
|
57
|
+
def __str__(self):
|
|
58
|
+
if self == RTKStatus.NONE:
|
|
59
|
+
return "None"
|
|
60
|
+
elif self == RTKStatus.SINGLE:
|
|
61
|
+
return "Single"
|
|
62
|
+
elif self == RTKStatus.FIX:
|
|
63
|
+
return "Fix"
|
|
64
|
+
elif self == RTKStatus.FLOAT:
|
|
65
|
+
return "Float"
|
|
66
|
+
else:
|
|
67
|
+
return "Unknown"
|
|
@@ -6,7 +6,7 @@ from google.protobuf import json_format
|
|
|
6
6
|
from mashumaro.mixins.orjson import DataClassORJSONMixin
|
|
7
7
|
from mashumaro.types import SerializableType
|
|
8
8
|
|
|
9
|
-
from
|
|
9
|
+
from pymammotion.proto import luba_msg_pb2
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
class Base64EncodedProtobuf(SerializableType):
|
|
@@ -5,7 +5,11 @@ from aiohttp import ClientSession
|
|
|
5
5
|
from mashumaro import DataClassDictMixin
|
|
6
6
|
from mashumaro.mixins.orjson import DataClassORJSONMixin
|
|
7
7
|
|
|
8
|
-
from
|
|
8
|
+
from pymammotion.const import (
|
|
9
|
+
MAMMOTION_CLIENT_ID,
|
|
10
|
+
MAMMOTION_CLIENT_SECRET,
|
|
11
|
+
MAMMOTION_DOMAIN,
|
|
12
|
+
)
|
|
9
13
|
|
|
10
14
|
DataT = TypeVar("DataT")
|
|
11
15
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from typing import Callable, Optional
|
|
2
2
|
|
|
3
|
-
from
|
|
4
|
-
from
|
|
3
|
+
from pymammotion.data.model.rapid_state import RapidState, RTKStatus
|
|
4
|
+
from pymammotion.data.mqtt.status import StatusType
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
class BaseLuba:
|
{pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/mammotion/commands/abstract_message.py
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
from abc import abstractmethod
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class AbstractMessage:
|
|
5
|
-
@abstractmethod
|
|
6
|
-
def get_device_name(self) -> str:
|
|
7
|
-
"""Get device name."""
|
|
1
|
+
from abc import abstractmethod
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class AbstractMessage:
|
|
5
|
+
@abstractmethod
|
|
6
|
+
def get_device_name(self) -> str:
|
|
7
|
+
"""Get device name."""
|
{pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/mammotion/commands/mammotion_command.py
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
from
|
|
2
|
-
from
|
|
3
|
-
from
|
|
4
|
-
from
|
|
5
|
-
from
|
|
6
|
-
from
|
|
1
|
+
from pymammotion.mammotion.commands.messages.navigation import MessageNavigation
|
|
2
|
+
from pymammotion.mammotion.commands.messages.network import MessageNetwork
|
|
3
|
+
from pymammotion.mammotion.commands.messages.ota import MessageOta
|
|
4
|
+
from pymammotion.mammotion.commands.messages.system import MessageSystem
|
|
5
|
+
from pymammotion.mammotion.commands.messages.video import MessageVideo
|
|
6
|
+
from pymammotion.proto import dev_net_pb2, luba_msg_pb2
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
class MammotionCommand(
|
|
@@ -1,108 +1,108 @@
|
|
|
1
|
-
# === sendOrderMsg_Driver ===
|
|
2
|
-
import time
|
|
3
|
-
from abc import ABC
|
|
4
|
-
from logging import getLogger
|
|
5
|
-
|
|
6
|
-
from
|
|
7
|
-
from
|
|
8
|
-
|
|
9
|
-
logger = getLogger(__name__)
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
class MessageDriver(AbstractMessage, ABC):
|
|
13
|
-
@staticmethod
|
|
14
|
-
def send_order_msg_driver(driver):
|
|
15
|
-
luba_msg = luba_msg_pb2.LubaMsg(
|
|
16
|
-
msgtype=luba_msg_pb2.MSG_CMD_TYPE_EMBED_DRIVER,
|
|
17
|
-
sender=luba_msg_pb2.DEV_MOBILEAPP,
|
|
18
|
-
rcver=luba_msg_pb2.DEV_MAINCTL,
|
|
19
|
-
msgattr=luba_msg_pb2.MSG_ATTR_REQ,
|
|
20
|
-
timestamp=round(time.time() * 1000),
|
|
21
|
-
seqs=1,
|
|
22
|
-
version=1,
|
|
23
|
-
subtype=1,
|
|
24
|
-
driver=driver,
|
|
25
|
-
)
|
|
26
|
-
|
|
27
|
-
return luba_msg.SerializeToString()
|
|
28
|
-
|
|
29
|
-
def set_blade_height(self, height: int):
|
|
30
|
-
logger.debug(f"Send knife height height={height}")
|
|
31
|
-
build = mctrl_driver_pb2.MctlDriver(
|
|
32
|
-
todev_knife_height_set=mctrl_driver_pb2.DrvKnifeHeight(knifeHeight=height)
|
|
33
|
-
)
|
|
34
|
-
logger.debug(f"Send command--Knife motor height setting height={height}")
|
|
35
|
-
return self.send_order_msg_driver(build)
|
|
36
|
-
|
|
37
|
-
def set_speed(self, speed: float):
|
|
38
|
-
logger.debug(f"{self.get_device_name()} set speed, {speed}")
|
|
39
|
-
build = mctrl_driver_pb2.MctlDriver(
|
|
40
|
-
bidire_speed_read_set=mctrl_driver_pb2.DrvSrSpeed(speed=speed, rw=1)
|
|
41
|
-
)
|
|
42
|
-
logger.debug(f"Send command--Speed setting speed={speed}")
|
|
43
|
-
return self.send_order_msg_driver(build)
|
|
44
|
-
|
|
45
|
-
def syn_nav_star_point_data(self, sat_system: int):
|
|
46
|
-
build = mctrl_driver_pb2.MctlDriver(
|
|
47
|
-
rtk_sys_mask_query=mctrl_driver_pb2.rtk_sys_mask_query_t(
|
|
48
|
-
sat_system=sat_system
|
|
49
|
-
)
|
|
50
|
-
)
|
|
51
|
-
logger.debug(
|
|
52
|
-
f"Send command--Navigation satellite frequency point synchronization={sat_system}"
|
|
53
|
-
)
|
|
54
|
-
return self.send_order_msg_driver(build)
|
|
55
|
-
|
|
56
|
-
def set_nav_star_point(self, cmd_req: str):
|
|
57
|
-
build = mctrl_driver_pb2.MctlDriver(
|
|
58
|
-
rtk_cfg_req=mctrl_driver_pb2.rtk_cfg_req_t(
|
|
59
|
-
cmd_req=cmd_req, cmd_length=len(cmd_req) - 1
|
|
60
|
-
)
|
|
61
|
-
)
|
|
62
|
-
logger.debug(
|
|
63
|
-
f"Send command--Navigation satellite frequency point setting={cmd_req}"
|
|
64
|
-
)
|
|
65
|
-
logger.debug(
|
|
66
|
-
f"Navigation satellite setting, Send command--Navigation satellite frequency point setting={cmd_req}"
|
|
67
|
-
)
|
|
68
|
-
return self.send_order_msg_driver(build)
|
|
69
|
-
|
|
70
|
-
def get_speed(self):
|
|
71
|
-
build = mctrl_driver_pb2.MctlDriver(
|
|
72
|
-
bidire_speed_read_set=mctrl_driver_pb2.DrvSrSpeed(rw=0)
|
|
73
|
-
)
|
|
74
|
-
logger.debug("Send command--Get speed value")
|
|
75
|
-
return self.send_order_msg_driver(build)
|
|
76
|
-
|
|
77
|
-
def operate_on_device(
|
|
78
|
-
self,
|
|
79
|
-
main_ctrl: int,
|
|
80
|
-
cut_knife_ctrl: int,
|
|
81
|
-
cut_knife_height: int,
|
|
82
|
-
max_run_speed: float,
|
|
83
|
-
):
|
|
84
|
-
build = mctrl_driver_pb2.MctlDriver(
|
|
85
|
-
mow_ctrl_by_hand=mctrl_driver_pb2.DrvMowCtrlByHand(
|
|
86
|
-
main_ctrl=main_ctrl,
|
|
87
|
-
cut_knife_ctrl=cut_knife_ctrl,
|
|
88
|
-
cut_knife_height=cut_knife_height,
|
|
89
|
-
max_run_Speed=max_run_speed,
|
|
90
|
-
)
|
|
91
|
-
)
|
|
92
|
-
logger.debug(
|
|
93
|
-
f"Send command--Manual mowing command, main_ctrl:{main_ctrl}, cut_knife_ctrl:{cut_knife_ctrl}, "
|
|
94
|
-
f"cut_knife_height:{cut_knife_height}, max_run_speed:{max_run_speed}"
|
|
95
|
-
)
|
|
96
|
-
|
|
97
|
-
return self.send_order_msg_driver(build)
|
|
98
|
-
|
|
99
|
-
def send_movement(self, linear_speed: int, angular_speed: int):
|
|
100
|
-
logger.debug(f"Control command print, linearSpeed={
|
|
101
|
-
linear_speed} // angularSpeed={angular_speed}")
|
|
102
|
-
return self.send_order_msg_driver(
|
|
103
|
-
mctrl_driver_pb2.MctlDriver(
|
|
104
|
-
todev_devmotion_ctrl=mctrl_driver_pb2.DrvMotionCtrl(
|
|
105
|
-
setLinearSpeed=linear_speed, setAngularSpeed=angular_speed
|
|
106
|
-
)
|
|
107
|
-
)
|
|
108
|
-
)
|
|
1
|
+
# === sendOrderMsg_Driver ===
|
|
2
|
+
import time
|
|
3
|
+
from abc import ABC
|
|
4
|
+
from logging import getLogger
|
|
5
|
+
|
|
6
|
+
from pymammotion.mammotion.commands.abstract_message import AbstractMessage
|
|
7
|
+
from pymammotion.proto import luba_msg_pb2, mctrl_driver_pb2
|
|
8
|
+
|
|
9
|
+
logger = getLogger(__name__)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class MessageDriver(AbstractMessage, ABC):
|
|
13
|
+
@staticmethod
|
|
14
|
+
def send_order_msg_driver(driver):
|
|
15
|
+
luba_msg = luba_msg_pb2.LubaMsg(
|
|
16
|
+
msgtype=luba_msg_pb2.MSG_CMD_TYPE_EMBED_DRIVER,
|
|
17
|
+
sender=luba_msg_pb2.DEV_MOBILEAPP,
|
|
18
|
+
rcver=luba_msg_pb2.DEV_MAINCTL,
|
|
19
|
+
msgattr=luba_msg_pb2.MSG_ATTR_REQ,
|
|
20
|
+
timestamp=round(time.time() * 1000),
|
|
21
|
+
seqs=1,
|
|
22
|
+
version=1,
|
|
23
|
+
subtype=1,
|
|
24
|
+
driver=driver,
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
return luba_msg.SerializeToString()
|
|
28
|
+
|
|
29
|
+
def set_blade_height(self, height: int):
|
|
30
|
+
logger.debug(f"Send knife height height={height}")
|
|
31
|
+
build = mctrl_driver_pb2.MctlDriver(
|
|
32
|
+
todev_knife_height_set=mctrl_driver_pb2.DrvKnifeHeight(knifeHeight=height)
|
|
33
|
+
)
|
|
34
|
+
logger.debug(f"Send command--Knife motor height setting height={height}")
|
|
35
|
+
return self.send_order_msg_driver(build)
|
|
36
|
+
|
|
37
|
+
def set_speed(self, speed: float):
|
|
38
|
+
logger.debug(f"{self.get_device_name()} set speed, {speed}")
|
|
39
|
+
build = mctrl_driver_pb2.MctlDriver(
|
|
40
|
+
bidire_speed_read_set=mctrl_driver_pb2.DrvSrSpeed(speed=speed, rw=1)
|
|
41
|
+
)
|
|
42
|
+
logger.debug(f"Send command--Speed setting speed={speed}")
|
|
43
|
+
return self.send_order_msg_driver(build)
|
|
44
|
+
|
|
45
|
+
def syn_nav_star_point_data(self, sat_system: int):
|
|
46
|
+
build = mctrl_driver_pb2.MctlDriver(
|
|
47
|
+
rtk_sys_mask_query=mctrl_driver_pb2.rtk_sys_mask_query_t(
|
|
48
|
+
sat_system=sat_system
|
|
49
|
+
)
|
|
50
|
+
)
|
|
51
|
+
logger.debug(
|
|
52
|
+
f"Send command--Navigation satellite frequency point synchronization={sat_system}"
|
|
53
|
+
)
|
|
54
|
+
return self.send_order_msg_driver(build)
|
|
55
|
+
|
|
56
|
+
def set_nav_star_point(self, cmd_req: str):
|
|
57
|
+
build = mctrl_driver_pb2.MctlDriver(
|
|
58
|
+
rtk_cfg_req=mctrl_driver_pb2.rtk_cfg_req_t(
|
|
59
|
+
cmd_req=cmd_req, cmd_length=len(cmd_req) - 1
|
|
60
|
+
)
|
|
61
|
+
)
|
|
62
|
+
logger.debug(
|
|
63
|
+
f"Send command--Navigation satellite frequency point setting={cmd_req}"
|
|
64
|
+
)
|
|
65
|
+
logger.debug(
|
|
66
|
+
f"Navigation satellite setting, Send command--Navigation satellite frequency point setting={cmd_req}"
|
|
67
|
+
)
|
|
68
|
+
return self.send_order_msg_driver(build)
|
|
69
|
+
|
|
70
|
+
def get_speed(self):
|
|
71
|
+
build = mctrl_driver_pb2.MctlDriver(
|
|
72
|
+
bidire_speed_read_set=mctrl_driver_pb2.DrvSrSpeed(rw=0)
|
|
73
|
+
)
|
|
74
|
+
logger.debug("Send command--Get speed value")
|
|
75
|
+
return self.send_order_msg_driver(build)
|
|
76
|
+
|
|
77
|
+
def operate_on_device(
|
|
78
|
+
self,
|
|
79
|
+
main_ctrl: int,
|
|
80
|
+
cut_knife_ctrl: int,
|
|
81
|
+
cut_knife_height: int,
|
|
82
|
+
max_run_speed: float,
|
|
83
|
+
):
|
|
84
|
+
build = mctrl_driver_pb2.MctlDriver(
|
|
85
|
+
mow_ctrl_by_hand=mctrl_driver_pb2.DrvMowCtrlByHand(
|
|
86
|
+
main_ctrl=main_ctrl,
|
|
87
|
+
cut_knife_ctrl=cut_knife_ctrl,
|
|
88
|
+
cut_knife_height=cut_knife_height,
|
|
89
|
+
max_run_Speed=max_run_speed,
|
|
90
|
+
)
|
|
91
|
+
)
|
|
92
|
+
logger.debug(
|
|
93
|
+
f"Send command--Manual mowing command, main_ctrl:{main_ctrl}, cut_knife_ctrl:{cut_knife_ctrl}, "
|
|
94
|
+
f"cut_knife_height:{cut_knife_height}, max_run_speed:{max_run_speed}"
|
|
95
|
+
)
|
|
96
|
+
|
|
97
|
+
return self.send_order_msg_driver(build)
|
|
98
|
+
|
|
99
|
+
def send_movement(self, linear_speed: int, angular_speed: int):
|
|
100
|
+
logger.debug(f"Control command print, linearSpeed={
|
|
101
|
+
linear_speed} // angularSpeed={angular_speed}")
|
|
102
|
+
return self.send_order_msg_driver(
|
|
103
|
+
mctrl_driver_pb2.MctlDriver(
|
|
104
|
+
todev_devmotion_ctrl=mctrl_driver_pb2.DrvMotionCtrl(
|
|
105
|
+
setLinearSpeed=linear_speed, setAngularSpeed=angular_speed
|
|
106
|
+
)
|
|
107
|
+
)
|
|
108
|
+
)
|