@homebridge-plugins/homebridge-meross 10.20.0 → 10.20.1

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.
@@ -13,6 +13,19 @@ function generateRandomString(length) {
13
13
 
14
14
  const hasProperty = (obj, prop) => Object.hasOwn(obj, prop)
15
15
 
16
+ /**
17
+ * Whether an error means a request ran out of time, whichever library threw it.
18
+ *
19
+ * The device queue and the connection both time requests out, but they report
20
+ * it differently: the queue throws a DOMException named TimeoutError, and the
21
+ * connection throws p-timeout's own TimeoutError class. Checking for the class
22
+ * alone would miss the queue's timeouts and log them as a raw error instead of
23
+ * the plain "timed out" message. Both carry the same name, so check that.
24
+ */
25
+ function isTimeoutError(err) {
26
+ return err?.name === 'TimeoutError'
27
+ }
28
+
16
29
  function parseError(err, hideStack = []) {
17
30
  let toReturn = err.message
18
31
  if (err?.stack?.length > 0 && !hideStack.includes(err.message)) {
@@ -34,6 +47,7 @@ export {
34
47
  encodeParams,
35
48
  generateRandomString,
36
49
  hasProperty,
50
+ isTimeoutError,
37
51
  parseError,
38
52
  sleep,
39
53
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@homebridge-plugins/homebridge-meross",
3
3
  "alias": "Meross",
4
4
  "type": "module",
5
- "version": "10.20.0",
5
+ "version": "10.20.1",
6
6
  "description": "Homebridge plugin to integrate Meross devices into HomeKit.",
7
7
  "author": {
8
8
  "name": "bwp91",
@@ -61,16 +61,16 @@
61
61
  "changelog:sync": "node .github/scripts/sync-changelog.mjs"
62
62
  },
63
63
  "dependencies": {
64
- "@homebridge/plugin-ui-utils": "^2.2.5",
65
- "axios": "^1.19.0",
66
- "mqtt": "^5.15.2",
64
+ "@homebridge/plugin-ui-utils": "^2.2.6",
65
+ "axios": "^1.20.0",
66
+ "mqtt": "^5.16.1",
67
67
  "node-persist": "^4.0.4",
68
- "p-queue": "^9.3.3",
69
- "p-timeout": "^7.0.1"
68
+ "p-queue": "^10.0.0",
69
+ "p-timeout": "^8.0.0"
70
70
  },
71
71
  "devDependencies": {
72
- "@antfu/eslint-config": "^9.3.0",
73
- "@vitest/coverage-v8": "^4.1.10",
74
- "vitest": "^4.1.10"
72
+ "@antfu/eslint-config": "^9.5.1",
73
+ "@vitest/coverage-v8": "^5.0.5",
74
+ "vitest": "^5.0.5"
75
75
  }
76
76
  }