Initial commit: 上传完整代码
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
import json
|
||||
|
||||
# MQTT配置
|
||||
BROKER = "127.0.0.1"
|
||||
MQTT_PORT = 1883
|
||||
USER = "test"
|
||||
PWD = "test"
|
||||
|
||||
# Modbus配置
|
||||
TIMEOUT = 0.1
|
||||
BYTESIZE = 8
|
||||
PARITY = 'N'
|
||||
STOPBITS = 1
|
||||
|
||||
# MQTT主题
|
||||
DEVICE_STATUS_TOPIC = "device/status"
|
||||
DEVICE_CONTROL_TOPIC = "device/control"
|
||||
SERVICE_STATUS_TOPIC = "service/status"
|
||||
|
||||
CONFIG_FILE = "/home/admin/.config/cpy/sensor.json"
|
||||
|
||||
try:
|
||||
with open(CONFIG_FILE, "r") as f:
|
||||
config = json.load(f)
|
||||
except FileNotFoundError:
|
||||
config = {}
|
||||
Reference in New Issue
Block a user