@riddix/hamh 2.1.0-alpha.559 → 2.1.0-alpha.561

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.
@@ -175935,6 +175935,14 @@ var RvcRunModeServerBase = class extends RvcRunModeServer {
175935
175935
  matchedAreaId = segmentId;
175936
175936
  }
175937
175937
  }
175938
+ if (matchedAreaId === null && segmentId != null) {
175939
+ for (const area of serviceArea.state.supportedAreas) {
175940
+ if (this.activeAreas.includes(area.areaId) && area.areaId % 1e4 === segmentId) {
175941
+ matchedAreaId = area.areaId;
175942
+ break;
175943
+ }
175944
+ }
175945
+ }
175938
175946
  if (matchedAreaId === null && roomName) {
175939
175947
  const area = serviceArea.state.supportedAreas.find(
175940
175948
  (a) => a.areaInfo.locationInfo?.locationName?.toLowerCase() === roomName.toLowerCase()
@@ -175944,8 +175952,8 @@ var RvcRunModeServerBase = class extends RvcRunModeServer {
175944
175952
  }
175945
175953
  }
175946
175954
  if (matchedAreaId === null) {
175947
- logger189.debug(
175948
- `currentRoom sensor: no match for "${roomName}" (segmentId=${segmentId}), activeAreas=[${this.activeAreas.join(", ")}]`
175955
+ logger189.info(
175956
+ `currentRoom sensor: no match for "${roomName}" (segmentId=${segmentId}), activeAreas=[${this.activeAreas.join(", ")}], supportedAreas=[${serviceArea.state.supportedAreas.map((a) => `${a.areaId}:${a.areaInfo.locationInfo?.locationName}`).join(", ")}]`
175949
175957
  );
175950
175958
  return;
175951
175959
  }
@@ -175954,11 +175962,15 @@ var RvcRunModeServerBase = class extends RvcRunModeServer {
175954
175962
  this.completedAreas.add(this.lastCurrentArea);
175955
175963
  }
175956
175964
  this.lastCurrentArea = matchedAreaId;
175957
- logger189.debug(
175958
- `currentRoom sensor: area ${matchedAreaId} ("${roomName}"), completed: [${[...this.completedAreas].join(", ")}]`
175965
+ logger189.info(
175966
+ `currentRoom sensor: transition to area ${matchedAreaId} ("${roomName}"), completed: [${[...this.completedAreas].join(", ")}]`
175959
175967
  );
175960
175968
  this.trySetCurrentArea(matchedAreaId);
175961
- } catch {
175969
+ } catch (e) {
175970
+ const msg = e instanceof Error ? e.message : String(e);
175971
+ if (!msg.includes("No provider for") && !msg.includes("not supported")) {
175972
+ logger189.warn(`currentRoom sensor update failed: ${msg}`);
175973
+ }
175962
175974
  }
175963
175975
  }
175964
175976
  /**
@@ -177856,6 +177868,21 @@ var advertisedOperationalStates = [
177856
177868
  OperationalState4.Docked
177857
177869
  ];
177858
177870
  var RvcOperationalStateServerBase = class extends RvcOperationalStateServer {
177871
+ /**
177872
+ * Alternating nonce that forces a structural difference in operationalError
177873
+ * on every update call. matter.js's Datasource uses isDeepEqual to detect
177874
+ * attribute changes — writing the same value is silently ignored, so no
177875
+ * subscription report is generated. By toggling errorStateDetails between
177876
+ * absent and "" (an optional, semantically meaningless field when
177877
+ * errorStateId is NoError), we guarantee the struct is never deep-equal to
177878
+ * its predecessor, which makes matter.js emit attrsChanged and produce a
177879
+ * subscription report.
177880
+ *
177881
+ * This works around a matter.js 0.16.x bug where the subscription
177882
+ * heartbeat timer (sendInterval) fails to fire for certain sessions,
177883
+ * causing Apple Home (iOS via Apple TV proxy) to show "Updating...".
177884
+ */
177885
+ keepaliveNonce = false;
177859
177886
  async initialize() {
177860
177887
  this.state.operationalStateList = advertisedOperationalStates.map((id) => ({
177861
177888
  operationalStateId: id
@@ -177876,13 +177903,17 @@ var RvcOperationalStateServerBase = class extends RvcOperationalStateServer {
177876
177903
  this.agent
177877
177904
  );
177878
177905
  const previousState = this.state.operationalState;
177906
+ this.keepaliveNonce = !this.keepaliveNonce;
177907
+ const errorStateId = newState === OperationalState4.Error ? ErrorState.Stuck : ErrorState.NoError;
177908
+ const operationalError = { errorStateId };
177909
+ if (this.keepaliveNonce) {
177910
+ operationalError.errorStateDetails = "";
177911
+ }
177879
177912
  applyPatchState(
177880
177913
  this.state,
177881
177914
  {
177882
177915
  operationalState: newState,
177883
- operationalError: {
177884
- errorStateId: newState === OperationalState4.Error ? ErrorState.Stuck : ErrorState.NoError
177885
- }
177916
+ operationalError
177886
177917
  },
177887
177918
  { force: true }
177888
177919
  );