@ray-js/lock-sdk 1.1.1-beta.5 → 1.1.1-beta.7

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/log.js CHANGED
@@ -36,6 +36,12 @@ export const getLatestLogs = async () => {
36
36
  catch {
37
37
  }
38
38
  }
39
+ let userName = item.userName;
40
+ let unlockName = item.unlockName;
41
+ if (item.dpId === 89 || item.dpId === 69) {
42
+ unlockName = item.userName;
43
+ userName = "";
44
+ }
39
45
  return {
40
46
  type,
41
47
  logId: item.logId,
@@ -43,8 +49,8 @@ export const getLatestLogs = async () => {
43
49
  dpCode,
44
50
  data: itemData,
45
51
  userId: item.userId,
46
- userName: item.userName,
47
- unlockName: item.unlockName,
52
+ userName,
53
+ unlockName,
48
54
  mediaInfo: item.mediaInfoList,
49
55
  unionUnlockInfo: item.unionUnlockInfo?.map((item1) => {
50
56
  return {
@@ -142,6 +148,12 @@ export const getLogs = async (params) => {
142
148
  if (dpCode === dpCodes.lockLocalRecord) {
143
149
  type = "local_operation";
144
150
  }
151
+ let userName = record.userName;
152
+ let unlockName = record.unlockName;
153
+ if (record.dpId === 89 || record.dpId === 69) {
154
+ unlockName = record.userName;
155
+ userName = "";
156
+ }
145
157
  return {
146
158
  type,
147
159
  logId: record.historyId.toString(),
@@ -149,8 +161,8 @@ export const getLogs = async (params) => {
149
161
  dpId: record.dpId,
150
162
  data: dpValue,
151
163
  dpCode,
152
- userName: record.userName,
153
- unlockName: record.unlockName,
164
+ userName,
165
+ unlockName,
154
166
  mediaInfo: record.mediaInfoList,
155
167
  unionUnlockInfo: record.unionUnlockInfo?.map((item) => ({
156
168
  userId: item.userId,
package/lib/open.js CHANGED
@@ -94,7 +94,7 @@ const _doAction = async (isOpen, timeout) => {
94
94
  }
95
95
  return false;
96
96
  };
97
- if (hasThread && deviceStatus.onlineType === "local") {
97
+ if (hasThread && deviceStatus.onlineTypes.includes("local") && deviceStatus.onlineTypes.length === 1) {
98
98
  await publishDps({ [dpCodes.matterLanUnlock]: isOpen }, {
99
99
  checkReport: (dps) => {
100
100
  return typeof dps[dpCodes.matterLanUnlock] !== "undefined";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/lock-sdk",
3
- "version": "1.1.1-beta.5",
3
+ "version": "1.1.1-beta.7",
4
4
  "files": [
5
5
  "lib",
6
6
  "LICENSE.md"