feat:对接参数记录echart、空调度数获取设置

This commit is contained in:
吉浩茹
2025-10-01 02:42:22 +08:00
parent ad9ae93117
commit deb4d99393
28 changed files with 3666 additions and 203 deletions

View File

@ -122,7 +122,7 @@ const initEventHandleMqtt = (topicUrl) => {
duration: 3000
});
} else {
console.log("✅ MQTT订阅主题成功:", topicUrl);
// console.log("✅ MQTT订阅主题成功:", topicUrl);
}
});
});
@ -137,13 +137,10 @@ const initEventHandleMqtt = (topicUrl) => {
// 获取信息
const mqttData = JSON.parse(message.toString());
console.log('📋 解析后的数据:', mqttData);
console.log('数据类型:', Array.isArray(mqttData) ? '数组' : '对象');
// 如果是数组,打印数组信息
if (Array.isArray(mqttData)) {
console.log('📋 数组长度:', mqttData.length);
mqttData.forEach((item, index) => {
console.log(`📦 数组[${index}]:`, item);
if (item.Device) {
console.log(`🔍 设备类型[${index}]: ${item.Device}`);
}
@ -221,16 +218,16 @@ const judgeBeat = () => {
// 获取连接状态
const getConnectionStatus = () => {
if (!client) {
console.log('🔍 连接状态检查: 客户端不存在');
// console.log('🔍 连接状态检查: 客户端不存在');
return false;
}
const isConnected = client.connected;
console.log('🔍 连接状态检查:', {
clientExists: !!client,
connected: isConnected,
readyState: client.stream ? client.stream.readyState : 'unknown'
});
// console.log('🔍 连接状态检查:', {
// clientExists: !!client,
// connected: isConnected,
// readyState: client.stream ? client.stream.readyState : 'unknown'
// });
return isConnected;
};