pymammotion 0.0.49__tar.gz → 0.0.51__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 (108) hide show
  1. {pymammotion-0.0.49 → pymammotion-0.0.51}/PKG-INFO +1 -1
  2. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/data/model/device.py +73 -29
  3. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/mammotion/devices/mammotion.py +3 -7
  4. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/utility/constant/device_constant.py +1 -1
  5. {pymammotion-0.0.49 → pymammotion-0.0.51}/pyproject.toml +2 -3
  6. {pymammotion-0.0.49 → pymammotion-0.0.51}/LICENSE +0 -0
  7. {pymammotion-0.0.49 → pymammotion-0.0.51}/README.md +0 -0
  8. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/__init__.py +0 -0
  9. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/aliyun/__init__.py +0 -0
  10. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/aliyun/cloud_gateway.py +0 -0
  11. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/aliyun/cloud_service.py +0 -0
  12. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/aliyun/dataclass/aep_response.py +0 -0
  13. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/aliyun/dataclass/connect_response.py +0 -0
  14. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/aliyun/dataclass/dev_by_account_response.py +0 -0
  15. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/aliyun/dataclass/login_by_oauth_response.py +0 -0
  16. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/aliyun/dataclass/regions_response.py +0 -0
  17. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/aliyun/dataclass/session_by_authcode_response.py +0 -0
  18. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/aliyun/tmp_constant.py +0 -0
  19. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/bluetooth/__init__.py +0 -0
  20. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/bluetooth/ble.py +0 -0
  21. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/bluetooth/ble_message.py +0 -0
  22. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/bluetooth/const.py +0 -0
  23. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/bluetooth/data/__init__.py +0 -0
  24. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/bluetooth/data/convert.py +0 -0
  25. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/bluetooth/data/framectrldata.py +0 -0
  26. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/bluetooth/data/notifydata.py +0 -0
  27. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/const.py +0 -0
  28. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/data/__init__.py +0 -0
  29. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/data/model/__init__.py +0 -0
  30. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/data/model/enums.py +0 -0
  31. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/data/model/excute_boarder_params.py +0 -0
  32. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/data/model/execute_boarder.py +0 -0
  33. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/data/model/generate_route_information.py +0 -0
  34. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/data/model/hash_list.py +0 -0
  35. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/data/model/location.py +0 -0
  36. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/data/model/mowing_modes.py +0 -0
  37. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/data/model/plan.py +0 -0
  38. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/data/model/rapid_state.py +0 -0
  39. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/data/model/region_data.py +0 -0
  40. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/data/mqtt/__init__.py +0 -0
  41. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/data/mqtt/event.py +0 -0
  42. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/data/mqtt/properties.py +0 -0
  43. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/data/mqtt/status.py +0 -0
  44. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/data/state_manager.py +0 -0
  45. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/event/__init__.py +0 -0
  46. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/event/event.py +0 -0
  47. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/http/_init_.py +0 -0
  48. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/http/http.py +0 -0
  49. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/mammotion/__init__.py +0 -0
  50. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/mammotion/commands/__init__.py +0 -0
  51. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/mammotion/commands/abstract_message.py +0 -0
  52. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/mammotion/commands/mammotion_command.py +0 -0
  53. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/mammotion/commands/messages/__init__.py +0 -0
  54. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/mammotion/commands/messages/driver.py +0 -0
  55. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/mammotion/commands/messages/media.py +0 -0
  56. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/mammotion/commands/messages/navigation.py +0 -0
  57. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/mammotion/commands/messages/network.py +0 -0
  58. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/mammotion/commands/messages/ota.py +0 -0
  59. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/mammotion/commands/messages/system.py +0 -0
  60. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/mammotion/commands/messages/video.py +0 -0
  61. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/mammotion/control/__init__.py +0 -0
  62. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/mammotion/control/joystick.py +0 -0
  63. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/mammotion/devices/__init__.py +0 -0
  64. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/mqtt/__init__.py +0 -0
  65. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/mqtt/mammotion_mqtt.py +0 -0
  66. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/proto/__init__.py +0 -0
  67. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/proto/common.proto +0 -0
  68. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/proto/common.py +0 -0
  69. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/proto/common_pb2.py +0 -0
  70. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/proto/common_pb2.pyi +0 -0
  71. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/proto/dev_net.proto +0 -0
  72. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/proto/dev_net.py +0 -0
  73. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/proto/dev_net_pb2.py +0 -0
  74. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/proto/dev_net_pb2.pyi +0 -0
  75. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/proto/luba_msg.proto +0 -0
  76. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/proto/luba_msg.py +0 -0
  77. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/proto/luba_msg_pb2.py +0 -0
  78. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/proto/luba_msg_pb2.pyi +0 -0
  79. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/proto/luba_mul.proto +0 -0
  80. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/proto/luba_mul.py +0 -0
  81. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/proto/luba_mul_pb2.py +0 -0
  82. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/proto/luba_mul_pb2.pyi +0 -0
  83. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/proto/mctrl_driver.proto +0 -0
  84. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/proto/mctrl_driver.py +0 -0
  85. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/proto/mctrl_driver_pb2.py +0 -0
  86. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/proto/mctrl_driver_pb2.pyi +0 -0
  87. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/proto/mctrl_nav.proto +0 -0
  88. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/proto/mctrl_nav.py +0 -0
  89. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/proto/mctrl_nav_pb2.py +0 -0
  90. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/proto/mctrl_nav_pb2.pyi +0 -0
  91. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/proto/mctrl_ota.proto +0 -0
  92. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/proto/mctrl_ota.py +0 -0
  93. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/proto/mctrl_ota_pb2.py +0 -0
  94. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/proto/mctrl_ota_pb2.pyi +0 -0
  95. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/proto/mctrl_pept.proto +0 -0
  96. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/proto/mctrl_pept.py +0 -0
  97. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/proto/mctrl_pept_pb2.py +0 -0
  98. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/proto/mctrl_pept_pb2.pyi +0 -0
  99. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/proto/mctrl_sys.proto +0 -0
  100. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/proto/mctrl_sys.py +0 -0
  101. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/proto/mctrl_sys_pb2.py +0 -0
  102. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/proto/mctrl_sys_pb2.pyi +0 -0
  103. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/py.typed +0 -0
  104. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/utility/constant/__init__.py +0 -0
  105. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/utility/datatype_converter.py +0 -0
  106. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/utility/device_type.py +0 -0
  107. {pymammotion-0.0.49 → pymammotion-0.0.51}/pymammotion/utility/periodic.py +0 -0
  108. {pymammotion-0.0.49 → pymammotion-0.0.51}/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.49
3
+ Version: 0.0.51
4
4
  Summary:
5
5
  License: GNU-3.0
6
6
  Author: Michael Arthur
@@ -2,6 +2,8 @@
2
2
 
3
3
  from dataclasses import dataclass
4
4
 
5
+ import betterproto
6
+
5
7
  from pymammotion.data.model import HashList
6
8
  from pymammotion.data.model.location import Location
7
9
  from pymammotion.proto.dev_net import DevNet
@@ -122,95 +124,137 @@ class MowingDevice:
122
124
  class DevNetData:
123
125
  """Wrapping class around LubaMsg to return a dataclass from the raw dict."""
124
126
 
125
- net: DevNet
127
+ net: dict
128
+
129
+ def __init__(self, net: DevNet):
130
+ self.net = net.to_dict()
126
131
 
127
132
  def __getattr__(self, item):
128
133
  """Intercept call to get net in dict and return a betterproto dataclass."""
129
- if not isinstance(self.net[item], dict):
130
- return self.net[item]
134
+ if self.net.get(item) is None:
135
+ return DevNet().__getattribute__(item)
131
136
 
132
- return DevNet().__getattribute__(item).from_dict(value=self.net[item])
137
+ if not isinstance(self.net.get(item), dict):
138
+ return self.net.get(item)
139
+
140
+ return DevNet().__getattribute__(item).from_dict(value=self.net.get(item))
133
141
 
134
142
 
135
143
  @dataclass
136
144
  class SysData:
137
145
  """Wrapping class around LubaMsg to return a dataclass from the raw dict."""
138
146
 
139
- sys: MctlSys
147
+ sys: dict
148
+
149
+ def __init__(self, sys: MctlSys):
150
+ self.sys = sys.to_dict()
140
151
 
141
152
  def __getattr__(self, item):
