pymammotion 0.2.23__tar.gz → 0.2.24__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. {pymammotion-0.2.23 → pymammotion-0.2.24}/PKG-INFO +1 -1
  2. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/data/model/device.py +15 -7
  3. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/data/model/location.py +1 -0
  4. pymammotion-0.2.24/pymammotion/data/model/rapid_state.py +43 -0
  5. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/data/mqtt/event.py +22 -0
  6. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/data/state_manager.py +2 -0
  7. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/mammotion/devices/mammotion.py +1 -1
  8. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/utility/constant/device_constant.py +1 -1
  9. pymammotion-0.2.24/pymammotion/utility/conversions.py +5 -0
  10. {pymammotion-0.2.23 → pymammotion-0.2.24}/pyproject.toml +3 -3
  11. pymammotion-0.2.23/pymammotion/data/model/rapid_state.py +0 -41
  12. {pymammotion-0.2.23 → pymammotion-0.2.24}/LICENSE +0 -0
  13. {pymammotion-0.2.23 → pymammotion-0.2.24}/README.md +0 -0
  14. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/__init__.py +0 -0
  15. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/aliyun/__init__.py +0 -0
  16. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/aliyun/cloud_gateway.py +0 -0
  17. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/aliyun/cloud_service.py +0 -0
  18. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/aliyun/dataclass/aep_response.py +0 -0
  19. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/aliyun/dataclass/connect_response.py +0 -0
  20. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/aliyun/dataclass/dev_by_account_response.py +0 -0
  21. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/aliyun/dataclass/login_by_oauth_response.py +0 -0
  22. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/aliyun/dataclass/regions_response.py +0 -0
  23. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/aliyun/dataclass/session_by_authcode_response.py +0 -0
  24. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/aliyun/tmp_constant.py +0 -0
  25. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/bluetooth/__init__.py +0 -0
  26. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/bluetooth/ble.py +0 -0
  27. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/bluetooth/ble_message.py +0 -0
  28. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/bluetooth/const.py +0 -0
  29. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/bluetooth/data/__init__.py +0 -0
  30. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/bluetooth/data/convert.py +0 -0
  31. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/bluetooth/data/framectrldata.py +0 -0
  32. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/bluetooth/data/notifydata.py +0 -0
  33. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/const.py +0 -0
  34. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/data/__init__.py +0 -0
  35. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/data/model/__init__.py +0 -0
  36. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/data/model/account.py +0 -0
  37. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/data/model/device_config.py +0 -0
  38. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/data/model/enums.py +0 -0
  39. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/data/model/excute_boarder_params.py +0 -0
  40. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/data/model/execute_boarder.py +0 -0
  41. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/data/model/generate_route_information.py +0 -0
  42. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/data/model/hash_list.py +0 -0
  43. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/data/model/mowing_modes.py +0 -0
  44. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/data/model/plan.py +0 -0
  45. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/data/model/region_data.py +0 -0
  46. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/data/model/report_info.py +0 -0
  47. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/data/mqtt/__init__.py +0 -0
  48. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/data/mqtt/properties.py +0 -0
  49. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/data/mqtt/status.py +0 -0
  50. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/event/__init__.py +0 -0
  51. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/event/event.py +0 -0
  52. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/http/_init_.py +0 -0
  53. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/http/http.py +0 -0
  54. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/mammotion/__init__.py +0 -0
  55. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/mammotion/commands/__init__.py +0 -0
  56. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/mammotion/commands/abstract_message.py +0 -0
  57. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/mammotion/commands/mammotion_command.py +0 -0
  58. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/mammotion/commands/messages/__init__.py +0 -0
  59. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/mammotion/commands/messages/driver.py +0 -0
  60. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/mammotion/commands/messages/media.py +0 -0
  61. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/mammotion/commands/messages/navigation.py +0 -0
  62. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/mammotion/commands/messages/network.py +0 -0
  63. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/mammotion/commands/messages/ota.py +0 -0
  64. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/mammotion/commands/messages/system.py +0 -0
  65. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/mammotion/commands/messages/video.py +0 -0
  66. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/mammotion/control/__init__.py +0 -0
  67. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/mammotion/control/joystick.py +0 -0
  68. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/mammotion/devices/__init__.py +0 -0
  69. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/mqtt/__init__.py +0 -0
  70. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/mqtt/mammotion_future.py +0 -0
  71. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/mqtt/mammotion_mqtt.py +0 -0
  72. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/proto/__init__.py +0 -0
  73. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/proto/basestation.proto +0 -0
  74. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/proto/basestation.py +0 -0
  75. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/proto/basestation_pb2.py +0 -0
  76. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/proto/basestation_pb2.pyi +0 -0
  77. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/proto/common.proto +0 -0
  78. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/proto/common.py +0 -0
  79. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/proto/common_pb2.py +0 -0
  80. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/proto/common_pb2.pyi +0 -0
  81. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/proto/dev_net.proto +0 -0
  82. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/proto/dev_net.py +0 -0
  83. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/proto/dev_net_pb2.py +0 -0
  84. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/proto/dev_net_pb2.pyi +0 -0
  85. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/proto/luba_msg.proto +0 -0
  86. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/proto/luba_msg.py +0 -0
  87. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/proto/luba_msg_pb2.py +0 -0
  88. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/proto/luba_msg_pb2.pyi +0 -0
  89. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/proto/luba_mul.proto +0 -0
  90. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/proto/luba_mul.py +0 -0
  91. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/proto/luba_mul_pb2.py +0 -0
  92. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/proto/luba_mul_pb2.pyi +0 -0
  93. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/proto/mctrl_driver.proto +0 -0
  94. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/proto/mctrl_driver.py +0 -0
  95. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/proto/mctrl_driver_pb2.py +0 -0
  96. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/proto/mctrl_driver_pb2.pyi +0 -0
  97. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/proto/mctrl_nav.proto +0 -0
  98. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/proto/mctrl_nav.py +0 -0
  99. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/proto/mctrl_nav_pb2.py +0 -0
  100. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/proto/mctrl_nav_pb2.pyi +0 -0
  101. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/proto/mctrl_ota.proto +0 -0
  102. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/proto/mctrl_ota.py +0 -0
  103. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/proto/mctrl_ota_pb2.py +0 -0
  104. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/proto/mctrl_ota_pb2.pyi +0 -0
  105. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/proto/mctrl_pept.proto +0 -0
  106. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/proto/mctrl_pept.py +0 -0
  107. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/proto/mctrl_pept_pb2.py +0 -0
  108. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/proto/mctrl_pept_pb2.pyi +0 -0
  109. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/proto/mctrl_sys.proto +0 -0
  110. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/proto/mctrl_sys.py +0 -0
  111. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/proto/mctrl_sys_pb2.py +0 -0
  112. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/proto/mctrl_sys_pb2.pyi +0 -0
  113. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/py.typed +0 -0
  114. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/utility/constant/__init__.py +0 -0
  115. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/utility/datatype_converter.py +0 -0
  116. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/utility/device_type.py +0 -0
  117. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/utility/map.py +0 -0
  118. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/utility/movement.py +0 -0
  119. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/utility/periodic.py +0 -0
  120. {pymammotion-0.2.23 → pymammotion-0.2.24}/pymammotion/utility/rocker_util.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pymammotion
