@riddix/hamh 2.1.0-alpha.576 → 2.1.0-alpha.578

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.
@@ -175949,8 +175949,8 @@ function isRoomMode(mode) {
175949
175949
  return mode >= ROOM_MODE_BASE;
175950
175950
  }
175951
175951
  var cleaningSessions = /* @__PURE__ */ new WeakMap();
175952
- function getSession(agent) {
175953
- let session = cleaningSessions.get(agent);
175952
+ function getSession(endpoint) {
175953
+ let session = cleaningSessions.get(endpoint);
175954
175954
  if (!session) {
175955
175955
  session = {
175956
175956
  completedAreas: /* @__PURE__ */ new Set(),
@@ -175958,7 +175958,7 @@ function getSession(agent) {
175958
175958
  activeAreas: [],
175959
175959
  loggedShortCircuits: /* @__PURE__ */ new Set()
175960
175960
  };
175961
- cleaningSessions.set(agent, session);
175961
+ cleaningSessions.set(endpoint, session);
175962
175962
  }
175963
175963
  return session;
175964
175964
  }
@@ -175973,7 +175973,7 @@ var RvcRunModeServerBase = class extends RvcRunModeServer {
175973
175973
  if (!entity.state || !entity.state.attributes) {
175974
175974
  return;
175975
175975
  }
175976
- const s = getSession(this.agent);
175976
+ const s = getSession(this.endpoint);
175977
175977
  const previousMode = this.state.currentMode;
175978
175978
  const newMode = this.state.config.getCurrentMode(entity.state, this.agent);
175979
175979
  applyPatchState(
@@ -176009,7 +176009,7 @@ var RvcRunModeServerBase = class extends RvcRunModeServer {
176009
176009
  * surfacing the silent paths that would otherwise be invisible.
176010
176010
  */
176011
176011
  logShortCircuitOnce(reason, message) {
176012
- const s = getSession(this.agent);
176012
+ const s = getSession(this.endpoint);
176013
176013
  if (s.loggedShortCircuits.has(reason)) return;
176014
176014
  s.loggedShortCircuits.add(reason);
176015
176015
  logger189.info(message);
@@ -176020,7 +176020,7 @@ var RvcRunModeServerBase = class extends RvcRunModeServer {
176020
176020
  */
176021
176021
  updateCurrentRoomFromSensor() {
176022
176022
  try {
176023
- const s = getSession(this.agent);
176023
+ const s = getSession(this.endpoint);
176024
176024
  const homeAssistant = this.agent.get(HomeAssistantEntityBehavior);
176025
176025
  const currentRoomEntityId = homeAssistant.state.mapping?.currentRoomEntity;
176026
176026
  if (!currentRoomEntityId) {
@@ -176121,7 +176121,7 @@ var RvcRunModeServerBase = class extends RvcRunModeServer {
176121
176121
  * matter.js property getters during transaction pre-commit.
176122
176122
  */
176123
176123
  updateProgress(serviceArea, areaId) {
176124
- const s = getSession(this.agent);
176124
+ const s = getSession(this.endpoint);
176125
176125
  if (s.activeAreas.length === 0) return;
176126
176126
  const state = serviceArea.state;
176127
176127
  if (areaId === null) {
@@ -176154,7 +176154,7 @@ var RvcRunModeServerBase = class extends RvcRunModeServer {
176154
176154
  }
176155
176155
  }
176156
176156
  changeToMode(request) {
176157
- const s = getSession(this.agent);
176157
+ const s = getSession(this.endpoint);
176158
176158
  const homeAssistant = this.agent.get(HomeAssistantEntityBehavior);
176159
176159
  const { newMode } = request;
176160
176160
  if (newMode !== this.state.currentMode && !this.state.supportedModes.some((m) => m.mode === newMode)) {
@@ -181012,6 +181012,11 @@ init_service();
181012
181012
 
181013
181013
  // src/matter/endpoints/server-mode-vacuum-endpoint.ts
181014
181014
  init_esm();
181015
+
181016
+ // ../../node_modules/.pnpm/@matter+main@0.16.10/node_modules/@matter/main/dist/esm/forwards/behaviors/rvc-run-mode.js
181017
+ init_nodejs();
181018
+
181019
+ // src/matter/endpoints/server-mode-vacuum-endpoint.ts
181015
181020
  init_home_assistant_entity_behavior();
181016
181021
  import debounce6 from "debounce";
181017
181022
 
@@ -181313,13 +181318,20 @@ var ServerModeVacuumEndpoint = class _ServerModeVacuumEndpoint extends EntityEnd
181313
181318
  this.keepaliveCounter++;
181314
181319
  const counter = this.keepaliveCounter;
181315
181320
  logger203.info(`Keepalive #${counter} for ${this.entityId}`);
181316
- const currentError = this.stateOf(RvcOperationalStateServer).operationalError;
181321
+ const opState = this.stateOf(RvcOperationalStateServer);
181317
181322
  await this.setStateOf(RvcOperationalStateServer, {
181323
+ operationalState: opState.operationalState,
181318
181324
  operationalError: {
181319
- errorStateId: currentError.errorStateId,
181325
+ errorStateId: opState.operationalError.errorStateId,
181320
181326
  errorStateDetails: `k${counter}`
181321
181327
  }
181322
181328
  });
181329
+ if (this.behaviors.has(RvcRunModeServer)) {
181330
+ const runMode = this.stateOf(RvcRunModeServer);
181331
+ await this.setStateOf(RvcRunModeServer, {
181332
+ currentMode: runMode.currentMode
181333
+ });
181334
+ }
181323
181335
  logger203.info(`Keepalive #${counter} committed for ${this.entityId}`);
181324
181336
  } catch (e) {
181325
181337
  if (e instanceof TransactionDestroyedError || e instanceof DestroyedDependencyError) {
@@ -183984,6 +183996,7 @@ export {
183984
183996
  @matter/main/dist/esm/forwards/clusters/rvc-clean-mode.js:
183985
183997
  @matter/main/dist/esm/forwards/behaviors/rvc-operational-state.js:
183986
183998
  @matter/main/dist/esm/forwards/clusters/rvc-operational-state.js:
183999
+ @matter/main/dist/esm/forwards/behaviors/rvc-run-mode.js:
183987
184000
  @matter/main/dist/esm/forwards/clusters/level-control.js:
183988
184001
  (**
183989
184002
  * @license