@ray-js/lamp-schedule-core 1.0.4-beta-1 → 1.0.4-beta-2
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.
- package/lib/dpParser/rhythms.js +5 -3
- package/package.json +1 -1
package/lib/dpParser/rhythms.js
CHANGED
|
@@ -89,9 +89,11 @@ export default class RhythmFormatter {
|
|
|
89
89
|
version,
|
|
90
90
|
power,
|
|
91
91
|
weeks,
|
|
92
|
-
rhythms
|
|
92
|
+
rhythms,
|
|
93
|
+
mode: dataMode
|
|
93
94
|
} = data;
|
|
94
|
-
|
|
95
|
+
const normalizedMode = Number(dataMode);
|
|
96
|
+
const mode = normalizedMode === 0 || normalizedMode === 15 ? normalizedMode : 0; // 仅允许00或0F,非法值回落为00
|
|
95
97
|
ScheduleLogger.debug('协议解析 rhythms formatter:', data);
|
|
96
98
|
const weekStr = [...weeks].reverse().join('').padStart(8, '0');
|
|
97
99
|
const number = rhythms.length;
|
|
@@ -99,7 +101,7 @@ export default class RhythmFormatter {
|
|
|
99
101
|
// 兼容 matter 设备,需要获取 dpCodes 来判断是否支持色温
|
|
100
102
|
const dpCodes = getDPByProtocol();
|
|
101
103
|
const isSupportWhiteTemp = support.isSupportDp(dpCodes.TEMPERATURE);
|
|
102
|
-
return `${to16(version)}${to16(Number(power))}${to16(
|
|
104
|
+
return `${to16(version)}${to16(Number(power))}${to16(mode)}${to16(weeksValue)}${to16(number)}${rhythms.map(_ref => {
|
|
103
105
|
let {
|
|
104
106
|
power,
|
|
105
107
|
hour,
|