pymammotion 0.4.46__py3-none-any.whl → 0.4.48__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -43,12 +43,14 @@ class MowingDevice(DataClassORJSONMixin):
43
43
  """Update the device based on which buffer we are reading from."""
44
44
  match buffer_list.update_buf_data[0]:
45
45
  case 1:
46
- # 4 speed
47
- self.location.RTK.latitude = parse_double(buffer_list.update_buf_data[5], 8.0)
48
- self.location.RTK.longitude = parse_double(buffer_list.update_buf_data[6], 8.0)
49
- self.location.dock.latitude = parse_double(buffer_list.update_buf_data[7], 4.0)
50
- self.location.dock.longitude = parse_double(buffer_list.update_buf_data[8], 4.0)
51
- self.location.dock.rotation = buffer_list.update_buf_data[3] + 180
46
+ # 4 speed?
47
+ if buffer_list.update_buf_data[5] != 0:
48
+ self.location.RTK.latitude = parse_double(buffer_list.update_buf_data[5], 8.0)
49
+ self.location.RTK.longitude = parse_double(buffer_list.update_buf_data[6], 8.0)
50
+ if buffer_list.update_buf_data[7] != 0:
51
+ self.location.dock.latitude = parse_double(buffer_list.update_buf_data[7], 4.0)
52
+ self.location.dock.longitude = parse_double(buffer_list.update_buf_data[8], 4.0)
53
+ self.location.dock.rotation = buffer_list.update_buf_data[3] + 180
52
54
  case 2:
53
55
  self.err_code_list.clear()
54
56
  self.err_code_list_time.clear()
@@ -99,13 +101,11 @@ class MowingDevice(DataClassORJSONMixin):
99
101
  # if loc.bol_hash:
100
102
  # if loc.bol_hash != location.bol_hash:
101
103
  # self.map = HashList()
102
- #MurMurHashUtil.hash_unsigned_list(list(self.map.area.keys()))
104
+ # MurMurHashUtil.hash_unsigned_list(list(self.map.area.keys()))
103
105
 
104
106
  if toapp_report_data.fw_info:
105
107
  self.update_device_firmwares(toapp_report_data.fw_info)
106
108
 
107
-
108
-
109
109
  self.report_data.update(toapp_report_data.to_dict(casing=betterproto.Casing.SNAKE))
110
110
 
111
111
  def run_state_update(self, rapid_state: SystemRapidStateTunnelMsg) -> None:
@@ -17,6 +17,9 @@ class SideLight(DataClassORJSONMixin):
17
17
  @dataclass
18
18
  class MowerInfo(DataClassORJSONMixin):
19
19
  blade_status: bool = False
20
+ rain_detection: bool = False
21
+ traversal_mode: int = 0
22
+ turning_mode: int = 0
20
23
  side_led: SideLight = field(default_factory=SideLight)
21
24
  collector_installation_status: bool = False
22
25
  model: str = ""
@@ -47,8 +47,8 @@ class TraversalMode(IntEnum):
47
47
  class TurningMode(IntEnum):
48
48
  """Turning mode on corners."""
49
49
 
50
- multipoint = 0
51
- zero_turn = 1
50
+ zero_turn = 0
51
+ multipoint = 1
52
52
 
53
53
 
54
54
  class DetectionStrategy(IntEnum):
