mirror of
https://github.com/emqx/neuron.git
synced 2026-10-19 05:51:27 +08:00
@@ -126,7 +126,7 @@
|
||||
"description_zh": "接收点位写入请求的 MQTT 主题。",
|
||||
"attribute": "required",
|
||||
"type": "string",
|
||||
"default": "/neuron/${random_str}/write/req",
|
||||
"default": "neuron/${random_str}/write/req",
|
||||
"valid": {
|
||||
"length": 255
|
||||
}
|
||||
@@ -138,7 +138,7 @@
|
||||
"description_zh": "发送点位写入响应的 MQTT 主题。",
|
||||
"attribute": "required",
|
||||
"type": "string",
|
||||
"default": "/neuron/${random_str}/write/resp",
|
||||
"default": "neuron/${random_str}/write/resp",
|
||||
"valid": {
|
||||
"length": 255
|
||||
}
|
||||
@@ -149,7 +149,7 @@
|
||||
"description": "MQTT topic prefix for driver function.",
|
||||
"attribute": "required",
|
||||
"type": "string",
|
||||
"default": "/neuron/${random_str}",
|
||||
"default": "neuron/${random_str}",
|
||||
"valid": {
|
||||
"length": 128
|
||||
}
|
||||
@@ -173,7 +173,7 @@
|
||||
"field": "upload_drv_state",
|
||||
"value": true
|
||||
},
|
||||
"default": "/neuron/${random_str}/state/update",
|
||||
"default": "neuron/${random_str}/state/update",
|
||||
"valid": {
|
||||
"length": 255
|
||||
}
|
||||
|
||||
@@ -265,13 +265,13 @@ static int create_topic(neu_plugin_t *plugin)
|
||||
return 0;
|
||||
}
|
||||
|
||||
neu_asprintf(&plugin->read_req_topic, "/neuron/%s/read/req",
|
||||
neu_asprintf(&plugin->read_req_topic, "neuron/%s/read/req",
|
||||
plugin->common.name);
|
||||
if (NULL == plugin->read_req_topic) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
neu_asprintf(&plugin->read_resp_topic, "/neuron/%s/read/resp",
|
||||
neu_asprintf(&plugin->read_resp_topic, "neuron/%s/read/resp",
|
||||
plugin->common.name);
|
||||
if (NULL == plugin->read_resp_topic) {
|
||||
free(plugin->read_req_topic);
|
||||
|
||||
@@ -62,12 +62,12 @@ TAGS = [
|
||||
]
|
||||
FORMAT_VALUES = 0
|
||||
FORMAT_TAGS = 1
|
||||
UPLOAD_TOPIC = f"/neuron/{NODE}/upload"
|
||||
WRITE_REQ_TOPIC = f"/neuron/{NODE}/write/req"
|
||||
WRITE_RESP_TOPIC = f"/neuron/{NODE}/write/resp"
|
||||
READ_REQ_TOPIC = f"/neuron/{NODE}/read/req"
|
||||
READ_RESP_TOPIC = f"/neuron/{NODE}/read/resp"
|
||||
UPLOAD_DRV_STATE_TOPIC = f"/neuron/{NODE}/state/update"
|
||||
UPLOAD_TOPIC = f"neuron/{NODE}/upload"
|
||||
WRITE_REQ_TOPIC = f"neuron/{NODE}/write/req"
|
||||
WRITE_RESP_TOPIC = f"neuron/{NODE}/write/resp"
|
||||
READ_REQ_TOPIC = f"neuron/{NODE}/read/req"
|
||||
READ_RESP_TOPIC = f"neuron/{NODE}/read/resp"
|
||||
UPLOAD_DRV_STATE_TOPIC = f"neuron/{NODE}/state/update"
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True, scope="class")
|
||||
@@ -204,7 +204,7 @@ def conf_upload_driver_state(conf_base):
|
||||
return {
|
||||
**conf_base,
|
||||
"upload_drv_state": True,
|
||||
"upload_drv_state_topic": f"/neuron/{NODE}/state/update",
|
||||
"upload_drv_state_topic": f"neuron/{NODE}/state/update",
|
||||
"upload_drv_state_interval": 1,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user