Files
sensgw/sensgw/models.py
2025-12-16 12:50:46 +06:00

35 lines
633 B
Python

# sensgw/models.py
from dataclasses import dataclass
from typing import Any
@dataclass(frozen=True)
class Endpoint:
endpoint_id: int
endpoint_key: str
protocol: str
conn: dict[str, Any]
is_enabled: bool
@dataclass(frozen=True)
class Device:
device_id: int
device_key: str
endpoint_id: int | None
location_id: int | None
is_enabled: bool
metadata: dict[str, Any]
@dataclass(frozen=True)
class Channel:
channel_id: int
device_id: int
metric: str
source: dict[str, Any]
scale_value: float
offset_value: float
poll_interval_s: int | None
is_enabled: bool