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

@@ -130,6 +130,6 @@ class ThingEventMessage(DataClassORJSONMixin):
130
130
  elif identifier == "device_config_req_event":
131
131
  params_obj = payload.get("params", '')
132
132
  else:
133
- raise ValueError(f"Unknown identifier: {identifier}")
133
+ raise ValueError(f"Unknown identifier: {identifier} {params_dict}")
134
134
 
135
135
  return cls(method=method, id=event_id, params=params_obj, version=version)
@@ -1071,6 +1071,12 @@ class MammotionBaseCloudDevice(MammotionBaseDevice):
1071
1071
 
1072
1072
  async def _send_command_locked(self, key: str, command: bytes) -> bytes:
1073
1073
  """Send command to device and read response."""
1074
+ if not self._mqtt_client.is_connected:
1075
+ loop = asyncio.get_running_loop()
1076
+ await loop.run_in_executor(None, self._mqtt_client.connect_async)
1077
+
1078
+ if not self._mqtt_client.is_connected:
1079
+ raise Exception("MQTT not connected, couldn't recover")
1074
1080
  try:
1075
1081
  return await self._execute_command_locked(key, command)
1076
1082
  except DeviceOfflineException as ex:
@@ -1106,7 +1112,7 @@ class MammotionBaseCloudDevice(MammotionBaseDevice):
1106
1112
  await self.loop.run_in_executor(None, self._mqtt_client.get_cloud_client().send_cloud_command, self.iot_id, command)
1107
1113
  future = MammotionFuture()
1108
1114
  self._waiting_queue.append(future)
1109
- timeout = 20
1115
+ timeout = 5
1110
1116
  try:
1111
1117
  notify_msg = await future.async_get(timeout)
1112
1118
  except asyncio.TimeoutError:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pymammotion
3
- Version: 0.2.18
3
+ Version: 0.2.19
4
4
  Summary:
5
5
  License: GNU-3.0
6
6
  Author: Michael Arthur
@@ -35,7 +35,7 @@ pymammotion/data/model/rapid_state.py,sha256=_e9M-65AbkvIqXyMYzLKBxbNvpso42qD8R-
35
35
  pymammotion/data/model/region_data.py,sha256=75xOTM1qeRbSROp53eIczw3yCmYM9DgMjMh8qE9xkKo,2880
36
36
  pymammotion/data/model/report_info.py,sha256=1Rj_yRZ9apWX296QHae5prdObDbs32bsQf9rzMz2KEQ,4458
37
37
  pymammotion/data/mqtt/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
38
- pymammotion/data/mqtt/event.py,sha256=ywlMEMVapuV-h6WE_miBq7lE10kcZBiNBJ3Taq2UP3k,3886
38
+ pymammotion/data/mqtt/event.py,sha256=QkuFQtSUfg8eHisJ-llu-b6cpAlTePaP0JbqL6xZcvk,3900
39
39
  pymammotion/data/mqtt/properties.py,sha256=HkBPghr26L9_b4QaOi1DtPgb0UoPIOGSe9wb3kgnM6Y,2815
40
40
  pymammotion/data/mqtt/status.py,sha256=zqnlo-MzejEQZszl0i0Wucoc3E76x6UtI9JLxoBnu54,1067
41
41
  pymammotion/data/state_manager.py,sha256=jkedK5qAVDTGqIzlPNCmPpE-Pc1V4e-ZHW6Ds1ihJ50,3004
@@ -58,7 +58,7 @@ pymammotion/mammotion/commands/messages/video.py,sha256=_8lJsU4sLm2CGnc7RDkueA0A
58
58
  pymammotion/mammotion/control/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
59
59
  pymammotion/mammotion/control/joystick.py,sha256=EWV20MMzQuhbLlNlXbsyZKSEpeM7x1CQL7saU4Pn0-g,6165
60
60
  pymammotion/mammotion/devices/__init__.py,sha256=T72jt0ejtMjo1rPmn_FeMF3pmp0LLeRRpc9WcDKEYYY,126
61
- pymammotion/mammotion/devices/mammotion.py,sha256=vPRVIV82c6Q25GHAG98kLihuPdwGgKJzPh9Kz4AGLqU,47945
61
+ pymammotion/mammotion/devices/mammotion.py,sha256=eZxYo4GWomEaSQNAm_kapE64nyjADj72vwsXmIkdidI,48239
62
62
  pymammotion/mqtt/__init__.py,sha256=Ocs5e-HLJvTuDpVXyECEsWIvwsUaxzj7lZ9mSYutNDY,105
63
63
  pymammotion/mqtt/mammotion_future.py,sha256=WKnHqeHiS2Ut-SaDBNOxqh1jDLeTiyLTsJ7PNUexrjk,687
64
64
  pymammotion/mqtt/mammotion_mqtt.py,sha256=7V0JW2N9dshUJAGlg6d6Y5LKWYoXvlQd0o-9l6idPNg,8071
@@ -111,7 +111,7 @@ pymammotion/utility/device_type.py,sha256=KYawu2glZMVlPmxRbA4kVFujXz3miHp3rJiOWR
111
111
  pymammotion/utility/map.py,sha256=aoi-Luzuph02hKynTofMoq3mnPstanx75MDAVv49CuY,2211
112
112
  pymammotion/utility/periodic.py,sha256=9wJMfwXPlx6Mbp3Fws7LLTI34ZDKphH1bva_Ggyk32g,3281
113
113
  pymammotion/utility/rocker_util.py,sha256=syPL0QN4zMzHiTIkUKS7RXBBptjdbkfNlPddwUD5V3A,7171
114
- pymammotion-0.2.18.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
115
- pymammotion-0.2.18.dist-info/METADATA,sha256=i4YzclEryvuMkLzPWQQC54c1gSgT2sWN2svPJKfyq04,3969
116
- pymammotion-0.2.18.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
117
- pymammotion-0.2.18.dist-info/RECORD,,
114
+ pymammotion-0.2.19.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
115
+ pymammotion-0.2.19.dist-info/METADATA,sha256=OAYBonVzuROxFpjnN4-v7Ny1iZhc3HJMvcU_GSYXYvY,3969
116
+ pymammotion-0.2.19.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
117
+ pymammotion-0.2.19.dist-info/RECORD,,