mirror of
https://github.com/pyMC-dev/pyMC_Repeater.git
synced 2026-08-11 19:32:55 +02:00
refactor: companion FrameServer and related (substantive only, no Black)
Reapply refactor from ce8381a (replace monolithic FrameServer with thin pymc_core subclass, re-export constants, SQLite persistence hooks) while preserving pre-refactor whitespace where patch applied cleanly. Remaining files match refactor commit exactly. Diff vs ce8381a is whitespace-only. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
import json
|
||||
import logging
|
||||
import ssl
|
||||
from typing import Dict, Any, Optional
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
try:
|
||||
import paho.mqtt.client as mqtt
|
||||
|
||||
MQTT_AVAILABLE = True
|
||||
except ImportError:
|
||||
MQTT_AVAILABLE = False
|
||||
@@ -102,17 +103,17 @@ class MQTTHandler:
|
||||
try:
|
||||
base_topic = self.mqtt_config.get("base_topic", "meshcore/repeater")
|
||||
topic = f"{base_topic}/{self.node_name}/{record_type}"
|
||||
|
||||
|
||||
if record_type == "packet":
|
||||
packet_record = PacketRecord.from_packet_record(
|
||||
record,
|
||||
origin=self.node_name,
|
||||
origin_id=self.node_id
|
||||
record, origin=self.node_name, origin_id=self.node_id
|
||||
)
|
||||
if not packet_record:
|
||||
logger.debug("Skipping MQTT publish: packet missing required data for PacketRecord")
|
||||
logger.debug(
|
||||
"Skipping MQTT publish: packet missing required data for PacketRecord"
|
||||
)
|
||||
return
|
||||
|
||||
|
||||
payload = packet_record.to_dict()
|
||||
logger.debug("Publishing packet using PacketRecord format")
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user