@ray-js/lamp-schedule-core 1.0.5-beta.6 → 1.0.5-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -69,12 +69,11 @@ export class WakeUpSigmesh {
|
|
|
69
69
|
var _data$nodes;
|
|
70
70
|
scheduleLogger.debug('Sigmesh dpParser ===> WakeUpSigmesh formatter: data', data);
|
|
71
71
|
// dataMode 可能是字符串 ('01'/'02'/'03') 或数字 (1/2/3)
|
|
72
|
-
|
|
73
|
-
// 使用 nodes.length 而非 data.length,因为调用方可能未更新 length 字段
|
|
72
|
+
typeof data.dataMode === 'string' ? parseInt(data.dataMode, 10) : data.dataMode; // 使用 nodes.length 而非 data.length,因为调用方可能未更新 length 字段
|
|
74
73
|
const nodeCount = (_data$nodes = data.nodes) === null || _data$nodes === void 0 ? void 0 : _data$nodes.length;
|
|
75
74
|
// 版本号固定为 1, 与文档不一致,文档有问题
|
|
76
75
|
|
|
77
|
-
const result = [numToHexString(1), numToHexString(
|
|
76
|
+
const result = [numToHexString(1), numToHexString(1), numToHexString(nodeCount)];
|
|
78
77
|
data.nodes.forEach(node => {
|
|
79
78
|
var _node$loops;
|
|
80
79
|
result.push(numToHexString(node.onOff ? 1 : 0), numToHexString(parseInt(node === null || node === void 0 || (_node$loops = node.loops) === null || _node$loops === void 0 || (_node$loops = _node$loops.split('')) === null || _node$loops === void 0 || (_node$loops = _node$loops.reverse()) === null || _node$loops === void 0 ? void 0 : _node$loops.join(''), 2)), numToHexString(node.step), numToHexString(node.hour), numToHexString(node.minute), numToHexString(node.brightness), numToHexString(node.temperature), numToHexString(node.duration));
|