3
- Version: 0.2.23
3
+ Version: 0.2.24
4
4
  Summary:
5
5
  License: GNU-3.0
6
6
  Author: Michael Arthur
@@ -5,7 +5,7 @@ from dataclasses import dataclass
5
5
 
6
6
  import betterproto
7
7
 
8
- from pymammotion.data.model import HashList
8
+ from pymammotion.data.model import HashList, RapidState
9
9
  from pymammotion.data.model.device_config import DeviceLimits
10
10
  from pymammotion.data.model.location import Location
11
11
  from pymammotion.data.model.report_info import ReportData
@@ -16,14 +16,13 @@ from pymammotion.proto.mctrl_driver import MctlDriver
16
16
  from pymammotion.proto.mctrl_nav import MctlNav
17
17
  from pymammotion.proto.mctrl_ota import MctlOta
18
18
  from pymammotion.proto.mctrl_pept import MctlPept
19
- from pymammotion.proto.mctrl_sys import MctlSys, MowToAppInfoT, ReportInfoData, SystemUpdateBufMsg
19
+ from pymammotion.proto.mctrl_sys import MctlSys, MowToAppInfoT, ReportInfoData, SystemUpdateBufMsg, \
20
+ SystemRapidStateTunnelMsg
21
+ from pymammotion.utility.constant import WorkMode
22
+ from pymammotion.utility.conversions import parse_double
20
23
  from pymammotion.utility.map import CoordinateConverter
21
24
 
22
25
 
23
- def parse_double(val: float, d: float):
24
- return val / math.pow(10.0, d)
25
-
26
-
27
26
  @dataclass
28
27
  class MowingDevice:
29
28
  """Wraps the betterproto dataclasses, so we can bypass the groups for keeping all data."""
@@ -31,6 +30,7 @@ class MowingDevice:
31
30
  device: LubaMsg
32
31
  map: HashList
33
32
  location: Location
33
+ mowing_state: RapidState
34
34
 
35
35
  def __init__(self):
36
36
  self.device = LubaMsg()
@@ -40,6 +40,7 @@ class MowingDevice:
40
40
  self.err_code_list = []
41
41
  self.err_code_list_time = []
