pymammotion 0.2.83__py3-none-any.whl → 0.2.85__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.
- pymammotion/http/model/http.py +1 -1
- pymammotion/mammotion/devices/mammotion_cloud.py +8 -3
- {pymammotion-0.2.83.dist-info → pymammotion-0.2.85.dist-info}/METADATA +1 -1
- {pymammotion-0.2.83.dist-info → pymammotion-0.2.85.dist-info}/RECORD +6 -6
- {pymammotion-0.2.83.dist-info → pymammotion-0.2.85.dist-info}/LICENSE +0 -0
- {pymammotion-0.2.83.dist-info → pymammotion-0.2.85.dist-info}/WHEEL +0 -0
pymammotion/http/model/http.py
CHANGED
@@ -77,7 +77,7 @@ class LoginResponseData(DataClassORJSONMixin):
|
|
77
77
|
expires_in: int
|
78
78
|
authorization_code: str
|
79
79
|
userInformation: LoginResponseUserInformation
|
80
|
-
jti:
|
80
|
+
jti: str = None
|
81
81
|
grant_type: Literal["password", "Password"] = None
|
82
82
|
scope: Literal["read", "Read"] = None
|
83
83
|
|
@@ -37,6 +37,7 @@ class MammotionCloud:
|
|
37
37
|
self.mqtt_properties_event = DataEvent()
|
38
38
|
self.on_ready_event = DataEvent()
|
39
39
|
self.on_disconnected_event = DataEvent()
|
40
|
+
self.on_connected_event = DataEvent()
|
40
41
|
self._operation_lock = asyncio.Lock()
|
41
42
|
self._mqtt_client = mqtt_client
|
42
43
|
self._mqtt_client.on_connected = self.on_connected
|
@@ -66,6 +67,7 @@ class MammotionCloud:
|
|
66
67
|
|
67
68
|
async def on_connected(self) -> None:
|
68
69
|
"""Callback for when MQTT connects."""
|
70
|
+
await self.on_connected_event.data_event(None)
|
69
71
|
|
70
72
|
async def on_disconnected(self) -> None:
|
71
73
|
"""Callback for when MQTT disconnects."""
|
@@ -165,6 +167,7 @@ class MammotionBaseCloudDevice(MammotionBaseDevice):
|
|
165
167
|
self._mqtt.mqtt_properties_event.add_subscribers(self._parse_message_properties_for_device)
|
166
168
|
self._mqtt.on_ready_event.add_subscribers(self.on_ready)
|
167
169
|
self._mqtt.on_disconnected_event.add_subscribers(self.on_disconnect)
|
170
|
+
self._mqtt.on_connected_event.add_subscribers(self.on_connect)
|
168
171
|
self.set_queue_callback(self.queue_command)
|
169
172
|
|
170
173
|
if self._mqtt.is_ready:
|
@@ -175,9 +178,6 @@ class MammotionBaseCloudDevice(MammotionBaseDevice):
|
|
175
178
|
if self.stopped:
|
176
179
|
return
|
177
180
|
try:
|
178
|
-
await self._ble_sync()
|
179
|
-
if self._ble_sync_task is None or self._ble_sync_task.cancelled():
|
180
|
-
await self.run_periodic_sync_task()
|
181
181
|
if self.on_ready_callback:
|
182
182
|
await self.on_ready_callback()
|
183
183
|
except DeviceOfflineException:
|
@@ -188,6 +188,11 @@ class MammotionBaseCloudDevice(MammotionBaseDevice):
|
|
188
188
|
self._ble_sync_task.cancel()
|
189
189
|
self._mqtt.disconnect()
|
190
190
|
|
191
|
+
async def on_connect(self) -> None:
|
192
|
+
await self._ble_sync()
|
193
|
+
if self._ble_sync_task is None or self._ble_sync_task.cancelled():
|
194
|
+
await self.run_periodic_sync_task()
|
195
|
+
|
191
196
|
async def stop(self) -> None:
|
192
197
|
"""Stop all tasks and disconnect."""
|
193
198
|
if self._ble_sync_task:
|
@@ -45,7 +45,7 @@ pymammotion/event/__init__.py,sha256=mgATR6vPHACNQ-0zH5fi7NdzeTCDV1CZyaWPmtUusi8
|
|
45
45
|
pymammotion/event/event.py,sha256=UzYnxV5DfvMDK3E06UvSzvzuBbaXOOUwO6xYt_zn9To,2034
|
46
46
|
pymammotion/http/_init_.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
47
47
|
pymammotion/http/http.py,sha256=9TnVah-R8nkjlb6oCMk78IZ0Y-2iAcMyIdjcQ54GEPk,3562
|
48
|
-
pymammotion/http/model/http.py,sha256=
|
48
|
+
pymammotion/http/model/http.py,sha256=_hHqe9IfKDukUYKQDrZb_Tt_9rd5BNN1WKsaGIjsexM,1876
|
49
49
|
pymammotion/mammotion/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
50
50
|
pymammotion/mammotion/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
51
51
|
pymammotion/mammotion/commands/abstract_message.py,sha256=l2Wcyg7tIEjRGyQAk9T2rQVOLwilxG1hXTNf7811jGA,727
|
@@ -64,7 +64,7 @@ pymammotion/mammotion/devices/__init__.py,sha256=f2qQFPgLGmV85W2hSlMUh5BYuht9o_A
|
|
64
64
|
pymammotion/mammotion/devices/base.py,sha256=F_L5aDtY6rgRkk7Q4CwilLenTANW6cBe9zIU3a9HRmA,10020
|
65
65
|
pymammotion/mammotion/devices/mammotion.py,sha256=hSO184o1q4ftfLPx9froFPIXk428wGg8Ayw160W3z7c,12482
|
66
66
|
pymammotion/mammotion/devices/mammotion_bluetooth.py,sha256=KjcIta1VcJ8eNJvPFeOtwxV2jl3nrk7PldMmPv_Caqw,18939
|
67
|
-
pymammotion/mammotion/devices/mammotion_cloud.py,sha256=
|
67
|
+
pymammotion/mammotion/devices/mammotion_cloud.py,sha256=ghNR1av4GJjrHPFWWTCnhNCA6MDmZq0lR7-ZfqweE7I,12337
|
68
68
|
pymammotion/mqtt/__init__.py,sha256=Ocs5e-HLJvTuDpVXyECEsWIvwsUaxzj7lZ9mSYutNDY,105
|
69
69
|
pymammotion/mqtt/mammotion_future.py,sha256=_OWqKOlUGl2yT1xOsXFQYpGd-1zQ63OxqXgy7KRQgYc,710
|
70
70
|
pymammotion/mqtt/mammotion_mqtt.py,sha256=LaySave_hf0gU3crUTLqzpdQtxIwK8vu5DM8F8fbU2Y,8748
|
@@ -119,7 +119,7 @@ pymammotion/utility/map.py,sha256=GYscVMg2cX3IPlNpCBNHDW0S55yS1WGRf1iHnNZ7TfQ,22
|
|
119
119
|
pymammotion/utility/movement.py,sha256=N75oAoAgFydqoaOedYIxGUHmuTCtPzAOtb-d_29tpfI,615
|
120
120
|
pymammotion/utility/periodic.py,sha256=MbeSb9cfhxzYmdT_RiE0dZe3H9IfbQW_zSqhmSX2RUc,3321
|
121
121
|
pymammotion/utility/rocker_util.py,sha256=6tX7sS87qoQC_tsxbx3NLL-HgS08wtzXiZkhDiz7uo0,7179
|
122
|
-
pymammotion-0.2.
|
123
|
-
pymammotion-0.2.
|
124
|
-
pymammotion-0.2.
|
125
|
-
pymammotion-0.2.
|
122
|
+
pymammotion-0.2.85.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
123
|
+
pymammotion-0.2.85.dist-info/METADATA,sha256=HJQ0Tzx-L-_zoBerxpjSCkTo42-dFPBfkIrK81y7FQg,3896
|
124
|
+
pymammotion-0.2.85.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
125
|
+
pymammotion-0.2.85.dist-info/RECORD,,
|
File without changes
|
File without changes
|