pymammotion 0.5.4__py3-none-any.whl → 0.5.5__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.
- pymammotion/data/mqtt/properties.py +4 -4
- pymammotion/mqtt/linkkit/linkkit.py +20 -27
- {pymammotion-0.5.4.dist-info → pymammotion-0.5.5.dist-info}/METADATA +1 -1
- {pymammotion-0.5.4.dist-info → pymammotion-0.5.5.dist-info}/RECORD +6 -6
- {pymammotion-0.5.4.dist-info → pymammotion-0.5.5.dist-info}/LICENSE +0 -0
- {pymammotion-0.5.4.dist-info → pymammotion-0.5.5.dist-info}/WHEEL +0 -0
|
@@ -125,13 +125,13 @@ ItemTypes = Union[
|
|
|
125
125
|
|
|
126
126
|
|
|
127
127
|
@dataclass
|
|
128
|
-
class Item:
|
|
128
|
+
class Item(DataClassDictMixin):
|
|
129
129
|
time: int
|
|
130
130
|
value: int | float | str | dict[str, Any] | ItemTypes # Depending on the type of value
|
|
131
131
|
|
|
132
132
|
|
|
133
133
|
@dataclass
|
|
134
|
-
class Items:
|
|
134
|
+
class Items(DataClassDictMixin):
|
|
135
135
|
iotState: Item | None = None
|
|
136
136
|
extMod: Item | None = None
|
|
137
137
|
deviceVersionInfo: Item | None = None
|
|
@@ -163,12 +163,12 @@ class Items:
|
|
|
163
163
|
|
|
164
164
|
@dataclass
|
|
165
165
|
class Params(DataClassORJSONMixin):
|
|
166
|
-
deviceType: Literal["LawnMower"]
|
|
166
|
+
deviceType: Literal["LawnMower", "Tracker"]
|
|
167
167
|
checkFailedData: dict
|
|
168
168
|
groupIdList: list[str]
|
|
169
169
|
_tenantId: str
|
|
170
170
|
groupId: str
|
|
171
|
-
categoryKey: Literal["LawnMower"]
|
|
171
|
+
categoryKey: Literal["LawnMower", "Tracker"]
|
|
172
172
|
batchId: str
|
|
173
173
|
gmtCreate: int
|
|
174
174
|
productKey: str
|
|
@@ -713,7 +713,7 @@ UxeCp6
|
|
|
713
713
|
self.__on_ota_message_arrived = None
|
|
714
714
|
|
|
715
715
|
if self.__just_for_pycharm_autocomplete:
|
|
716
|
-
self.__mqtt_client = mqtt.Client(CallbackAPIVersion.
|
|
716
|
+
self.__mqtt_client = mqtt.Client(CallbackAPIVersion.VERSION1)
|
|
717
717
|
|
|
718
718
|
# device interface info
|
|
719
719
|
self.__device_info_topic = "/sys/%s/%s/thing/deviceinfo/update" % (self.__product_key, self.__device_name)
|
|
@@ -1311,10 +1311,7 @@ UxeCp6
|
|
|
1311
1311
|
elif self.__mqtt_protocol == "MQTTv31":
|
|
1312
1312
|
mqtt_protocol_version = mqtt.MQTTv31
|
|
1313
1313
|
self.__mqtt_client = mqtt.Client(
|
|
1314
|
-
|
|
1315
|
-
client_id=client_id,
|
|
1316
|
-
clean_session=self.__mqtt_clean_session,
|
|
1317
|
-
protocol=mqtt_protocol_version,
|
|
1314
|
+
client_id=client_id, clean_session=self.__mqtt_clean_session, protocol=mqtt_protocol_version
|
|
1318
1315
|
)
|
|
1319
1316
|
|
|
1320
1317
|
if self.__link_log.is_enabled():
|
|
@@ -1570,13 +1567,13 @@ UxeCp6
|
|
|
1570
1567
|
else:
|
|
1571
1568
|
return 1, None
|
|
1572
1569
|
|
|
1573
|
-
def __on_internal_connect_safe(self, client,
|
|
1574
|
-
if
|
|
1570
|
+
def __on_internal_connect_safe(self, client, user_data, session_flag, rc) -> None:
|
|
1571
|
+
if rc == 0:
|
|
1575
1572
|
self.__reset_reconnect_wait()
|
|
1576
1573
|
self.__force_reconnect = False
|
|
1577
|
-
session_flag_internal = {"session present":
|
|
1574
|
+
session_flag_internal = {"session present": session_flag}
|
|
1578
1575
|
self.__handler_task.post_message(
|
|
1579
|
-
self.__handler_task_cmd_on_connect, (client,
|
|
1576
|
+
self.__handler_task_cmd_on_connect, (client, user_data, session_flag_internal, rc)
|
|
1580
1577
|
)
|
|
1581
1578
|
|
|
1582
1579
|
def __loop_forever_internal(self):
|
|
@@ -1609,7 +1606,7 @@ UxeCp6
|
|
|
1609
1606
|
except ssl.SSLError as e:
|
|
1610
1607
|
self.__link_log.error("config mqtt raise exception:" + str(e))
|
|
1611
1608
|
self.__linkkit_state = LinkKit.LinkKitState.INITIALIZED
|
|
1612
|
-
self.__on_internal_connect_safe(None, None, 0, 6
|
|
1609
|
+
self.__on_internal_connect_safe(None, None, 0, 6)
|
|
1613
1610
|
return
|
|
1614
1611
|
|
|
1615
1612
|
try:
|
|
@@ -1619,7 +1616,7 @@ UxeCp6
|
|
|
1619
1616
|
except Exception as e:
|
|
1620
1617
|
self.__link_log.error("__loop_forever_internal connect raise exception:" + str(e))
|
|
1621
1618
|
self.__linkkit_state = LinkKit.LinkKitState.INITIALIZED
|
|
1622
|
-
self.__on_internal_connect_safe(None, None, 0, 7
|
|
1619
|
+
self.__on_internal_connect_safe(None, None, 0, 7)
|
|
1623
1620
|
return
|
|
1624
1621
|
while True:
|
|
1625
1622
|
if self.__worker_loop_exit_req:
|
|
@@ -1642,7 +1639,7 @@ UxeCp6
|
|
|
1642
1639
|
# return
|
|
1643
1640
|
if self.__linkkit_state == LinkKit.LinkKitState.CONNECTING:
|
|
1644
1641
|
self.__linkkit_state = LinkKit.LinkKitState.DISCONNECTED
|
|
1645
|
-
self.__on_internal_connect_safe(None, None, 0, 9
|
|
1642
|
+
self.__on_internal_connect_safe(None, None, 0, 9)
|
|
1646
1643
|
if self.__linkkit_state == LinkKit.LinkKitState.DESTRUCTING:
|
|
1647
1644
|
self.__handler_task.stop()
|
|
1648
1645
|
self.__linkkit_state = LinkKit.LinkKitState.DESTRUCTED
|
|
@@ -1664,7 +1661,7 @@ UxeCp6
|
|
|
1664
1661
|
break
|
|
1665
1662
|
|
|
1666
1663
|
if self.__linkkit_state == LinkKit.LinkKitState.CONNECTED:
|
|
1667
|
-
self.__on_internal_disconnect(None, None, 1
|
|
1664
|
+
self.__on_internal_disconnect(None, None, 1)
|
|
1668
1665
|
self.__link_log.info("loop return:%r" % rc)
|
|
1669
1666
|
|
|
1670
1667
|
if self.__worker_loop_exit_req:
|
|
@@ -2539,25 +2536,23 @@ UxeCp6
|
|
|
2539
2536
|
client, user_data, message = value
|
|
2540
2537
|
self.__on_internal_async_message(message)
|
|
2541
2538
|
|
|
2542
|
-
def __on_internal_connect(self, client,
|
|
2539
|
+
def __on_internal_connect(self, client, user_data, session_flag, rc) -> None:
|
|
2543
2540
|
self.__link_log.info("__on_internal_connect")
|
|
2544
|
-
if
|
|
2541
|
+
if rc == 0:
|
|
2545
2542
|
self.__reset_reconnect_wait()
|
|
2546
2543
|
# self.__upload_device_interface_info()
|
|
2547
|
-
self.__handler_task.post_message(
|
|
2548
|
-
self.__handler_task_cmd_on_connect, (client, userdata, flags, reason_code, properties)
|
|
2549
|
-
)
|
|
2544
|
+
self.__handler_task.post_message(self.__handler_task_cmd_on_connect, (client, user_data, session_flag, rc))
|
|
2550
2545
|
|
|
2551
2546
|
def __handler_task_on_connect_callback(self, value) -> None:
|
|
2552
|
-
client,
|
|
2547
|
+
client, user_data, session_flag, rc = value
|
|
2553
2548
|
self.__link_log.info("__on_internal_connect enter")
|
|
2554
|
-
self.__link_log.debug("session:%d, return code:%d" % (
|
|
2549
|
+
self.__link_log.debug("session:%d, return code:%d" % (session_flag["session present"], rc))
|
|
2555
2550
|
if rc == 0:
|
|
2556
2551
|
self.__linkkit_state = LinkKit.LinkKitState.CONNECTED
|
|
2557
2552
|
# self.__worker_thread.start()
|
|
2558
2553
|
if self.__on_connect is not None:
|
|
2559
2554
|
try:
|
|
2560
|
-
self.__on_connect(
|
|
2555
|
+
self.__on_connect(session_flag["session present"], rc, self.__user_data)
|
|
2561
2556
|
except Exception as e:
|
|
2562
2557
|
self.__link_log.error("on_connect process raise exception:%r" % e)
|
|
2563
2558
|
if self.__thing_setup_state:
|
|
@@ -2565,7 +2560,7 @@ UxeCp6
|
|
|
2565
2560
|
if self.__on_thing_enable:
|
|
2566
2561
|
self.__on_thing_enable(self.__user_data)
|
|
2567
2562
|
|
|
2568
|
-
def __on_internal_disconnect(self, client,
|
|
2563
|
+
def __on_internal_disconnect(self, client, user_data, rc) -> None:
|
|
2569
2564
|
self.__link_log.info("__on_internal_disconnect enter")
|
|
2570
2565
|
if self.__linkkit_state == LinkKit.LinkKitState.DESTRUCTING:
|
|
2571
2566
|
self.__linkkit_state = LinkKit.LinkKitState.DESTRUCTED
|
|
@@ -2598,15 +2593,13 @@ UxeCp6
|
|
|
2598
2593
|
self.__device_info_mid.clear()
|
|
2599
2594
|
self.__thing_update_device_info_up_mid.clear()
|
|
2600
2595
|
self.__thing_delete_device_info_up_mid.clear()
|
|
2601
|
-
self.__handler_task.post_message(
|
|
2602
|
-
self.__handler_task_cmd_on_disconnect, (client, userdata, reason_code, properties)
|
|
2603
|
-
)
|
|
2596
|
+
self.__handler_task.post_message(self.__handler_task_cmd_on_disconnect, (client, user_data, rc))
|
|
2604
2597
|
if self.__linkkit_state == LinkKit.LinkKitState.DESTRUCTED:
|
|
2605
2598
|
self.__handler_task.stop()
|
|
2606
2599
|
|
|
2607
2600
|
def __handler_task_on_disconnect_callback(self, value) -> None:
|
|
2608
2601
|
self.__link_log.info("__handler_task_on_disconnect_callback enter")
|
|
2609
|
-
client,
|
|
2602
|
+
client, user_data, rc = value
|
|
2610
2603
|
if self.__thing_setup_state:
|
|
2611
2604
|
if self.__thing_enable_state:
|
|
2612
2605
|
self.__thing_enable_state = False
|
|
@@ -2617,7 +2610,7 @@ UxeCp6
|
|
|
2617
2610
|
self.__link_log.error("on_thing_disable process raise exception:%r" % e)
|
|
2618
2611
|
if self.__on_disconnect is not None:
|
|
2619
2612
|
try:
|
|
2620
|
-
self.__on_disconnect(
|
|
2613
|
+
self.__on_disconnect(rc, self.__user_data)
|
|
2621
2614
|
except Exception as e:
|
|
2622
2615
|
self.__link_log.error("on_disconnect process raise exception:%r" % e)
|
|
2623
2616
|
|
|
@@ -43,7 +43,7 @@ pymammotion/data/model/report_info.py,sha256=3nXBFRfdKWnZj4YfBcrPwhBRpq58ICMQlrE
|
|
|
43
43
|
pymammotion/data/model/work.py,sha256=AfKMItFqnRtAlVHzKCfYY-BQy-WFDYZBzdj-9Yc03bo,655
|
|
44
44
|
pymammotion/data/mqtt/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
45
45
|
pymammotion/data/mqtt/event.py,sha256=C8TGRJs9wNxwg9FFmr9qcsweDnl5v5kcVcwiHxtYzJw,5384
|
|
46
|
-
pymammotion/data/mqtt/properties.py,sha256=
|
|
46
|
+
pymammotion/data/mqtt/properties.py,sha256=laud9rE-JqBHWKZ44Dov2yMkp3Ld8ghpBwlZ4_3g9uQ,4321
|
|
47
47
|
pymammotion/data/mqtt/status.py,sha256=SgdrpE1Uldb01hybO6hYhgU1Sp1eILghC0UhMZMHrdQ,1091
|
|
48
48
|
pymammotion/data/state_manager.py,sha256=Q0WTI-ehXH50bQEroXibzGK5MLRx5OThGZ86NNCPJjc,11508
|
|
49
49
|
pymammotion/event/__init__.py,sha256=mgATR6vPHACNQ-0zH5fi7NdzeTCDV1CZyaWPmtUusi8,115
|
|
@@ -78,7 +78,7 @@ pymammotion/mammotion/devices/mammotion_cloud.py,sha256=Pd4aOIhcjVZznJfa0ANYTdG3
|
|
|
78
78
|
pymammotion/mqtt/__init__.py,sha256=Ocs5e-HLJvTuDpVXyECEsWIvwsUaxzj7lZ9mSYutNDY,105
|
|
79
79
|
pymammotion/mqtt/linkkit/__init__.py,sha256=ENgc3ynd2kd9gMQR3-kgmCu6Ed9Y6XCIzU0zFReUlkk,80
|
|
80
80
|
pymammotion/mqtt/linkkit/h2client.py,sha256=w9Nvi_nY4CLD_fw-pHtYChwQf7e2TiAGeqkY_sF4cf0,19659
|
|
81
|
-
pymammotion/mqtt/linkkit/linkkit.py,sha256=
|
|
81
|
+
pymammotion/mqtt/linkkit/linkkit.py,sha256=SGWny2_LKa8qg8RD0Bgd3a4S_fMqpYxJ7a9eFRvgcN0,132923
|
|
82
82
|
pymammotion/mqtt/mammotion_future.py,sha256=_OWqKOlUGl2yT1xOsXFQYpGd-1zQ63OxqXgy7KRQgYc,710
|
|
83
83
|
pymammotion/mqtt/mammotion_mqtt.py,sha256=4jNNV5tx6CCryjLSmAQA6u19bhRSuVkZem32JCpOakE,10198
|
|
84
84
|
pymammotion/proto/__init__.py,sha256=vUF-eieR8e4VfduqaQ3KfeCRhsMD56NTX2Kk6sS38IE,73466
|
|
@@ -124,7 +124,7 @@ pymammotion/utility/movement.py,sha256=N75oAoAgFydqoaOedYIxGUHmuTCtPzAOtb-d_29tp
|
|
|
124
124
|
pymammotion/utility/mur_mur_hash.py,sha256=xEfOZVbqRawJj66eLgtnZ85OauDR47oIPr29OHelzPI,4468
|
|
125
125
|
pymammotion/utility/periodic.py,sha256=MbeSb9cfhxzYmdT_RiE0dZe3H9IfbQW_zSqhmSX2RUc,3321
|
|
126
126
|
pymammotion/utility/rocker_util.py,sha256=6tX7sS87qoQC_tsxbx3NLL-HgS08wtzXiZkhDiz7uo0,7179
|
|
127
|
-
pymammotion-0.5.
|
|
128
|
-
pymammotion-0.5.
|
|
129
|
-
pymammotion-0.5.
|
|
130
|
-
pymammotion-0.5.
|
|
127
|
+
pymammotion-0.5.5.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
128
|
+
pymammotion-0.5.5.dist-info/METADATA,sha256=OoAgAEjBHXz8XRebg4rgZAUHx4nPIx4mXvUyLXwdHzI,3870
|
|
129
|
+
pymammotion-0.5.5.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
130
|
+
pymammotion-0.5.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|