42
42
  self.limits = DeviceLimits(30, 70, 0.2, 0.6)
43
+ self.mowing_state = RapidState()
43
44
 
44
45
  @classmethod
45
46
  def from_raw(cls, raw: dict) -> "MowingDevice":
@@ -97,15 +98,22 @@ class MowingDevice:
97
98
  def update_report_data(self, toapp_report_data: ReportInfoData):
98
99
  coordinate_converter = CoordinateConverter(self.location.RTK.latitude, self.location.RTK.longitude)
99
100
  for index, location in enumerate(toapp_report_data.locations):
100
- if index == 0:
101
+ if index == 0 and location.real_pos_y != 0:
101
102
  self.location.position_type = location.pos_type
102
103
  self.location.orientation = location.real_toward / 10000
103
104
  self.location.device = coordinate_converter.enu_to_lla(
104
105
  parse_double(location.real_pos_y, 4.0), parse_double(location.real_pos_x, 4.0)
105
106
  )
107
+ if location.zone_hash:
108
+ self.location.work_zone = location.zone_hash if self.report_data.dev.sys_status == WorkMode.MODE_WORKING else 0
109
+
110
+
106
111
 
107
112
  self.report_data = self.report_data.from_dict(toapp_report_data.to_dict(casing=betterproto.Casing.SNAKE))
108
113
 
114
+ def run_state_update(self, rapid_state: SystemRapidStateTunnelMsg):
115
+ self.mowing_state = RapidState().from_raw(rapid_state.rapid_state_data)
116
+
109
117
  def mow_info(self, toapp_mow_info: MowToAppInfoT):
110
118
  pass
111
119
 
@@ -31,6 +31,7 @@ class Location:
31
31
  dock: Dock
32
32
  position_type: int = 0
33
33
  orientation: int = 0 # 360 degree rotation +-
34
+ work_zone: int = 0
34
35
 
35
36
  def __init__(self):
36
37
  self.device = Point()
@@ -0,0 +1,43 @@
1
+ from dataclasses import dataclass
2
+ from enum import Enum
3
+
4
+ from pymammotion.utility.conversions import parse_double
5
+
6
+
7
+ class RTKStatus(Enum):
8
+ NONE = 0
9
+ BAD = 1
10
+ FINE = 4
11
+
12
+
13
+ @dataclass
14
+ class RapidState:
15
+ pos_x: float = 0
16
+ pos_y: float = 0
17
+ rtk_status: RTKStatus = RTKStatus.NONE
18
+ toward: float = 0
19
+ satellites_total: int = 0
20
+ satellites_l2: int = 0
21
+ rtk_age: float = 0
22
+ lat_std: float = 0
23
+ lon_std: float = 0
24
+ pos_type: int = 0
25
+ zone_hash: int = 0
26
+ pos_level: int = 0
27
+
28
+ @classmethod
29
+ def from_raw(cls, raw: list[int]) -> "RapidState":
30
+ return RapidState(
31
+ rtk_status=RTKStatus.FINE if raw[0] == 4 else RTKStatus.BAD if raw[0] in (1, 5) else RTKStatus.NONE,
32
+ pos_level=raw[1],
33
+ satellites_total=raw[2],
34
+ rtk_age=parse_double(raw[3], 4.0),
35
+ lat_std=parse_double(raw[4], 4.0),
36
+ lon_std=parse_double(raw[5], 4.0),
37
+ satellites_l2=raw[6],
38
+ pos_x=parse_double(raw[7], 4.0),
39
+ pos_y=parse_double(raw[8], 4.0),
40
+ toward=parse_double(raw[9], 4.0),
41
+ pos_type=raw[10],
42
+ zone_hash=raw[11],
43
+ )
@@ -51,6 +51,16 @@ class DeviceConfigurationRequestValue(DataClassORJSONMixin):
51
51
  bizId: str
52
52
  params: str
53
53
 
54
+ @dataclass
55
+ class DeviceNotificationEventCode(DataClassORJSONMixin):
56
+ localTime: int
57
+ code: str
58
+
59
+ @dataclass
60
+ class DeviceNotificationEventValue(DataClassORJSONMixin):
61
+ data: DeviceNotificationEventCode
62
+
63
+
54
64
 
55
65
  @dataclass
56
66
  class GeneralParams(DataClassORJSONMixin):
@@ -90,6 +100,16 @@ class DeviceProtobufMsgEventParams(GeneralParams):
90
100
  type: Literal["info"]
91
101
  value: DeviceProtobufMsgEventValue
92
102
 
103
+ @dataclass
104
+ class DeviceNotificationEventParams(GeneralParams):
105
+ """Device notification event.
106
+
107
+ {'data': '{"localTime":1725159492000,"code":"1002"}'},
108
+ """
109
+
110
+ identifier: Literal["device_notification_event"]
111
+ type: Literal["info"]
112
+ value: DeviceNotificationEventValue
93
113
 
