homebridge-roborock-matter 2.9.3 → 2.9.4

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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.9.4
4
+
5
+ Startup-cost cleanup release (also refreshes the npm README with the Donate button and the prominent Verified badge).
6
+
7
+ - **Two fewer RSA-2048 key generations at every startup.** The MQTT connector generated a protocol keypair that nothing ever read (removed), and the message layer generated its keypair eagerly even though it is only needed for the rare photo request path on camera-equipped models (now created lazily on first use). Measured ~50 ms per keygen on fast hardware — substantially more on a Raspberry Pi.
8
+ - Removed dead code: the never-called `decryptWithPrivateKey` helper and the unused `scenesData` field (both HomeKit-era leftovers).
9
+
3
10
  ## 2.9.3
4
11
 
5
12
  **The plugin is now Verified by Homebridge!** 🎉 Reviewed and endorsed by the Homebridge team (homebridge/plugins#1124), with specific praise for the encrypted at-rest session storage, the preserved fork attribution, and the per-release notes.
package/README.md CHANGED
@@ -9,7 +9,6 @@
9
9
  </p>
10
10
 
11
11
  <p align="center">
12
- <a href="https://github.com/homebridge/homebridge/wiki/Verified-Plugins"><img src="https://img.shields.io/badge/homebridge-verified-blueviolet?color=%23491F59&style=flat" alt="verified-by-homebridge"></a>
13
12
  <a href="https://www.npmjs.com/package/homebridge-roborock-matter"><img src="https://img.shields.io/npm/v/homebridge-roborock-matter?label=npm&color=cb3837" alt="npm version"></a>
14
13
  <a href="https://www.npmjs.com/package/homebridge-roborock-matter"><img src="https://img.shields.io/npm/dt/homebridge-roborock-matter?label=downloads&color=8a5cf5" alt="npm downloads"></a>
15
14
  <a href="https://github.com/mathiashornbek/homebridge-roborock-matter/actions"><img src="https://img.shields.io/github/actions/workflow/status/mathiashornbek/homebridge-roborock-matter/nodejs.yml?label=CI" alt="CI status"></a>
@@ -18,6 +17,14 @@
18
17
  <a href="./LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue" alt="MIT license"></a>
19
18
  </p>
20
19
 
20
+ <p align="center">
21
+ <a href="https://paypal.me/MathiasHornbek"><img src="https://img.shields.io/badge/PayPal-Donate-00457C?logo=paypal&logoColor=white" alt="Donate via PayPal"></a>
22
+ </p>
23
+
24
+ <p align="center">
25
+ <a href="https://github.com/homebridge/homebridge/wiki/Verified-Plugins"><img src="https://img.shields.io/badge/homebridge-verified-blueviolet?color=%23491F59&style=for-the-badge&logoColor=%23FFFFFF&logo=homebridge" alt="Verified by Homebridge"></a>
26
+ </p>
27
+
21
28
  ---
22
29
 
23
30
  Log in with your **Roborock app account** — no token extraction, no rooted apps, no packet sniffing — and every robot appears in Apple Home as a first-class **Matter Robotic Vacuum Cleaner**: start, pause, dock, pick rooms, choose cleaning modes, and watch the status pill name the room the robot is _actually inside_, live.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "homebridge-roborock-matter",
3
- "version": "2.9.3",
3
+ "version": "2.9.4",
4
4
  "description": "Matter-only Homebridge plugin publishing Roborock robot vacuums (including 2025 B01/Q7-series) as native Matter accessories for Apple Home. Fork of homebridge-roborock-vacuum2.",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -32,7 +32,18 @@ class message {
32
32
  this.adapter = adapter;
33
33
  this.missingLocalKeyWarnings = new Set();
34
34
 
35
- this.keys = roborockCrypto.generateRsaKeyPair();
35
+ // The protocol RSA keypair is only needed for the rare photo request
36
+ // path (camera-equipped models). Generate it lazily on first use
37
+ // instead of paying a full RSA-2048 keygen (~50 ms on fast hardware,
38
+ // substantially more on a Raspberry Pi) at every startup.
39
+ this._keys = null;
40
+ }
41
+
42
+ get keys() {
43
+ if (!this._keys) {
44
+ this._keys = roborockCrypto.generateRsaKeyPair();
45
+ }
46
+ return this._keys;
36
47
  }
37
48
 
38
49
  async buildPayload(
@@ -77,7 +77,10 @@ class roborock_mqtt_connector {
77
77
 
78
78
  this.connected = false;
79
79
 
80
- this.keys = roborockCrypto.generateRsaKeyPair();
80
+ // NOTE: this class previously generated its own RSA-2048 keypair here,
81
+ // but nothing ever read it — the protocol keypair lives in message.js
82
+ // (lazily created for the rare photo path). Removed: one full RSA
83
+ // keygen less at every startup.
81
84
  }
82
85
 
83
86
  async initUser(userdata) {
@@ -524,24 +527,6 @@ class roborock_mqtt_connector {
524
527
 
525
528
  return false;
526
529
  }
527
-
528
- decryptWithPrivateKey(privateKeyPem, encryptedData) {
529
- const privateKey = crypto.createPrivateKey({
530
- key: privateKeyPem,
531
- format: "pem",
532
- type: "pkcs8",
533
- });
534
-
535
- const decryptedData = crypto.privateDecrypt(
536
- {
537
- key: privateKey,
538
- padding: crypto.constants.RSA_PKCS1_PADDING,
539
- },
540
- encryptedData
541
- );
542
-
543
- return decryptedData;
544
- }
545
530
  }
546
531
 
547
532
  /**
@@ -122,8 +122,6 @@ class Roborock {
122
122
  this.localDevices = {};
123
123
  this.remoteDevices = new Set();
124
124
 
125
- this.scenesData = null; // Store scenes data locally
126
-
127
125
  this.name = "roborock";
128
126
  this.deviceNotify = null;
129
127
  this.serviceAreaRoomMapRefreshAttempts = new Map();