Initial commit: 上传完整代码

This commit is contained in:
2026-06-19 20:47:06 +08:00
commit 78b5898da2
71 changed files with 8767 additions and 0 deletions
+42
View File
@@ -0,0 +1,42 @@
import json
# MQTT配置
BROKER = "127.0.0.1"
MQTT_PORT = 1883
USER = "test"
PWD = "test"
# Modbus配置
TIMEOUT = 0.5
BYTESIZE = 8
PARITY = 'N'
STOPBITS = 1
# 读取间隔(秒)
READ_INTERVAL = 1
# MQTT主题
DEVICE_STATUS_TOPIC = "device/status"
DEVICE_CONTROL_TOPIC = "device/control"
DEVICE_HVS_CONTROL_TOPIC = "device/hvs/control"
DEVICE_API_TOPIC = "api/devices/hvs/response"
SERVICE_STATUS_TOPIC = "service/status"
# 寄存器配置 - 根据实际设备修改
INPUT_REGISTERS = {
"start_address": 0,
"count": 5
}
COIL_REGISTERS = {
"start_address": 0,
"count": 10
}
CONFIG_FILE = "/home/admin/.config/cpy/hvs.json"
try:
with open(CONFIG_FILE, "r") as f:
config = json.load(f)
except FileNotFoundError:
config = {}