pymammotion 0.1.4__py3-none-any.whl → 0.1.5__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.

Potentially problematic release.


This version of pymammotion might be problematic. Click here for more details.

@@ -1,5 +1,5 @@
1
1
  """MowingDevice class to wrap around the betterproto dataclasses."""
2
-
2
+ import math
3
3
  from dataclasses import dataclass
4
4
 
5
5
  import betterproto
@@ -19,6 +19,10 @@ from pymammotion.proto.mctrl_sys import MctlSys, MowToAppInfoT, SystemUpdateBufM
19
19
  from pymammotion.utility.map import CoordinateConverter
20
20
 
21
21
 
22
+ def parse_double(val: float, d: float):
23
+ return val / math.pow(10.0, d)
24
+
25
+
22
26
  @dataclass
23
27
  class MowingDevice:
24
28
  """Wraps the betterproto dataclasses, so we can bypass the groups for keeping all data."""
@@ -52,10 +56,10 @@ class MowingDevice:
52
56
  match buffer_list.update_buf_data[0]:
53
57
  case 1:
54
58
  # 4 speed
55
- self.location.RTK.latitude = buffer_list.update_buf_data[5]
56
- self.location.RTK.longitude = buffer_list.update_buf_data[6]
57
- self.location.dock.latitude = buffer_list.update_buf_data[7]
58
- self.location.dock.longitude = buffer_list.update_buf_data[8]
59
+ self.location.RTK.latitude = parse_double(buffer_list.update_buf_data[5], 8.0)
60
+ self.location.RTK.longitude = parse_double(buffer_list.update_buf_data[6], 8.0)
61
+ self.location.dock.latitude = parse_double(buffer_list.update_buf_data[7], 4.0)
62
+ self.location.dock.longitude = parse_double(buffer_list.update_buf_data[8], 4.0)
59
63
  self.location.dock.rotation = buffer_list.update_buf_data[3] + 180
60
64
  case 2:
61
65
  self.err_code_list.clear()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pymammotion
3
- Version: 0.1.4
3
+ Version: 0.1.5
4
4
  Summary:
5
5
  License: GNU-3.0
6
6
  Author: Michael Arthur
@@ -20,7 +20,7 @@ pymammotion/bluetooth/data/notifydata.py,sha256=N1bphpueWUWbsWUcpZmMGt2CyCgLcKAF
20
20
  pymammotion/const.py,sha256=3plR6t5sFVhx3LoUbW5PE2gqIANoD-fSm-T0q8uIwIU,336
21
21
  pymammotion/data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
22
22
  pymammotion/data/model/__init__.py,sha256=d8FlIgCcWqoH3jJSpnm-IY-25RM-l2nbRwLtWjSHo74,222
23
- pymammotion/data/model/device.py,sha256=tvwxuodX54CIYVIs9XqZLX0k546SJqAx5hsVi7n9A-A,10151
23
+ pymammotion/data/model/device.py,sha256=3GWhgFhW5TwJNUv3HAAz3ZTB4XUnIWusD5x9Iug87Gg,10315
24
24
  pymammotion/data/model/device_config.py,sha256=6BcyVbMyw6vA1jANof8_mnG-jizGsF96pbKeHP4t8G4,179
25
25
  pymammotion/data/model/enums.py,sha256=tD_vYsxstOV_lUkYF9uWkrjVOgAJPNnGevy_xmiu3WE,1558
26
26
  pymammotion/data/model/excute_boarder_params.py,sha256=kadSth4y-VXlXIZ6R-Ng-kDvBbM-3YRr8bmR86qR0U0,1355
@@ -109,7 +109,7 @@ pymammotion/utility/device_type.py,sha256=KYawu2glZMVlPmxRbA4kVFujXz3miHp3rJiOWR
109
109
  pymammotion/utility/map.py,sha256=CRW-CjkLBp8R9UcobH2cQ9x4qNxHSLlI2u0jAiKyB8A,2271
110
110
  pymammotion/utility/periodic.py,sha256=9wJMfwXPlx6Mbp3Fws7LLTI34ZDKphH1bva_Ggyk32g,3281
111
111
  pymammotion/utility/rocker_util.py,sha256=syPL0QN4zMzHiTIkUKS7RXBBptjdbkfNlPddwUD5V3A,7171
112
- pymammotion-0.1.4.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
113
- pymammotion-0.1.4.dist-info/METADATA,sha256=3HWIpIIRvA-gnH-SZ3qJH7mdieIwKy3hNEPLJ9eszA4,3922
114
- pymammotion-0.1.4.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
115
- pymammotion-0.1.4.dist-info/RECORD,,
112
+ pymammotion-0.1.5.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
113
+ pymammotion-0.1.5.dist-info/METADATA,sha256=lSXl_U8-dbyyJWwiHt_E0j6F3N4qdCrh8UY9IHpWm9c,3922
114
+ pymammotion-0.1.5.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
115
+ pymammotion-0.1.5.dist-info/RECORD,,