@apocaliss92/nodedreame 1.1.0 → 1.3.0

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/README.md CHANGED
@@ -288,6 +288,54 @@ parser and SVG renderer from
288
288
  [antondaubert/dreame-mower](https://github.com/antondaubert/dreame-mower). Both
289
289
  are MIT — see `LICENSE`.
290
290
 
291
+ ## Diagnostic dump (read-only)
292
+
293
+ `nodedreame` can record what a device exposes while it operates and export an
294
+ **anonymized** JSON you can attach to a GitHub issue to help map undocumented
295
+ codes (e.g. mower `taskStatus` 2/3/10/13). The dumper is strictly **read-only** —
296
+ it never sends a command and never wakes the robot to act. It only subscribes to
297
+ the device's event stream (`on`/`off`), reads the cache (`getProperty`), and
298
+ pulls the cloud shadow (`refreshFromCache`).
299
+
300
+ ```ts
301
+ import { Nodreame, createDumper } from '@apocaliss92/nodedreame';
302
+
303
+ const client = new Nodreame({ username, password, region: 'eu' });
304
+ await client.login();
305
+ const [device] = await client.discoverDevices();
306
+
307
+ const dumper = createDumper(device);
308
+ await dumper.start(); // hooks the live stream + periodic cloud-shadow read
309
+ // ...operate the device normally for a few minutes...
310
+ await dumper.stop();
311
+
312
+ console.log(dumper.exportJson()); // pretty, anonymized — safe to share
313
+ await client.close();
314
+ ```
315
+
316
+ What it captures: per-property distinct value-sets with an `unmapped` flag
317
+ (values that match no known enum — the highest-value signal), MIoT events, and a
318
+ static command/capability catalog. What it strips: device/account ids, tokens,
319
+ MAC, serial, Wi-Fi/IP, GPS, room names, and any custom device name (all →
320
+ `[redacted]`). `firmware`/`region` are omitted (not surfaced by the device
321
+ handle yet).
322
+
323
+ Dump a whole account at once with `createClientDumper(client)`, which returns one
324
+ dumper per discovered device:
325
+
326
+ ```ts
327
+ import { createClientDumper } from '@apocaliss92/nodedreame';
328
+
329
+ const dumpers = createClientDumper(client);
330
+ await Promise.all(dumpers.map((d) => d.start()));
331
+ // ...observe...
332
+ await Promise.all(dumpers.map((d) => d.stop()));
333
+ const dumps = dumpers.map((d) => d.exportJson());
334
+ ```
335
+
336
+ Share the exported JSON in a library issue — maintainers diff it against the enum
337
+ tables to label new codes and fold them into the library.
338
+
291
339
  ## Install
292
340
 
293
341
  ```bash