pymammotion 0.2.10__tar.gz → 0.5.53__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 (207) hide show
  1. pymammotion-0.5.53/.gitignore +237 -0
  2. {pymammotion-0.2.10 → pymammotion-0.5.53}/PKG-INFO +27 -33
  3. {pymammotion-0.2.10 → pymammotion-0.5.53}/README.md +1 -1
  4. {pymammotion-0.2.10 → pymammotion-0.5.53}/pymammotion/__init__.py +19 -13
  5. pymammotion-0.5.53/pymammotion/aliyun/client.py +235 -0
  6. pymammotion-0.5.53/pymammotion/aliyun/cloud_gateway.py +979 -0
  7. {pymammotion-0.2.10/pymammotion/aliyun/dataclass → pymammotion-0.5.53/pymammotion/aliyun/model}/aep_response.py +1 -2
  8. pymammotion-0.5.53/pymammotion/aliyun/model/dev_by_account_response.py +195 -0
  9. {pymammotion-0.2.10/pymammotion/aliyun/dataclass → pymammotion-0.5.53/pymammotion/aliyun/model}/login_by_oauth_response.py +2 -3
  10. {pymammotion-0.2.10/pymammotion/aliyun/dataclass → pymammotion-0.5.53/pymammotion/aliyun/model}/regions_response.py +4 -5
  11. {pymammotion-0.2.10/pymammotion/aliyun/dataclass → pymammotion-0.5.53/pymammotion/aliyun/model}/session_by_authcode_response.py +4 -3
  12. pymammotion-0.5.53/pymammotion/aliyun/model/thing_response.py +12 -0
  13. pymammotion-0.5.53/pymammotion/aliyun/regions.py +62 -0
  14. pymammotion-0.5.53/pymammotion/aliyun/tea/core.py +297 -0
  15. {pymammotion-0.2.10 → pymammotion-0.5.53}/pymammotion/bluetooth/ble.py +16 -20
  16. pymammotion-0.5.53/pymammotion/bluetooth/ble_message.py +686 -0
  17. {pymammotion-0.2.10 → pymammotion-0.5.53}/pymammotion/bluetooth/data/convert.py +1 -1
  18. {pymammotion-0.2.10 → pymammotion-0.5.53}/pymammotion/bluetooth/data/framectrldata.py +1 -1
  19. {pymammotion-0.2.10 → pymammotion-0.5.53}/pymammotion/bluetooth/data/notifydata.py +6 -6
  20. pymammotion-0.5.53/pymammotion/bluetooth/model/atomic_integer.py +54 -0
  21. {pymammotion-0.2.10 → pymammotion-0.5.53}/pymammotion/const.py +6 -2
  22. {pymammotion-0.2.10 → pymammotion-0.5.53}/pymammotion/data/model/__init__.py +2 -1
  23. {pymammotion-0.2.10 → pymammotion-0.5.53}/pymammotion/data/model/account.py +1 -1
  24. pymammotion-0.5.53/pymammotion/data/model/device.py +183 -0
  25. pymammotion-0.5.53/pymammotion/data/model/device_config.py +72 -0
  26. pymammotion-0.5.53/pymammotion/data/model/device_info.py +60 -0
  27. pymammotion-0.5.53/pymammotion/data/model/device_limits.py +49 -0
  28. {pymammotion-0.2.10 → pymammotion-0.5.53}/pymammotion/data/model/enums.py +14 -4
  29. pymammotion-0.5.53/pymammotion/data/model/errors.py +12 -0
  30. pymammotion-0.5.53/pymammotion/data/model/events.py +14 -0
  31. {pymammotion-0.2.10 → pymammotion-0.5.53}/pymammotion/data/model/excute_boarder_params.py +5 -5
  32. {pymammotion-0.2.10 → pymammotion-0.5.53}/pymammotion/data/model/execute_boarder.py +4 -4
  33. pymammotion-0.5.53/pymammotion/data/model/generate_geojson.py +551 -0
  34. pymammotion-0.5.53/pymammotion/data/model/generate_route_information.py +26 -0
  35. pymammotion-0.5.53/pymammotion/data/model/hash_list.py +459 -0
  36. pymammotion-0.5.53/pymammotion/data/model/location.py +36 -0
  37. pymammotion-0.5.53/pymammotion/data/model/mowing_modes.py +77 -0
  38. pymammotion-0.5.53/pymammotion/data/model/rapid_state.py +45 -0
  39. pymammotion-0.5.53/pymammotion/data/model/raw_data.py +215 -0
  40. {pymammotion-0.2.10 → pymammotion-0.5.53}/pymammotion/data/model/region_data.py +17 -14
  41. pymammotion-0.5.53/pymammotion/data/model/report_info.py +152 -0
  42. pymammotion-0.5.53/pymammotion/data/model/work.py +27 -0
  43. pymammotion-0.5.53/pymammotion/data/mower_state_manager.py +369 -0
  44. pymammotion-0.5.53/pymammotion/data/mqtt/event.py +223 -0
  45. pymammotion-0.5.53/pymammotion/data/mqtt/mammotion_properties.py +257 -0
  46. pymammotion-0.5.53/pymammotion/data/mqtt/properties.py +199 -0
  47. pymammotion-0.5.53/pymammotion/data/mqtt/status.py +53 -0
  48. pymammotion-0.5.53/pymammotion/event/event.py +96 -0
  49. pymammotion-0.5.53/pymammotion/homeassistant/__init__.py +3 -0
  50. pymammotion-0.5.53/pymammotion/homeassistant/mower_api.py +484 -0
  51. pymammotion-0.5.53/pymammotion/homeassistant/rtk_api.py +54 -0
  52. pymammotion-0.5.53/pymammotion/http/encryption.py +220 -0
  53. pymammotion-0.5.53/pymammotion/http/http.py +693 -0
  54. pymammotion-0.5.53/pymammotion/http/model/camera_stream.py +31 -0
  55. pymammotion-0.5.53/pymammotion/http/model/http.py +230 -0
  56. pymammotion-0.5.53/pymammotion/http/model/response_factory.py +61 -0
  57. pymammotion-0.5.53/pymammotion/http/model/rtk.py +16 -0
  58. pymammotion-0.5.53/pymammotion/mammotion/commands/abstract_message.py +24 -0
  59. pymammotion-0.5.53/pymammotion/mammotion/commands/mammotion_command.py +81 -0
  60. pymammotion-0.5.53/pymammotion/mammotion/commands/messages/basestation.py +43 -0
  61. pymammotion-0.5.53/pymammotion/mammotion/commands/messages/driver.py +122 -0
  62. pymammotion-0.5.53/pymammotion/mammotion/commands/messages/media.py +87 -0
  63. {pymammotion-0.2.10 → pymammotion-0.5.53}/pymammotion/mammotion/commands/messages/navigation.py +122 -96
  64. pymammotion-0.5.53/pymammotion/mammotion/commands/messages/network.py +205 -0
  65. pymammotion-0.5.53/pymammotion/mammotion/commands/messages/ota.py +38 -0
  66. pymammotion-0.5.53/pymammotion/mammotion/commands/messages/system.py +330 -0
  67. pymammotion-0.5.53/pymammotion/mammotion/commands/messages/video.py +33 -0
  68. {pymammotion-0.2.10 → pymammotion-0.5.53}/pymammotion/mammotion/control/joystick.py +17 -32
  69. pymammotion-0.5.53/pymammotion/mammotion/devices/__init__.py +29 -0
  70. pymammotion-0.5.53/pymammotion/mammotion/devices/base.py +163 -0
  71. pymammotion-0.5.53/pymammotion/mammotion/devices/mammotion.py +541 -0
  72. pymammotion-0.5.53/pymammotion/mammotion/devices/mammotion_bluetooth.py +497 -0
  73. pymammotion-0.5.53/pymammotion/mammotion/devices/mammotion_cloud.py +345 -0
  74. pymammotion-0.5.53/pymammotion/mammotion/devices/mammotion_mower_ble.py +49 -0
  75. pymammotion-0.5.53/pymammotion/mammotion/devices/mammotion_mower_cloud.py +39 -0
  76. pymammotion-0.5.53/pymammotion/mammotion/devices/managers/managers.py +81 -0
  77. pymammotion-0.5.53/pymammotion/mammotion/devices/mower_device.py +124 -0
  78. pymammotion-0.5.53/pymammotion/mammotion/devices/mower_manager.py +107 -0
  79. pymammotion-0.5.53/pymammotion/mammotion/devices/rtk_ble.py +89 -0
  80. pymammotion-0.5.53/pymammotion/mammotion/devices/rtk_cloud.py +113 -0
  81. pymammotion-0.5.53/pymammotion/mammotion/devices/rtk_device.py +50 -0
  82. pymammotion-0.5.53/pymammotion/mammotion/devices/rtk_manager.py +122 -0
  83. pymammotion-0.5.53/pymammotion/mqtt/__init__.py +6 -0
  84. pymammotion-0.2.10/pymammotion/mqtt/mammotion_mqtt.py → pymammotion-0.5.53/pymammotion/mqtt/aliyun_mqtt.py +82 -46
  85. pymammotion-0.5.53/pymammotion/mqtt/linkkit/__init__.py +5 -0
  86. pymammotion-0.5.53/pymammotion/mqtt/linkkit/h2client.py +585 -0
  87. pymammotion-0.5.53/pymammotion/mqtt/linkkit/linkkit.py +3023 -0
  88. {pymammotion-0.2.10 → pymammotion-0.5.53}/pymammotion/mqtt/mammotion_future.py +3 -2
  89. pymammotion-0.5.53/pymammotion/mqtt/mammotion_mqtt.py +214 -0
  90. pymammotion-0.5.53/pymammotion/mqtt/mqtt_models.py +66 -0
  91. pymammotion-0.5.53/pymammotion/proto/__init__.py +4841 -0
  92. {pymammotion-0.2.10 → pymammotion-0.5.53}/pymammotion/proto/basestation.proto +8 -0
  93. pymammotion-0.5.53/pymammotion/proto/basestation_pb2.py +35 -0
  94. {pymammotion-0.2.10 → pymammotion-0.5.53}/pymammotion/proto/basestation_pb2.pyi +16 -2
  95. {pymammotion-0.2.10 → pymammotion-0.5.53}/pymammotion/proto/dev_net.proto +79 -55
  96. pymammotion-0.5.53/pymammotion/proto/dev_net_pb2.py +111 -0
  97. {pymammotion-0.2.10 → pymammotion-0.5.53}/pymammotion/proto/dev_net_pb2.pyi +49 -6
  98. {pymammotion-0.2.10 → pymammotion-0.5.53}/pymammotion/proto/luba_msg.proto +2 -1
  99. {pymammotion-0.2.10 → pymammotion-0.5.53}/pymammotion/proto/luba_msg_pb2.py +6 -6
  100. {pymammotion-0.2.10 → pymammotion-0.5.53}/pymammotion/proto/luba_msg_pb2.pyi +1 -0
  101. {pymammotion-0.2.10 → pymammotion-0.5.53}/pymammotion/proto/luba_mul.proto +62 -1
  102. pymammotion-0.5.53/pymammotion/proto/luba_mul_pb2.py +61 -0
  103. pymammotion-0.5.53/pymammotion/proto/luba_mul_pb2.pyi +178 -0
  104. {pymammotion-0.2.10 → pymammotion-0.5.53}/pymammotion/proto/mctrl_driver.proto +44 -4
  105. pymammotion-0.5.53/pymammotion/proto/mctrl_driver_pb2.py +57 -0
  106. {pymammotion-0.2.10 → pymammotion-0.5.53}/pymammotion/proto/mctrl_driver_pb2.pyi +66 -11
  107. {pymammotion-0.2.10 → pymammotion-0.5.53}/pymammotion/proto/mctrl_nav.proto +98 -54
  108. pymammotion-0.5.53/pymammotion/proto/mctrl_nav_pb2.py +136 -0
  109. {pymammotion-0.2.10 → pymammotion-0.5.53}/pymammotion/proto/mctrl_nav_pb2.pyi +142 -56
  110. pymammotion-0.5.53/pymammotion/proto/mctrl_ota.proto +80 -0
  111. pymammotion-0.5.53/pymammotion/proto/mctrl_ota_pb2.py +45 -0
  112. pymammotion-0.5.53/pymammotion/proto/mctrl_ota_pb2.pyi +128 -0
  113. {pymammotion-0.2.10 → pymammotion-0.5.53}/pymammotion/proto/mctrl_pept.proto +8 -3
  114. pymammotion-0.5.53/pymammotion/proto/mctrl_pept_pb2.py +33 -0
  115. {pymammotion-0.2.10 → pymammotion-0.5.53}/pymammotion/proto/mctrl_pept_pb2.pyi +14 -6
  116. {pymammotion-0.2.10 → pymammotion-0.5.53}/pymammotion/proto/mctrl_sys.proto +336 -82
  117. pymammotion-0.5.53/pymammotion/proto/mctrl_sys_pb2.py +206 -0
  118. {pymammotion-0.2.10 → pymammotion-0.5.53}/pymammotion/proto/mctrl_sys_pb2.pyi +450 -24
  119. pymammotion-0.5.53/pymammotion/proto/message_pool.py +3 -0
  120. pymammotion-0.5.53/pymammotion/proto/py.typed +0 -0
  121. pymammotion-0.5.53/pymammotion/py.typed +0 -0
  122. pymammotion-0.5.53/pymammotion/utility/constant/__init__.py +3 -0
  123. {pymammotion-0.2.10 → pymammotion-0.5.53}/pymammotion/utility/constant/device_constant.py +66 -22
  124. pymammotion-0.5.53/pymammotion/utility/conversions.py +5 -0
  125. {pymammotion-0.2.10 → pymammotion-0.5.53}/pymammotion/utility/datatype_converter.py +16 -15
  126. pymammotion-0.5.53/pymammotion/utility/device_config.py +755 -0
  127. pymammotion-0.5.53/pymammotion/utility/device_type.py +489 -0
  128. pymammotion-0.5.53/pymammotion/utility/map.py +259 -0
  129. pymammotion-0.5.53/pymammotion/utility/movement.py +18 -0
  130. pymammotion-0.5.53/pymammotion/utility/mur_mur_hash.py +159 -0
  131. {pymammotion-0.2.10 → pymammotion-0.5.53}/pymammotion/utility/periodic.py +5 -5
  132. {pymammotion-0.2.10 → pymammotion-0.5.53}/pymammotion/utility/rocker_util.py +1 -1
  133. {pymammotion-0.2.10 → pymammotion-0.5.53}/pyproject.toml +121 -140
  134. pymammotion-0.2.10/pymammotion/aliyun/cloud_gateway.py +0 -600
  135. pymammotion-0.2.10/pymammotion/aliyun/cloud_service.py +0 -65
  136. pymammotion-0.2.10/pymammotion/aliyun/dataclass/dev_by_account_response.py +0 -47
  137. pymammotion-0.2.10/pymammotion/bluetooth/ble_message.py +0 -406
  138. pymammotion-0.2.10/pymammotion/data/model/device.py +0 -306
  139. pymammotion-0.2.10/pymammotion/data/model/device_config.py +0 -9
  140. pymammotion-0.2.10/pymammotion/data/model/generate_route_information.py +0 -133
  141. pymammotion-0.2.10/pymammotion/data/model/hash_list.py +0 -42
  142. pymammotion-0.2.10/pymammotion/data/model/location.py +0 -38
  143. pymammotion-0.2.10/pymammotion/data/model/mowing_modes.py +0 -46
  144. pymammotion-0.2.10/pymammotion/data/model/plan.py +0 -58
  145. pymammotion-0.2.10/pymammotion/data/model/rapid_state.py +0 -41
  146. pymammotion-0.2.10/pymammotion/data/model/report_info.py +0 -146
  147. pymammotion-0.2.10/pymammotion/data/mqtt/event.py +0 -121
  148. pymammotion-0.2.10/pymammotion/data/mqtt/properties.py +0 -140
  149. pymammotion-0.2.10/pymammotion/data/mqtt/status.py +0 -52
  150. pymammotion-0.2.10/pymammotion/data/state_manager.py +0 -83
  151. pymammotion-0.2.10/pymammotion/event/event.py +0 -65
  152. pymammotion-0.2.10/pymammotion/http/http.py +0 -77
  153. pymammotion-0.2.10/pymammotion/mammotion/commands/abstract_message.py +0 -10
  154. pymammotion-0.2.10/pymammotion/mammotion/commands/mammotion_command.py +0 -40
  155. pymammotion-0.2.10/pymammotion/mammotion/commands/messages/driver.py +0 -94
  156. pymammotion-0.2.10/pymammotion/mammotion/commands/messages/media.py +0 -31
  157. pymammotion-0.2.10/pymammotion/mammotion/commands/messages/network.py +0 -216
  158. pymammotion-0.2.10/pymammotion/mammotion/commands/messages/ota.py +0 -34
  159. pymammotion-0.2.10/pymammotion/mammotion/commands/messages/system.py +0 -251
  160. pymammotion-0.2.10/pymammotion/mammotion/commands/messages/video.py +0 -25
  161. pymammotion-0.2.10/pymammotion/mammotion/devices/__init__.py +0 -5
  162. pymammotion-0.2.10/pymammotion/mammotion/devices/mammotion.py +0 -1164
  163. pymammotion-0.2.10/pymammotion/mqtt/__init__.py +0 -5
  164. pymammotion-0.2.10/pymammotion/proto/basestation.py +0 -59
  165. pymammotion-0.2.10/pymammotion/proto/basestation_pb2.py +0 -33
  166. pymammotion-0.2.10/pymammotion/proto/common.py +0 -12
  167. pymammotion-0.2.10/pymammotion/proto/dev_net.py +0 -381
  168. pymammotion-0.2.10/pymammotion/proto/dev_net_pb2.py +0 -107
  169. pymammotion-0.2.10/pymammotion/proto/luba_msg.py +0 -81
  170. pymammotion-0.2.10/pymammotion/proto/luba_mul.py +0 -76
  171. pymammotion-0.2.10/pymammotion/proto/luba_mul_pb2.py +0 -45
  172. pymammotion-0.2.10/pymammotion/proto/luba_mul_pb2.pyi +0 -91
  173. pymammotion-0.2.10/pymammotion/proto/mctrl_driver.py +0 -100
  174. pymammotion-0.2.10/pymammotion/proto/mctrl_driver_pb2.py +0 -45
  175. pymammotion-0.2.10/pymammotion/proto/mctrl_nav.py +0 -661
  176. pymammotion-0.2.10/pymammotion/proto/mctrl_nav_pb2.py +0 -128
  177. pymammotion-0.2.10/pymammotion/proto/mctrl_ota.proto +0 -42
  178. pymammotion-0.2.10/pymammotion/proto/mctrl_ota.py +0 -48
  179. pymammotion-0.2.10/pymammotion/proto/mctrl_ota_pb2.py +0 -35
  180. pymammotion-0.2.10/pymammotion/proto/mctrl_ota_pb2.pyi +0 -65
  181. pymammotion-0.2.10/pymammotion/proto/mctrl_pept.py +0 -41
  182. pymammotion-0.2.10/pymammotion/proto/mctrl_pept_pb2.py +0 -31
  183. pymammotion-0.2.10/pymammotion/proto/mctrl_sys.py +0 -573
  184. pymammotion-0.2.10/pymammotion/proto/mctrl_sys_pb2.py +0 -142
  185. pymammotion-0.2.10/pymammotion/utility/constant/__init__.py +0 -1
  186. pymammotion-0.2.10/pymammotion/utility/device_type.py +0 -264
  187. pymammotion-0.2.10/pymammotion/utility/map.py +0 -72
  188. {pymammotion-0.2.10 → pymammotion-0.5.53}/LICENSE +0 -0
  189. {pymammotion-0.2.10 → pymammotion-0.5.53}/pymammotion/aliyun/__init__.py +0 -0
  190. {pymammotion-0.2.10/pymammotion/aliyun/dataclass → pymammotion-0.5.53/pymammotion/aliyun/model}/connect_response.py +0 -0
  191. {pymammotion-0.2.10 → pymammotion-0.5.53}/pymammotion/aliyun/tmp_constant.py +0 -0
  192. {pymammotion-0.2.10 → pymammotion-0.5.53}/pymammotion/bluetooth/__init__.py +0 -0
  193. {pymammotion-0.2.10 → pymammotion-0.5.53}/pymammotion/bluetooth/const.py +0 -0
  194. {pymammotion-0.2.10 → pymammotion-0.5.53}/pymammotion/bluetooth/data/__init__.py +0 -0
  195. {pymammotion-0.2.10/pymammotion/data → pymammotion-0.5.53/pymammotion/bluetooth/model}/__init__.py +0 -0
  196. {pymammotion-0.2.10/pymammotion/mammotion → pymammotion-0.5.53/pymammotion/data}/__init__.py +0 -0
  197. {pymammotion-0.2.10 → pymammotion-0.5.53}/pymammotion/data/mqtt/__init__.py +0 -0
  198. {pymammotion-0.2.10 → pymammotion-0.5.53}/pymammotion/event/__init__.py +0 -0
  199. {pymammotion-0.2.10/pymammotion/mammotion/commands → pymammotion-0.5.53/pymammotion/http}/__init__.py +0 -0
  200. {pymammotion-0.2.10/pymammotion/mammotion/commands/messages → pymammotion-0.5.53/pymammotion/http/model}/__init__.py +0 -0
  201. {pymammotion-0.2.10/pymammotion/mammotion/control → pymammotion-0.5.53/pymammotion/mammotion}/__init__.py +0 -0
  202. {pymammotion-0.2.10/pymammotion/proto → pymammotion-0.5.53/pymammotion/mammotion/commands}/__init__.py +0 -0
  203. /pymammotion-0.2.10/pymammotion/http/_init_.py → /pymammotion-0.5.53/pymammotion/mammotion/commands/messages/__init__.py +0 -0
  204. /pymammotion-0.2.10/pymammotion/py.typed → /pymammotion-0.5.53/pymammotion/mammotion/control/__init__.py +0 -0
  205. {pymammotion-0.2.10 → pymammotion-0.5.53}/pymammotion/proto/common.proto +0 -0
  206. {pymammotion-0.2.10 → pymammotion-0.5.53}/pymammotion/proto/common_pb2.py +0 -0
  207. {pymammotion-0.2.10 → pymammotion-0.5.53}/pymammotion/proto/common_pb2.pyi +0 -0
