espark-core 0.5.4__tar.gz → 0.5.6__tar.gz
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.4/espark_core.egg-info → espark_core-0.5.6}/PKG-INFO +2 -2
- {espark_core-0.5.4 → espark_core-0.5.6/espark_core.egg-info}/PKG-INFO +2 -2
- {espark_core-0.5.4 → espark_core-0.5.6}/espark_core.egg-info/requires.txt +1 -1
- {espark_core-0.5.4 → espark_core-0.5.6}/esparkcore/services/mqtt.py +29 -28
- {espark_core-0.5.4 → espark_core-0.5.6}/requirements.txt +1 -1
- {espark_core-0.5.4 → espark_core-0.5.6}/setup.py +1 -1
- {espark_core-0.5.4 → espark_core-0.5.6}/LICENSE +0 -0
- {espark_core-0.5.4 → espark_core-0.5.6}/MANIFEST.in +0 -0
- {espark_core-0.5.4 → espark_core-0.5.6}/README.md +0 -0
- {espark_core-0.5.4 → espark_core-0.5.6}/espark_core.egg-info/SOURCES.txt +0 -0
- {espark_core-0.5.4 → espark_core-0.5.6}/espark_core.egg-info/dependency_links.txt +0 -0
- {espark_core-0.5.4 → espark_core-0.5.6}/espark_core.egg-info/top_level.txt +0 -0
- {espark_core-0.5.4 → espark_core-0.5.6}/esparkcore/__init__.py +0 -0
- {espark_core-0.5.4 → espark_core-0.5.6}/esparkcore/constants.py +0 -0
- {espark_core-0.5.4 → espark_core-0.5.6}/esparkcore/data/__init__.py +0 -0
- {espark_core-0.5.4 → espark_core-0.5.6}/esparkcore/data/database.py +0 -0
- {espark_core-0.5.4 → espark_core-0.5.6}/esparkcore/data/models/__init__.py +0 -0
- {espark_core-0.5.4 → espark_core-0.5.6}/esparkcore/data/models/device.py +0 -0
- {espark_core-0.5.4 → espark_core-0.5.6}/esparkcore/data/models/notification.py +0 -0
- {espark_core-0.5.4 → espark_core-0.5.6}/esparkcore/data/models/outbox.py +0 -0
- {espark_core-0.5.4 → espark_core-0.5.6}/esparkcore/data/models/telemetry.py +0 -0
- {espark_core-0.5.4 → espark_core-0.5.6}/esparkcore/data/models/trigger.py +0 -0
- {espark_core-0.5.4 → espark_core-0.5.6}/esparkcore/data/models/version.py +0 -0
- {espark_core-0.5.4 → espark_core-0.5.6}/esparkcore/data/repositories/__init__.py +0 -0
- {espark_core-0.5.4 → espark_core-0.5.6}/esparkcore/data/repositories/base_repository.py +0 -0
- {espark_core-0.5.4 → espark_core-0.5.6}/esparkcore/data/repositories/device_repository.py +0 -0
- {espark_core-0.5.4 → espark_core-0.5.6}/esparkcore/data/repositories/notification_repository.py +0 -0
- {espark_core-0.5.4 → espark_core-0.5.6}/esparkcore/data/repositories/outbox_repository.py +0 -0
- {espark_core-0.5.4 → espark_core-0.5.6}/esparkcore/data/repositories/telemetry_repository.py +0 -0
- {espark_core-0.5.4 → espark_core-0.5.6}/esparkcore/data/repositories/trigger_repository.py +0 -0
- {espark_core-0.5.4 → espark_core-0.5.6}/esparkcore/data/repositories/version_repository.py +0 -0
- {espark_core-0.5.4 → espark_core-0.5.6}/esparkcore/notifications/__init__.py +0 -0
- {espark_core-0.5.4 → espark_core-0.5.6}/esparkcore/notifications/notifier.py +0 -0
- {espark_core-0.5.4 → espark_core-0.5.6}/esparkcore/notifications/slack_notifier.py +0 -0
- {espark_core-0.5.4 → espark_core-0.5.6}/esparkcore/routers/__init__.py +0 -0
- {espark_core-0.5.4 → espark_core-0.5.6}/esparkcore/routers/base_router.py +0 -0
- {espark_core-0.5.4 → espark_core-0.5.6}/esparkcore/routers/device_router.py +0 -0
- {espark_core-0.5.4 → espark_core-0.5.6}/esparkcore/routers/notification_router.py +0 -0
- {espark_core-0.5.4 → espark_core-0.5.6}/esparkcore/routers/telemetry_router.py +0 -0
- {espark_core-0.5.4 → espark_core-0.5.6}/esparkcore/routers/trigger_router.py +0 -0
- {espark_core-0.5.4 → espark_core-0.5.6}/esparkcore/routers/version_router.py +0 -0
- {espark_core-0.5.4 → espark_core-0.5.6}/esparkcore/schedules/__init__.py +0 -0
- {espark_core-0.5.4 → espark_core-0.5.6}/esparkcore/schedules/outbox.py +0 -0
- {espark_core-0.5.4 → espark_core-0.5.6}/esparkcore/schedules/scheduler.py +0 -0
- {espark_core-0.5.4 → espark_core-0.5.6}/esparkcore/services/__init__.py +0 -0
- {espark_core-0.5.4 → espark_core-0.5.6}/esparkcore/utils/__init__.py +0 -0
- {espark_core-0.5.4 → espark_core-0.5.6}/esparkcore/utils/logging.py +0 -0
- {espark_core-0.5.4 → espark_core-0.5.6}/requirements.dev.txt +0 -0
- {espark_core-0.5.4 → espark_core-0.5.6}/setup.cfg +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: espark-core
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.6
|
|
4
4
|
Summary: The core module of the Espark ESP32-based IoT device management framework.
|
|
5
5
|
License: MIT
|
|
6
6
|
Requires-Python: >=3.10
|
|
7
7
|
Description-Content-Type: text/markdown
|
|
8
8
|
License-File: LICENSE
|
|
9
|
-
Requires-Dist: aiomqtt>=2.
|
|
9
|
+
Requires-Dist: aiomqtt>=2.5.0
|
|
10
10
|
Requires-Dist: apscheduler>=3.11.2
|
|
11
11
|
Requires-Dist: fastapi>=0.128.0
|
|
12
12
|
Requires-Dist: packaging>=25.0
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: espark-core
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.6
|
|
4
4
|
Summary: The core module of the Espark ESP32-based IoT device management framework.
|
|
5
5
|
License: MIT
|
|
6
6
|
Requires-Python: >=3.10
|
|
7
7
|
Description-Content-Type: text/markdown
|
|
8
8
|
License-File: LICENSE
|
|
9
|
-
Requires-Dist: aiomqtt>=2.
|
|
9
|
+
Requires-Dist: aiomqtt>=2.5.0
|
|
10
10
|
Requires-Dist: apscheduler>=3.11.2
|
|
11
11
|
Requires-Dist: fastapi>=0.128.0
|
|
12
12
|
Requires-Dist: packaging>=25.0
|
|
@@ -35,8 +35,6 @@ class MQTTManager:
|
|
|
35
35
|
async with async_session() as session:
|
|
36
36
|
device = await self.device_repo.get(session, Device.id == device_id)
|
|
37
37
|
if device:
|
|
38
|
-
device.last_seen = datetime.now(timezone.utc)
|
|
39
|
-
|
|
40
38
|
await self.device_repo.update(session, device, last_seen=datetime.now(timezone.utc))
|
|
41
39
|
else:
|
|
42
40
|
device = Device()
|
|
@@ -127,34 +125,37 @@ class MQTTManager:
|
|
|
127
125
|
|
|
128
126
|
async def _process_queue(self) -> None:
|
|
129
127
|
while True:
|
|
130
|
-
topic, payload = await self.queue.get()
|
|
131
|
-
|
|
132
|
-
topic_parts: list[str] = str(topic).split('/')
|
|
133
|
-
if len(topic_parts) != 3:
|
|
134
|
-
log_error(Exception('Invalid topic format, skipping message'))
|
|
135
|
-
continue
|
|
136
|
-
|
|
137
|
-
app_type, message_type, device_id = topic_parts
|
|
138
|
-
if app_type != 'espark':
|
|
139
|
-
log_debug('Invalid app type, skipping message')
|
|
140
|
-
continue
|
|
141
|
-
|
|
142
128
|
try:
|
|
143
|
-
payload =
|
|
144
|
-
|
|
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:
|
|
145
158
|
log_error(e)
|
|
146
|
-
continue
|
|
147
|
-
|
|
148
|
-
if message_type == TOPIC_REGISTRATION.split('/')[1]:
|
|
149
|
-
await self._handle_registration(device_id, payload)
|
|
150
|
-
elif message_type == TOPIC_TELEMETRY.split('/')[1]:
|
|
151
|
-
await self._handle_telemetry(device_id, payload)
|
|
152
|
-
elif message_type == TOPIC_CRASH.split('/')[1]:
|
|
153
|
-
log_debug(f'Received crash report from device {device_id}: {payload}')
|
|
154
|
-
else:
|
|
155
|
-
log_debug(f'Unknown message type "{message_type}", skipping message')
|
|
156
|
-
|
|
157
|
-
self.queue.task_done()
|
|
158
159
|
|
|
159
160
|
async def _process_messages(self) -> None:
|
|
160
161
|
while True:
|
|
@@ -10,7 +10,7 @@ extra_requirements = (root / 'requirements.dev.txt').read_text().splitlines
|
|
|
10
10
|
|
|
11
11
|
setup(
|
|
12
12
|
name='espark-core',
|
|
13
|
-
version='0.5.
|
|
13
|
+
version='0.5.6',
|
|
14
14
|
description='The core module of the Espark ESP32-based IoT device management framework.',
|
|
15
15
|
long_description=(root / 'README.md').read_text(),
|
|
16
16
|
long_description_content_type='text/markdown',
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{espark_core-0.5.4 → espark_core-0.5.6}/esparkcore/data/repositories/notification_repository.py
RENAMED
|
File without changes
|
|
File without changes
|
{espark_core-0.5.4 → espark_core-0.5.6}/esparkcore/data/repositories/telemetry_repository.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|