@ray-js/lamp-schedule-core 1.0.2-beta-1 → 1.0.2-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/hooks/useCommonSupport.js +16 -19
- package/package.json +1 -1
|
@@ -77,30 +77,27 @@ export const useScheduleInit = props => {
|
|
|
77
77
|
ScheduleLogger.info('useScheduleInit registerGroupChange groupId: ', props.groupId);
|
|
78
78
|
registerGroupChange({
|
|
79
79
|
groupIdList: [props.groupId],
|
|
80
|
-
success(
|
|
81
|
-
|
|
82
|
-
// 监听dp值变化 并触发
|
|
83
|
-
|
|
84
|
-
if (_isInit) {
|
|
85
|
-
ScheduleLogger.warn('useSupport: support is already initialized');
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
onGroupDpDataChangeEvent(res => {
|
|
89
|
-
if (!(res !== null && res !== void 0 && res.dps)) {
|
|
90
|
-
ScheduleLogger.warn(`useScheduleInit fail ${DP_CHANGE_EVENT_KEY}`, res);
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
ScheduleLogger.info(`useScheduleInit ${DP_CHANGE_EVENT_KEY}`, res);
|
|
94
|
-
emitter.emit(DP_CHANGE_EVENT_KEY, {
|
|
95
|
-
deviceId: res.devId || res.deviceId || res.groupId,
|
|
96
|
-
dps: res === null || res === void 0 ? void 0 : res.dps
|
|
97
|
-
});
|
|
98
|
-
});
|
|
80
|
+
success() {
|
|
81
|
+
// 安卓下有问题,不会触发到这里,所以 onGroupDpDataChangeEvent 挪到外面去了
|
|
99
82
|
},
|
|
100
83
|
fail(err) {
|
|
101
84
|
ScheduleLogger.error('useScheduleInit registerGroupChange fail', err);
|
|
102
85
|
}
|
|
103
86
|
});
|
|
87
|
+
ScheduleLogger.info('useScheduleInit registerGroupChange success: ', res);
|
|
88
|
+
// 监听dp值变化 并触发
|
|
89
|
+
|
|
90
|
+
onGroupDpDataChangeEvent(res => {
|
|
91
|
+
if (!(res !== null && res !== void 0 && res.dps)) {
|
|
92
|
+
ScheduleLogger.warn(`useScheduleInit fail ${DP_CHANGE_EVENT_KEY}`, res);
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
ScheduleLogger.info(`useScheduleInit ${DP_CHANGE_EVENT_KEY}`, res);
|
|
96
|
+
emitter.emit(DP_CHANGE_EVENT_KEY, {
|
|
97
|
+
deviceId: res.devId || res.deviceId || res.groupId,
|
|
98
|
+
dps: res === null || res === void 0 ? void 0 : res.dps
|
|
99
|
+
});
|
|
100
|
+
});
|
|
104
101
|
} else if (props.devId) {
|
|
105
102
|
ScheduleLogger.info('useScheduleInit registerDeviceListListener devId: ', props.devId);
|
|
106
103
|
registerDeviceListListener({
|