@apocaliss92/nodedreame 1.3.1 → 1.4.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/dist/index.cjs +32 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +17 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.js +32 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1221,7 +1221,14 @@ var VACUUM_PROP = {
|
|
|
1221
1221
|
/** VERIFIED r2532a 2026-05-03 — task progress percentage 0..100. */
|
|
1222
1222
|
TASK_PROGRESS_PCT: { siid: 4, piid: 63 },
|
|
1223
1223
|
/** VERIFIED r2532a — mop-drying progress (minutes ticking during MopDrying). */
|
|
1224
|
-
DRYING_PROGRESS: { siid: 4, piid: 64 }
|
|
1224
|
+
DRYING_PROGRESS: { siid: 4, piid: 64 },
|
|
1225
|
+
/**
|
|
1226
|
+
* Map "PATH" push — the OSS object name of the latest map frame the robot
|
|
1227
|
+
* uploaded (the value passed to {@link VacuumDevice.getMap}). Arrives via the
|
|
1228
|
+
* MQTT push during/after cleaning; NOT in `DEFAULT_PROPS` because it is not
|
|
1229
|
+
* polled (it is pushed). Read it through {@link VacuumDevice.mapFilename}.
|
|
1230
|
+
*/
|
|
1231
|
+
MAP_PATH: { siid: 6, piid: 3 }
|
|
1225
1232
|
};
|
|
1226
1233
|
var VACUUM_ACTION = {
|
|
1227
1234
|
/** ASSUMED Tasshack — start cleaning. */
|
|
@@ -2877,6 +2884,30 @@ var VacuumDevice = class _VacuumDevice extends BaseDevice {
|
|
|
2877
2884
|
get lastMap() {
|
|
2878
2885
|
return this.#lastMap;
|
|
2879
2886
|
}
|
|
2887
|
+
/**
|
|
2888
|
+
* The OSS object name of the latest map frame the robot advertised via its
|
|
2889
|
+
* PATH push (siid 6 piid 3), or `null` when none has been observed yet (the
|
|
2890
|
+
* robot has not uploaded a map since connect). This is the `filename` to pass
|
|
2891
|
+
* to {@link getMap} — or just call {@link fetchLatestMap}.
|
|
2892
|
+
*/
|
|
2893
|
+
get mapFilename() {
|
|
2894
|
+
const v = this.getProperty(VACUUM_PROP.MAP_PATH.siid, VACUUM_PROP.MAP_PATH.piid)?.value;
|
|
2895
|
+
return typeof v === "string" && v.length > 0 ? v : null;
|
|
2896
|
+
}
|
|
2897
|
+
/**
|
|
2898
|
+
* Convenience: fetch + decode the LATEST map frame the robot advertised,
|
|
2899
|
+
* reading {@link mapFilename} and delegating to {@link getMap}. Returns `null`
|
|
2900
|
+
* when no map filename has been observed yet (vs throwing) so a consumer can
|
|
2901
|
+
* poll it safely; once a filename is present it behaves exactly like
|
|
2902
|
+
* {@link getMap} (capability-gated on `canMap`, caches {@link lastMap}, emits
|
|
2903
|
+
* `'map'`). The `fetcher`/`key`/`iv`/`host`/`timeoutMs`/`signal` overrides are
|
|
2904
|
+
* forwarded verbatim.
|
|
2905
|
+
*/
|
|
2906
|
+
async fetchLatestMap(opts = {}) {
|
|
2907
|
+
const filename = this.mapFilename;
|
|
2908
|
+
if (filename === null) return null;
|
|
2909
|
+
return this.getMap({ filename, ...opts });
|
|
2910
|
+
}
|
|
2880
2911
|
/**
|
|
2881
2912
|
* The current room/segment id, derived from the most-recently-decoded map's
|
|
2882
2913
|
* active-segment set (`sa`). `null` when no map has been fetched or no
|