@@ -0,0 +1,237 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64
19
+ lib64/
20
+ bin/
21
+ parts/
22
+ sdist/
23
+ var/
24
+ wheels/
25
+ share/python-wheels/
26
+ *.egg-info/
27
+ .installed.cfg
28
+ *.egg
29
+ MANIFEST
30
+
31
+ # PyInstaller
32
+ # Usually these files are written by a python script from a template
33
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
34
+ *.manifest
35
+ *.spec
36
+
37
+ # Installer logs
38
+ pip-log.txt
39
+ pip-delete-this-directory.txt
40
+
41
+ # Unit test / coverage reports
42
+ htmlcov/
43
+ .tox/
44
+ .nox/
45
+ .coverage
46
+ .coverage.*
47
+ .cache
48
+ nosetests.xml
49
+ coverage.xml
50
+ *.cover
51
+ *.py,cover
52
+ .hypothesis/
53
+ .pytest_cache/
54
+ cover/
55
+
56
+ # Translations
57
+ *.mo
58
+ *.pot
59
+
60
+ # Django stuff:
61
+ *.log
62
+ local_settings.py
63
+ db.sqlite3
64
+ db.sqlite3-journal
65
+
66
+ # Flask stuff:
67
+ instance/
68
+ .webassets-cache
69
+
70
+ # Scrapy stuff:
71
+ .scrapy
72
+
73
+ # Sphinx documentation
74
+ docs/_build/
75
+
76
+ # PyBuilder
77
+ .pybuilder/
78
+ target/
79
+
80
+ # Jupyter Notebook
81
+ .ipynb_checkpoints
82
+
83
+ # IPython
84
+ profile_default/
85
+ ipython_config.py
86
+
87
+ # pyenv
88
+ # For a library or package, you might want to ignore these files since the code is
89
+ # intended to run in multiple environments; otherwise, check them in:
90
+ # .python-version
91
+ pyvenv.cfg
92
+
93
+ # pipenv
94
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
95
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
96
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
97
+ # install all needed dependencies.
98
+ #Pipfile.lock
99
+
100
+ # poetry
101
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
102
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
103
+ # commonly ignored for libraries.
104
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
105
+ #poetry.lock
106
+
107
+ # pdm
108
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
109
+ #pdm.lock
110
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
111
+ # in version control.
112
+ # https://pdm.fming.dev/#use-with-ide
113
+ .pdm.toml
114
+
115
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
116
+ __pypackages__/
117
+
118
+ # Celery stuff
119
+ celerybeat-schedule
120
+ celerybeat.pid
121
+
122
+ # SageMath parsed files
123
+ *.sage.py
124
+
125
+ # Environments
126
+ .env
127
+ .venv
128
+ env/
129
+ venv/
130
+ ENV/
131
+ env.bak/
132
+ venv.bak/
133
+
134
+ # Spyder project settings
135
+ .spyderproject
136
+ .spyproject
137
+
138
+ # Rope project settings
139
+ .ropeproject
140
+
141
+ # mkdocs documentation
142
+ /site
143
+
144
+ # mypy
145
+ .mypy_cache/
146
+ .dmypy.json
147
+ dmypy.json
148
+
149
+ # Pyre type checker
150
+ .pyre/
151
+
152
+ # pytype static type analyzer
153
+ .pytype/
154
+
155
+ # Cython debug symbols
156
+ cython_debug/
157
+
158
+ # PyCharm
159
+ # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
160
+ # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
161
+
162
+ # User-specific stuff
163
+ .idea/**/workspace.xml
164
+ .idea/**/tasks.xml
165
+ .idea/**/usage.statistics.xml
166
+ .idea/**/dictionaries
167
+ .idea/**/shelf
168
+
169
+ # AWS User-specific
170
+ .idea/**/aws.xml
171
+
172
+ # Generated files
173
+ .idea/**/contentModel.xml
174
+
175
+ # Sensitive or high-churn files
176
+ .idea/**/dataSources/
177
+ .idea/**/dataSources.ids
178
+ .idea/**/dataSources.local.xml
179
+ .idea/**/sqlDataSources.xml
180
+ .idea/**/dynamic.xml
181
+ .idea/**/uiDesigner.xml
182
+ .idea/**/dbnavigator.xml
183
+
184
+ # Gradle
185
+ .idea/**/gradle.xml
186
+ .idea/**/libraries
187
+
188
+ # Gradle and Maven with auto-import
189
+ # When using Gradle or Maven with auto-import, you should exclude module files,
190
+ # since they will be recreated, and may cause churn. Uncomment if using
191
+ # auto-import.
192
+ # .idea/artifacts
193
+ # .idea/compiler.xml
194
+ # .idea/jarRepositories.xml
195
+ # .idea/modules.xml
196
+ # .idea/*.iml
197
+ # .idea/modules
198
+ # *.iml
199
+ # *.ipr
200
+
201
+ # CMake
202
+ cmake-build-*/
203
+
204
+ # Mongo Explorer plugin
205
+ .idea/**/mongoSettings.xml
206
+
207
+ # File-based project format
208
+ *.iws
209
+
210
+ # IntelliJ
211
+ out/
212
+
213
+ # mpeltonen/sbt-idea plugin
214
+ .idea_modules/
215
+
216
+ # JIRA plugin
217
+ atlassian-ide-plugin.xml
218
+
219
+ # Cursive Clojure plugin
220
+ .idea/replstate.xml
221
+
222
+ # SonarLint plugin
223
+ .idea/sonarlint/
224
+
225
+ # Crashlytics plugin (for Android Studio and IntelliJ)
226
+ com_crashlytics_export_strings.xml
227
+ crashlytics.properties
228
+ crashlytics-build.properties
229
+ fabric.properties
230
+
231
+ # Editor-based Rest Client
232
+ .idea/httpRequests
233
+
234
+ # Android studio 3.1+ serialized cache file
235
+ .idea/caches/build_file_checksums.ser
236
+ scripts.txt
237
+ .idea
@@ -1,35 +1,30 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: pymammotion
3
- Version: 0.2.10
4
- Summary:
5
- License: GNU-3.0
6
- Author: Michael Arthur
7
- Author-email: michael@jumblesoft.co.nz
8
- Requires-Python: >=3.10,<3.13
9
- Classifier: License :: Other/Proprietary License
10
- Classifier: Programming Language :: Python :: 3
11
- Classifier: Programming Language :: Python :: 3.10
12
- Classifier: Programming Language :: Python :: 3.11
13
- Classifier: Programming Language :: Python :: 3.12
14
- Requires-Dist: aiohttp (>=3.9.1,<4.0.0)
15
- Requires-Dist: alibabacloud-apigateway-util (>=0.0.2,<0.0.3)
16
- Requires-Dist: alibabacloud-iot-api-gateway (>=0.0.4,<0.0.5)
17
- Requires-Dist: alicloud-gateway-iot (>=1.0.0,<2.0.0)
18
- Requires-Dist: aliyun-iot-linkkit (>=1.2.12,<2.0.0)
19
- Requires-Dist: aliyun-python-sdk-iot (>=8.57.0,<9.0.0)
20
- Requires-Dist: async-timeout (>=4.0.3,<5.0.0)
21
- Requires-Dist: betterproto (>=1.2.5,<2.0.0)
22
- Requires-Dist: bleak (>=0.21.0)
23
- Requires-Dist: bleak-retry-connector (>=3.5.0,<4.0.0)
24
- Requires-Dist: jsonic (>=1.0.0,<2.0.0)
25
- Requires-Dist: mashumaro (>=3.13,<4.0)
26
- Requires-Dist: nest-asyncio (>=1.6.0,<2.0.0)
27
- Requires-Dist: numpy (>=1.26.0,<2.0.0)
28
- Requires-Dist: orjson (>=3.9.15,<4.0.0)
29
- Requires-Dist: paho-mqtt (>=1.6.1,<2.0.0)
30
- Requires-Dist: protobuf (>=4.23.1)
31
- Requires-Dist: py-jsonic (>=0.0.2,<0.0.3)
32
- Requires-Dist: pyjoystick (>=1.2.4,<2.0.0)
3
+ Version: 0.5.53
4
+ Author: jLynx
5
+ Author-email: Michael Arthur <michael@jumblesoft.co.nz>
6
+ License-Expression: GPL-3.0
7
+ License-File: LICENSE
8
+ Requires-Python: <4.0,>=3.12
9
+ Requires-Dist: aiohttp>=3.9.1
10
+ Requires-Dist: alibabacloud-apigateway-util<0.0.3,>=0.0.2
11
+ Requires-Dist: alibabacloud-iot-api-gateway<0.0.5,>=0.0.4
12
+ Requires-Dist: alicloud-gateway-iot<2,>=1.0.0
13
+ Requires-Dist: async-timeout<5,>=4.0.3
14
+ Requires-Dist: betterproto2>=0.9.1
15
+ Requires-Dist: bleak-retry-connector>=3.5.0
16
+ Requires-Dist: bleak>=0.21.0
17
+ Requires-Dist: crcmod~=1.7
18
+ Requires-Dist: cryptography>=43.0.1
19
+ Requires-Dist: jsonic<2,>=1.0.0
20
+ Requires-Dist: mashumaro~=3.13
21
+ Requires-Dist: numpy>=1.26.0
22
+ Requires-Dist: orjson<4,>=3.9.15
23
+ Requires-Dist: paho-mqtt<3,>=2.1.0
24
+ Requires-Dist: protobuf>=4.23.1
25
+ Requires-Dist: py-jsonic<0.0.3,>=0.0.2
26
+ Requires-Dist: pyjwt>=2.10.1
27
+ Requires-Dist: shapely>=2.1.2
33
28
  Description-Content-Type: text/markdown
