@riddix/hamh 2.1.0-alpha.567 → 2.1.0-alpha.569

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.
@@ -167818,7 +167818,7 @@ var BasicInformationServer2 = class extends BridgedDeviceBasicInformationServer
167818
167818
  this.reactTo(homeAssistant.onChange, this.update);
167819
167819
  }
167820
167820
  update(entity) {
167821
- if (!entity.state) {
167821
+ if (!entity.state || !entity.state.attributes) {
167822
167822
  return;
167823
167823
  }
167824
167824
  const { basicInformation } = this.env.get(BridgeDataProvider);
@@ -167994,7 +167994,7 @@ var HumidityMeasurementServerBase = class extends RelativeHumidityMeasurementSer
167994
167994
  this.reactTo(homeAssistant.onChange, this.update);
167995
167995
  }
167996
167996
  update(entity) {
167997
- if (!entity.state) {
167997
+ if (!entity.state || !entity.state.attributes) {
167998
167998
  return;
167999
167999
  }
168000
168000
  const humidity = this.getHumidity(this.state.config, entity.state);
@@ -168058,7 +168058,7 @@ var PowerSourceServerBase = class extends FeaturedBase2 {
168058
168058
  this.reactTo(homeAssistant.onChange, this.update);
168059
168059
  }
168060
168060
  update(entity) {
168061
- if (!entity.state) {
168061
+ if (!entity.state || !entity.state.attributes) {
168062
168062
  return;
168063
168063
  }
168064
168064
  const config10 = this.state.config;
@@ -168144,7 +168144,7 @@ var TemperatureMeasurementServerBase = class extends TemperatureMeasurementServe
168144
168144
  this.reactTo(homeAssistant.onChange, this.update);
168145
168145
  }
168146
168146
  update(entity) {
168147
- if (!entity.state) {
168147
+ if (!entity.state || !entity.state.attributes) {
168148
168148
  return;
168149
168149
  }
168150
168150
  applyPatchState(this.state, {
@@ -168186,7 +168186,7 @@ var HepaFilterMonitoringServerBase = class extends FeaturedBase3 {
168186
168186
  this.reactTo(homeAssistant.onChange, this.update);
168187
168187
  }
168188
168188
  update(entity) {
168189
- if (!entity.state) {
168189
+ if (!entity.state || !entity.state.attributes) {
168190
168190
  return;
168191
168191
  }
168192
168192
  const filterLife = this.getFilterLife(this.state.config, entity.state);
@@ -168526,7 +168526,11 @@ var OnOffServerBase = class extends OnOffServer {
168526
168526
  this.update(homeAssistant.entity);
168527
168527
  this.reactTo(homeAssistant.onChange, this.update);
168528
168528
  }
168529
- update({ state }) {
168529
+ update(entity) {
168530
+ if (!entity.state || !entity.state.attributes) {
168531
+ return;
168532
+ }
168533
+ const { state } = entity;
168530
168534
  const onOff = this.isOn(state);
168531
168535
  const entityId = this.agent.get(HomeAssistantEntityBehavior).entity.entity_id;
168532
168536
  const optimistic = optimisticOnOffState.get(entityId);
@@ -169380,7 +169384,7 @@ var PressureMeasurementServerBase = class extends PressureMeasurementServer {
169380
169384
  this.reactTo(homeAssistant.onChange, this.update);
169381
169385
  }
169382
169386
  update(entity) {
169383
- if (!entity.state) {
169387
+ if (!entity.state || !entity.state.attributes) {
169384
169388
  return;
169385
169389
  }
169386
169390
  const pressure = this.getPressure(entity.state);
@@ -169735,7 +169739,7 @@ var ModeSelectServerBase = class extends ModeSelectServer {
169735
169739
  this.reactTo(homeAssistant.onChange, this.update);
169736
169740
  }
169737
169741
  update(entity) {
169738
- if (!entity.state) {
169742
+ if (!entity.state || !entity.state.attributes) {
169739
169743
  return;
169740
169744
  }
169741
169745
  const config10 = this.state.config;
@@ -169940,7 +169944,7 @@ var BooleanStateServerBase = class extends BooleanStateServer {
169940
169944
  this.reactTo(homeAssistant.onChange, this.update);
169941
169945
  }
169942
169946
  update(entity) {
169943
- if (!entity.state) {
169947
+ if (!entity.state || !entity.state.attributes) {
169944
169948
  return;
169945
169949
  }
169946
169950
  const newState = this.getStateValue(entity.state);
@@ -170016,7 +170020,7 @@ var PirOccupancySensingServer = class extends PirOccupancySensingServerBase {
170016
170020
  this.reactTo(homeAssistant.onChange, this.update);
170017
170021
  }
170018
170022
  update(entity) {
170019
- if (!entity.state) {
170023
+ if (!entity.state || !entity.state.attributes) {
170020
170024
  return;
170021
170025
  }
170022
170026
  const { state } = entity;
@@ -170084,7 +170088,7 @@ var OccupancySensingServer2 = class extends OccupancySensingServerBase {
170084
170088
  this.reactTo(homeAssistant.onChange, this.update);
170085
170089
  }
170086
170090
  update(entity) {
170087
- if (!entity.state) {
170091
+ if (!entity.state || !entity.state.attributes) {
170088
170092
  return;
170089
170093
  }
170090
170094
  const { state } = entity;
@@ -171463,7 +171467,7 @@ var WindowCoveringServerBase = class _WindowCoveringServerBase extends FeaturedB
171463
171467
  this.reactTo(homeAssistant.onChange, this.update);
171464
171468
  }
171465
171469
  update(entity) {
171466
- if (!entity.state) {
171470
+ if (!entity.state || !entity.state.attributes) {
171467
171471
  return;
171468
171472
  }
171469
171473
  const config10 = this.state.config;
@@ -172883,7 +172887,7 @@ var LockServerBase = class extends DoorLockServer {
172883
172887
  this.reactTo(homeAssistant.onChange, this.update);
172884
172888
  }
172885
172889
  update(entity) {
172886
- if (!entity.state) {
172890
+ if (!entity.state || !entity.state.attributes) {
172887
172891
  return;
172888
172892
  }
172889
172893
  applyPatchState(this.state, {
@@ -172955,7 +172959,7 @@ var LockServerWithPinBase = class extends PinCredentialBase {
172955
172959
  this.reactTo(homeAssistant.onChange, this.update);
172956
172960
  }
172957
172961
  update(entity) {
172958
- if (!entity.state) {
172962
+ if (!entity.state || !entity.state.attributes) {
172959
172963
  return;
172960
172964
  }
172961
172965
  const homeAssistant = this.agent.get(HomeAssistantEntityBehavior);
@@ -173149,7 +173153,7 @@ var LockServerWithPinAndUnboltBase = class extends PinCredentialUnboltBase {
173149
173153
  this.reactTo(homeAssistant.onChange, this.update);
173150
173154
  }
173151
173155
  update(entity) {
173152
- if (!entity.state) {
173156
+ if (!entity.state || !entity.state.attributes) {
173153
173157
  return;
173154
173158
  }
173155
173159
  const homeAssistant = this.agent.get(HomeAssistantEntityBehavior);
@@ -173511,7 +173515,7 @@ var MediaInputServerBase = class extends MediaInputServer {
173511
173515
  this.reactTo(homeAssistant.onChange, this.update);
173512
173516
  }
173513
173517
  update(entity) {
173514
- if (!entity.state) {
173518
+ if (!entity.state || !entity.state.attributes) {
173515
173519
  return;
173516
173520
  }
173517
173521
  const config10 = this.state.config;
@@ -173718,7 +173722,7 @@ var SpeakerLevelControlServerBase = class extends FeaturedBase9 {
173718
173722
  this.reactTo(homeAssistant.onChange, this.update);
173719
173723
  }
173720
173724
  update(entity) {
173721
- if (!entity.state) {
173725
+ if (!entity.state || !entity.state.attributes) {
173722
173726
  return;
173723
173727
  }
173724
173728
  const { state } = entity;
@@ -173907,7 +173911,7 @@ var PumpConfigurationAndControlServerBase = class extends PumpConfigurationAndCo
173907
173911
  this.reactTo(homeAssistant.onChange, this.update);
173908
173912
  }
173909
173913
  update(entity) {
173910
- if (!entity.state) {
173914
+ if (!entity.state || !entity.state.attributes) {
173911
173915
  return;
173912
173916
  }
173913
173917
  const isOn = this.agent.get(HomeAssistantEntityBehavior).isAvailable && entity.state.state === "on";
@@ -174208,7 +174212,7 @@ var CarbonMonoxideConcentrationMeasurementServer2 = class extends CarbonMonoxide
174208
174212
  this.reactTo(homeAssistant.onChange, this.update);
174209
174213
  }
174210
174214
  update(entity) {
174211
- if (!entity.state) {
174215
+ if (!entity.state || !entity.state.attributes) {
174212
174216
  return;
174213
174217
  }
174214
174218
  const state = entity.state.state;
@@ -174387,7 +174391,7 @@ var FlowMeasurementServerBase = class extends FlowMeasurementServer {
174387
174391
  this.reactTo(homeAssistant.onChange, this.update);
174388
174392
  }
174389
174393
  update(entity) {
174390
- if (!entity.state) {
174394
+ if (!entity.state || !entity.state.attributes) {
174391
174395
  return;
174392
174396
  }
174393
174397
  applyPatchState(this.state, {
@@ -174479,7 +174483,7 @@ var FormaldehydeConcentrationMeasurementServer2 = class extends FormaldehydeConc
174479
174483
  this.reactTo(homeAssistant.onChange, this.update);
174480
174484
  }
174481
174485
  update(entity) {
174482
- if (!entity.state) {
174486
+ if (!entity.state || !entity.state.attributes) {
174483
174487
  return;
174484
174488
  }
174485
174489
  const state = entity.state.state;
@@ -174569,7 +174573,7 @@ var IlluminanceMeasurementServerBase = class extends IlluminanceMeasurementServe
174569
174573
  this.reactTo(homeAssistant.onChange, this.update);
174570
174574
  }
174571
174575
  update(entity) {
174572
- if (!entity.state) {
174576
+ if (!entity.state || !entity.state.attributes) {
174573
174577
  return;
174574
174578
  }
174575
174579
  const illuminance = this.getIlluminance(this.state.config, entity.state);
@@ -174653,7 +174657,7 @@ var NitrogenDioxideConcentrationMeasurementServer2 = class extends NitrogenDioxi
174653
174657
  this.reactTo(homeAssistant.onChange, this.update);
174654
174658
  }
174655
174659
  update(entity) {
174656
- if (!entity.state) {
174660
+ if (!entity.state || !entity.state.attributes) {
174657
174661
  return;
174658
174662
  }
174659
174663
  const state = entity.state.state;
@@ -174746,7 +174750,7 @@ var OzoneConcentrationMeasurementServer2 = class extends OzoneConcentrationMeasu
174746
174750
  this.reactTo(homeAssistant.onChange, this.update);
174747
174751
  }
174748
174752
  update(entity) {
174749
- if (!entity.state) {
174753
+ if (!entity.state || !entity.state.attributes) {
174750
174754
  return;
174751
174755
  }
174752
174756
  const state = entity.state.state;
@@ -174839,7 +174843,7 @@ var Pm1ConcentrationMeasurementServer2 = class extends Pm1ConcentrationMeasureme
174839
174843
  this.reactTo(homeAssistant.onChange, this.update);
174840
174844
  }
174841
174845
  update(entity) {
174842
- if (!entity.state) {
174846
+ if (!entity.state || !entity.state.attributes) {
174843
174847
  return;
174844
174848
  }
174845
174849
  const state = entity.state.state;
@@ -174952,7 +174956,7 @@ var RadonConcentrationMeasurementServer2 = class extends RadonConcentrationMeasu
174952
174956
  this.reactTo(homeAssistant.onChange, this.update);
174953
174957
  }
174954
174958
  update(entity) {
174955
- if (!entity.state) {
174959
+ if (!entity.state || !entity.state.attributes) {
174956
174960
  return;
174957
174961
  }
174958
174962
  const state = entity.state.state;
@@ -175100,7 +175104,7 @@ var TvocConcentrationMeasurementServer = class extends TvocConcentrationMeasurem
175100
175104
  this.reactTo(homeAssistant.onChange, this.update);
175101
175105
  }
175102
175106
  update(entity) {
175103
- if (!entity.state) {
175107
+ if (!entity.state || !entity.state.attributes) {
175104
175108
  return;
175105
175109
  }
175106
175110
  const state = entity.state.state;
@@ -175213,7 +175217,7 @@ var CarbonDioxideConcentrationMeasurementServer2 = class extends CarbonDioxideCo
175213
175217
  this.reactTo(homeAssistant.onChange, this.update);
175214
175218
  }
175215
175219
  update(entity) {
175216
- if (!entity.state) {
175220
+ if (!entity.state || !entity.state.attributes) {
175217
175221
  return;
175218
175222
  }
175219
175223
  const state = entity.state.state;
@@ -175309,7 +175313,7 @@ var Pm10ConcentrationMeasurementServer2 = class extends Pm10ConcentrationMeasure
175309
175313
  this.reactTo(homeAssistant.onChange, this.update);
175310
175314
  }
175311
175315
  update(entity) {
175312
- if (!entity.state) {
175316
+ if (!entity.state || !entity.state.attributes) {
175313
175317
  return;
175314
175318
  }
175315
175319
  const state = entity.state.state;
@@ -175413,7 +175417,7 @@ var Pm25ConcentrationMeasurementServer2 = class extends Pm25ConcentrationMeasure
175413
175417
  this.reactTo(homeAssistant.onChange, this.update);
175414
175418
  }
175415
175419
  update(entity) {
175416
- if (!entity.state) {
175420
+ if (!entity.state || !entity.state.attributes) {
175417
175421
  return;
175418
175422
  }
175419
175423
  const state = entity.state.state;
@@ -175886,7 +175890,7 @@ var RvcRunModeServerBase = class extends RvcRunModeServer {
175886
175890
  this.reactTo(homeAssistant.onChange, this.update);
175887
175891
  }
175888
175892
  update(entity) {
175889
- if (!entity.state) {
175893
+ if (!entity.state || !entity.state.attributes) {
175890
175894
  return;
175891
175895
  }
175892
175896
  const previousMode = this.state.currentMode;
@@ -177153,7 +177157,7 @@ var RvcCleanModeServerBase = class _RvcCleanModeServerBase extends RvcCleanModeS
177153
177157
  this.reactTo(homeAssistant.onChange, this.update);
177154
177158
  }
177155
177159
  update(entity) {
177156
- if (!entity.state) {
177160
+ if (!entity.state || !entity.state.attributes) {
177157
177161
  return;
177158
177162
  }
177159
177163
  const reportedMode = this.state.config.getCurrentMode(
@@ -177929,7 +177933,7 @@ var RvcOperationalStateServerBase = class extends RvcOperationalStateServer {
177929
177933
  this.reactTo(homeAssistant.onChange, this.update);
177930
177934
  }
177931
177935
  update(entity) {
177932
- if (!entity.state) {
177936
+ if (!entity.state || !entity.state.attributes) {
177933
177937
  return;
177934
177938
  }
177935
177939
  const newState = this.state.config.getOperationalState(
@@ -178186,7 +178190,7 @@ var ValveConfigurationAndControlServerBase = class extends ValveConfigurationAnd
178186
178190
  this.reactTo(homeAssistant.onChange, this.update);
178187
178191
  }
178188
178192
  update(entity) {
178189
- if (!entity.state) {
178193
+ if (!entity.state || !entity.state.attributes) {
178190
178194
  return;
178191
178195
  }
178192
178196
  const config10 = this.state.config;
@@ -181186,11 +181190,11 @@ var ServerModeVacuumEndpoint = class _ServerModeVacuumEndpoint extends EntityEnd
181186
181190
  * Writing directly via endpoint.act() creates an independent
181187
181191
  * transaction that goes through the full commit lifecycle. */
181188
181192
  keepaliveTimer;
181189
- /** Alternating nonce so operationalError is structurally different
181190
- * each keepalive tick. matter.js's Datasource uses isDeepEqual;
181191
- * toggling errorStateDetails between absent and "" changes the
181192
- * property count so the struct is never deep-equal. */
181193
- keepaliveNonce = false;
181193
+ /** Monotonic counter that ensures operationalError is structurally
181194
+ * different on every keepalive tick. matter.js's Datasource uses
181195
+ * isDeepEqual; a unique errorStateLabel value guarantees the struct
181196
+ * is never deep-equal to its predecessor. */
181197
+ keepaliveCounter = 0;
181194
181198
  constructor(type, entityId, customName, mappedEntityIds) {
181195
181199
  super(type, entityId, customName, mappedEntityIds);
181196
181200
  this.flushUpdate = debounce6(this.flushPendingUpdate.bind(this), 50);
@@ -181210,22 +181214,24 @@ var ServerModeVacuumEndpoint = class _ServerModeVacuumEndpoint extends EntityEnd
181210
181214
  }
181211
181215
  /**
181212
181216
  * Write directly to the RvcOperationalState cluster in a fresh
181213
- * transaction. The nonce toggles errorStateDetails between absent
181214
- * and "" so the struct is structurally different each call,
181217
+ * transaction. Each call produces a unique errorStateLabel value
181218
+ * so the struct is never deep-equal to its predecessor,
181215
181219
  * guaranteeing matter.js emits attrsChanged → subscription report.
181216
181220
  */
181217
181221
  async pushKeepalive() {
181218
181222
  try {
181223
+ this.keepaliveCounter++;
181224
+ const counter = this.keepaliveCounter;
181225
+ logger203.info(`Keepalive #${counter} for ${this.entityId}`);
181219
181226
  await this.act("vacuum-keepalive", async (agent) => {
181220
181227
  const opState = agent.get(RvcOperationalStateServer);
181221
- this.keepaliveNonce = !this.keepaliveNonce;
181222
181228
  const errorStateId = opState.state.operationalError.errorStateId;
181223
- const operationalError = { errorStateId };
181224
- if (this.keepaliveNonce) {
181225
- operationalError.errorStateDetails = "";
181226
- }
181227
- opState.state.operationalError = operationalError;
181229
+ opState.state.operationalError = {
181230
+ errorStateId,
181231
+ errorStateLabel: `k${counter}`
181232
+ };
181228
181233
  });
181234
+ logger203.info(`Keepalive #${counter} committed for ${this.entityId}`);
181229
181235
  } catch (e) {
181230
181236
  if (e instanceof TransactionDestroyedError || e instanceof DestroyedDependencyError) {
181231
181237
  return;
@@ -181234,7 +181240,7 @@ var ServerModeVacuumEndpoint = class _ServerModeVacuumEndpoint extends EntityEnd
181234
181240
  if (msg.includes("Endpoint storage inaccessible")) {
181235
181241
  return;
181236
181242
  }
181237
- logger203.debug(`Keepalive failed for ${this.entityId}: ${msg}`);
181243
+ logger203.warn(`Keepalive failed for ${this.entityId}: ${msg}`);
181238
181244
  }
181239
181245
  }
181240
181246
  async updateStates(states) {