@ray-js/lamp-schedule-core 1.0.2-beta-1 → 1.0.2-beta-3
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 +15 -19
- package/package.json +1 -1
|
@@ -77,30 +77,26 @@ 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
|
+
// 监听dp值变化 并触发
|
|
88
|
+
|
|
89
|
+
onGroupDpDataChangeEvent(res => {
|
|
90
|
+
if (!(res !== null && res !== void 0 && res.dps)) {
|
|
91
|
+
ScheduleLogger.warn(`useScheduleInit fail ${DP_CHANGE_EVENT_KEY}`, res);
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
ScheduleLogger.info(`useScheduleInit ${DP_CHANGE_EVENT_KEY}`, res);
|
|
95
|
+
emitter.emit(DP_CHANGE_EVENT_KEY, {
|
|
96
|
+
deviceId: res.devId || res.deviceId || res.groupId,
|
|
97
|
+
dps: res === null || res === void 0 ? void 0 : res.dps
|
|
98
|
+
});
|
|
99
|
+
});
|
|
104
100
|
} else if (props.devId) {
|
|
105
101
|
ScheduleLogger.info('useScheduleInit registerDeviceListListener devId: ', props.devId);
|
|
106
102
|
registerDeviceListListener({
|