Working device manager, added folders for better organization.

This commit is contained in:
ferdzo
2025-10-30 14:26:08 +01:00
parent 12d3720421
commit 7446e9b4ac
21 changed files with 342 additions and 47 deletions

View File

@@ -10,10 +10,10 @@ import time
import structlog
from typing import List
from config import config
from redis_reader import RedisReader
from db_writer import DatabaseWriter
from schema import SchemaHandler, StreamMessage, TelemetryReading
from src.config import config
from src.redis_reader import RedisReader
from src.db_writer import DatabaseWriter
from src.schema import SchemaHandler, StreamMessage, TelemetryReading
def configure_logging():

View File

@@ -4,9 +4,8 @@ from sqlalchemy import create_engine, select
from sqlalchemy.orm import sessionmaker
from sqlalchemy.pool import QueuePool
from config import config
from schema import TelemetryReading
from models import Telemetry
from src.config import config
from src.schema import TelemetryReading
class DatabaseWriter:
@@ -40,7 +39,7 @@ class DatabaseWriter:
try:
# Convert to database objects using the correct field mapping
db_objects = [
Telemetry(
TelemetryReading(
time=reading.time,
device_id=reading.device_id,
metric=reading.metric,

View File

@@ -1,8 +1,8 @@
import redis
import logging
from typing import List, Optional, Dict
from config import config
from schema import SchemaHandler, StreamMessage
from src.config import config
from src.schema import SchemaHandler, StreamMessage
class RedisReader: