feat(wits): 添加WITS TCP发送功能和配置重构
- 新增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文档说明项目需求
This commit is contained in:
40
config/model.py
Normal file
40
config/model.py
Normal file
@@ -0,0 +1,40 @@
|
||||
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
|
||||
Reference in New Issue
Block a user