142
- """Intercept call to get net in dict and return a betterproto dataclass."""
143
- if not isinstance(self.sys[item], dict):
144
- return self.sys[item]
153
+ """Intercept call to get sys in dict and return a betterproto dataclass."""
154
+ if self.sys.get(item) is None:
155
+ return MctlSys().__getattribute__(item)
156
+
157
+ if not isinstance(self.sys.get(item), dict):
158
+ return self.sys.get(item)
145
159
 
146
- return MctlSys().__getattribute__(item).from_dict(value=self.sys[item])
160
+ return MctlSys().__getattribute__(item).from_dict(value=self.sys.get(item))
147
161
 
148
162
 
149
163
  @dataclass
150
164
  class NavData:
151
165
  """Wrapping class around LubaMsg to return a dataclass from the raw dict."""
152
166
 
153
- nav: MctlNav
167
+ nav: dict
168
+
169
+ def __init__(self, nav: MctlNav):
170
+ self.nav = nav.to_dict()
154
171
 
155
172
  def __getattr__(self, item):
156
173
  """Intercept call to get nav in dict and return a betterproto dataclass."""
157
- if not isinstance(self.nav[item], dict):
158
- return self.nav[item]
174
+ if self.nav.get(item) is None:
175
+ return MctlNav().__getattribute__(item)
176
+
177
+ if not isinstance(self.nav.get(item), dict):
178
+ return self.nav.get(item)
159
179
 
160
- return MctlNav().__getattribute__(item).from_dict(value=self.nav[item])
180
+ return MctlNav().__getattribute__(item).from_dict(value=self.nav.get(item))
161
181
 
162
182
 
163
183
  @dataclass
164
184
  class DriverData:
165
185
  """Wrapping class around LubaMsg to return a dataclass from the raw dict."""
166
186
 
167
- driver: MctlDriver
187
+ driver: dict
188
+
189
+ def __init__(self, driver: MctlDriver):
190
+ self.driver = driver.to_dict()
168
191
 
169
192
  def __getattr__(self, item):
170
193
  """Intercept call to get driver in dict and return a betterproto dataclass."""
171
- if not isinstance(self.driver[item], dict):
172
- return self.driver[item]
194
+ if self.driver.get(item) is None:
195
+ return MctlDriver().__getattribute__(item)
196
+
197
+ if not isinstance(self.driver.get(item), dict):
198
+ return self.driver.get(item)
173
199
 
174
- return MctlDriver().__getattribute__(item).from_dict(value=self.driver[item])
200
+ return MctlDriver().__getattribute__(item).from_dict(value=self.driver.get(item))
175
201
 
176
202
 
177
203
  @dataclass
178
204
  class MulData:
179
205
  """Wrapping class around LubaMsg to return a dataclass from the raw dict."""
180
206
 
181
- mul: SocMul
207
+ mul: dict
208
+
209
+ def __init__(self, mul: SocMul):
210
+ self.mul = mul.to_dict()
182
211
 
183
212
  def __getattr__(self, item):
184
213
  """Intercept call to get mul in dict and return a betterproto dataclass."""
185
- if not isinstance(self.mul[item], dict):
186
- return self.mul[item]
214
+ if self.mul.get(item) is None:
215
+ return SocMul().__getattribute__(item)
216
+
217
+ if not isinstance(self.mul.get(item), dict):
218
+ return self.mul.get(item)
187
219
 
188
- return SocMul().__getattribute__(item).from_dict(value=self.mul[item])
220
+ return SocMul().__getattribute__(item).from_dict(value=self.mul.get(item))
189
221
 
190
222
 
191
223
  @dataclass
192
224
  class OtaData:
193
225
  """Wrapping class around LubaMsg to return a dataclass from the raw dict."""
194
226
 
195
- ota: MctlOta
227
+ ota: dict
228
+
229
+ def __init__(self, ota: MctlOta):
230
+ self.ota = ota.to_dict()
196
231
 
197
232
  def __getattr__(self, item):
198
233
  """Intercept call to get ota in dict and return a betterproto dataclass."""
199
- if not isinstance(self.ota[item], dict):
200
- return self.ota[item]
234
+ if self.ota.get(item) is None:
235
+ return MctlOta().__getattribute__(item)
236
+
237
+ if not isinstance(self.ota.get(item), dict):
238
+ return self.ota.get(item)
201
239
 
