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.

Files changed (114) hide show
  1. {pymammotion-0.0.37 → pymammotion-0.0.38}/PKG-INFO +6 -6
  2. {pymammotion-0.0.37 → pymammotion-0.0.38}/README.md +5 -5
  3. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/__init__.py +4 -4
  4. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/aliyun/cloud_gateway.py +10 -8
  5. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/bluetooth/ble.py +2 -2
  6. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/bluetooth/ble_message.py +9 -9
  7. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/bluetooth/data/convert.py +3 -2
  8. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/data/model/__init__.py +0 -1
  9. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/data/model/device.py +8 -8
  10. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/data/model/enums.py +67 -67
  11. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/data/mqtt/event.py +1 -1
  12. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/http/http.py +5 -1
  13. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/luba/base.py +2 -2
  14. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/mammotion/commands/abstract_message.py +7 -7
  15. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/mammotion/commands/mammotion_command.py +6 -6
  16. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/mammotion/commands/messages/driver.py +108 -108
  17. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/mammotion/commands/messages/media.py +36 -36
  18. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/mammotion/commands/messages/navigation.py +535 -535
  19. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/mammotion/commands/messages/network.py +236 -236
  20. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/mammotion/commands/messages/ota.py +34 -34
  21. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/mammotion/commands/messages/system.py +266 -266
  22. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/mammotion/commands/messages/video.py +27 -27
  23. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/mammotion/control/joystick.py +3 -3
  24. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/mammotion/devices/luba.py +4 -6
  25. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/mqtt/mqtt.py +7 -7
  26. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/proto/common.py +1 -1
  27. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/proto/common_pb2.py +3 -3
  28. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/proto/dev_net.py +1 -1
  29. pymammotion-0.0.38/pymammotion/proto/dev_net_pb2.py +107 -0
  30. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/proto/luba_msg.proto +7 -7
  31. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/proto/luba_msg.py +1 -1
  32. pymammotion-0.0.38/pymammotion/proto/luba_msg_pb2.py +40 -0
  33. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/proto/luba_msg_pb2.pyi +7 -7
  34. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/proto/luba_mul.py +1 -1
  35. pymammotion-0.0.38/pymammotion/proto/luba_mul_pb2.py +45 -0
  36. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/proto/mctrl_driver.py +1 -1
  37. pymammotion-0.0.38/pymammotion/proto/mctrl_driver_pb2.py +45 -0
  38. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/proto/mctrl_nav.proto +1 -1
  39. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/proto/mctrl_nav.py +1 -1
  40. pymammotion-0.0.38/pymammotion/proto/mctrl_nav_pb2.py +116 -0
  41. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/proto/mctrl_nav_pb2.pyi +1 -1
  42. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/proto/mctrl_ota.py +1 -1
  43. pymammotion-0.0.38/pymammotion/proto/mctrl_ota_pb2.py +35 -0
  44. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/proto/mctrl_pept.py +1 -1
  45. pymammotion-0.0.38/pymammotion/proto/mctrl_pept_pb2.py +31 -0
  46. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/proto/mctrl_sys.proto +1 -1
  47. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/proto/mctrl_sys.py +1 -1
  48. pymammotion-0.0.38/pymammotion/proto/mctrl_sys_pb2.py +142 -0
  49. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/proto/mctrl_sys_pb2.pyi +1 -1
  50. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/utility/device_type.py +152 -152
  51. {pymammotion-0.0.37 → pymammotion-0.0.38}/pyproject.toml +1 -1
  52. pymammotion-0.0.37/pymammotion/proto/dev_net_pb2.py +0 -107
  53. pymammotion-0.0.37/pymammotion/proto/luba_msg_pb2.py +0 -40
  54. pymammotion-0.0.37/pymammotion/proto/luba_mul_pb2.py +0 -45
  55. pymammotion-0.0.37/pymammotion/proto/mctrl_driver_pb2.py +0 -45
  56. pymammotion-0.0.37/pymammotion/proto/mctrl_nav_pb2.py +0 -116
  57. pymammotion-0.0.37/pymammotion/proto/mctrl_ota_pb2.py +0 -35
  58. pymammotion-0.0.37/pymammotion/proto/mctrl_pept_pb2.py +0 -31
  59. pymammotion-0.0.37/pymammotion/proto/mctrl_sys_pb2.py +0 -142
  60. {pymammotion-0.0.37 → pymammotion-0.0.38}/LICENSE +0 -0
  61. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/aliyun/cloud_service.py +0 -0
  62. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/aliyun/dataclass/aep_response.py +0 -0
  63. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/aliyun/dataclass/connect_response.py +0 -0
  64. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/aliyun/dataclass/dev_by_account_response.py +0 -0
  65. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/aliyun/dataclass/login_by_oauth_response.py +0 -0
  66. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/aliyun/dataclass/regions_response.py +0 -0
  67. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/aliyun/dataclass/session_by_authcode_response.py +0 -0
  68. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/aliyun/tmp_constant.py +0 -0
  69. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/bluetooth/__init__.py +0 -0
  70. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/bluetooth/const.py +0 -0
  71. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/bluetooth/data/__init__.py +0 -0
  72. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/bluetooth/data/framectrldata.py +0 -0
  73. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/bluetooth/data/notifydata.py +0 -0
  74. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/const.py +0 -0
  75. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/data/__init__.py +0 -0
  76. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/data/model/excute_boarder_params.py +0 -0
  77. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/data/model/execute_boarder.py +0 -0
  78. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/data/model/generate_route_information.py +0 -0
  79. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/data/model/hash_list.py +0 -0
  80. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/data/model/mowing_modes.py +0 -0
  81. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/data/model/plan.py +0 -0
  82. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/data/model/rapid_state.py +0 -0
  83. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/data/model/region_data.py +0 -0
  84. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/data/mqtt/__init__.py +0 -0
  85. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/data/mqtt/properties.py +0 -0
  86. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/data/mqtt/status.py +0 -0
  87. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/event/__init__.py +0 -0
  88. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/event/event.py +0 -0
  89. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/http/_init_.py +0 -0
  90. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/luba/_init_.py +0 -0
  91. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/mammotion/__init__.py +0 -0
  92. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/mammotion/commands/__init__.py +0 -0
  93. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/mammotion/commands/messages/__init__.py +0 -0
  94. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/mammotion/control/__init__.py +0 -0
  95. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/mammotion/devices/__init__.py +0 -0
  96. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/proto/__init__.py +0 -0
  97. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/proto/common.proto +0 -0
  98. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/proto/common_pb2.pyi +0 -0
  99. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/proto/dev_net.proto +0 -0
  100. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/proto/dev_net_pb2.pyi +0 -0
  101. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/proto/luba_mul.proto +0 -0
  102. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/proto/luba_mul_pb2.pyi +0 -0
  103. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/proto/mctrl_driver.proto +0 -0
  104. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/proto/mctrl_driver_pb2.pyi +0 -0
  105. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/proto/mctrl_ota.proto +0 -0
  106. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/proto/mctrl_ota_pb2.pyi +0 -0
  107. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/proto/mctrl_pept.proto +0 -0
  108. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/proto/mctrl_pept_pb2.pyi +0 -0
  109. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/py.typed +0 -0
  110. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/utility/constant/__init__.py +0 -0
  111. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/utility/constant/device_constant.py +0 -0
  112. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/utility/datatype_converter.py +0 -0
  113. {pymammotion-0.0.37 → pymammotion-0.0.38}/pymammotion/utility/periodic.py +0 -0
  114. {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.37
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/pyluba/
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/pyluba/#files
42
+ [url_pypi]: https://pypi.org/project/pymammotion/#files
43
43
 
44
- [img_pyversions]: https://img.shields.io/pypi/pyversions/pyluba.svg
45
- [url_pyversions]: https://pypi.python.org/pypi/pyluba
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 pyluba
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/pyluba/
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/pyluba/#files
11
+ [url_pypi]: https://pypi.org/project/pymammotion/#files
12
12
 
13
- [img_pyversions]: https://img.shields.io/pypi/pyversions/pyluba.svg
14
- [url_pyversions]: https://pypi.python.org/pypi/pyluba
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 pyluba
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 pyluba.bluetooth.ble import LubaBLE
13
- from pyluba.http.http import LubaHTTP, connect_http
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 pyluba.mammotion.devices import MammotionBaseBLEDevice
17
- from pyluba.mqtt.mqtt import LubaMQTT, logger
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 pyluba.aliyun.dataclass.aep_response import AepResponse
19
- from pyluba.aliyun.dataclass.connect_response import ConnectResponse
20
- from pyluba.aliyun.dataclass.dev_by_account_response import ListingDevByAccountResponse
21
- from pyluba.aliyun.dataclass.login_by_oauth_response import LoginByOAuthResponse
22
- from pyluba.aliyun.dataclass.regions_response import RegionResponse
23
- from pyluba.aliyun.dataclass.session_by_authcode_response import (
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 pyluba.const import ALIYUN_DOMAIN, APP_KEY, APP_SECRET, APP_VERSION
27
- from pyluba.utility.datatype_converter import DatatypeConverter
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 pyluba.bluetooth.const import (
4
+ from pymammotion.bluetooth.const import (
5
5
  SERVICE_CHANGED_CHARACTERISTIC,
6
6
  UUID_NOTIFICATION_CHARACTERISTIC,
7
7
  )
8
- from pyluba.event.event import BleNotificationEvent
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 pyluba.aliyun.tmp_constant import tmp_constant
14
- from pyluba.bluetooth.const import UUID_WRITE_CHARACTERISTIC
15
- from pyluba.bluetooth.data.convert import parse_custom_data
16
- from pyluba.bluetooth.data.framectrldata import FrameCtrlData
17
- from pyluba.bluetooth.data.notifydata import BlufiNotifyData
18
- from pyluba.data.model.execute_boarder import ExecuteBorder
19
- from pyluba.mammotion.commands.messages.navigation import MessageNavigation
20
- from pyluba.proto import (
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 pyluba.utility.constant.device_constant import bleOrderCmd
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
- from pyluba.proto import luba_msg_pb2
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]
@@ -5,4 +5,3 @@ from .hash_list import HashList
5
5
  from .plan import Plan
6
6
  from .rapid_state import RapidState, RTKStatus
7
7
  from .region_data import RegionData
8
-
@@ -2,14 +2,14 @@
2
2
 
3
3
  from dataclasses import dataclass
4
4
 
5
- from pyluba.proto.dev_net import DevNet
6
- from pyluba.proto.luba_msg import LubaMsg
7
- from pyluba.proto.luba_mul import SocMul
8
- from pyluba.proto.mctrl_driver import MctlDriver
9
- from pyluba.proto.mctrl_nav import MctlNav
10
- from pyluba.proto.mctrl_ota import MctlOta
11
- from pyluba.proto.mctrl_pept import MctlPept
12
- from pyluba.proto.mctrl_sys import MctlSys
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 pyluba.proto import luba_msg_pb2
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 pyluba.const import MAMMOTION_CLIENT_ID, MAMMOTION_CLIENT_SECRET, MAMMOTION_DOMAIN
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 pyluba.data.model.rapid_state import RapidState, RTKStatus
4
- from pyluba.data.mqtt.status import StatusType
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:
@@ -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."""
@@ -1,9 +1,9 @@
1
- from pyluba.mammotion.commands.messages.navigation import MessageNavigation
2
- from pyluba.mammotion.commands.messages.network import MessageNetwork
3
- from pyluba.mammotion.commands.messages.ota import MessageOta
4
- from pyluba.mammotion.commands.messages.system import MessageSystem
5
- from pyluba.mammotion.commands.messages.video import MessageVideo
6
- from pyluba.proto import dev_net_pb2, luba_msg_pb2
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 pyluba.mammotion.commands.abstract_message import AbstractMessage
7
- from pyluba.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
- )
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
+ )