@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.
@@ -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
- // 一直渐变:00; 到达节点15分钟内渐变:0f
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(0)}${to16(weeksValue)}${to16(number)}${rhythms.map(_ref => {
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,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/lamp-schedule-core",
3
- "version": "1.0.4-beta-1",
3
+ "version": "1.0.4-beta-2",
4
4
  "description": "照明计划模块核心能力",
5
5
  "main": "./lib/index.js",
6
6
  "files": [