espark-core 0.5.5__py3-none-any.whl → 0.5.6__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 espark-core might be problematic. Click here for more details.
- {espark_core-0.5.5.dist-info → espark_core-0.5.6.dist-info}/METADATA +1 -1
- {espark_core-0.5.5.dist-info → espark_core-0.5.6.dist-info}/RECORD +6 -6
- esparkcore/services/mqtt.py +29 -26
- {espark_core-0.5.5.dist-info → espark_core-0.5.6.dist-info}/WHEEL +0 -0
- {espark_core-0.5.5.dist-info → espark_core-0.5.6.dist-info}/licenses/LICENSE +0 -0
- {espark_core-0.5.5.dist-info → espark_core-0.5.6.dist-info}/top_level.txt +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
espark_core-0.5.
|
|
1
|
+
espark_core-0.5.6.dist-info/licenses/LICENSE,sha256=wkIXJHYIspOGVvn_ajKyLucpIyw9_pO3QExFcNTCY78,1065
|
|
2
2
|
esparkcore/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
3
|
esparkcore/constants.py,sha256=2Bmx62j4kykkPhcQ9ygEJ08uyVlykXMNFhpO26-Czlg,417
|
|
4
4
|
esparkcore/data/__init__.py,sha256=abMOPq6jC5qOQCl9j7iPDv8iyjzDF-oVd_gW0la5kL4,45
|
|
@@ -32,10 +32,10 @@ esparkcore/schedules/__init__.py,sha256=v5Wy3Cbt2AnudGMGXv_Cyaa10s6NAmP66rDjcMSv
|
|
|
32
32
|
esparkcore/schedules/outbox.py,sha256=GGANvjkI7w1BdmmVRgKog498ASD_xRN0g8bG6yC_SN4,811
|
|
33
33
|
esparkcore/schedules/scheduler.py,sha256=aYQXImLZ4tW-hRavn3ObuV3lYjmOZD813YkeG1NsYfY,170
|
|
34
34
|
esparkcore/services/__init__.py,sha256=RIZOHBfkWn3HsApdA5rH9EZbbXGq0NfiGoOWDO_JX1k,30
|
|
35
|
-
esparkcore/services/mqtt.py,sha256=
|
|
35
|
+
esparkcore/services/mqtt.py,sha256=iZ1vULPhuVcfMsJ40NA-vpVaDs_kUzrxR35NZWMiVig,9078
|
|
36
36
|
esparkcore/utils/__init__.py,sha256=rzuCJUAaQl-yPhM1vcWB_1zVXqtA71ChYP2aM_3UfKk,42
|
|
37
37
|
esparkcore/utils/logging.py,sha256=sRO8uOcPkFH-DwepqLOTS2qGaopXpMdVOjzZL6RpGs4,257
|
|
38
|
-
espark_core-0.5.
|
|
39
|
-
espark_core-0.5.
|
|
40
|
-
espark_core-0.5.
|
|
41
|
-
espark_core-0.5.
|
|
38
|
+
espark_core-0.5.6.dist-info/METADATA,sha256=i2pOiS6Iwi9ibFKpPRP8o7gIuNWbY5T-LoErdNaRoFE,6330
|
|
39
|
+
espark_core-0.5.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
40
|
+
espark_core-0.5.6.dist-info/top_level.txt,sha256=hXVyhIPB4aGskFm5queWALxDPhcDkrN7_8vcjwA1iE4,11
|
|
41
|
+
espark_core-0.5.6.dist-info/RECORD,,
|
esparkcore/services/mqtt.py
CHANGED
|
@@ -125,34 +125,37 @@ class MQTTManager:
|
|
|
125
125
|
|
|
126
126
|
async def _process_queue(self) -> None:
|
|
127
127
|
while True:
|
|
128
|
-
topic, payload = await self.queue.get()
|
|
129
|
-
|
|
130
|
-
topic_parts: list[str] = str(topic).split('/')
|
|
131
|
-
if len(topic_parts) != 3:
|
|
132
|
-
log_error(Exception('Invalid topic format, skipping message'))
|
|
133
|
-
continue
|
|
134
|
-
|
|
135
|
-
app_type, message_type, device_id = topic_parts
|
|
136
|
-
if app_type != 'espark':
|
|
137
|
-
log_debug('Invalid app type, skipping message')
|
|
138
|
-
continue
|
|
139
|
-
|
|
140
128
|
try:
|
|
141
|
-
payload =
|
|
142
|
-
|
|
129
|
+
topic, payload = await self.queue.get()
|
|
130
|
+
|
|
131
|
+
topic_parts: list[str] = str(topic).split('/')
|
|
132
|
+
if len(topic_parts) != 3:
|
|
133
|
+
log_error(Exception('Invalid topic format, skipping message'))
|
|
134
|
+
continue
|
|
135
|
+
|
|
136
|
+
app_type, message_type, device_id = topic_parts
|
|
137
|
+
if app_type != 'espark':
|
|
138
|
+
log_debug('Invalid app type, skipping message')
|
|
139
|
+
continue
|
|
140
|
+
|
|
141
|
+
try:
|
|
142
|
+
payload = loads(payload.decode())
|
|
143
|
+
except JSONDecodeError as e:
|
|
144
|
+
log_error(e)
|
|
145
|
+
continue
|
|
146
|
+
|
|
147
|
+
if message_type == TOPIC_REGISTRATION.split('/')[1]:
|
|
148
|
+
await self._handle_registration(device_id, payload)
|
|
149
|
+
elif message_type == TOPIC_TELEMETRY.split('/')[1]:
|
|
150
|
+
await self._handle_telemetry(device_id, payload)
|
|
151
|
+
elif message_type == TOPIC_CRASH.split('/')[1]:
|
|
152
|
+
log_debug(f'Received crash report from device {device_id}: {payload}')
|
|
153
|
+
else:
|
|
154
|
+
log_debug(f'Unknown message type "{message_type}", skipping message')
|
|
155
|
+
|
|
156
|
+
self.queue.task_done()
|
|
157
|
+
except Exception as e:
|
|
143
158
|
log_error(e)
|
|
144
|
-
continue
|
|
145
|
-
|
|
146
|
-
if message_type == TOPIC_REGISTRATION.split('/')[1]:
|
|
147
|
-
await self._handle_registration(device_id, payload)
|
|
148
|
-
elif message_type == TOPIC_TELEMETRY.split('/')[1]:
|
|
149
|
-
await self._handle_telemetry(device_id, payload)
|
|
150
|
-
elif message_type == TOPIC_CRASH.split('/')[1]:
|
|
151
|
-
log_debug(f'Received crash report from device {device_id}: {payload}')
|
|
152
|
-
else:
|
|
153
|
-
log_debug(f'Unknown message type "{message_type}", skipping message')
|
|
154
|
-
|
|
155
|
-
self.queue.task_done()
|
|
156
159
|
|
|
157
160
|
async def _process_messages(self) -> None:
|
|
158
161
|
while True:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|