Files
python-api/app/communication/mqtt/topics.py
2026-03-01 07:44:19 +09:00

26 lines
988 B
Python

from __future__ import annotations
# ── Device → Server ──────────────────────────────────
DEVICE_TELEMETRY = "devices/{device_uid}/telemetry"
DEVICE_STATUS = "devices/{device_uid}/status"
DEVICE_LOG = "devices/{device_uid}/log"
DEVICE_RESPONSE = "devices/{device_uid}/response"
# ── Server → Device ──────────────────────────────────
DEVICE_COMMAND = "devices/{device_uid}/command"
DEVICE_CONFIG = "devices/{device_uid}/config"
DEVICE_OTA = "devices/{device_uid}/ota"
# ── Wildcard subscriptions ───────────────────────────
SUB_ALL_TELEMETRY = "devices/+/telemetry"
SUB_ALL_STATUS = "devices/+/status"
SUB_ALL_LOG = "devices/+/log"
SUB_ALL_RESPONSE = "devices/+/response"
SUBSCRIBE_TOPICS = [
SUB_ALL_TELEMETRY,
SUB_ALL_STATUS,
SUB_ALL_LOG,
SUB_ALL_RESPONSE,
]