@ray-js/lamp-schedule-core 1.0.2-beta-10 → 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/__test__/cycle.test.js +1 -0
- package/lib/dpParser/__test__/rtcTimer.test.js +1 -0
- package/lib/dpParser/__test__/wakeupSigmesh.test.js +1 -0
- package/lib/dpParser/cycle/index.js +1 -0
- package/lib/dpParser/random/index.js +1 -0
- package/lib/dpParser/rhythms.js +6 -3
- package/lib/hooks/__test__/useCycleDp.test.js +1 -0
- package/lib/hooks/__test__/useRandomDp.test.js +1 -0
- package/lib/hooks/__test__/useRhythmsDp.test.js +1 -0
- package/lib/hooks/__test__/useSleepDp.test.js +1 -0
- package/lib/hooks/__test__/useTimerDp.test.js +1 -0
- package/lib/hooks/__test__/useTimerOperateLocal.test.js +1 -0
- package/lib/hooks/__test__/useTimerReportDp.test.js +1 -0
- package/lib/hooks/__test__/useWakeUpDp.test.js +1 -0
- package/lib/hooks/useCommon.js +4 -1
- package/lib/hooks/useCommonSupport.js +1 -0
- package/lib/hooks/useLampRoad.js +0 -1
- package/lib/utils/ScheduleCloudProperty.js +1 -0
- package/lib/utils/ScheduleDataSync.js +1 -0
- package/lib/utils/ScheduleEmit.js +1 -0
- package/lib/utils/ScheduleLogger.js +1 -0
- package/lib/utils/__test__/ScheduleCloudProperty.test.js +1 -0
- package/lib/utils/common.js +1 -0
- package/lib/utils/objectToId.js +1 -0
- package/package.json +3 -3
package/lib/dpParser/rhythms.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import "core-js/modules/esnext.iterator.constructor.js";
|
|
1
2
|
import "core-js/modules/esnext.iterator.map.js";
|
|
2
3
|
import { generateDpStrStep, numToHexString } from '@ray-js/panel-sdk/lib/utils';
|
|
3
4
|
import { padStart } from 'lodash-es';
|
|
@@ -88,9 +89,11 @@ export default class RhythmFormatter {
|
|
|
88
89
|
version,
|
|
89
90
|
power,
|
|
90
91
|
weeks,
|
|
91
|
-
rhythms
|
|
92
|
+
rhythms,
|
|
93
|
+
mode: dataMode
|
|
92
94
|
} = data;
|
|
93
|
-
|
|
95
|
+
const normalizedMode = Number(dataMode);
|
|
96
|
+
const mode = normalizedMode === 0 || normalizedMode === 15 ? normalizedMode : 0; // 仅允许00或0F,非法值回落为00
|
|
94
97
|
ScheduleLogger.debug('协议解析 rhythms formatter:', data);
|
|
95
98
|
const weekStr = [...weeks].reverse().join('').padStart(8, '0');
|
|
96
99
|
const number = rhythms.length;
|
|
@@ -98,7 +101,7 @@ export default class RhythmFormatter {
|
|
|
98
101
|
// 兼容 matter 设备,需要获取 dpCodes 来判断是否支持色温
|
|
99
102
|
const dpCodes = getDPByProtocol();
|
|
100
103
|
const isSupportWhiteTemp = support.isSupportDp(dpCodes.TEMPERATURE);
|
|
101
|
-
return `${to16(version)}${to16(Number(power))}${to16(
|
|
104
|
+
return `${to16(version)}${to16(Number(power))}${to16(mode)}${to16(weeksValue)}${to16(number)}${rhythms.map(_ref => {
|
|
102
105
|
let {
|
|
103
106
|
power,
|
|
104
107
|
hour,
|
package/lib/hooks/useCommon.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useEffect, useRef } from 'react';
|
|
2
|
-
import { hideMenuButton } from '@ray-js/ray';
|
|
2
|
+
import { hideMenuButton, showMenuButton } from '@ray-js/ray';
|
|
3
3
|
import { getCachedSystemInfo } from '../utils/getCachedSystemInfo';
|
|
4
4
|
export let Themes = /*#__PURE__*/function (Themes) {
|
|
5
5
|
Themes["dark"] = "dark";
|
|
@@ -55,5 +55,8 @@ export const useIsIOS = () => {
|
|
|
55
55
|
export const useHideMenu = () => {
|
|
56
56
|
useEffect(() => {
|
|
57
57
|
hideMenuButton();
|
|
58
|
+
return () => {
|
|
59
|
+
showMenuButton();
|
|
60
|
+
};
|
|
58
61
|
}, []);
|
|
59
62
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import "core-js/modules/es.json.stringify.js";
|
|
2
3
|
import "core-js/modules/esnext.iterator.constructor.js";
|
|
3
4
|
import "core-js/modules/esnext.iterator.every.js";
|
|
4
5
|
import "core-js/modules/esnext.iterator.for-each.js";
|
package/lib/hooks/useLampRoad.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import "core-js/modules/esnext.iterator.constructor.js";
|
|
2
2
|
import "core-js/modules/esnext.iterator.every.js";
|
|
3
|
-
import "core-js/modules/esnext.iterator.find.js";
|
|
4
3
|
import "core-js/modules/esnext.iterator.map.js";
|
|
5
4
|
import "core-js/modules/esnext.iterator.some.js";
|
|
6
5
|
// 判断照明灯是几路
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import "core-js/modules/es.json.stringify.js";
|
|
2
3
|
import "core-js/modules/esnext.iterator.constructor.js";
|
|
3
4
|
import "core-js/modules/esnext.iterator.filter.js";
|
|
4
5
|
import "core-js/modules/esnext.iterator.find.js";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import "core-js/modules/es.json.stringify.js";
|
|
2
3
|
import { renderHook } from '@testing-library/react-hooks';
|
|
3
4
|
import { getDevProperty, saveDevProperty, requestCloud, getDeviceProperty } from '@ray-js/ray';
|
|
4
5
|
import { saveList, save, update, get, getAll, remove, useCloudProperty, useLocalTimerCloudProperty } from '../ScheduleCloudProperty';
|
package/lib/utils/common.js
CHANGED
package/lib/utils/objectToId.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ray-js/lamp-schedule-core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4-beta-2",
|
|
4
4
|
"description": "照明计划模块核心能力",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"files": [
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
"@babel/core": "^7.0.0",
|
|
41
41
|
"@commitlint/cli": "^7.2.1",
|
|
42
42
|
"@commitlint/config-conventional": "^9.0.1",
|
|
43
|
-
"@ray-js/cli": "^1.
|
|
43
|
+
"@ray-js/cli": "^1.7.57",
|
|
44
44
|
"@ray-js/panel-sdk": "^1.13.6-beta.2",
|
|
45
|
-
"@ray-js/ray": "^1.
|
|
45
|
+
"@ray-js/ray": "^1.7.57",
|
|
46
46
|
"@testing-library/dom": "^10.0.0",
|
|
47
47
|
"@testing-library/react": "^16.3.0",
|
|
48
48
|
"@testing-library/react-hooks": "^8.0.1",
|