34
29
 
35
30
  # PyMammotion - Python API for Mammotion Mowers [![Discord](https://img.shields.io/discord/1247286396297678879)](https://discord.gg/vpZdWhJX8x)
@@ -70,7 +65,7 @@ pip install pymammotion
70
65
  PyMammotion uses `betterproto` and `protoc` for generating protobuf models. To set up the development environment:
71
66
 
72
67
  1. Clone the repository
73
- 2. ???
68
+ 2. poetry install --with=dev
74
69
  3. Profit
75
70
 
76
71
  ## Contributing 🤝
@@ -98,4 +93,3 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
98
93
 
99
94
  The trademarks "Mammotion," "Luba," and "Yuka" referenced herein are registered trademarks of their respective owners. The author of this software repository is not affiliated with, endorsed by, or connected to these trademark owners in any way.
100
95
 
101
-
@@ -36,7 +36,7 @@ pip install pymammotion
36
36
  PyMammotion uses `betterproto` and `protoc` for generating protobuf models. To set up the development environment:
37
37
 
38
38
  1. Clone the repository
39
- 2. ???
39
+ 2. poetry install --with=dev
40
40
  3. Profit
41
41
 
42
42
  ## Contributing 🤝
@@ -8,18 +8,21 @@ import asyncio
8
8
  import logging
