espark-core 0.4.8__tar.gz → 0.4.9__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.
- {espark_core-0.4.8/espark_core.egg-info → espark_core-0.4.9}/PKG-INFO +3 -3
- {espark_core-0.4.8 → espark_core-0.4.9/espark_core.egg-info}/PKG-INFO +3 -3
- {espark_core-0.4.8 → espark_core-0.4.9}/espark_core.egg-info/requires.txt +2 -2
- {espark_core-0.4.8 → espark_core-0.4.9}/esparkcore/constants.py +1 -0
- {espark_core-0.4.8 → espark_core-0.4.9}/esparkcore/data/models/device.py +1 -1
- {espark_core-0.4.8 → espark_core-0.4.9}/esparkcore/notifications/notifier.py +1 -1
- espark_core-0.4.9/esparkcore/notifications/slack_notifier.py +17 -0
- {espark_core-0.4.8 → espark_core-0.4.9}/requirements.dev.txt +1 -1
- {espark_core-0.4.8 → espark_core-0.4.9}/requirements.txt +1 -1
- {espark_core-0.4.8 → espark_core-0.4.9}/setup.py +1 -1
- espark_core-0.4.8/esparkcore/notifications/slack_notifier.py +0 -16
- {espark_core-0.4.8 → espark_core-0.4.9}/LICENSE +0 -0
- {espark_core-0.4.8 → espark_core-0.4.9}/MANIFEST.in +0 -0
- {espark_core-0.4.8 → espark_core-0.4.9}/README.md +0 -0
- {espark_core-0.4.8 → espark_core-0.4.9}/espark_core.egg-info/SOURCES.txt +0 -0
- {espark_core-0.4.8 → espark_core-0.4.9}/espark_core.egg-info/dependency_links.txt +0 -0
- {espark_core-0.4.8 → espark_core-0.4.9}/espark_core.egg-info/top_level.txt +0 -0
- {espark_core-0.4.8 → espark_core-0.4.9}/esparkcore/__init__.py +0 -0
- {espark_core-0.4.8 → espark_core-0.4.9}/esparkcore/data/__init__.py +0 -0
- {espark_core-0.4.8 → espark_core-0.4.9}/esparkcore/data/database.py +0 -0
- {espark_core-0.4.8 → espark_core-0.4.9}/esparkcore/data/models/__init__.py +0 -0
- {espark_core-0.4.8 → espark_core-0.4.9}/esparkcore/data/models/outbox.py +0 -0
- {espark_core-0.4.8 → espark_core-0.4.9}/esparkcore/data/models/telemetry.py +0 -0
- {espark_core-0.4.8 → espark_core-0.4.9}/esparkcore/data/models/version.py +0 -0
- {espark_core-0.4.8 → espark_core-0.4.9}/esparkcore/data/repositories/__init__.py +0 -0
- {espark_core-0.4.8 → espark_core-0.4.9}/esparkcore/data/repositories/base_repository.py +0 -0
- {espark_core-0.4.8 → espark_core-0.4.9}/esparkcore/data/repositories/device_repository.py +0 -0
- {espark_core-0.4.8 → espark_core-0.4.9}/esparkcore/data/repositories/outbox_repository.py +0 -0
- {espark_core-0.4.8 → espark_core-0.4.9}/esparkcore/data/repositories/telemetry_repository.py +0 -0
- {espark_core-0.4.8 → espark_core-0.4.9}/esparkcore/data/repositories/version_repository.py +0 -0
- {espark_core-0.4.8 → espark_core-0.4.9}/esparkcore/notifications/__init__.py +0 -0
- {espark_core-0.4.8 → espark_core-0.4.9}/esparkcore/routers/__init__.py +0 -0
- {espark_core-0.4.8 → espark_core-0.4.9}/esparkcore/routers/base_router.py +0 -0
- {espark_core-0.4.8 → espark_core-0.4.9}/esparkcore/routers/device_router.py +0 -0
- {espark_core-0.4.8 → espark_core-0.4.9}/esparkcore/routers/telemetry_router.py +0 -0
- {espark_core-0.4.8 → espark_core-0.4.9}/esparkcore/routers/version_router.py +0 -0
- {espark_core-0.4.8 → espark_core-0.4.9}/esparkcore/schedules/__init__.py +0 -0
- {espark_core-0.4.8 → espark_core-0.4.9}/esparkcore/schedules/outbox.py +0 -0
- {espark_core-0.4.8 → espark_core-0.4.9}/esparkcore/schedules/scheduler.py +0 -0
- {espark_core-0.4.8 → espark_core-0.4.9}/esparkcore/services/__init__.py +0 -0
- {espark_core-0.4.8 → espark_core-0.4.9}/esparkcore/services/mqtt.py +0 -0
- {espark_core-0.4.8 → espark_core-0.4.9}/esparkcore/utils/__init__.py +0 -0
- {espark_core-0.4.8 → espark_core-0.4.9}/esparkcore/utils/logging.py +0 -0
- {espark_core-0.4.8 → espark_core-0.4.9}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: espark-core
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.9
|
|
4
4
|
Summary: The core module of the Espark ESP32-based IoT device management framework.
|
|
5
5
|
License: MIT
|
|
6
6
|
Requires-Python: >=3.8
|
|
@@ -8,14 +8,14 @@ Description-Content-Type: text/markdown
|
|
|
8
8
|
License-File: LICENSE
|
|
9
9
|
Requires-Dist: aiomqtt>=2.4.0
|
|
10
10
|
Requires-Dist: apscheduler>=3.11.1
|
|
11
|
-
Requires-Dist: fastapi>=0.124.
|
|
11
|
+
Requires-Dist: fastapi>=0.124.4
|
|
12
12
|
Requires-Dist: packaging>=25.0
|
|
13
13
|
Requires-Dist: slack-sdk==3.39.0
|
|
14
14
|
Requires-Dist: sqlalchemy>=2.0.45
|
|
15
15
|
Requires-Dist: sqlmodel>=0.0.27
|
|
16
16
|
Requires-Dist: uvicorn[standard]>=0.38.0
|
|
17
17
|
Provides-Extra: dev
|
|
18
|
-
Requires-Dist: aiosqlite==0.
|
|
18
|
+
Requires-Dist: aiosqlite==0.22.0; extra == "dev"
|
|
19
19
|
Requires-Dist: autopep8==2.3.2; extra == "dev"
|
|
20
20
|
Requires-Dist: build==1.3.0; extra == "dev"
|
|
21
21
|
Requires-Dist: fastapi-cli[standard-no-fastapi-cloud-cli]==0.0.16; extra == "dev"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: espark-core
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.9
|
|
4
4
|
Summary: The core module of the Espark ESP32-based IoT device management framework.
|
|
5
5
|
License: MIT
|
|
6
6
|
Requires-Python: >=3.8
|
|
@@ -8,14 +8,14 @@ Description-Content-Type: text/markdown
|
|
|
8
8
|
License-File: LICENSE
|
|
9
9
|
Requires-Dist: aiomqtt>=2.4.0
|
|
10
10
|
Requires-Dist: apscheduler>=3.11.1
|
|
11
|
-
Requires-Dist: fastapi>=0.124.
|
|
11
|
+
Requires-Dist: fastapi>=0.124.4
|
|
12
12
|
Requires-Dist: packaging>=25.0
|
|
13
13
|
Requires-Dist: slack-sdk==3.39.0
|
|
14
14
|
Requires-Dist: sqlalchemy>=2.0.45
|
|
15
15
|
Requires-Dist: sqlmodel>=0.0.27
|
|
16
16
|
Requires-Dist: uvicorn[standard]>=0.38.0
|
|
17
17
|
Provides-Extra: dev
|
|
18
|
-
Requires-Dist: aiosqlite==0.
|
|
18
|
+
Requires-Dist: aiosqlite==0.22.0; extra == "dev"
|
|
19
19
|
Requires-Dist: autopep8==2.3.2; extra == "dev"
|
|
20
20
|
Requires-Dist: build==1.3.0; extra == "dev"
|
|
21
21
|
Requires-Dist: fastapi-cli[standard-no-fastapi-cloud-cli]==0.0.16; extra == "dev"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
aiomqtt>=2.4.0
|
|
2
2
|
apscheduler>=3.11.1
|
|
3
|
-
fastapi>=0.124.
|
|
3
|
+
fastapi>=0.124.4
|
|
4
4
|
packaging>=25.0
|
|
5
5
|
slack-sdk==3.39.0
|
|
6
6
|
sqlalchemy>=2.0.45
|
|
@@ -8,7 +8,7 @@ sqlmodel>=0.0.27
|
|
|
8
8
|
uvicorn[standard]>=0.38.0
|
|
9
9
|
|
|
10
10
|
[dev]
|
|
11
|
-
aiosqlite==0.
|
|
11
|
+
aiosqlite==0.22.0
|
|
12
12
|
autopep8==2.3.2
|
|
13
13
|
build==1.3.0
|
|
14
14
|
fastapi-cli[standard-no-fastapi-cloud-cli]==0.0.16
|
|
@@ -8,7 +8,7 @@ from sqlmodel import SQLModel, Field, JSON
|
|
|
8
8
|
class Device(SQLModel, table=True):
|
|
9
9
|
id : str = Field(primary_key=True, description='Unique identifier for the device')
|
|
10
10
|
display_name : Optional[str] = Field(default=None, description='Human-readable name of the device')
|
|
11
|
-
app_name : Optional[str] = Field(default=None, description='Name of the application running on the device')
|
|
11
|
+
app_name : Optional[str] = Field(default=None, foreign_key='appversion.id', ondelete='CASCADE', description='Name of the application running on the device')
|
|
12
12
|
app_version : Optional[str] = Field(default=None, description='Version of the application running on the device')
|
|
13
13
|
capabilities : Optional[str] = Field(default=None, description='Comma separated capabilities of the device')
|
|
14
14
|
parameters : Dict[str, str | int | bool] = Field(default_factory=dict, sa_column=Column(JSON), description='JSON string of capability-specific parameters')
|
|
@@ -3,7 +3,7 @@ from abc import ABC, abstractmethod
|
|
|
3
3
|
|
|
4
4
|
class BaseNotifier(ABC):
|
|
5
5
|
@abstractmethod
|
|
6
|
-
async def notify(self, device_id: str, event_type: str, value: int
|
|
6
|
+
async def notify(self, device_id: str, event_type: str, value: int) -> None:
|
|
7
7
|
"""
|
|
8
8
|
Send a notification for an event.
|
|
9
9
|
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
from slack_sdk import WebClient
|
|
2
|
+
|
|
3
|
+
from ..utils import log_debug
|
|
4
|
+
from .notifier import BaseNotifier
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class SlackNotifier(BaseNotifier):
|
|
8
|
+
def __init__(self, slack_token: str, slack_channel: str) -> None:
|
|
9
|
+
self.slack_token = slack_token
|
|
10
|
+
self.slack_channel = slack_channel
|
|
11
|
+
|
|
12
|
+
async def notify(self, device_id: str, event_type: str, value: int) -> None:
|
|
13
|
+
client = WebClient(token=self.slack_token)
|
|
14
|
+
|
|
15
|
+
log_debug(f'Posting {event_type} event to Slack for device {device_id}: {value}')
|
|
16
|
+
|
|
17
|
+
client.chat_postMessage(channel=self.slack_channel, text=f'Device {device_id} reported {event_type} with value {value}.')
|
|
@@ -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.4.
|
|
13
|
+
version='0.4.9',
|
|
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',
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
from slack_sdk import WebClient
|
|
2
|
-
|
|
3
|
-
from ..utils import log_debug
|
|
4
|
-
from .notifier import BaseNotifier
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
class SlackNotifier(BaseNotifier):
|
|
8
|
-
async def notify(self, device_id: str, event_type: str, value: int, **kwargs) -> None:
|
|
9
|
-
slack_token = kwargs.get('slack_token')
|
|
10
|
-
slack_channel = kwargs.get('slack_channel')
|
|
11
|
-
|
|
12
|
-
client = WebClient(token=slack_token)
|
|
13
|
-
|
|
14
|
-
log_debug(f'Posting {event_type} event to Slack for device {device_id}: {value}')
|
|
15
|
-
|
|
16
|
-
client.chat_postMessage(channel=slack_channel, text=f'Device {device_id} reported {event_type} with value {value}.')
|
|
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.4.8 → espark_core-0.4.9}/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
|