- 新增WitsConfig数据类用于WITS配置管理 - 在AppConfig中集成wits配置选项 - 重命名dependencies.py为config.py并重构配置加载逻辑 - 移除db/config.py文件中的TDengine配置相关代码 - 创建新的model.py文件定义MqttConfig、TmsConfig和TdengineConfig模型 - 更新MQTT模块导入路径从config.dependencies到config.config - 添加WITS发送器脚本wits_sender.py实现TCP数据包发送 - 在README.md中添加WITS发送器使用说明和配置选项 - 添加WITS样本数据文件data/wits_sample.txt - 添加requirements.md文档说明项目需求
41 lines
619 B
Python
41 lines
619 B
Python
from dataclasses import dataclass
|
|
|
|
|
|
@dataclass
|
|
class MqttConfig:
|
|
broker: str
|
|
client_id: str
|
|
mock_client_id: str
|
|
sender_client_id: str
|
|
subscriber_client_id: str
|
|
username: str
|
|
password: str
|
|
pub_topic: str
|
|
|
|
|
|
@dataclass
|
|
class TmsConfig:
|
|
device_code: str
|
|
equipment_sn: str
|
|
timeout: int
|
|
keepalive: int
|
|
server_ip: str
|
|
server_port: int
|
|
|
|
|
|
@dataclass
|
|
class TdengineConfig:
|
|
url: str
|
|
username: str
|
|
password: str
|
|
database: str
|
|
stable: str
|
|
device_code: str
|
|
|
|
|
|
@dataclass
|
|
class Config:
|
|
mqtt: MqttConfig
|
|
tms: TmsConfig
|
|
tdengine: TdengineConfig
|