9
9
  import os
10
10
 
11
+ from pymammotion.aliyun.cloud_gateway import CloudIOTGateway
12
+
11
13
  # works outside HA on its own
12
- from pymammotion.bluetooth.ble import LubaBLE
13
- from pymammotion.http.http import MammotionHTTP, connect_http
14
+ from pymammotion.bluetooth.ble import MammotionBLE
15
+ from pymammotion.http.http import MammotionHTTP
14
16
 
15
17
  # TODO make a working device that will work outside HA too.
16
- from pymammotion.mammotion.devices import MammotionBaseBLEDevice
17
- from pymammotion.mqtt import MammotionMQTT
18
-
19
- __all__ = ["LubaBLE", "MammotionHTTP", "connect_http", "MammotionBaseBLEDevice", "MammotionMQTT"]
18
+ from pymammotion.mqtt import AliyunMQTT, MammotionMQTT
20
19
 
21
20
  logger = logging.getLogger(__name__)
22
21
 
22
+
23
+ __all__ = ["MammotionBLE", "MammotionHTTP", "AliyunMQTT", "MammotionMQTT", "logger"]
24
+
25
+
23
26
  # TODO provide interface to pick between mqtt/cloud/bluetooth
24
27
 
25
28
  if __name__ == "__main__":
@@ -32,13 +35,16 @@ if __name__ == "__main__":
32
35
  CLIENT_ID = os.environ.get("CLIENT_ID")
