@apocaliss92/nodedreame 1.6.0 → 1.6.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.
package/dist/index.d.cts CHANGED
@@ -1280,6 +1280,16 @@ declare class VacuumDevice extends BaseDevice<VacuumDeviceEvents> {
1280
1280
  * when the value is unobserved or the feature is not representable.
1281
1281
  */
1282
1282
  aiFeature(feature: DreameAiFeature): boolean | null;
1283
+ /**
1284
+ * Seed {@link aiDetectionRaw} from the CLOUD SHADOW (the last value the robot
1285
+ * pushed for `AI_DETECTION`, siid 4 piid 22) WITHOUT waking it. The AI-obstacle
1286
+ * toggles are STATIC settings the robot rarely re-pushes over MQTT, so a fresh
1287
+ * connect to an idle robot has no value cached — call this on activate to
1288
+ * surface the current toggles. Emits the usual `propertyChanged`/`stateChanged`
1289
+ * (so a watching consumer re-decodes) and returns the resolved raw value
1290
+ * (`null` when the model has no AI detection or the shadow carries none yet).
1291
+ */
1292
+ refreshAiDetection(): Promise<AiDetectionRaw>;
1283
1293
  /**
1284
1294
  * Toggle ONE AI-obstacle feature, preserving the others via a read-modify-write
1285
1295
  * of the packed `AI_DETECTION` property (mirrors Tasshack `set_ai_detection`).
package/dist/index.d.ts CHANGED
@@ -1280,6 +1280,16 @@ declare class VacuumDevice extends BaseDevice<VacuumDeviceEvents> {
1280
1280
  * when the value is unobserved or the feature is not representable.
1281
1281
  */
1282
1282
  aiFeature(feature: DreameAiFeature): boolean | null;
1283
+ /**
1284
+ * Seed {@link aiDetectionRaw} from the CLOUD SHADOW (the last value the robot
1285
+ * pushed for `AI_DETECTION`, siid 4 piid 22) WITHOUT waking it. The AI-obstacle
1286
+ * toggles are STATIC settings the robot rarely re-pushes over MQTT, so a fresh
1287
+ * connect to an idle robot has no value cached — call this on activate to
1288
+ * surface the current toggles. Emits the usual `propertyChanged`/`stateChanged`
1289
+ * (so a watching consumer re-decodes) and returns the resolved raw value
1290
+ * (`null` when the model has no AI detection or the shadow carries none yet).
1291
+ */
1292
+ refreshAiDetection(): Promise<AiDetectionRaw>;
1283
1293
  /**
1284
1294
  * Toggle ONE AI-obstacle feature, preserving the others via a read-modify-write
1285
1295
  * of the packed `AI_DETECTION` property (mirrors Tasshack `set_ai_detection`).
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // src/support/version.ts
2
2
  var LIBRARY_NAME = "nodedreame";
3
- var LIBRARY_VERSION = "1.6.0";
3
+ var LIBRARY_VERSION = "1.6.1";
4
4
 
5
5
  // src/transport/errors.ts
6
6
  var DreameError = class extends Error {
@@ -2793,6 +2793,20 @@ var VacuumDevice = class _VacuumDevice extends BaseDevice {
2793
2793
  aiFeature(feature) {
2794
2794
  return decodeAiFeature(this.aiDetectionRaw, feature);
2795
2795
  }
2796
+ /**
2797
+ * Seed {@link aiDetectionRaw} from the CLOUD SHADOW (the last value the robot
2798
+ * pushed for `AI_DETECTION`, siid 4 piid 22) WITHOUT waking it. The AI-obstacle
2799
+ * toggles are STATIC settings the robot rarely re-pushes over MQTT, so a fresh
2800
+ * connect to an idle robot has no value cached — call this on activate to
2801
+ * surface the current toggles. Emits the usual `propertyChanged`/`stateChanged`
2802
+ * (so a watching consumer re-decodes) and returns the resolved raw value
2803
+ * (`null` when the model has no AI detection or the shadow carries none yet).
2804
+ */
2805
+ async refreshAiDetection() {
2806
+ if (!this.#caps.hasAiObstacleDetection) return null;
2807
+ await this.refreshCachedProperties([VACUUM_PROP.AI_DETECTION]);
2808
+ return this.aiDetectionRaw;
2809
+ }
2796
2810
  /**
2797
2811
  * Toggle ONE AI-obstacle feature, preserving the others via a read-modify-write
2798
2812
  * of the packed `AI_DETECTION` property (mirrors Tasshack `set_ai_detection`).