94
114
  @dataclass
95
115
  class DeviceWarningEventParams(GeneralParams):
@@ -129,6 +149,8 @@ class ThingEventMessage(DataClassORJSONMixin):
129
149
  params_obj = DeviceWarningEventParams(**params_dict)
130
150
  elif identifier == "device_config_req_event":
131
151
  params_obj = payload.get("params", '')
152
+ elif identifier == "device_notification_event":
153
+ params_obj = DeviceNotificationEventParams(**params_dict)
132
154
  else:
133
155
  raise ValueError(f"Unknown identifier: {identifier} {params_dict}")
134
156
 
@@ -72,6 +72,8 @@ class StateManager:
72
72
  self._device.update_report_data(sys_msg[1])
73
73
  case "mow_to_app_info":
74
74
  self._device.mow_info(sys_msg[1])
75
+ case "system_tard_state_tunnel":
76
+ self._device.run_state_update(sys_msg[1])
75
77
 
76
78
  def _update_driver_data(self, message):
77
79
  pass
@@ -537,7 +537,7 @@ class MammotionBaseDevice:
537
537
  async def move_back(self, linear: float):
538
538
  """Move back. values 0.0 1.0."""
539
539
  linear_percent = get_percent(abs(linear * 100))
540
- (linear_speed, angular_speed) = transform_both_speeds(90.0, 0.0, linear_percent, 0.0)
540
+ (linear_speed, angular_speed) = transform_both_speeds(270.0, 0.0, linear_percent, 0.0)
541
541
  await self.queue_command("send_movement", linear_speed=linear_speed, angular_speed=angular_speed)
542
542
 
543
543
  async def move_left(self, angulur: float):
@@ -123,7 +123,7 @@ class SystemUpdateBuf:
123
123
  ZONE_STATE_LEN_INDEX = 1
124
124
 
125
125
 
126
- class SystemRapidStateTunnel:
126
+ class SystemRapidStateTunnelIndex(IntEnum):
127
127
  DIS_CAR_RTK_STARS_INDEX = 15
128
128
  DIS_RTK_STATUS_INDEX = 13
129
129
  L1_SATS_INDEX = 2
@@ -0,0 +1,5 @@
1
+ import math
2
+
3
+
4
+ def parse_double(val: float, d: float):
5
+ return val / math.pow(10.0, d)
@@ -1,10 +1,10 @@
1
1
  [project]
2
2
  name = "pymammotion"
3
- version = "0.2.23"
3
+ version = "0.2.24"
4
4
 
5
5
  [tool.poetry]
6
6
  name = "pymammotion"
7
- version = "0.2.23"
7
+ version = "0.2.24"
8
8
  license = "GNU-3.0"
9
9
  description = ""
10
10
  readme = "README.md"
@@ -53,7 +53,7 @@ mypy = "^1.10.0"
53
53
  pre-commit = "^3.8.0"
54
54
 
55
55
  [tool.bumpver]
56
- current_version = "0.2.23"
56
+ current_version = "0.2.24"
57
57
  version_pattern = "MAJOR.MINOR.PATCH"
58
58
  commit_message = "Bump version {old_version} -> {new_version}"
59
59
  commit = true
@@ -1,41 +0,0 @@
1
- from dataclasses import dataclass
2
- from enum import Enum
3
-
4
-
5
- class RTKStatus(Enum):
6
- NONE = 0
7
- BAD = 1
8
- FINE = 4
9
-
10
-
11
- @dataclass
12
- class RapidState:
13
- pos_x: float
14
- pos_y: float
15
- rtk_status: RTKStatus
16
- toward: float
17
- satellites_total: int
18
- satellites_l2: int
19
- rtk_age: float
20
- lat_std: float
21
- lon_std: float
22
- pos_type: int
23
- zone_hash: int
24
- pos_level: int
25
-
26
- @classmethod
27
- def from_raw(cls, raw: list[int]) -> "RapidState":
28
- return RapidState(
29
- rtk_status=RTKStatus.FINE if raw[0] == 4 else RTKStatus.BAD if raw[0] in (1, 5) else RTKStatus.NONE,
30
- pos_level=raw[1],
31
- satellites_total=raw[2],
32
- rtk_age=raw[3] / 10000,
33
- lat_std=raw[4] / 10000,
34
- lon_std=raw[5] / 10000,
35
- satellites_l2=raw[6],
36
- pos_x=raw[7] / 10000,
37
- pos_y=raw[8] / 10000,
38
- toward=raw[9] / 10000,
39
- pos_type=raw[10],
40
- zone_hash=raw[11],
41
- )
File without changes
File without changes