33
36
  IOT_TOKEN = os.environ.get("IOT_TOKEN")
34
37
  REGION = os.environ.get("REGION")
35
- luba = MammotionMQTT(
36
- iot_token=IOT_TOKEN,
37
- region_id=REGION,
38
- product_key=PRODUCT_KEY,
39
- device_name=DEVICE_NAME,
40
- device_secret=DEVICE_SECRET,
41
- client_id=CLIENT_ID,
38
+ mammotion_http = MammotionHTTP()
39
+ cloud_client = CloudIOTGateway(mammotion_http)
40
+ luba = AliyunMQTT(
41
+ iot_token=IOT_TOKEN or "",
42
+ region_id=REGION or "",
43
+ product_key=PRODUCT_KEY or "",
44
+ device_name=DEVICE_NAME or "",
45
+ device_secret=DEVICE_SECRET or "",
46
+ client_id=CLIENT_ID or "",
47
+ cloud_client=cloud_client,
42
48
  )
43
49
  luba.connect_async()
44
50
 
@@ -0,0 +1,235 @@
1
+ from datetime import UTC, datetime
2
+ import time
3
+
4
+ from Tea.exceptions import UnretryableException
5
+ from Tea.request import TeaRequest
6
+
7
+ from pymammotion.aliyun.tea.core import TeaCore
8
+
9
+ try:
10
+ from typing import Dict
11
+ except ImportError:
12
+ pass
13
+
14
+ from alibabacloud_apigateway_util.client import Client as APIGatewayUtilClient
15
+ from alibabacloud_tea_util.client import Client as UtilClient
16
+
17
+
18
+ class Client:
19
+ """test"""
20
+
21
+ _app_key = None # type: str
22
+ _app_secret = None # type: str
23
+ _protocol = None # type: str
24
+ _user_agent = None # type: str
25
+ _read_timeout = None # type: int
26
+ _connect_timeout = None # type: int
27
+ _http_proxy = None # type: str
28
+ _https_proxy = None # type: str
29
+ _no_proxy = None # type: str
30
+ _max_idle_conns = None # type: int
31
+ _domain = None # type: str
32
+
33
+ def __init__(self, config) -> None:
34
+ self._domain = config.domain
35
+ self._app_key = config.app_key
36
+ self._app_secret = config.app_secret
37
+ self._protocol = config.protocol
38
+ self._read_timeout = config.read_timeout
39
+ self._connect_timeout = config.connect_timeout
40
+ self._http_proxy = config.http_proxy
41
+ self._https_proxy = config.https_proxy
42
+ self._no_proxy = config.no_proxy
43
+ self._max_idle_conns = config.max_idle_conns
44
+
45
+ def do_request(self, pathname, protocol, method, header, body, runtime):
46
+ """Send request
47
+
48
+ @type pathname: str
49
+ @param pathname: the url path
50
+
51
+ @type protocol: str
52
+ @param protocol: http or https
53
+
54
+ @type method: str
55
+ @param method: example GET
56
+
57
+ @type header: Dict[str, str]
58
+ @param header: request header
59
+
60
+ @type body: iot_api_gateway_models.IoTApiRequest
61
+ @param body: the object of IoTApiRequest
62
+
63
+ @type runtime: util_models.RuntimeOptions
64
+ @param runtime: which controls some details of call api, such as retry times
65
+
66
+ @rtype: TeaResponse
67
+ @return: the response
68
+ """
69
+ body.validate()
70
+ runtime.validate()
71
+ _runtime = {
72
+ "timeouted": "retry",
73
+ "readTimeout": UtilClient.default_number(runtime.read_timeout, self._read_timeout),
74
+ "connectTimeout": UtilClient.default_number(runtime.connect_timeout, self._connect_timeout),
75
+ "httpProxy": UtilClient.default_string(runtime.http_proxy, self._http_proxy),
76
+ "httpsProxy": UtilClient.default_string(runtime.https_proxy, self._https_proxy),
77
+ "noProxy": UtilClient.default_string(runtime.no_proxy, self._no_proxy),
78
+ "maxIdleConns": UtilClient.default_number(runtime.max_idle_conns, self._max_idle_conns),
79
+ "retry": {
80
+ "retryable": runtime.autoretry,
81
+ "maxAttempts": UtilClient.default_number(runtime.max_attempts, 3),
82
+ },
83
+ "backoff": {
84
+ "policy": UtilClient.default_string(runtime.backoff_policy, "yes"),
85
+ "period": UtilClient.default_number(runtime.backoff_period, 1),
86
+ },
87
+ "ignoreSSL": runtime.ignore_ssl,
88
+ }
89
+ _last_request = None
90
+ _last_exception = None
91
+ _now = time.time()
92
+ _retry_times = 0
93
+ while TeaCore.allow_retry(_runtime.get("retry"), _retry_times, _now):
94
+ if _retry_times > 0:
95
+ _backoff_time = TeaCore.get_backoff_time(_runtime.get("backoff"), _retry_times)
96
+ if _backoff_time > 0:
97
+ TeaCore.sleep(_backoff_time)
98
+ _retry_times = _retry_times + 1
99
+ try:
100
+ _request = TeaRequest()
101
+ _request.protocol = UtilClient.default_string(self._protocol, protocol)
102
+ _request.method = UtilClient.default_string(method, "POST")
103
+ _request.pathname = pathname
104
+ _request.headers = TeaCore.merge(
105
+ {
106
+ "host": self._domain,
107
+ "date": datetime.now(UTC).strftime("%a, %d %b %Y %H:%M:%S GMT"),
108
+ "x-ca-nonce": UtilClient.get_nonce(),
109
+ "x-ca-key": self._app_key,
110
+ "x-ca-signaturemethod": "HmacSHA256",
111
+ "accept": "application/json",
112
+ "user-agent": self.get_user_agent(),
113
+ },
114
+ header,
115
+ )
116
+ if UtilClient.empty(body.id):
117
+ body.id = UtilClient.get_nonce()
118
+ if not UtilClient.is_unset(body):
119
+ _request.headers["content-type"] = "application/octet-stream"
120
+ _request.headers["content-md5"] = APIGatewayUtilClient.get_content_md5(
121
+ UtilClient.to_jsonstring(TeaCore.to_map(body))
122
+ )
123
+ _request.body = UtilClient.to_jsonstring(TeaCore.to_map(body))
124
+ _request.headers["x-ca-signature"] = APIGatewayUtilClient.get_signature(_request, self._app_secret)
125
+ _last_request = _request
126
+ _response = TeaCore.do_action(_request, _runtime)
127
+ if _response.body.get("code") == 20056:
128
+ raise Exception("Gateway timeout.")
129
+
130
+ return _response
131
+ except Exception as e:
132
+ if TeaCore.is_retryable(e):
133
+ _last_exception = e
134
+ continue
135
+ raise e
136
+ raise UnretryableException(_last_request, _last_exception)
137
+
138
+ async def async_do_request(self, pathname, protocol, method, header, body, runtime):
139
+ """Send request
140
+
141
+ @type pathname: str
142
+ @param pathname: the url path
143
+
144
+ @type protocol: str
145
+ @param protocol: http or https
146
+
147
+ @type method: str
148
+ @param method: example GET
149
+
150
+ @type header: Dict[str, str]
151
+ @param header: request header
152
+
153
+ @type body: iot_api_gateway_models.IoTApiRequest
154
+ @param body: the object of IoTApiRequest
155
+
156
+ @type runtime: util_models.RuntimeOptions
157
+ @param runtime: which controls some details of call api, such as retry times
158
+
159
+ @rtype: TeaResponse
160
+ @return: the response
161
+ """
162
+ body.validate()
163
+ runtime.validate()
164
+ _runtime = {
165
+ "timeouted": "retry",
166
+ "readTimeout": UtilClient.default_number(runtime.read_timeout, self._read_timeout),
167
+ "connectTimeout": UtilClient.default_number(runtime.connect_timeout, self._connect_timeout),
168
+ "httpProxy": UtilClient.default_string(runtime.http_proxy, self._http_proxy),
169
+ "httpsProxy": UtilClient.default_string(runtime.https_proxy, self._https_proxy),
170
+ "noProxy": UtilClient.default_string(runtime.no_proxy, self._no_proxy),
171
+ "maxIdleConns": UtilClient.default_number(runtime.max_idle_conns, self._max_idle_conns),
172
+ "retry": {
173
+ "retryable": runtime.autoretry,
174
+ "maxAttempts": UtilClient.default_number(runtime.max_attempts, 3),
175
+ },
176
+ "backoff": {
177
+ "policy": UtilClient.default_string(runtime.backoff_policy, "yes"),
178
+ "period": UtilClient.default_number(runtime.backoff_period, 1),
179
+ },
180
+ "ignoreSSL": runtime.ignore_ssl,
181
+ }
182
+ _last_request = None
183
+ _last_exception = None
184
+ _now = time.time()
185
+ _retry_times = 0
186
+ while TeaCore.allow_retry(_runtime.get("retry"), _retry_times, _now):
187
+ if _retry_times > 0:
188
+ _backoff_time = TeaCore.get_backoff_time(_runtime.get("backoff"), _retry_times)
189
+ if _backoff_time > 0:
190
+ await TeaCore.sleep_async(_backoff_time)
191
+ _retry_times = _retry_times + 1
192
+ try:
193
+ _request = TeaRequest()
194
+ _request.protocol = UtilClient.default_string(self._protocol, protocol)
195
+ _request.method = UtilClient.default_string(method, "POST")
196
+ _request.pathname = pathname
197
+ _request.headers = TeaCore.merge(
198
+ {
199
+ "host": self._domain,
200
+ "date": UtilClient.get_date_utcstring(),
201
+ "x-ca-nonce": UtilClient.get_nonce(),
202
+ "x-ca-key": self._app_key,
203
+ "x-ca-signaturemethod": "HmacSHA256",
204
+ "accept": "application/json",
205
+ "user-agent": self.get_user_agent(),
206
+ },
207
+ header,
208
+ )
209
+ if UtilClient.empty(body.id):
210
+ body.id = UtilClient.get_nonce()
211
+ if not UtilClient.is_unset(body):
212
+ _request.headers["content-type"] = "application/octet-stream"
213
+ _request.headers["content-md5"] = APIGatewayUtilClient.get_content_md5(
214
+ UtilClient.to_jsonstring(TeaCore.to_map(body))
215
+ )
216
+ _request.body = UtilClient.to_jsonstring(TeaCore.to_map(body))
217
+ _request.headers["x-ca-signature"] = APIGatewayUtilClient.get_signature(_request, self._app_secret)
218
+ _last_request = _request
219
+ _response = await TeaCore.async_do_action(_request, _runtime)
220
+ return _response
221
+ except Exception as e:
222
+ if TeaCore.is_retryable(e):
223
+ _last_exception = e
224
+ continue
225
+ raise e
226
+ raise UnretryableException(_last_request, _last_exception)
227
+
228
+ def get_user_agent(self):
229
+ """Get user agent
230
+
231
+ @rtype: str
232
+ @return: user agent
233
+ """
234
+ user_agent = UtilClient.get_user_agent(self._user_agent)
235
+ return user_agent