pymammotion 0.4.0a5__py3-none-any.whl → 0.4.0a6__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/aliyun/cloud_gateway.py +7 -1
- pymammotion/data/model/device.py +4 -4
- pymammotion/data/model/device_info.py +2 -1
- pymammotion/data/state_manager.py +8 -9
- pymammotion/mqtt/linkkit/__init__.py +1 -1
- pymammotion/mqtt/linkkit/h2client.py +171 -135
- pymammotion/mqtt/linkkit/linkkit.py +448 -451
- pymammotion/mqtt/mammotion_mqtt.py +7 -7
- pymammotion/utility/device_config.py +657 -25
- pymammotion/utility/device_type.py +13 -1
- {pymammotion-0.4.0a5.dist-info → pymammotion-0.4.0a6.dist-info}/METADATA +3 -1
- {pymammotion-0.4.0a5.dist-info → pymammotion-0.4.0a6.dist-info}/RECORD +14 -14
- {pymammotion-0.4.0a5.dist-info → pymammotion-0.4.0a6.dist-info}/LICENSE +0 -0
- {pymammotion-0.4.0a5.dist-info → pymammotion-0.4.0a6.dist-info}/WHEEL +0 -0
@@ -6,8 +6,8 @@ import hashlib
|
|
6
6
|
import hmac
|
7
7
|
import json
|
8
8
|
import logging
|
9
|
+
from collections.abc import Awaitable, Callable
|
9
10
|
from logging import getLogger
|
10
|
-
from typing import Awaitable, Callable, Optional
|
11
11
|
|
12
12
|
import betterproto
|
13
13
|
from paho.mqtt.client import MQTTMessage
|
@@ -33,18 +33,18 @@ class MammotionMQTT:
|
|
33
33
|
device_secret: str,
|
34
34
|
iot_token: str,
|
35
35
|
cloud_client: CloudIOTGateway,
|
36
|
-
client_id:
|
36
|
+
client_id: str | None = None,
|
37
37
|
) -> None:
|
38
38
|
"""Create instance of MammotionMQTT."""
|
39
39
|
super().__init__()
|
40
40
|
self._cloud_client = cloud_client
|
41
41
|
self.is_connected = False
|
42
42
|
self.is_ready = False
|
43
|
-
self.on_connected:
|
44
|
-
self.on_ready:
|
45
|
-
self.on_error:
|
46
|
-
self.on_disconnected:
|
47
|
-
self.on_message:
|
43
|
+
self.on_connected: Callable[[], Awaitable[None]] | None = None
|
44
|
+
self.on_ready: Callable[[], Awaitable[None]] | None = None
|
45
|
+
self.on_error: Callable[[str], Awaitable[None]] | None = None
|
46
|
+
self.on_disconnected: Callable[[], Awaitable[None]] | None = None
|
47
|
+
self.on_message: Callable[[str, str, str], Awaitable[None]] | None = None
|
48
48
|
|
49
49
|
self._product_key = product_key
|
50
50
|
self._device_name = device_name
|