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

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.
@@ -177856,6 +177856,21 @@ var advertisedOperationalStates = [
177856
177856
  OperationalState4.Docked
177857
177857
  ];
177858
177858
  var RvcOperationalStateServerBase = class extends RvcOperationalStateServer {
177859
+ /**
177860
+ * Alternating nonce that forces a structural difference in operationalError
177861
+ * on every update call. matter.js's Datasource uses isDeepEqual to detect
177862
+ * attribute changes — writing the same value is silently ignored, so no
177863
+ * subscription report is generated. By toggling errorStateDetails between
177864
+ * absent and "" (an optional, semantically meaningless field when
177865
+ * errorStateId is NoError), we guarantee the struct is never deep-equal to
177866
+ * its predecessor, which makes matter.js emit attrsChanged and produce a
177867
+ * subscription report.
177868
+ *
177869
+ * This works around a matter.js 0.16.x bug where the subscription
177870
+ * heartbeat timer (sendInterval) fails to fire for certain sessions,
177871
+ * causing Apple Home (iOS via Apple TV proxy) to show "Updating...".
177872
+ */
177873
+ keepaliveNonce = false;
177859
177874
  async initialize() {
177860
177875
  this.state.operationalStateList = advertisedOperationalStates.map((id) => ({
177861
177876
  operationalStateId: id
@@ -177876,13 +177891,17 @@ var RvcOperationalStateServerBase = class extends RvcOperationalStateServer {
177876
177891
  this.agent
177877
177892
  );
177878
177893
  const previousState = this.state.operationalState;
177894
+ this.keepaliveNonce = !this.keepaliveNonce;
177895
+ const errorStateId = newState === OperationalState4.Error ? ErrorState.Stuck : ErrorState.NoError;
177896
+ const operationalError = { errorStateId };
177897
+ if (this.keepaliveNonce) {
177898
+ operationalError.errorStateDetails = "";
177899
+ }
177879
177900
  applyPatchState(
177880
177901
  this.state,
177881
177902
  {
177882
177903
  operationalState: newState,
177883
- operationalError: {
177884
- errorStateId: newState === OperationalState4.Error ? ErrorState.Stuck : ErrorState.NoError
177885
- }
177904
+ operationalError
177886
177905
  },
177887
177906
  { force: true }
177888
177907
  );