@@ -25,6 +25,7 @@ from pymammotion.proto import (
25
25
  NavGetHashListAck,
26
26
  NavPlanJobSet,
27
27
  NavReqCoverPath,
28
+ NavSysParamMsg,
28
29
  SvgMessageAckT,
29
30
  TimeCtrlLight,
30
31
  WifiIotStatusReport,
@@ -173,6 +174,15 @@ class StateManager:
173
174
  self._device.work = CurrentTaskSettings.from_dict(
174
175
  work_settings.to_dict(casing=betterproto.Casing.SNAKE)
175
176
  )
177
+ case "nav_sys_param_cmd":
178
+ settings: NavSysParamMsg = nav_msg[1]
179
+ match settings.id:
180
+ case 3:
181
+ self._device.mower_state.rain_detection = bool(settings.context)
182
+ case 6:
183
+ self._device.mower_state.turning_mode = settings.context
184
+ case 7:
185
+ self._device.mower_state.traversal_mode = settings.context
176
186
 
177
187
  def _update_sys_data(self, message) -> None:
178
188
  """Update system."""
@@ -125,14 +125,6 @@ class MessageSystem(AbstractMessage, ABC):
125
125
  return self.messageNavigation.allpowerfull_rw_adapter_x3(rw_id, context, rw)
126
126
  build = MctlSys(bidire_comm_cmd=SysCommCmd(id=rw_id, context=context, rw=rw))
127
127
  logger.debug(f"Send command - 9 general read and write command id={rw_id}, context={context}, rw={rw}")
128
- if rw_id == 5:
129
- # TODO investigate if the original code makes any difference to this call.
130
- """
131
- LubaMsgOuterClass.LubaMsg.Builder protoBufBuilderSet = getProtoBufBuilderSet(LubaMsgOuterClass.MsgCmdType.EMBED_SYS, LubaMsgOuterClass.MsgDevice.DEV_MAINCTL, LubaMsgOuterClass.MsgAttr.REQ);
132
- protoBufBuilderSet.setSys(build);
133
- sendMsg(protoBufBuilderSet, 122, true, "发送指令--9通用读写命令id=" + i + ",context=" + i2 + ",rw=" + i3);
134
- """
135
- return self.send_order_msg_sys(build)
136
128
  return self.send_order_msg_sys(build)
137
129
 
138
130
  def traverse_mode(self, context: int) -> bytes:
@@ -145,8 +137,8 @@ class MessageSystem(AbstractMessage, ABC):
145
137
  def turning_mode(self, context: int) -> bytes:
146
138
  """Sets the traversal mode back to charger."""
147
139
  # setTurnAroundMode
148
- # 0 multipoint turn
149
- # 1 zero turn
140
+ # 0 zero turn
141
+ # 1 multipoint turn
150
142
  return self.allpowerfull_rw(6, context, 1)
151
143
 
152
144
  # Commented out as not needed and too many refs to try fix up
@@ -262,8 +262,11 @@ class MammotionBaseDevice:
262
262
 
263
263
  async def async_read_settings(self) -> None:
264
264
  """Read settings from device."""
265
+ # no cutting in rain nav_sys_param_cmd (id 3 context 1/0)
265
266
  await self.queue_command("allpowerfull_rw", rw_id=3, context=1, rw=0)
267
+ # ??
266
268
  await self.queue_command("allpowerfull_rw", rw_id=4, context=1, rw=0)
269
+ # turning mode nav_sys_param_cmd (id 6, context 1/0)
267
270
  await self.queue_command("allpowerfull_rw", rw_id=6, context=1, rw=0)
268
271
  # traversal mode
269
272
  await self.queue_command("allpowerfull_rw", rw_id=7, context=1, rw=0)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pymammotion
3
- Version: 0.4.46
3
+ Version: 0.4.48
4
4
  Summary:
5
5
  License: GPL-3.0
6
6
  Author: Michael Arthur
@@ -25,9 +25,9 @@ pymammotion/const.py,sha256=lWRxvTVdXnNHuxqvRkjO5ziK0Ic-fZMM6J2dbe5M6Nc,385
25
25
  pymammotion/data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
26
26
  pymammotion/data/model/__init__.py,sha256=UVRbSXGOjYnWv30ZEvzT5QRpdVqAbyeToo-t0QBWyi4,292
27
27
  pymammotion/data/model/account.py,sha256=vJM-KTf2q6eBfVC-UlNHBSmJvqHiCawZ40vnuhXhaz8,140
28
- pymammotion/data/model/device.py,sha256=9rKshhdlHFfyPW-brxlhydQLDZuNi9Q4t8KjSu8Dm2s,7381
28
+ pymammotion/data/model/device.py,sha256=tsOuapxFVp17Qwng62EcHGl53Xqfndnk4o6eEpkbq60,7509
29
29
  pymammotion/data/model/device_config.py,sha256=DTnoePsMwJrKVXqGeKvbZQjs8Zab61U5T3b-c-w0WlM,2654
30
- pymammotion/data/model/device_info.py,sha256=Q0qJ6BflQycH_VFugwaFFXcvM69q2v9JAe2wWOcCggE,904
30
+ pymammotion/data/model/device_info.py,sha256=R1vLBvAgST2sWTAYYKmZB7HcYXqq_LlobrhrGG0TKIc,991
31
31
  pymammotion/data/model/device_limits.py,sha256=m8HdxD-RaAkPm7jHYb9GLxMEH9IfzBPz0ZypmsLnId4,1946
32
32
  pymammotion/data/model/enums.py,sha256=NLImBbeqwbwBLbABC_NbBzk4M8OxhUTcto6QcGZVNOc,1707
33
33
  pymammotion/data/model/excute_boarder_params.py,sha256=9CpUqrygcle1C_1hDW-riLmm4map4ZbE842NXjcomEI,1394
@@ -35,7 +35,7 @@ pymammotion/data/model/execute_boarder.py,sha256=9rd_h4fbcsXxgnLOd2rO2hWyD1abnTG
35
35
  pymammotion/data/model/generate_route_information.py,sha256=pgjqURwmEIzjCMbl4Z5JDDkfxyUAdry1KhPfyir3-mU,777
36
36
  pymammotion/data/model/hash_list.py,sha256=t9pY5JkL8Ky5YE4y6FowsiBeEZJPFl8XrPvW21xavEE,12121
37
37
  pymammotion/data/model/location.py,sha256=PwmITejfI4pm7PI4rzqSuuHetwle6IJr_CV95435s2M,871
38
- pymammotion/data/model/mowing_modes.py,sha256=bBbRhDe-imZsXDR0TN0emQv6BiIkAlXJFb5isPEjgDk,1078
38
+ pymammotion/data/model/mowing_modes.py,sha256=RY4vNYwnrVjJyjDD2DKZG4B9K9z0GuHbtavWjCc2oVk,1078
39
39
  pymammotion/data/model/rapid_state.py,sha256=mIdhAG_LZXpVcybxqTLgLXkNOmVmDTn04B9PGIDA8Ls,1251
40
40
  pymammotion/data/model/raw_data.py,sha256=x2xuqVC8CQuV3ui3QK4G5EqRET9EsNljHLHR11ByYgo,6471
41
41
  pymammotion/data/model/region_data.py,sha256=VokMRqB_o4OFL1TWAM90Fvm-1z4jcYrw3X2o760qpx4,2949
@@ -45,7 +45,7 @@ pymammotion/data/mqtt/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdr
45
45
  pymammotion/data/mqtt/event.py,sha256=r14gzZVxmlGVAwFdZQ1CUsMZFHHwRKnbt2VHnjugP28,5123
46
46
  pymammotion/data/mqtt/properties.py,sha256=pX5JRVmmpVO04CSPm5xAGcSWA_OeLd0JnBagLsfiSEc,3755
47
47
  pymammotion/data/mqtt/status.py,sha256=SgdrpE1Uldb01hybO6hYhgU1Sp1eILghC0UhMZMHrdQ,1091
48
- pymammotion/data/state_manager.py,sha256=lORef_yVdYzaO_XafeRyILdXxGYx4Btt7ZvMNChpL3I,9829
48
+ pymammotion/data/state_manager.py,sha256=1LlkR1ghMHdxAfSR1OHmrz_X2-Da3f6xqNoxLSk-zT4,10313
49
49
  pymammotion/event/__init__.py,sha256=mgATR6vPHACNQ-0zH5fi7NdzeTCDV1CZyaWPmtUusi8,115
50
50
  pymammotion/event/event.py,sha256=bj2RirSIRyBs0QvkcrOtwZWUX_8F3m1sySuHVyKmZLs,2143
51
51
  pymammotion/http/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -65,12 +65,12 @@ pymammotion/mammotion/commands/messages/media.py,sha256=a6CY_1wEpepH9zg6-HfH1lt-
65
65
  pymammotion/mammotion/commands/messages/navigation.py,sha256=aEEpvDW5QukJ0QiWMhPjjz0eTTF1ndQuvv8a6hJlUg0,23257
66
66
  pymammotion/mammotion/commands/messages/network.py,sha256=oO3PK6TKY563Jw-ZRpNmIzGCgkuk2SQm0BhcDL5claM,7595
67
67
  pymammotion/mammotion/commands/messages/ota.py,sha256=ZHLQRE5ETvLEIu2Vbj3m2XidIWT8uorYSHxkZd3pkRc,1376
68
- pymammotion/mammotion/commands/messages/system.py,sha256=P3ndyhvvJbYFjurwMi6LRObG4yTBlooZAxuwa4guYec,14813
68
+ pymammotion/mammotion/commands/messages/system.py,sha256=XOEeyUAz1iNtPk37dzCbLrxx1pljUlGy1IKuof_Pko0,14244
69
69
  pymammotion/mammotion/commands/messages/video.py,sha256=KN9Zj8h7EnVipVBOzHxWF4RXhU3MpueYe1GNErGHapg,1248
70
70
  pymammotion/mammotion/control/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
71
71
  pymammotion/mammotion/control/joystick.py,sha256=QfBVxM_gxpWsZAGO90whtgxCI2tIZ3TTad9wHIPsU9s,5640
72
72
  pymammotion/mammotion/devices/__init__.py,sha256=f2qQFPgLGmV85W2hSlMUh5BYuht9o_Ar_JEAAMD4fsE,102
73
- pymammotion/mammotion/devices/base.py,sha256=fXpAjqN2Rsuzpbls4gkoX--gWEuI_XQxF0UF7560XO0,11890
73
+ pymammotion/mammotion/devices/base.py,sha256=wM2c2vjfPjYPYmMTk77E833IN1ioearcU2pcLZUkP7I,12030
74
74
  pymammotion/mammotion/devices/mammotion.py,sha256=MNOoPNHjojnTUwKY3LmUe-vBxdmfwoRgEYNNueCpXC0,14472
75
75
  pymammotion/mammotion/devices/mammotion_bluetooth.py,sha256=sgfL4sz6WkIlr2bvYplzxsudmzATNE-z3UGe0K1Csng,18919
76
76
  pymammotion/mammotion/devices/mammotion_cloud.py,sha256=P352E-pcbG6wA-RXubI51EUJ3UUQcqJkxRDIqh3g-58,14217
@@ -123,7 +123,7 @@ pymammotion/utility/movement.py,sha256=N75oAoAgFydqoaOedYIxGUHmuTCtPzAOtb-d_29tp
123
123
  pymammotion/utility/mur_mur_hash.py,sha256=xEfOZVbqRawJj66eLgtnZ85OauDR47oIPr29OHelzPI,4468
124
124
  pymammotion/utility/periodic.py,sha256=MbeSb9cfhxzYmdT_RiE0dZe3H9IfbQW_zSqhmSX2RUc,3321
125
125
  pymammotion/utility/rocker_util.py,sha256=6tX7sS87qoQC_tsxbx3NLL-HgS08wtzXiZkhDiz7uo0,7179
126
- pymammotion-0.4.46.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
127
- pymammotion-0.4.46.dist-info/METADATA,sha256=z90IoGAzkUtyaR8c3i2jWNFErwyzwDqjo-Qx1yRFeJM,3878
128
- pymammotion-0.4.46.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
129
- pymammotion-0.4.46.dist-info/RECORD,,
126
+ pymammotion-0.4.48.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
127
+ pymammotion-0.4.48.dist-info/METADATA,sha256=XUvVIzAkWDYWJvQAiyVDpmd2jB6q85tob7arz4nukrY,3878
128
+ pymammotion-0.4.48.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
129
+ pymammotion-0.4.48.dist-info/RECORD,,