202
- return MctlOta().__getattribute__(item).from_dict(value=self.ota[item])
240
+ return MctlOta().__getattribute__(item).from_dict(value=self.ota.get(item))
203
241
 
204
242
 
205
243
  @dataclass
206
244
  class PeptData:
207
245
  """Wrapping class around LubaMsg to return a dataclass from the raw dict."""
208
246
 
209
- pept: MctlPept
247
+ pept: dict
248
+
249
+ def __init__(self, pept: MctlPept):
250
+ self.pept = pept.to_dict()
210
251
 
211
252
  def __getattr__(self, item):
212
253
  """Intercept call to get pept in dict and return a betterproto dataclass."""
213
- if not isinstance(self.pept[item], dict):
214
- return self.pept[item]
254
+ if self.pept.get(item) is None:
255
+ return MctlPept().__getattribute__(item)
256
+
257
+ if not isinstance(self.pept.get(item), dict):
258
+ return self.pept.get(item)
215
259
 
216
- return MctlPept().__getattribute__(item).from_dict(value=self.pept[item])
260
+ return MctlPept().__getattribute__(item).from_dict(value=self.pept.get(item))
@@ -318,7 +318,6 @@ class MammotionBaseBLEDevice(MammotionBaseDevice):
318
318
  def __init__(self, device: BLEDevice, interface: int = 0, **kwargs: Any) -> None:
319
319
  """Initialize MammotionBaseBLEDevice."""
320
320
  super().__init__()
321
- self._pong_count = None
322
321
  self._ble_sync_task = None
323
322
  self._prev_notification = None
324
323
  self._interface = f"hci{interface}"
@@ -526,16 +525,13 @@ class MammotionBaseBLEDevice(MammotionBaseDevice):
526
525
  new_msg = LubaMsg().parse(data)
527
526
  if betterproto.serialized_on_wire(new_msg.net):
528
527
  if new_msg.net.todev_ble_sync != 0 or has_field(new_msg.net.toapp_wifi_iot_status):
529
- self._pong_count += 1
530
-
531
- if self._pong_count < 3:
532
- return
528
+ return
533
529
 
534
530
  # may or may not be correct, some work could be done here to correctly match responses
535
531
  if self._notify_future and not self._notify_future.done():
536
- self._pong_count = 0
537
532
  self._notify_future.set_result(data)
538
533
 
534
+ self._reset_disconnect_timer()
539
535
  await self._state_manager.notification(new_msg)
540
536
 
541
537
  async def _start_notify(self) -> None:
@@ -668,7 +664,7 @@ class MammotionBaseBLEDevice(MammotionBaseDevice):
668
664
  _LOGGER.debug("%s: Disconnecting", self.name)
669
665
  try:
670
666
  """We reset what command the robot last heard before disconnecting."""
671
- if client.is_connected:
667
+ if client is not None and client.is_connected:
672
668
  command_bytes = self._commands.send_todev_ble_sync(2)
673
669
  await self._message.post_custom_data_bytes(command_bytes)
674
670
  await client.stop_notify(self._read_char)
@@ -209,7 +209,7 @@ class WorkMode:
209
209
  MODE_WORKING = 13
210
210
 
211
211
 
212
- def device_mode(value):
212
+ def device_mode(value) -> str:
213
213
  """Return the mode corresponding to the given value.
214
214
 
215
215
  This function takes a value and returns the corresponding mode from a
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "pymammotion"
3
- version = "0.0.49"
3
+ version = "0.0.51"
4
4
  license = "GNU-3.0"
5
5
  description = ""
6
6
  readme = "README.md"
@@ -46,9 +46,8 @@ ruff = "^0.4.6"
46
46
  mypy = "^1.10.0"
47
47
  pre-commit = "^3.7.1"
48
48
 
49
-
50
49
  [tool.bumpver]
51
- current_version = "0.0.49"
50
+ current_version = "0.0.51"
52
51
  version_pattern = "MAJOR.MINOR.PATCH"
53
52
  commit_message = "Bump version {old_version} -> {new_version}"
54
53
  commit = true
File without changes
File without changes