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

@@ -17,6 +17,7 @@ class StateManager:
17
17
  self._device = device
18
18
  self.gethash_ack_callback: Optional[Callable[[NavGetHashListAck],Awaitable[None]]] = None
19
19
  self.get_commondata_ack_callback: Optional[Callable[[NavGetCommDataAck],Awaitable[None]]] = None
20
+ self.on_notification_callback: Optional[Callable[[],Awaitable[None]]] = None
20
21
 
21
22
  def get_device(self) -> MowingDevice:
22
23
  """Get device."""
@@ -44,6 +45,9 @@ class StateManager:
44
45
  case "ota":
45
46
  self._update_ota_data(message)
46
47
 
48
+ if self.on_notification_callback:
49
+ await self.on_notification_callback()
50
+
47
51
  async def _update_nav_data(self, message):
48
52
  """Update nav data."""
49
53
  nav_msg = betterproto.which_one_of(message.nav, "SubNavMsg")
@@ -346,6 +346,9 @@ class MammotionBaseDevice:
346
346
  self._notify_future: asyncio.Future[bytes] | None = None
347
347
  self._cloud_device = cloud_device
348
348
 
349
+ def set_notifiction_callback(self, func: Callable[[],Awaitable[None]]):
350
+ self._state_manager.on_notification_callback = func
351
+
349
352
  async def datahash_response(self, hash_ack: NavGetHashListAck):
350
353
  """Handle datahash responses."""
351
354
  result_hash = 0
@@ -1150,7 +1153,7 @@ class MammotionBaseCloudDevice(MammotionBaseDevice):
1150
1153
  if isinstance(params, str):
1151
1154
  _LOGGER.debug("config event %s", str)
1152
1155
  return
1153
- if params.identifier == "device_protobuf_msg_event" and params.thingType == "thing.events":
1156
+ if params.identifier == "device_protobuf_msg_event" and event.method == "thing.events":
1154
1157
  _LOGGER.debug("Protobuf event")
1155
1158
  binary_data = base64.b64decode(params.value.get("content", ""))
1156
1159
  self._update_raw_data(cast(bytes, binary_data))
@@ -1171,7 +1174,7 @@ class MammotionBaseCloudDevice(MammotionBaseDevice):
1171
1174
  if not fut.fut.cancelled():
1172
1175
  fut.resolve(cast(bytes, binary_data))
1173
1176
  await self._state_manager.notification(new_msg)
1174
- if params.thingType == "thing.properties":
1177
+ if event.method == "thing.properties":
1175
1178
  _LOGGER.debug(event)
1176
1179
 
1177
1180
  async def _handle_mqtt_message(self, topic: str, payload: dict) -> None:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pymammotion
3
- Version: 0.2.16
3
+ Version: 0.2.17
4
4
  Summary:
5
5
  License: GNU-3.0
6
6
  Author: Michael Arthur
@@ -38,7 +38,7 @@ pymammotion/data/mqtt/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdr
38
38
  pymammotion/data/mqtt/event.py,sha256=j2bo__p7ROPPeiBH-74YyOAOMV7tlYYfl30nnZ81XgQ,3567
39
39
  pymammotion/data/mqtt/properties.py,sha256=HkBPghr26L9_b4QaOi1DtPgb0UoPIOGSe9wb3kgnM6Y,2815
40
40
  pymammotion/data/mqtt/status.py,sha256=zqnlo-MzejEQZszl0i0Wucoc3E76x6UtI9JLxoBnu54,1067
41
- pymammotion/data/state_manager.py,sha256=mNIAhP8f1Cb6-wFm2R5e-NlZauj-71iDGz8oZvdTq3Y,2826
41
+ pymammotion/data/state_manager.py,sha256=jkedK5qAVDTGqIzlPNCmPpE-Pc1V4e-ZHW6Ds1ihJ50,3004
42
42
  pymammotion/event/__init__.py,sha256=mgATR6vPHACNQ-0zH5fi7NdzeTCDV1CZyaWPmtUusi8,115
43
43
  pymammotion/event/event.py,sha256=Fy5-I1p92AO_D67VW4eHQqA4pOt7MZsrP--tVfIVUz8,1820
44
44
  pymammotion/http/_init_.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -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=Mml0L_eGUbLzJtQ97xThDpYzDhoaT6oDY9rHo8riAJ8,47868
61
+ pymammotion/mammotion/devices/mammotion.py,sha256=6icsKV066SX-4QPVD1IF3LXhJf_fGv8CtDDuDyOF29U,47997
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.16.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
115
- pymammotion-0.2.16.dist-info/METADATA,sha256=SxR4HOcpH2rHpm6h34W7PzbAxJlopexjYivgbWpZthc,3969
116
- pymammotion-0.2.16.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
117
- pymammotion-0.2.16.dist-info/RECORD,,
114
+ pymammotion-0.2.17.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
115
+ pymammotion-0.2.17.dist-info/METADATA,sha256=Pu-S4POuRuUcvi7fOiAROoc8QwzxZmIVwoV-g8EO16M,3969
116
+ pymammotion-0.2.17.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
117
+ pymammotion-0.2.17.dist-info/RECORD,,