@homebridge-wyze-node24/homebridge-wyze-node24 1.1.1 → 1.1.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.
Files changed (2) hide show
  1. package/package.json +6 -15
  2. package/src/security.js +13 -6
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@homebridge-wyze-node24/homebridge-wyze-node24",
3
- "version": "1.1.1",
4
- "description": "Wyze Smart Home plugin for Homebridge compatible with Node.JS 24",
3
+ "version": "1.1.3",
4
+ "description": "Wyze Smart Home plugin for Homebridge (Node.js 24 compatible)",
5
5
  "license": "MIT",
6
6
  "type": "commonjs",
7
7
  "main": "src/index.js",
@@ -23,7 +23,7 @@
23
23
  },
24
24
  "engines": {
25
25
  "homebridge": "^1.6.0 || ^2.0.0-beta.0",
26
- "node": ">=24.13.1"
26
+ "node": "^18.20.4 || ^20.15.1 || ^22"
27
27
  },
28
28
  "files": [
29
29
  "src/**/*",
@@ -35,21 +35,12 @@
35
35
  "logo.png"
36
36
  ],
37
37
  "dependencies": {
38
- "aws-sdk": "2.1693.0",
39
- "axios": "^1.5.0",
40
- "base64-js": "1.5.1",
41
38
  "colorsys": "^1.0.22",
42
- "crypto-js": "4.2.0",
43
- "inherits": "2.0.4",
44
- "md5": "^2.2.1",
45
- "moment": "2.30.1",
46
- "querystring": "0.2.1",
47
- "urllib": "4.9.0",
48
- "utf8": "^3.0.0",
49
- "uuid": "13.0.0",
50
- "uuid-by-string": "4.0.0",
51
39
  "wyze-api": "1.1.7"
52
40
  },
41
+ "peerDependencies": {
42
+ "homebridge": "^1.6.0 || ^2.0.0-beta.0"
43
+ },
53
44
  "devDependencies": {
54
45
  "eslint": "^8.17.0",
55
46
  "eslint-config-standard": "^17.0.0",
package/src/security.js CHANGED
@@ -111,17 +111,24 @@ function sanitizeDeviceName(name) {
111
111
  }
112
112
 
113
113
  function wrapLogger(log) {
114
- const baseFn = typeof log === 'function' ? log : (...args) => log.info(...args)
114
+ const callLevel = (level, args) => {
115
+ const sanitizedArgs = args.map(sanitizeLogMessage)
115
116
 
116
- const wrapped = (...args) => baseFn(...args.map(sanitizeLogMessage))
117
+ if (log && typeof log[level] === 'function') {
118
+ return log[level](...sanitizedArgs)
119
+ }
117
120
 
118
- for (const level of ['error', 'warn', 'info', 'debug']) {
119
- const underlying = log?.[level]
120
- if (typeof underlying === 'function') {
121
- wrapped[level] = (...args) => underlying(...args.map(sanitizeLogMessage))
121
+ if (typeof log === 'function') {
122
+ return log(...sanitizedArgs)
122
123
  }
123
124
  }
124
125
 
126
+ const wrapped = (...args) => callLevel('info', args)
127
+
128
+ for (const level of ['error', 'warn', 'info', 'debug']) {
129
+ wrapped[level] = (...args) => callLevel(level, args)
130
+ }
131
+
125
132
  return wrapped
126
133
  }
127
134