@riddix/hamh 2.1.0-alpha.837 → 2.1.0-alpha.839

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.
@@ -1767,8 +1767,8 @@ var init_Cancelable = __esm({
1767
1767
  };
1768
1768
  return result;
1769
1769
  }
1770
- static set logger(logger247) {
1771
- this.#logger = logger247;
1770
+ static set logger(logger248) {
1771
+ this.#logger = logger248;
1772
1772
  }
1773
1773
  static get logger() {
1774
1774
  return this.#logger;
@@ -3475,13 +3475,13 @@ var init_Logger = __esm({
3475
3475
  *
3476
3476
  * @deprecated use {@link destinations}
3477
3477
  */
3478
- static addLogger(identifier, logger247, options) {
3478
+ static addLogger(identifier, logger248, options) {
3479
3479
  if (identifier in this.destinations) {
3480
3480
  throw new ImplementationError(`Logger "${identifier}" already exists`);
3481
3481
  }
3482
3482
  const dest = LogDestination({ name: identifier });
3483
3483
  const legacy = adaptDestinationToLegacy(dest);
3484
- legacy.log = logger247;
3484
+ legacy.log = logger248;
3485
3485
  if (options?.defaultLogLevel !== void 0) {
3486
3486
  legacy.defaultLogLevel = options.defaultLogLevel;
3487
3487
  }
@@ -5687,8 +5687,8 @@ var init_Construction = __esm({
5687
5687
  }
5688
5688
  }
5689
5689
  #unhandledError(...args) {
5690
- const logger247 = Logger.get(this.#subject.constructor.name);
5691
- logger247.error(...args);
5690
+ const logger248 = Logger.get(this.#subject.constructor.name);
5691
+ logger248.error(...args);
5692
5692
  }
5693
5693
  #createErrorHandler(name) {
5694
5694
  return (e) => {
@@ -64070,8 +64070,8 @@ var init_NodeSession = __esm({
64070
64070
  return session?.type === SessionType.Unicast;
64071
64071
  }
64072
64072
  NodeSession2.is = is;
64073
- function logNew(logger247, operation, session, messenger, fabric, peerNodeId) {
64074
- logger247.info(
64073
+ function logNew(logger248, operation, session, messenger, fabric, peerNodeId) {
64074
+ logger248.info(
64075
64075
  session.via,
64076
64076
  `${operation} session with`,
64077
64077
  Diagnostic.strong(PeerAddress({ fabricIndex: fabric.fabricIndex, nodeId: peerNodeId }).toString()),
@@ -117714,11 +117714,11 @@ var init_Api = __esm({
117714
117714
  }
117715
117715
  Api2.resourceFor = resourceFor;
117716
117716
  function log(level, facility, id, ...message) {
117717
- let logger247 = loggers.get(facility);
117718
- if (!logger247) {
117719
- loggers.set(facility, logger247 = Logger.get(facility));
117717
+ let logger248 = loggers.get(facility);
117718
+ if (!logger248) {
117719
+ loggers.set(facility, logger248 = Logger.get(facility));
117720
117720
  }
117721
- logger247[level](Diagnostic.via(id || "(anon)"), message);
117721
+ logger248[level](Diagnostic.via(id || "(anon)"), message);
117722
117722
  }
117723
117723
  Api2.log = log;
117724
117724
  function logRequest(facility, id, method, target) {
@@ -131221,6 +131221,13 @@ var init_controller_compat = __esm({
131221
131221
  aqara: "yes",
131222
131222
  note: "Aqara lists battery storage; others show battery inside a device."
131223
131223
  },
131224
+ 1292: {
131225
+ apple: "no",
131226
+ google: "no",
131227
+ alexa: "no",
131228
+ aqara: "yes",
131229
+ note: "HA and Aqara render EnergyEvse; SmartThings announced support, unconfirmed. Bridged EVSE can break Alexa device recognition, keep it off Alexa bridges."
131230
+ },
131224
131231
  39: {
131225
131232
  apple: "no",
131226
131233
  google: "no",
@@ -132624,10 +132631,10 @@ var init_home_assistant_actions = __esm({
132624
132631
  circuitBreakerResetMs: 3e4
132625
132632
  };
132626
132633
  HomeAssistantActions = class extends Service {
132627
- constructor(logger247, client, config11) {
132634
+ constructor(logger248, client, config11) {
132628
132635
  super("HomeAssistantActions");
132629
132636
  this.client = client;
132630
- this.log = logger247.get(this);
132637
+ this.log = logger248.get(this);
132631
132638
  this.config = { ...defaultConfig, ...config11 };
132632
132639
  this.circuitBreaker = new CircuitBreaker(
132633
132640
  this.config.circuitBreakerThreshold,
@@ -132973,10 +132980,10 @@ var DiagnosticService = class {
132973
132980
  };
132974
132981
 
132975
132982
  // src/api/access-log.ts
132976
- function accessLogger(logger247) {
132983
+ function accessLogger(logger248) {
132977
132984
  return (req, res, next) => {
132978
132985
  res.on("finish", () => {
132979
- logger247.debug(
132986
+ logger248.debug(
132980
132987
  `${req.method} ${decodeURI(req.originalUrl)} ${res.statusCode} ${res.statusMessage} from ${req.socket.remoteAddress}`
132981
132988
  );
132982
132989
  });
@@ -133161,6 +133168,8 @@ WARNING: ${includeIdentity ? "This backup contains sensitive Matter identity dat
133161
133168
  currentEntity: config11.currentEntity,
133162
133169
  batteryPowerEntity: config11.batteryPowerEntity,
133163
133170
  batteryEnergyEntity: config11.batteryEnergyEntity,
133171
+ chargingSwitchEntity: config11.chargingSwitchEntity,
133172
+ currentLimitEntity: config11.currentLimitEntity,
133164
133173
  suctionLevelEntity: config11.suctionLevelEntity,
133165
133174
  mopIntensityEntity: config11.mopIntensityEntity,
133166
133175
  valetudoIdentifier: config11.valetudoIdentifier,
@@ -133322,6 +133331,8 @@ WARNING: ${includeIdentity ? "This backup contains sensitive Matter identity dat
133322
133331
  currentEntity: config11.currentEntity,
133323
133332
  batteryPowerEntity: config11.batteryPowerEntity,
133324
133333
  batteryEnergyEntity: config11.batteryEnergyEntity,
133334
+ chargingSwitchEntity: config11.chargingSwitchEntity,
133335
+ currentLimitEntity: config11.currentLimitEntity,
133325
133336
  suctionLevelEntity: config11.suctionLevelEntity,
133326
133337
  mopIntensityEntity: config11.mopIntensityEntity,
133327
133338
  temperatureEntity: config11.temperatureEntity,
@@ -134174,6 +134185,8 @@ function entityMappingApi(mappingStorage, identityStorage) {
134174
134185
  currentEntity: body.currentEntity,
134175
134186
  batteryPowerEntity: body.batteryPowerEntity,
134176
134187
  batteryEnergyEntity: body.batteryEnergyEntity,
134188
+ chargingSwitchEntity: body.chargingSwitchEntity,
134189
+ currentLimitEntity: body.currentLimitEntity,
134177
134190
  suctionLevelEntity: body.suctionLevelEntity,
134178
134191
  mopIntensityEntity: body.mopIntensityEntity,
134179
134192
  customServiceAreas: body.customServiceAreas,
@@ -134675,6 +134688,8 @@ function configToProfileEntry(config11) {
134675
134688
  currentEntity: config11.currentEntity,
134676
134689
  batteryPowerEntity: config11.batteryPowerEntity,
134677
134690
  batteryEnergyEntity: config11.batteryEnergyEntity,
134691
+ chargingSwitchEntity: config11.chargingSwitchEntity,
134692
+ currentLimitEntity: config11.currentLimitEntity,
134678
134693
  suctionLevelEntity: config11.suctionLevelEntity,
134679
134694
  mopIntensityEntity: config11.mopIntensityEntity,
134680
134695
  customServiceAreas: config11.customServiceAreas,
@@ -134814,6 +134829,8 @@ function mappingProfileApi(mappingStorage) {
134814
134829
  currentEntity: entry.currentEntity,
134815
134830
  batteryPowerEntity: entry.batteryPowerEntity,
134816
134831
  batteryEnergyEntity: entry.batteryEnergyEntity,
134832
+ chargingSwitchEntity: entry.chargingSwitchEntity,
134833
+ currentLimitEntity: entry.currentLimitEntity,
134817
134834
  suctionLevelEntity: entry.suctionLevelEntity,
134818
134835
  mopIntensityEntity: entry.mopIntensityEntity,
134819
134836
  customServiceAreas: entry.customServiceAreas,
@@ -135090,6 +135107,8 @@ function getMappedEntityIds(mapping) {
135090
135107
  if (mapping.currentEntity) ids.push(mapping.currentEntity);
135091
135108
  if (mapping.batteryPowerEntity) ids.push(mapping.batteryPowerEntity);
135092
135109
  if (mapping.batteryEnergyEntity) ids.push(mapping.batteryEnergyEntity);
135110
+ if (mapping.chargingSwitchEntity) ids.push(mapping.chargingSwitchEntity);
135111
+ if (mapping.currentLimitEntity) ids.push(mapping.currentLimitEntity);
135093
135112
  if (mapping.currentRoomEntity) ids.push(mapping.currentRoomEntity);
135094
135113
  if (mapping.cleanedAreaEntity) ids.push(mapping.cleanedAreaEntity);
135095
135114
  if (mapping.composedEntities) {
@@ -137511,7 +137530,7 @@ var WebSocketApi = class {
137511
137530
 
137512
137531
  // src/api/web-api.ts
137513
137532
  var WebApi = class extends Service {
137514
- constructor(logger247, bridgeService, haClient, haRegistry, bridgeStorage, mappingStorage, identityStorage, lockCredentialStorage, settingsStorage, backupService, props) {
137533
+ constructor(logger248, bridgeService, haClient, haRegistry, bridgeStorage, mappingStorage, identityStorage, lockCredentialStorage, settingsStorage, backupService, props) {
137515
137534
  super("WebApi");
137516
137535
  this.bridgeService = bridgeService;
137517
137536
  this.haClient = haClient;
@@ -137523,8 +137542,8 @@ var WebApi = class extends Service {
137523
137542
  this.settingsStorage = settingsStorage;
137524
137543
  this.backupService = backupService;
137525
137544
  this.props = props;
137526
- this.logger = logger247;
137527
- this.log = logger247.get(this);
137545
+ this.logger = logger248;
137546
+ this.log = logger248.get(this);
137528
137547
  this.accessLogger = accessLogger(this.log.createChild("Access Log"));
137529
137548
  this.startTime = Date.now();
137530
137549
  this.wsApi = new WebSocketApi(
@@ -138715,10 +138734,10 @@ function isTransientConnectError(reason) {
138715
138734
  return msg.includes("socket hang up") || msg.includes("tls") || msg.includes("TLS");
138716
138735
  }
138717
138736
  var HomeAssistantClient = class extends Service {
138718
- constructor(logger247, options) {
138737
+ constructor(logger248, options) {
138719
138738
  super("HomeAssistantClient");
138720
138739
  this.options = options;
138721
- this.log = logger247.get(this);
138740
+ this.log = logger248.get(this);
138722
138741
  }
138723
138742
  options;
138724
138743
  static Options = /* @__PURE__ */ Symbol.for("HomeAssistantClientProps");
@@ -139534,6 +139553,8 @@ var EntityMappingStorage = class extends Service {
139534
139553
  currentEntity: request.currentEntity?.trim() || void 0,
139535
139554
  batteryPowerEntity: request.batteryPowerEntity?.trim() || void 0,
139536
139555
  batteryEnergyEntity: request.batteryEnergyEntity?.trim() || void 0,
139556
+ chargingSwitchEntity: request.chargingSwitchEntity?.trim() || void 0,
139557
+ currentLimitEntity: request.currentLimitEntity?.trim() || void 0,
139537
139558
  pressureEntity: request.pressureEntity?.trim() || void 0,
139538
139559
  suctionLevelEntity: request.suctionLevelEntity?.trim() || void 0,
139539
139560
  mopIntensityEntity: request.mopIntensityEntity?.trim() || void 0,
@@ -139562,7 +139583,7 @@ var EntityMappingStorage = class extends Service {
139562
139583
  composedEntities: request.composedEntities?.filter((e) => e.entityId?.trim()) ?? void 0,
139563
139584
  disableMomentaryFlip: request.disableMomentaryFlip || void 0
139564
139585
  };
139565
- if (!config11.matterDeviceType && !config11.customName && !config11.customProductName && !config11.customVendorName && !config11.customSerialNumber && config11.customVendorId === void 0 && config11.disabled !== true && !config11.filterLifeEntity && !config11.cleaningModeEntity && !config11.temperatureEntity && !config11.humidityEntity && !config11.batteryEntity && !config11.disableBatteryMapping && !config11.chargingStateEntity && !config11.roomEntities && !config11.disableLockPin && !config11.lockUsercodeService && config11.lockUsercodeSlot === void 0 && config11.lockPinMinLength === void 0 && config11.lockPinMaxLength === void 0 && !config11.powerEntity && !config11.energyEntity && !config11.voltageEntity && !config11.currentEntity && !config11.batteryPowerEntity && !config11.batteryEnergyEntity && !config11.pressureEntity && !config11.suctionLevelEntity && !config11.mopIntensityEntity && (!config11.customServiceAreas || config11.customServiceAreas.length === 0) && (!config11.customFanSpeedTags || Object.keys(config11.customFanSpeedTags).length === 0) && (!config11.fanWindPresets || (config11.fanWindPresets.natural?.length ?? 0) === 0 && (config11.fanWindPresets.sleep?.length ?? 0) === 0) && !config11.fanRestoreSpeedOnPowerOn && !config11.currentRoomEntity && !config11.cleanedAreaEntity && !config11.disableCustomAreaRoomModes && !config11.valetudoIdentifier && !config11.coverSwapOpenClose && !config11.coverExposeAsDimmableLight && !config11.selectExposeAsSwitch && !config11.selectSwitchOnOption && !config11.selectSwitchOffOption && !config11.coverSliderDebounceMs && !config11.updateThrottleMs && !config11.disableClimateOnOff && !config11.disableClimateFanControl && !config11.climateKeepModeOnIdle && !config11.climateExposeFan && !config11.climateAutoMode && (!config11.composedEntities || config11.composedEntities.length === 0) && !config11.disableMomentaryFlip) {
139586
+ if (!config11.matterDeviceType && !config11.customName && !config11.customProductName && !config11.customVendorName && !config11.customSerialNumber && config11.customVendorId === void 0 && config11.disabled !== true && !config11.filterLifeEntity && !config11.cleaningModeEntity && !config11.temperatureEntity && !config11.humidityEntity && !config11.batteryEntity && !config11.disableBatteryMapping && !config11.chargingStateEntity && !config11.roomEntities && !config11.disableLockPin && !config11.lockUsercodeService && config11.lockUsercodeSlot === void 0 && config11.lockPinMinLength === void 0 && config11.lockPinMaxLength === void 0 && !config11.powerEntity && !config11.energyEntity && !config11.voltageEntity && !config11.currentEntity && !config11.batteryPowerEntity && !config11.batteryEnergyEntity && !config11.chargingSwitchEntity && !config11.currentLimitEntity && !config11.pressureEntity && !config11.suctionLevelEntity && !config11.mopIntensityEntity && (!config11.customServiceAreas || config11.customServiceAreas.length === 0) && (!config11.customFanSpeedTags || Object.keys(config11.customFanSpeedTags).length === 0) && (!config11.fanWindPresets || (config11.fanWindPresets.natural?.length ?? 0) === 0 && (config11.fanWindPresets.sleep?.length ?? 0) === 0) && !config11.fanRestoreSpeedOnPowerOn && !config11.currentRoomEntity && !config11.cleanedAreaEntity && !config11.disableCustomAreaRoomModes && !config11.valetudoIdentifier && !config11.coverSwapOpenClose && !config11.coverExposeAsDimmableLight && !config11.selectExposeAsSwitch && !config11.selectSwitchOnOption && !config11.selectSwitchOffOption && !config11.coverSliderDebounceMs && !config11.updateThrottleMs && !config11.disableClimateOnOff && !config11.disableClimateFanControl && !config11.climateKeepModeOnIdle && !config11.climateExposeFan && !config11.climateAutoMode && (!config11.composedEntities || config11.composedEntities.length === 0) && !config11.disableMomentaryFlip) {
139566
139587
  bridgeMap.delete(request.entityId);
139567
139588
  } else {
139568
139589
  bridgeMap.set(request.entityId, config11);
@@ -149523,6 +149544,7 @@ var EnergyEvseDeviceDefinition = MutableEndpoint({
149523
149544
  )
149524
149545
  });
149525
149546
  Object.freeze(EnergyEvseDeviceDefinition);
149547
+ var EnergyEvseDevice = EnergyEvseDeviceDefinition;
149526
149548
 
149527
149549
  // ../../node_modules/.pnpm/@matter+node@0.17.7_patch_hash=34f8224b2964673272e9f22613c0cb1f8ec12758dd46b4fe303d42373451ad4c/node_modules/@matter/node/dist/esm/devices/extended-color-light.js
149528
149550
  init_IdentifyServer();
@@ -157228,6 +157250,70 @@ function seedExistingSessionStarts(startedAt, sessions, now = Date.now()) {
157228
157250
  }
157229
157251
  }
157230
157252
 
157253
+ // src/services/bridges/subscription-summary.ts
157254
+ function readPaths(value) {
157255
+ return Array.isArray(value) ? value : null;
157256
+ }
157257
+ function unknownSummary(id) {
157258
+ return {
157259
+ id,
157260
+ attributePaths: 0,
157261
+ eventPaths: 0,
157262
+ scope: "unknown",
157263
+ endpointIds: []
157264
+ };
157265
+ }
157266
+ function summarizeSubscription(sub) {
157267
+ let id = null;
157268
+ let request;
157269
+ try {
157270
+ const s = sub;
157271
+ if (typeof s.subscriptionId === "number") {
157272
+ id = s.subscriptionId;
157273
+ }
157274
+ request = s.request;
157275
+ } catch {
157276
+ return unknownSummary(id);
157277
+ }
157278
+ if (request == null || typeof request !== "object") {
157279
+ return unknownSummary(id);
157280
+ }
157281
+ const req = request;
157282
+ const attrPaths = readPaths(req.attributeRequests);
157283
+ const eventPaths = readPaths(req.eventRequests);
157284
+ if (attrPaths === null && eventPaths === null) {
157285
+ return unknownSummary(id);
157286
+ }
157287
+ const all = [...attrPaths ?? [], ...eventPaths ?? []];
157288
+ let wildcard = false;
157289
+ const endpointIds = /* @__PURE__ */ new Set();
157290
+ for (const path14 of all) {
157291
+ const ep = path14?.endpointId;
157292
+ if (ep == null) {
157293
+ wildcard = true;
157294
+ } else if (typeof ep === "number" || typeof ep === "bigint") {
157295
+ endpointIds.add(Number(ep));
157296
+ }
157297
+ }
157298
+ return {
157299
+ id,
157300
+ attributePaths: attrPaths?.length ?? 0,
157301
+ eventPaths: eventPaths?.length ?? 0,
157302
+ scope: wildcard ? "wildcard" : "endpoint-specific",
157303
+ endpointIds: [...endpointIds].sort((a, b) => a - b)
157304
+ };
157305
+ }
157306
+ function summarizeSubscriptions(subscriptions) {
157307
+ const out = [];
157308
+ try {
157309
+ for (const sub of subscriptions) {
157310
+ out.push(summarizeSubscription(sub));
157311
+ }
157312
+ } catch {
157313
+ }
157314
+ return out;
157315
+ }
157316
+
157231
157317
  // src/services/bridges/wedge-watchdog.ts
157232
157318
  var WEDGE_WARMUP_MS = 15 * 60 * 1e3;
157233
157319
  var WEDGE_IM_SILENCE_MS = 45 * 60 * 1e3;
@@ -157249,11 +157335,11 @@ var AUTO_FORCE_SYNC_INTERVAL_MS = 9e4;
157249
157335
  var SHUTDOWN_SESSION_CLOSE_TIMEOUT_MS = 2500;
157250
157336
  var MDNS_ADDRESS_CHECK_INTERVAL_MS = 6e4;
157251
157337
  var Bridge = class {
157252
- constructor(env, logger247, dataProvider, endpointManager, serverOptions) {
157338
+ constructor(env, logger248, dataProvider, endpointManager, serverOptions) {
157253
157339
  this.dataProvider = dataProvider;
157254
157340
  this.endpointManager = endpointManager;
157255
157341
  this.serverOptions = serverOptions;
157256
- this.log = logger247.get(`Bridge / ${dataProvider.id}`);
157342
+ this.log = logger248.get(`Bridge / ${dataProvider.id}`);
157257
157343
  this.server = new BridgeServerNode(
157258
157344
  env,
157259
157345
  this.dataProvider,
@@ -157344,6 +157430,7 @@ var Bridge = class {
157344
157430
  const sessionList = sessions.map((s) => {
157345
157431
  const subCount = s.subscriptions.size;
157346
157432
  totalSubscriptions += subCount;
157433
+ const subscriptions = summarizeSubscriptions(s.subscriptions);
157347
157434
  const fi = typeof s.fabric?.fabricIndex === "number" ? s.fabric.fabricIndex : null;
157348
157435
  if (fi !== null) {
157349
157436
  const existing = fabricMap.get(fi) ?? {
@@ -157365,6 +157452,7 @@ var Bridge = class {
157365
157452
  peerNodeId: String(s.peerNodeId),
157366
157453
  fabricIndex: fi,
157367
157454
  subscriptionCount: subCount,
157455
+ subscriptions,
157368
157456
  lastActiveMsAgo,
157369
157457
  lastAnyActivityMsAgo,
157370
157458
  lastImRequestMsAgo,
@@ -167877,6 +167965,284 @@ var ElectricalMeterType = ElectricalMeterDevice.with(
167877
167965
  EnergyServer
167878
167966
  );
167879
167967
 
167968
+ // src/matter/endpoints/legacy/sensor/devices/energy-evse.ts
167969
+ init_esm();
167970
+ init_home_assistant_actions();
167971
+ init_home_assistant_entity_behavior();
167972
+
167973
+ // src/matter/endpoints/legacy/sensor/devices/evse-status.ts
167974
+ function mapEvseStatus(rawState, chargingSwitchOn) {
167975
+ const raw = rawState.toLowerCase().trim();
167976
+ const switchSupply = chargingSwitchOn ? EnergyEvse3.SupplyState.ChargingEnabled : EnergyEvse3.SupplyState.Disabled;
167977
+ if (raw === "" || raw === "unknown" || raw === "unavailable") {
167978
+ return {
167979
+ state: null,
167980
+ supplyState: EnergyEvse3.SupplyState.Disabled,
167981
+ faultState: EnergyEvse3.FaultState.NoError
167982
+ };
167983
+ }
167984
+ if (raw.includes("error") || raw.includes("fault")) {
167985
+ return {
167986
+ state: EnergyEvse3.State.Fault,
167987
+ supplyState: EnergyEvse3.SupplyState.DisabledError,
167988
+ faultState: EnergyEvse3.FaultState.Other
167989
+ };
167990
+ }
167991
+ if (raw.includes("not connected") || raw.includes("not_connected") || raw.includes("disconnected") || raw.includes("no vehicle")) {
167992
+ return {
167993
+ state: EnergyEvse3.State.NotPluggedIn,
167994
+ supplyState: switchSupply,
167995
+ faultState: EnergyEvse3.FaultState.NoError
167996
+ };
167997
+ }
167998
+ if (raw.includes("not charging") || raw.includes("not_charging") || raw.includes("not-charging")) {
167999
+ return {
168000
+ state: EnergyEvse3.State.PluggedInNoDemand,
168001
+ supplyState: switchSupply,
168002
+ faultState: EnergyEvse3.FaultState.NoError
168003
+ };
168004
+ }
168005
+ if (raw.includes("charg") && !raw.includes("discharg")) {
168006
+ return {
168007
+ state: EnergyEvse3.State.PluggedInCharging,
168008
+ supplyState: EnergyEvse3.SupplyState.ChargingEnabled,
168009
+ faultState: EnergyEvse3.FaultState.NoError
168010
+ };
168011
+ }
168012
+ if (raw.includes("connected") || raw.includes("ready") || raw.includes("awaiting") || raw.includes("completed") || raw.includes("sleep") || raw.includes("paused")) {
168013
+ return {
168014
+ state: EnergyEvse3.State.PluggedInNoDemand,
168015
+ supplyState: switchSupply,
168016
+ faultState: EnergyEvse3.FaultState.NoError
168017
+ };
168018
+ }
168019
+ return {
168020
+ state: null,
168021
+ supplyState: EnergyEvse3.SupplyState.Disabled,
168022
+ faultState: EnergyEvse3.FaultState.NoError
168023
+ };
168024
+ }
168025
+
168026
+ // src/matter/endpoints/legacy/sensor/devices/energy-evse.ts
168027
+ var logger229 = Logger.get("EnergyEvse");
168028
+ var MIN_CHARGE_CURRENT_MA = 6e3;
168029
+ var MAX_CHARGE_CURRENT_MA = 32e3;
168030
+ var CIRCUIT_CAPACITY_MA = 32e3;
168031
+ var MAX_TIMER_MS = 2147483647;
168032
+ function clampMa(ma) {
168033
+ return Math.min(CIRCUIT_CAPACITY_MA, Math.max(MIN_CHARGE_CURRENT_MA, ma));
168034
+ }
168035
+ var evseChargingTimers = /* @__PURE__ */ new WeakMap();
168036
+ function clearEvseChargingTimer(endpoint) {
168037
+ const timer = evseChargingTimers.get(endpoint);
168038
+ if (timer) {
168039
+ clearTimeout(timer);
168040
+ evseChargingTimers.delete(endpoint);
168041
+ }
168042
+ }
168043
+ var EvseStatusServer = class _EvseStatusServer extends EnergyEvseServer {
168044
+ async initialize() {
168045
+ await super.initialize();
168046
+ const homeAssistant = await this.agent.load(HomeAssistantEntityBehavior);
168047
+ this.update();
168048
+ this.reactTo(homeAssistant.onChange, this.update, { offline: true });
168049
+ }
168050
+ async [Symbol.asyncDispose]() {
168051
+ clearEvseChargingTimer(this.endpoint);
168052
+ await super[Symbol.asyncDispose]();
168053
+ }
168054
+ chargingSwitchIsOn() {
168055
+ const mapping = this.agent.get(HomeAssistantEntityBehavior).state.mapping;
168056
+ const switchEntity = mapping?.chargingSwitchEntity;
168057
+ if (!switchEntity) return false;
168058
+ const stateProvider = this.agent.env.get(EntityStateProvider);
168059
+ return stateProvider.getState(switchEntity)?.state === "on";
168060
+ }
168061
+ update() {
168062
+ const homeAssistant = this.agent.get(HomeAssistantEntityBehavior);
168063
+ const raw = homeAssistant.entity.state?.state ?? "";
168064
+ const status3 = mapEvseStatus(raw, this.chargingSwitchIsOn());
168065
+ const patch = {
168066
+ state: status3.state,
168067
+ supplyState: status3.supplyState,
168068
+ faultState: status3.faultState
168069
+ };
168070
+ const mapping = homeAssistant.state.mapping;
168071
+ if (mapping?.currentLimitEntity) {
168072
+ const stateProvider = this.agent.env.get(EntityStateProvider);
168073
+ const amps = stateProvider.getNumericState(mapping.currentLimitEntity);
168074
+ if (amps != null) {
168075
+ patch.maximumChargeCurrent = clampMa(Math.round(amps * 1e3));
168076
+ }
168077
+ }
168078
+ applyPatchState(this.state, patch);
168079
+ }
168080
+ enableCharging(request) {
168081
+ const homeAssistant = this.agent.get(HomeAssistantEntityBehavior);
168082
+ const mapping = homeAssistant.state.mapping;
168083
+ const until = request.chargingEnabledUntil;
168084
+ if (until != null && until * 1e3 <= Date.now()) {
168085
+ this.disable();
168086
+ return;
168087
+ }
168088
+ clearEvseChargingTimer(this.endpoint);
168089
+ let dispatched = false;
168090
+ if (mapping?.chargingSwitchEntity) {
168091
+ homeAssistant.callAction({
168092
+ action: "switch.turn_on",
168093
+ target: mapping.chargingSwitchEntity
168094
+ });
168095
+ dispatched = true;
168096
+ }
168097
+ const maxCurrent = request.maximumChargeCurrent;
168098
+ if (mapping?.currentLimitEntity && maxCurrent != null) {
168099
+ const amps = Math.max(
168100
+ MIN_CHARGE_CURRENT_MA / 1e3,
168101
+ Math.floor(clampMa(Number(maxCurrent)) / 1e3)
168102
+ );
168103
+ homeAssistant.callAction({
168104
+ action: "number.set_value",
168105
+ target: mapping.currentLimitEntity,
168106
+ data: { value: amps }
168107
+ });
168108
+ dispatched = true;
168109
+ }
168110
+ if (!dispatched) {
168111
+ logger229.debug(
168112
+ `enableCharging ignored for ${homeAssistant.entityId}: no charging switch or current limit mapped`
168113
+ );
168114
+ return;
168115
+ }
168116
+ const patch = {
168117
+ supplyState: EnergyEvse3.SupplyState.ChargingEnabled,
168118
+ chargingEnabledUntil: until ?? null
168119
+ };
168120
+ if (request.minimumChargeCurrent != null) {
168121
+ patch.minimumChargeCurrent = clampMa(
168122
+ Number(request.minimumChargeCurrent)
168123
+ );
168124
+ }
168125
+ if (maxCurrent != null) {
168126
+ patch.maximumChargeCurrent = clampMa(Number(maxCurrent));
168127
+ }
168128
+ applyPatchState(this.state, patch);
168129
+ if (until != null) {
168130
+ const delay = until * 1e3 - Date.now();
168131
+ if (delay > 0 && delay <= MAX_TIMER_MS) {
168132
+ const endpoint = this.endpoint;
168133
+ const actions = this.env.get(HomeAssistantActions);
168134
+ const entityId = homeAssistant.entityId;
168135
+ const switchEntity = mapping?.chargingSwitchEntity;
168136
+ const timer = setTimeout(() => {
168137
+ void (async () => {
168138
+ try {
168139
+ if (evseChargingTimers.get(endpoint) !== timer) return;
168140
+ if (switchEntity) {
168141
+ actions.call(
168142
+ { action: "switch.turn_off", target: switchEntity },
168143
+ entityId
168144
+ );
168145
+ }
168146
+ await endpoint.setStateOf(_EvseStatusServer, {
168147
+ supplyState: EnergyEvse3.SupplyState.Disabled,
168148
+ chargingEnabledUntil: null
168149
+ });
168150
+ } catch (error) {
168151
+ logger229.debug(
168152
+ `EVSE charge-window expiry write failed (endpoint may be closing): ${error}`
168153
+ );
168154
+ } finally {
168155
+ if (evseChargingTimers.get(endpoint) === timer) {
168156
+ evseChargingTimers.delete(endpoint);
168157
+ }
168158
+ }
168159
+ })();
168160
+ }, delay);
168161
+ timer.unref?.();
168162
+ evseChargingTimers.set(endpoint, timer);
168163
+ }
168164
+ }
168165
+ }
168166
+ disable() {
168167
+ clearEvseChargingTimer(this.endpoint);
168168
+ const homeAssistant = this.agent.get(HomeAssistantEntityBehavior);
168169
+ const mapping = homeAssistant.state.mapping;
168170
+ if (mapping?.chargingSwitchEntity) {
168171
+ homeAssistant.callAction({
168172
+ action: "switch.turn_off",
168173
+ target: mapping.chargingSwitchEntity
168174
+ });
168175
+ }
168176
+ if (mapping?.chargingSwitchEntity || mapping?.currentLimitEntity) {
168177
+ applyPatchState(this.state, {
168178
+ supplyState: EnergyEvse3.SupplyState.Disabled,
168179
+ chargingEnabledUntil: null
168180
+ });
168181
+ } else {
168182
+ logger229.debug(
168183
+ `disable ignored for ${homeAssistant.entityId}: no charging switch mapped`
168184
+ );
168185
+ }
168186
+ }
168187
+ };
168188
+ var EvseStatusSeeded = EvseStatusServer.set({
168189
+ supplyState: EnergyEvse3.SupplyState.Disabled,
168190
+ faultState: EnergyEvse3.FaultState.NoError,
168191
+ circuitCapacity: CIRCUIT_CAPACITY_MA,
168192
+ minimumChargeCurrent: MIN_CHARGE_CURRENT_MA,
168193
+ maximumChargeCurrent: MAX_CHARGE_CURRENT_MA
168194
+ });
168195
+ var EvseModeSeeded = EnergyEvseModeServer.set({
168196
+ supportedModes: [
168197
+ {
168198
+ label: "Manual",
168199
+ mode: 1,
168200
+ modeTags: [{ value: EnergyEvseMode3.ModeTag.Manual }]
168201
+ }
168202
+ ],
168203
+ currentMode: 1
168204
+ });
168205
+ var WiredPowerSourceBase = PowerSourceServer.with("Wired");
168206
+ var EvsePowerSourceServer = class extends WiredPowerSourceBase {
168207
+ async initialize() {
168208
+ await super.initialize();
168209
+ const endpointNumber = this.endpoint.number;
168210
+ if (endpointNumber != null) {
168211
+ applyPatchState(this.state, { endpointList: [endpointNumber] });
168212
+ }
168213
+ }
168214
+ };
168215
+ var EvsePowerSource = EvsePowerSourceServer.set({
168216
+ status: PowerSource3.PowerSourceStatus.Active,
168217
+ order: 0,
168218
+ description: "Mains",
168219
+ wiredCurrentType: PowerSource3.WiredCurrentType.Ac
168220
+ });
168221
+ var EnergyEvseBase = EnergyEvseDevice.with(
168222
+ BasicInformationServer2,
168223
+ IdentifyServer2,
168224
+ HomeAssistantEntityBehavior,
168225
+ EvseStatusSeeded,
168226
+ EvseModeSeeded,
168227
+ EvsePowerSource,
168228
+ // Always mount the measurement clusters; both seed safe defaults when no
168229
+ // power/energy entity is mapped, so the endpoint honestly carries the
168230
+ // ElectricalSensor device type.
168231
+ PowerServer,
168232
+ EnergyServer,
168233
+ DescriptorServer
168234
+ ).set({
168235
+ descriptor: {
168236
+ deviceTypeList: [
168237
+ { deviceType: DeviceTypeId(1292), revision: 2 },
168238
+ { deviceType: DeviceTypeId(1296), revision: 1 }
168239
+ ]
168240
+ }
168241
+ });
168242
+ function energyEvseType() {
168243
+ return EnergyEvseBase;
168244
+ }
168245
+
167880
168246
  // src/matter/behaviors/flow-measurement-server.ts
167881
168247
  init_home_assistant_entity_behavior();
167882
168248
  var FlowMeasurementServerBase = class extends FlowMeasurementServer {
@@ -168616,7 +168982,7 @@ var TvocConcentrationMeasurementServer = class extends TvocConcentrationMeasurem
168616
168982
  };
168617
168983
 
168618
168984
  // src/matter/endpoints/legacy/sensor/devices/tvoc-sensor.ts
168619
- var logger229 = Logger.get("TvocSensor");
168985
+ var logger230 = Logger.get("TvocSensor");
168620
168986
  function airQualityFromUgm3(value) {
168621
168987
  if (value <= 300) return AirQuality3.AirQualityEnum.Good;
168622
168988
  if (value <= 1e3) return AirQuality3.AirQualityEnum.Fair;
@@ -168657,17 +169023,17 @@ var TvocAirQualityServer = class extends TvocAirQualityServerBase {
168657
169023
  const attributes9 = entity.state.attributes;
168658
169024
  const deviceClass = attributes9.device_class;
168659
169025
  let airQuality = AirQuality3.AirQualityEnum.Unknown;
168660
- logger229.debug(
169026
+ logger230.debug(
168661
169027
  `[${entity.entity_id}] TVOC update: state="${state}", device_class="${deviceClass}"`
168662
169028
  );
168663
169029
  if (state != null && !Number.isNaN(+state)) {
168664
169030
  const value = +state;
168665
169031
  airQuality = deviceClass === SensorDeviceClass.volatile_organic_compounds ? airQualityFromUgm3(value) : airQualityFromPpb(value);
168666
- logger229.debug(
169032
+ logger230.debug(
168667
169033
  `[${entity.entity_id}] TVOC value=${value} (${deviceClass}) -> airQuality=${AirQuality3.AirQualityEnum[airQuality]}`
168668
169034
  );
168669
169035
  } else {
168670
- logger229.warn(
169036
+ logger230.warn(
168671
169037
  `[${entity.entity_id}] TVOC state not a valid number: "${state}"`
168672
169038
  );
168673
169039
  }
@@ -168881,7 +169247,7 @@ init_home_assistant_entity_behavior();
168881
169247
  // src/matter/behaviors/pm25-concentration-measurement-server.ts
168882
169248
  init_esm();
168883
169249
  init_home_assistant_entity_behavior();
168884
- var logger230 = Logger.get("Pm25ConcentrationMeasurementServer");
169250
+ var logger231 = Logger.get("Pm25ConcentrationMeasurementServer");
168885
169251
  var Pm25ConcentrationMeasurementServerBase = Pm25ConcentrationMeasurementServer.with(
168886
169252
  ConcentrationMeasurement3.Feature.NumericMeasurement
168887
169253
  );
@@ -168905,11 +169271,11 @@ var Pm25ConcentrationMeasurementServer2 = class extends Pm25ConcentrationMeasure
168905
169271
  if (this.state.measurementMedium === void 0) {
168906
169272
  this.state.measurementMedium = ConcentrationMeasurement3.MeasurementMedium.Air;
168907
169273
  }
168908
- logger230.debug(
169274
+ logger231.debug(
168909
169275
  "Pm25ConcentrationMeasurementServer: before super.initialize()"
168910
169276
  );
168911
169277
  await super.initialize();
168912
- logger230.debug(
169278
+ logger231.debug(
168913
169279
  "Pm25ConcentrationMeasurementServer: after super.initialize()"
168914
169280
  );
168915
169281
  const homeAssistant = await this.agent.load(HomeAssistantEntityBehavior);
@@ -168932,7 +169298,7 @@ var Pm25ConcentrationMeasurementServer2 = class extends Pm25ConcentrationMeasure
168932
169298
  };
168933
169299
 
168934
169300
  // src/matter/endpoints/legacy/sensor/devices/pm25-sensor.ts
168935
- var logger231 = Logger.get("Pm25AirQualityServer");
169301
+ var logger232 = Logger.get("Pm25AirQualityServer");
168936
169302
  var Pm25AirQualityServerBase = AirQualityServer.with(
168937
169303
  AirQuality3.Feature.Fair,
168938
169304
  AirQuality3.Feature.Moderate,
@@ -168944,9 +169310,9 @@ var Pm25AirQualityServer = class extends Pm25AirQualityServerBase {
168944
169310
  if (this.state.airQuality === void 0) {
168945
169311
  this.state.airQuality = AirQuality3.AirQualityEnum.Unknown;
168946
169312
  }
168947
- logger231.debug("Pm25AirQualityServer: before super.initialize()");
169313
+ logger232.debug("Pm25AirQualityServer: before super.initialize()");
168948
169314
  await super.initialize();
168949
- logger231.debug("Pm25AirQualityServer: after super.initialize()");
169315
+ logger232.debug("Pm25AirQualityServer: after super.initialize()");
168950
169316
  const homeAssistant = await this.agent.load(HomeAssistantEntityBehavior);
168951
169317
  this.update(homeAssistant.entity);
168952
169318
  this.reactTo(homeAssistant.onChange, this.update, { offline: true });
@@ -169371,7 +169737,7 @@ init_home_assistant_entity_behavior();
169371
169737
  init_dist();
169372
169738
  init_esm();
169373
169739
  init_home_assistant_entity_behavior();
169374
- var logger232 = Logger.get("VacuumIdentifyServer");
169740
+ var logger233 = Logger.get("VacuumIdentifyServer");
169375
169741
  var IDENTIFY_BUTTON_SUFFIXES = ["_identify", "_locate", "_find_me"];
169376
169742
  var VacuumIdentifyServer = class extends IdentifyServer2 {
169377
169743
  triggerEffect(effect) {
@@ -169388,19 +169754,19 @@ var VacuumIdentifyServer = class extends IdentifyServer2 {
169388
169754
  const homeAssistant = this.agent.get(HomeAssistantEntityBehavior);
169389
169755
  const features3 = homeAssistant.entity.state.attributes.supported_features ?? 0;
169390
169756
  if (testBit(features3, VacuumDeviceFeature.LOCATE)) {
169391
- logger232.info(`${source} \u2192 vacuum.locate for ${homeAssistant.entityId}`);
169757
+ logger233.info(`${source} \u2192 vacuum.locate for ${homeAssistant.entityId}`);
169392
169758
  homeAssistant.callAction({ action: "vacuum.locate" });
169393
169759
  return;
169394
169760
  }
169395
169761
  const sibling = this.#findIdentifyButton(homeAssistant);
169396
169762
  if (sibling) {
169397
- logger232.info(
169763
+ logger233.info(
169398
169764
  `${source} \u2192 button.press ${sibling} for ${homeAssistant.entityId}`
169399
169765
  );
169400
169766
  homeAssistant.callAction({ action: "button.press", target: sibling });
169401
169767
  return;
169402
169768
  }
169403
- logger232.warn(
169769
+ logger233.warn(
169404
169770
  `${source} for ${homeAssistant.entityId}, LOCATE not in supported_features (${features3}), trying vacuum.locate anyway`
169405
169771
  );
169406
169772
  homeAssistant.callAction({ action: "vacuum.locate" });
@@ -169599,14 +169965,14 @@ init_esm();
169599
169965
 
169600
169966
  // src/matter/behaviors/service-area-server.ts
169601
169967
  init_esm();
169602
- var logger233 = Logger.get("ServiceAreaServer");
169968
+ var logger234 = Logger.get("ServiceAreaServer");
169603
169969
  var ServiceAreaWithProgress = ServiceAreaBehavior.with(
169604
169970
  ServiceArea3.Feature.ProgressReporting
169605
169971
  );
169606
169972
  var ServiceAreaServerBase = class extends ServiceAreaWithProgress {
169607
169973
  selectAreas(request) {
169608
169974
  const { newAreas } = request;
169609
- logger233.info(
169975
+ logger234.info(
169610
169976
  `ServiceArea selectAreas called with: ${JSON.stringify(newAreas)}`
169611
169977
  );
169612
169978
  const uniqueAreas = [...new Set(newAreas)];
@@ -169615,7 +169981,7 @@ var ServiceAreaServerBase = class extends ServiceAreaWithProgress {
169615
169981
  (id) => !supportedAreaIds.includes(id)
169616
169982
  );
169617
169983
  if (invalidAreas.length > 0) {
169618
- logger233.warn(`Invalid area IDs requested: ${invalidAreas.join(", ")}`);
169984
+ logger234.warn(`Invalid area IDs requested: ${invalidAreas.join(", ")}`);
169619
169985
  return {
169620
169986
  status: ServiceArea3.SelectAreasStatus.UnsupportedArea,
169621
169987
  statusText: `Invalid area IDs: ${invalidAreas.join(", ")}`
@@ -169627,7 +169993,7 @@ var ServiceAreaServerBase = class extends ServiceAreaWithProgress {
169627
169993
  status: ServiceArea3.OperationalStatus.Pending
169628
169994
  }));
169629
169995
  this.state.currentArea = null;
169630
- logger233.info(
169996
+ logger234.info(
169631
169997
  `ServiceArea: Stored ${uniqueAreas.length} areas for cleaning: ${uniqueAreas.join(", ")}`
169632
169998
  );
169633
169999
  return {
@@ -169648,7 +170014,7 @@ var ServiceAreaServerBase = class extends ServiceAreaWithProgress {
169648
170014
  ServiceAreaServerBase2.State = State;
169649
170015
  })(ServiceAreaServerBase || (ServiceAreaServerBase = {}));
169650
170016
  function ServiceAreaServer2(initialState) {
169651
- logger233.info(
170017
+ logger234.info(
169652
170018
  `Creating ServiceAreaServer with ${initialState.supportedAreas.length} areas`
169653
170019
  );
169654
170020
  return ServiceAreaServerBase.set({
@@ -169665,7 +170031,7 @@ var ServiceAreaWithMapsAndProgress = ServiceAreaBehavior.with(
169665
170031
  var ServiceAreaServerWithMapsBase = class extends ServiceAreaWithMapsAndProgress {
169666
170032
  selectAreas(request) {
169667
170033
  const { newAreas } = request;
169668
- logger233.info(
170034
+ logger234.info(
169669
170035
  `ServiceArea selectAreas called with: ${JSON.stringify(newAreas)}`
169670
170036
  );
169671
170037
  const uniqueAreas = [...new Set(newAreas)];
@@ -169674,7 +170040,7 @@ var ServiceAreaServerWithMapsBase = class extends ServiceAreaWithMapsAndProgress
169674
170040
  (id) => !supportedAreaIds.includes(id)
169675
170041
  );
169676
170042
  if (invalidAreas.length > 0) {
169677
- logger233.warn(`Invalid area IDs requested: ${invalidAreas.join(", ")}`);
170043
+ logger234.warn(`Invalid area IDs requested: ${invalidAreas.join(", ")}`);
169678
170044
  return {
169679
170045
  status: ServiceArea3.SelectAreasStatus.UnsupportedArea,
169680
170046
  statusText: `Invalid area IDs: ${invalidAreas.join(", ")}`
@@ -169686,7 +170052,7 @@ var ServiceAreaServerWithMapsBase = class extends ServiceAreaWithMapsAndProgress
169686
170052
  status: ServiceArea3.OperationalStatus.Pending
169687
170053
  }));
169688
170054
  this.state.currentArea = null;
169689
- logger233.info(
170055
+ logger234.info(
169690
170056
  `ServiceArea: Stored ${uniqueAreas.length} areas for cleaning: ${uniqueAreas.join(", ")}`
169691
170057
  );
169692
170058
  return {
@@ -169707,14 +170073,14 @@ var ServiceAreaServerWithMapsBase = class extends ServiceAreaWithMapsAndProgress
169707
170073
  ServiceAreaServerWithMapsBase2.State = State;
169708
170074
  })(ServiceAreaServerWithMapsBase || (ServiceAreaServerWithMapsBase = {}));
169709
170075
  function ServiceAreaServerWithMaps(initialState) {
169710
- logger233.info(
170076
+ logger234.info(
169711
170077
  `Creating ServiceAreaServer with Maps: ${initialState.supportedAreas.length} areas, ${initialState.supportedMaps.length} maps`
169712
170078
  );
169713
170079
  for (const map of initialState.supportedMaps) {
169714
170080
  const areaCount = initialState.supportedAreas.filter(
169715
170081
  (a) => a.mapId === map.mapId
169716
170082
  ).length;
169717
- logger233.info(` Map ${map.mapId}: "${map.name}" (${areaCount} areas)`);
170083
+ logger234.info(` Map ${map.mapId}: "${map.name}" (${areaCount} areas)`);
169718
170084
  }
169719
170085
  return ServiceAreaServerWithMapsBase.set({
169720
170086
  supportedAreas: initialState.supportedAreas,
@@ -169726,7 +170092,7 @@ function ServiceAreaServerWithMaps(initialState) {
169726
170092
  }
169727
170093
 
169728
170094
  // src/matter/endpoints/legacy/vacuum/behaviors/vacuum-service-area-server.ts
169729
- var logger234 = Logger.get("VacuumServiceAreaServer");
170095
+ var logger235 = Logger.get("VacuumServiceAreaServer");
169730
170096
  function toAreaId(roomId) {
169731
170097
  if (typeof roomId === "number") {
169732
170098
  return roomId;
@@ -169805,13 +170171,13 @@ function createVacuumServiceAreaServer(attributes9, roomEntities, includeUnnamed
169805
170171
  let rooms;
169806
170172
  if (roomEntities && roomEntities.length > 0) {
169807
170173
  rooms = buttonEntitiesToRooms(roomEntities, attributes9);
169808
- logger234.info(
170174
+ logger235.info(
169809
170175
  `Using ${rooms.length} button entities as rooms: ${rooms.map((r) => r.name).join(", ")}`
169810
170176
  );
169811
170177
  } else {
169812
170178
  rooms = parseVacuumRooms(attributes9, includeUnnamedRooms);
169813
170179
  if (rooms.length > 0) {
169814
- logger234.info(
170180
+ logger235.info(
169815
170181
  `Using ${rooms.length} rooms from attributes: ${rooms.map((r) => r.name).join(", ")}`
169816
170182
  );
169817
170183
  }
@@ -169865,7 +170231,7 @@ function createCustomServiceAreaServer(customAreas) {
169865
170231
  landmarkInfo: null
169866
170232
  }
169867
170233
  }));
169868
- logger234.info(
170234
+ logger235.info(
169869
170235
  `Using ${customAreas.length} custom service areas: ${customAreas.map((a) => a.name).join(", ")}`
169870
170236
  );
169871
170237
  return ServiceAreaServer2({
@@ -169887,7 +170253,7 @@ function createCleanAreaServiceAreaServer(cleanAreaRooms) {
169887
170253
  landmarkInfo: null
169888
170254
  }
169889
170255
  }));
169890
- logger234.info(
170256
+ logger235.info(
169891
170257
  `Using ${cleanAreaRooms.length} HA areas via CLEAN_AREA: ${cleanAreaRooms.map((r) => r.name).join(", ")}`
169892
170258
  );
169893
170259
  return ServiceAreaServer2({
@@ -169898,11 +170264,11 @@ function createCleanAreaServiceAreaServer(cleanAreaRooms) {
169898
170264
  }
169899
170265
 
169900
170266
  // src/matter/endpoints/legacy/vacuum/behaviors/vacuum-rvc-run-mode-server.ts
169901
- var logger235 = Logger.get("VacuumRvcRunModeServer");
170267
+ var logger236 = Logger.get("VacuumRvcRunModeServer");
169902
170268
  function buildValetudoSegmentAction(vacuumEntityId, segmentIds, valetudoIdentifier) {
169903
170269
  const identifier = valetudoIdentifier || vacuumEntityId.replace(/^vacuum\.valetudo_/, "");
169904
170270
  const topic = `valetudo/${identifier}/MapSegmentationCapability/clean/set`;
169905
- logger235.info(
170271
+ logger236.info(
169906
170272
  `Valetudo: mqtt.publish to ${topic}, segments: ${segmentIds.join(", ")}`
169907
170273
  );
169908
170274
  return {
@@ -170007,14 +170373,14 @@ function mergeBatchData(areas) {
170007
170373
  function handleCustomServiceAreas(selectedAreas, customAreas, session) {
170008
170374
  const matched = selectedAreas.map((areaId) => ({ areaId, area: customAreas[areaId - 1] })).filter((m) => !!m.area);
170009
170375
  if (matched.length === 0) {
170010
- logger235.warn(
170376
+ logger236.warn(
170011
170377
  `Custom service areas: no match for selected IDs ${selectedAreas.join(", ")}`
170012
170378
  );
170013
170379
  return { action: "vacuum.start" };
170014
170380
  }
170015
170381
  const batchArea = matched.find(({ area }) => area.batchDispatch === true);
170016
170382
  if (batchArea) {
170017
- logger235.info(
170383
+ logger236.info(
170018
170384
  `Custom service areas (batch): single call for ${matched.length} room(s): ${matched.map(({ area }) => area.name).join(", ")}`
170019
170385
  );
170020
170386
  session.pendingDispatches = [];
@@ -170035,7 +170401,7 @@ function handleCustomServiceAreas(selectedAreas, customAreas, session) {
170035
170401
  }
170036
170402
  };
170037
170403
  }
170038
- logger235.info(
170404
+ logger236.info(
170039
170405
  `Custom service areas: ${matched.length} room(s) queued: ${matched.map(({ area }) => `${area.service} (${area.name})`).join(", ")}`
170040
170406
  );
170041
170407
  session.pendingDispatches = matched.slice(1).map(({ areaId, area }) => ({
@@ -170073,7 +170439,7 @@ function vacuumIsCleaning(state) {
170073
170439
  var vacuumRvcRunModeConfig = {
170074
170440
  getCurrentMode: (entity) => {
170075
170441
  const isCleaning = vacuumIsCleaning(entity.state);
170076
- logger235.debug(
170442
+ logger236.debug(
170077
170443
  `Vacuum state: "${entity.state}", isCleaning: ${isCleaning}, currentMode: ${isCleaning ? "Cleaning" : "Idle"}`
170078
170444
  );
170079
170445
  return isCleaning ? 1 /* Cleaning */ : 0 /* Idle */;
@@ -170107,7 +170473,7 @@ var vacuumRvcRunModeConfig = {
170107
170473
  if (cleanAreaRooms && cleanAreaRooms.length > 0) {
170108
170474
  const haAreaIds = resolveCleanAreaIds(selectedAreas, cleanAreaRooms);
170109
170475
  if (haAreaIds.length > 0) {
170110
- logger235.info(
170476
+ logger236.info(
170111
170477
  `CLEAN_AREA: cleaning HA areas: ${haAreaIds.join(", ")}`
170112
170478
  );
170113
170479
  return {
@@ -170126,7 +170492,7 @@ var vacuumRvcRunModeConfig = {
170126
170492
  }
170127
170493
  }
170128
170494
  if (matched.length > 0) {
170129
- logger235.info(
170495
+ logger236.info(
170130
170496
  `Roborock: ${matched.length} room button(s) queued: ${matched.map((m) => m.entityId).join(", ")}`
170131
170497
  );
170132
170498
  session.pendingDispatches = matched.slice(1).map(({ areaId, entityId }) => ({
@@ -170160,14 +170526,14 @@ var vacuumRvcRunModeConfig = {
170160
170526
  }
170161
170527
  }
170162
170528
  if (roomIds.length > 0) {
170163
- logger235.info(
170529
+ logger236.info(
170164
170530
  `Starting cleaning with selected areas: ${roomIds.join(", ")}`
170165
170531
  );
170166
170532
  if (isDreameVacuum(attributes9)) {
170167
170533
  if (targetMapName) {
170168
170534
  const vacName = vacuumEntityId.replace("vacuum.", "");
170169
170535
  const selectedMapEntity = `select.${vacName}_selected_map`;
170170
- logger235.info(
170536
+ logger236.info(
170171
170537
  `Dreame multi-floor: switching to map "${targetMapName}" via ${selectedMapEntity}`
170172
170538
  );
170173
170539
  homeAssistant.callAction({
@@ -170194,7 +170560,7 @@ var vacuumRvcRunModeConfig = {
170194
170560
  }
170195
170561
  if (isEcovacsVacuum(attributes9)) {
170196
170562
  const roomIdStr = roomIds.join(",");
170197
- logger235.info(
170563
+ logger236.info(
170198
170564
  `Ecovacs vacuum: Using spot_area for rooms: ${roomIdStr}`
170199
170565
  );
170200
170566
  return {
@@ -170209,14 +170575,14 @@ var vacuumRvcRunModeConfig = {
170209
170575
  }
170210
170576
  };
170211
170577
  }
170212
- logger235.warn(
170578
+ logger236.warn(
170213
170579
  `Room cleaning via send_command not supported for this vacuum type. Rooms: ${roomIds.join(", ")}. Falling back to vacuum.start`
170214
170580
  );
170215
170581
  }
170216
170582
  }
170217
170583
  } catch {
170218
170584
  }
170219
- logger235.info("Starting regular cleaning (no areas selected)");
170585
+ logger236.info("Starting regular cleaning (no areas selected)");
170220
170586
  return { action: "vacuum.start" };
170221
170587
  },
170222
170588
  returnToBase: () => ({ action: "vacuum.return_to_base" }),
@@ -170231,7 +170597,7 @@ var vacuumRvcRunModeConfig = {
170231
170597
  const homeAssistant = agent.get(HomeAssistantEntityBehavior);
170232
170598
  const entity = homeAssistant.entity;
170233
170599
  const attributes9 = entity.state.attributes;
170234
- logger235.info(`cleanRoom called: roomMode=${roomMode}`);
170600
+ logger236.info(`cleanRoom called: roomMode=${roomMode}`);
170235
170601
  const cleanAreaRooms = homeAssistant.state.mapping?.cleanAreaRooms;
170236
170602
  if (cleanAreaRooms && cleanAreaRooms.length > 0) {
170237
170603
  const sorted = [...cleanAreaRooms].sort(
@@ -170240,7 +170606,7 @@ var vacuumRvcRunModeConfig = {
170240
170606
  const areaIndex = roomMode - ROOM_MODE_BASE2 - 1;
170241
170607
  if (areaIndex >= 0 && areaIndex < sorted.length) {
170242
170608
  const area = sorted[areaIndex];
170243
- logger235.info(
170609
+ logger236.info(
170244
170610
  `cleanRoom: CLEAN_AREA "${area.name}" \u2192 vacuum.clean_area(${area.haAreaId})`
170245
170611
  );
170246
170612
  return {
@@ -170257,7 +170623,7 @@ var vacuumRvcRunModeConfig = {
170257
170623
  const areaIndex = roomMode - ROOM_MODE_BASE2 - 1;
170258
170624
  if (areaIndex >= 0 && areaIndex < sorted.length) {
170259
170625
  const area = sorted[areaIndex];
170260
- logger235.info(
170626
+ logger236.info(
170261
170627
  `cleanRoom: custom service area "${area.name}" \u2192 ${area.service}`
170262
170628
  );
170263
170629
  return {
@@ -170278,7 +170644,7 @@ var vacuumRvcRunModeConfig = {
170278
170644
  }
170279
170645
  const rooms = parseVacuumRooms(attributes9);
170280
170646
  const numericIdFromMode = getRoomIdFromMode(roomMode);
170281
- logger235.info(
170647
+ logger236.info(
170282
170648
  `cleanRoom: numericIdFromMode=${numericIdFromMode}, available rooms: ${JSON.stringify(rooms.map((r) => ({ id: r.id, name: r.name, modeValue: getRoomModeValue(r) })))}`
170283
170649
  );
170284
170650
  const room = rooms.find((r) => getRoomModeValue(r) === roomMode);
@@ -170288,7 +170654,7 @@ var vacuumRvcRunModeConfig = {
170288
170654
  if (room.mapName) {
170289
170655
  const vacuumName = vacuumEntityId.replace("vacuum.", "");
170290
170656
  const selectedMapEntity = `select.${vacuumName}_selected_map`;
170291
- logger235.info(
170657
+ logger236.info(
170292
170658
  `Dreame multi-floor: switching to map "${room.mapName}" via ${selectedMapEntity}`
170293
170659
  );
170294
170660
  homeAssistant.callAction({
@@ -170297,7 +170663,7 @@ var vacuumRvcRunModeConfig = {
170297
170663
  data: { option: room.mapName }
170298
170664
  });
170299
170665
  }
170300
- logger235.debug(
170666
+ logger236.debug(
170301
170667
  `Dreame vacuum detected, using dreame_vacuum.vacuum_clean_segment for room ${room.name} (commandId: ${commandId3}, id: ${room.id})`
170302
170668
  );
170303
170669
  return {
@@ -170308,7 +170674,7 @@ var vacuumRvcRunModeConfig = {
170308
170674
  };
170309
170675
  }
170310
170676
  if (isRoborockVacuum(attributes9) || isXiaomiMiotVacuum(attributes9)) {
170311
- logger235.debug(
170677
+ logger236.debug(
170312
170678
  `Using vacuum.send_command with app_segment_clean for room ${room.name} (commandId: ${commandId3}, id: ${room.id})`
170313
170679
  );
170314
170680
  return {
@@ -170321,7 +170687,7 @@ var vacuumRvcRunModeConfig = {
170321
170687
  }
170322
170688
  if (isEcovacsVacuum(attributes9)) {
170323
170689
  const roomIdStr = String(commandId3);
170324
- logger235.info(
170690
+ logger236.info(
170325
170691
  `Ecovacs vacuum: Using spot_area for room ${room.name} (id: ${roomIdStr})`
170326
170692
  );
170327
170693
  return {
@@ -170336,7 +170702,7 @@ var vacuumRvcRunModeConfig = {
170336
170702
  }
170337
170703
  };
170338
170704
  }
170339
- logger235.warn(
170705
+ logger236.warn(
170340
170706
  `Room cleaning via send_command not supported for this vacuum type. Room: ${room.name} (id=${commandId3}). Falling back to vacuum.start`
170341
170707
  );
170342
170708
  }
@@ -170353,20 +170719,20 @@ function createVacuumRvcRunModeServer(attributes9, includeUnnamedRooms = false,
170353
170719
  customAreas,
170354
170720
  disableRoomModes
170355
170721
  );
170356
- logger235.info(
170722
+ logger236.info(
170357
170723
  `Creating VacuumRvcRunModeServer with ${rooms.length} rooms, ${supportedModes2.length} total modes`
170358
170724
  );
170359
170725
  if (rooms.length > 0) {
170360
- logger235.info(`Rooms found: ${rooms.map((r) => r.name).join(", ")}`);
170726
+ logger236.info(`Rooms found: ${rooms.map((r) => r.name).join(", ")}`);
170361
170727
  }
170362
170728
  if (filteredCount > 0) {
170363
170729
  const filtered = allRooms.filter((r) => !rooms.some((x) => x.id === r.id));
170364
- logger235.info(
170730
+ logger236.info(
170365
170731
  `Filtered out ${filteredCount} unnamed room(s): ${filtered.map((r) => r.name).join(", ")}`
170366
170732
  );
170367
170733
  }
170368
170734
  if (allRooms.length === 0) {
170369
- logger235.debug(
170735
+ logger236.debug(
170370
170736
  `No rooms found. Attributes: rooms=${JSON.stringify(attributes9.rooms)}, segments=${JSON.stringify(attributes9.segments)}, room_list=${attributes9.room_list}`
170371
170737
  );
170372
170738
  }
@@ -170400,7 +170766,7 @@ function createCleanAreaRvcRunModeServer(cleanAreaRooms) {
170400
170766
  modeTags: [{ value: RvcRunMode3.ModeTag.Cleaning }]
170401
170767
  });
170402
170768
  }
170403
- logger235.info(
170769
+ logger236.info(
170404
170770
  `Creating CLEAN_AREA RvcRunModeServer with ${cleanAreaRooms.length} HA areas, ${modes.length} total modes`
170405
170771
  );
170406
170772
  return RvcRunModeServer2(vacuumRvcRunModeConfig, {
@@ -170490,7 +170856,7 @@ init_nodejs();
170490
170856
 
170491
170857
  // src/matter/behaviors/rvc-clean-mode-server.ts
170492
170858
  init_home_assistant_entity_behavior();
170493
- var logger236 = Logger.get("RvcCleanModeServerBase");
170859
+ var logger237 = Logger.get("RvcCleanModeServerBase");
170494
170860
  var RvcCleanModeServerBase = class _RvcCleanModeServerBase extends RvcCleanModeServer {
170495
170861
  // Pending mode from a recent changeToMode command.
170496
170862
  // Prevents stale HA state (from a different entity like select.xxx)
@@ -170537,14 +170903,14 @@ var RvcCleanModeServerBase = class _RvcCleanModeServerBase extends RvcCleanModeS
170537
170903
  const homeAssistant = this.agent.get(HomeAssistantEntityBehavior);
170538
170904
  const { newMode } = request;
170539
170905
  if (newMode !== this.state.currentMode && !this.state.supportedModes.some((m) => m.mode === newMode)) {
170540
- logger236.warn(`changeToMode(${newMode}) rejected: unsupported mode`);
170906
+ logger237.warn(`changeToMode(${newMode}) rejected: unsupported mode`);
170541
170907
  return {
170542
170908
  status: ModeBase3.ModeChangeStatus.UnsupportedMode,
170543
170909
  statusText: `Unsupported mode: ${newMode}`
170544
170910
  };
170545
170911
  }
170546
170912
  const modeLabel = this.state.supportedModes.find((m) => m.mode === newMode);
170547
- logger236.info(
170913
+ logger237.info(
170548
170914
  `changeToMode(${newMode}) "${modeLabel?.label ?? "unknown"}" for ${homeAssistant.entityId}`
170549
170915
  );
170550
170916
  this.pendingMode = newMode;
@@ -170552,7 +170918,7 @@ var RvcCleanModeServerBase = class _RvcCleanModeServerBase extends RvcCleanModeS
170552
170918
  this.state.currentMode = newMode;
170553
170919
  const action = this.state.config.setCleanMode(newMode, this.agent);
170554
170920
  if (action) {
170555
- logger236.info(
170921
+ logger237.info(
170556
170922
  `changeToMode: dispatching action ${action.action} \u2192 ${action.target ?? homeAssistant.entityId}`
170557
170923
  );
170558
170924
  homeAssistant.callAction(action);
@@ -170585,7 +170951,7 @@ function RvcCleanModeServer2(config11, initialState) {
170585
170951
  }
170586
170952
 
170587
170953
  // src/matter/endpoints/legacy/vacuum/behaviors/vacuum-rvc-clean-mode-server.ts
170588
- var logger237 = Logger.get("VacuumRvcCleanModeServer");
170954
+ var logger238 = Logger.get("VacuumRvcCleanModeServer");
170589
170955
  var MODE_VACUUM = 0;
170590
170956
  var MODE_VACUUM_AND_MOP = 1;
170591
170957
  var MODE_MOP = 2;
@@ -170855,7 +171221,7 @@ function findMatchingCleanOption(ct, availableOptions) {
170855
171221
  const match = availableOptions.find((o) => classifyCleanOption(o) === type);
170856
171222
  if (match) return match;
170857
171223
  }
170858
- logger237.warn(
171224
+ logger238.warn(
170859
171225
  `No match for ${CLEAN_TYPE_LABELS[ct]} in [${availableOptions.join(", ")}]`
170860
171226
  );
170861
171227
  return availableOptions[0];
@@ -170864,7 +171230,7 @@ function buildCleaningModeAction(targetCleanType, agent) {
170864
171230
  const selectEntityId = getCleaningModeSelectEntity(agent);
170865
171231
  const { options } = readSelectEntity(selectEntityId, agent);
170866
171232
  const optionToUse = findMatchingCleanOption(targetCleanType, options);
170867
- logger237.info(
171233
+ logger238.info(
170868
171234
  `Switching cleaning mode to: ${optionToUse} via ${selectEntityId}`
170869
171235
  );
170870
171236
  return {
@@ -170953,7 +171319,7 @@ function createCleanModeConfig(fanSpeedList, mopIntensityList, cleaningModeOptio
170953
171319
  }
170954
171320
  }
170955
171321
  if (speedMode !== void 0) {
170956
- logger237.debug(
171322
+ logger238.debug(
170957
171323
  `Current mode: Vacuum + fan_speed="${speedState}" -> mode ${speedMode}`
170958
171324
  );
170959
171325
  return speedMode;
@@ -170974,7 +171340,7 @@ function createCleanModeConfig(fanSpeedList, mopIntensityList, cleaningModeOptio
170974
171340
  }
170975
171341
  }
170976
171342
  if (mopMode !== void 0) {
170977
- logger237.debug(
171343
+ logger238.debug(
170978
171344
  `Current mode: Mop + intensity="${state}" -> mode ${mopMode}`
170979
171345
  );
170980
171346
  return mopMode;
@@ -170992,14 +171358,14 @@ function createCleanModeConfig(fanSpeedList, mopIntensityList, cleaningModeOptio
170992
171358
  const homeAssistant = agent.get(HomeAssistantEntityBehavior);
170993
171359
  const vacuumEntityId = homeAssistant.entityId;
170994
171360
  const mapping = homeAssistant.state.mapping;
170995
- logger237.info(
171361
+ logger238.info(
170996
171362
  `setCleanMode(${mode}) for ${vacuumEntityId}, suctionEntity=${mapping?.suctionLevelEntity ?? "none"}, mopEntity=${mapping?.mopIntensityEntity ?? "none"}, fanSpeedList=${JSON.stringify(fanSpeedList ?? [])}, mopIntensityList=${JSON.stringify(mopIntensityList ?? [])}, customTags=${JSON.stringify(customFanSpeedTags ?? {})}`
170997
171363
  );
170998
171364
  if (mopIntensityList && mopIntensityList.length > 0 && isMopIntensityMode(mode)) {
170999
171365
  const mopIndex = mode - MOP_INTENSITY_MODE_BASE;
171000
171366
  const mopName = mopIntensityList[mopIndex];
171001
171367
  if (!mopName) {
171002
- logger237.warn(`Invalid mop intensity mode index: ${mopIndex}`);
171368
+ logger238.warn(`Invalid mop intensity mode index: ${mopIndex}`);
171003
171369
  return void 0;
171004
171370
  }
171005
171371
  if (hasCleanTypes) {
@@ -171012,18 +171378,18 @@ function createCleanModeConfig(fanSpeedList, mopIntensityList, cleaningModeOptio
171012
171378
  mapping.mopIntensityEntity,
171013
171379
  agent
171014
171380
  );
171015
- logger237.info(
171381
+ logger238.info(
171016
171382
  `Mop intensity entity ${mapping.mopIntensityEntity}: current="${state}", options=${JSON.stringify(options ?? [])}`
171017
171383
  );
171018
171384
  let option = matchMopIntensityOption(mopName, options);
171019
171385
  if (!option && options && mopIndex < options.length) {
171020
171386
  option = options[mopIndex];
171021
- logger237.info(
171387
+ logger238.info(
171022
171388
  `Positional match for mop "${mopName}" -> "${option}" (index ${mopIndex})`
171023
171389
  );
171024
171390
  }
171025
171391
  if (option) {
171026
- logger237.info(
171392
+ logger238.info(
171027
171393
  `Setting mop intensity to: ${option} via ${mapping.mopIntensityEntity}`
171028
171394
  );
171029
171395
  return {
@@ -171032,11 +171398,11 @@ function createCleanModeConfig(fanSpeedList, mopIntensityList, cleaningModeOptio
171032
171398
  target: mapping.mopIntensityEntity
171033
171399
  };
171034
171400
  }
171035
- logger237.warn(
171401
+ logger238.warn(
171036
171402
  `No match for mop intensity "${mopName}" in options: [${(options ?? []).join(", ")}]`
171037
171403
  );
171038
171404
  } else {
171039
- logger237.warn(
171405
+ logger238.warn(
171040
171406
  `Mop intensity mode ${mode} requested but no mopIntensityEntity configured`
171041
171407
  );
171042
171408
  }
@@ -171046,7 +171412,7 @@ function createCleanModeConfig(fanSpeedList, mopIntensityList, cleaningModeOptio
171046
171412
  const fanSpeedIndex = mode - FAN_SPEED_MODE_BASE;
171047
171413
  const fanSpeedName = fanSpeedList[fanSpeedIndex];
171048
171414
  if (!fanSpeedName) {
171049
- logger237.warn(`Invalid fan speed mode index: ${fanSpeedIndex}`);
171415
+ logger238.warn(`Invalid fan speed mode index: ${fanSpeedIndex}`);
171050
171416
  return void 0;
171051
171417
  }
171052
171418
  if (mapping?.suctionLevelEntity) {
@@ -171059,7 +171425,7 @@ function createCleanModeConfig(fanSpeedList, mopIntensityList, cleaningModeOptio
171059
171425
  mapping.suctionLevelEntity,
171060
171426
  agent
171061
171427
  );
171062
- logger237.info(
171428
+ logger238.info(
171063
171429
  `Suction entity ${mapping.suctionLevelEntity}: current="${state}", options=${JSON.stringify(options ?? [])}`
171064
171430
  );
171065
171431
  let option = matchFanSpeedOption(
@@ -171069,12 +171435,12 @@ function createCleanModeConfig(fanSpeedList, mopIntensityList, cleaningModeOptio
171069
171435
  );
171070
171436
  if (!option && options && fanSpeedIndex < options.length) {
171071
171437
  option = options[fanSpeedIndex];
171072
- logger237.info(
171438
+ logger238.info(
171073
171439
  `Positional match for fan "${fanSpeedName}" -> "${option}" (index ${fanSpeedIndex})`
171074
171440
  );
171075
171441
  }
171076
171442
  if (option) {
171077
- logger237.info(
171443
+ logger238.info(
171078
171444
  `Setting suction to: ${option} via ${mapping.suctionLevelEntity}`
171079
171445
  );
171080
171446
  return {
@@ -171083,7 +171449,7 @@ function createCleanModeConfig(fanSpeedList, mopIntensityList, cleaningModeOptio
171083
171449
  target: mapping.suctionLevelEntity
171084
171450
  };
171085
171451
  }
171086
- logger237.warn(
171452
+ logger238.warn(
171087
171453
  `No match for fan speed "${fanSpeedName}" in suction options: [${(options ?? []).join(", ")}]`
171088
171454
  );
171089
171455
  return void 0;
@@ -171093,7 +171459,7 @@ function createCleanModeConfig(fanSpeedList, mopIntensityList, cleaningModeOptio
171093
171459
  buildCleaningModeAction(0 /* Sweeping */, agent)
171094
171460
  );
171095
171461
  }
171096
- logger237.info(
171462
+ logger238.info(
171097
171463
  `Setting fan speed to: ${fanSpeedName} via vacuum.set_fan_speed`
171098
171464
  );
171099
171465
  return {
@@ -171103,7 +171469,7 @@ function createCleanModeConfig(fanSpeedList, mopIntensityList, cleaningModeOptio
171103
171469
  };
171104
171470
  }
171105
171471
  if (!hasCleanTypes) {
171106
- logger237.debug(
171472
+ logger238.debug(
171107
171473
  `Ignoring cleaning type change (mode=${mode}): no cleaning mode entity`
171108
171474
  );
171109
171475
  return void 0;
@@ -171115,7 +171481,7 @@ function createCleanModeConfig(fanSpeedList, mopIntensityList, cleaningModeOptio
171115
171481
  agent
171116
171482
  );
171117
171483
  const optionToUse = findMatchingCleanOption(cleanType, availableOptions);
171118
- logger237.info(
171484
+ logger238.info(
171119
171485
  `Setting cleaning mode to: ${optionToUse} (mode=${mode}) via ${selectEntityId}`
171120
171486
  );
171121
171487
  return {
@@ -171133,10 +171499,10 @@ function createVacuumRvcCleanModeServer(_attributes, fanSpeedList, mopIntensityL
171133
171499
  cleaningModeOptions,
171134
171500
  customFanSpeedTags
171135
171501
  );
171136
- logger237.info(
171502
+ logger238.info(
171137
171503
  `Creating VacuumRvcCleanModeServer with ${supportedModes2.length} modes (fanSpeedList=${JSON.stringify(fanSpeedList ?? [])}, mopIntensityList=${JSON.stringify(mopIntensityList ?? [])}, cleaningModeOptions=${JSON.stringify(cleaningModeOptions ?? [])}, customTags=${JSON.stringify(customFanSpeedTags ?? {})})`
171138
171504
  );
171139
- logger237.info(
171505
+ logger238.info(
171140
171506
  `Modes: ${supportedModes2.map((m) => `${m.mode}:${m.label}[${m.modeTags.map((t) => t.value).join(",")}]`).join(", ")}`
171141
171507
  );
171142
171508
  const initialState = {
@@ -171199,7 +171565,7 @@ function resolveMopIntensityList(mopIntensityEntity) {
171199
171565
  init_dist();
171200
171566
  init_esm();
171201
171567
  init_home_assistant_entity_behavior();
171202
- var logger238 = Logger.get("VacuumRvcOperationalStateServer");
171568
+ var logger239 = Logger.get("VacuumRvcOperationalStateServer");
171203
171569
  function batteryFromAttributes(attrs) {
171204
171570
  const raw = attrs.battery_level ?? attrs.battery;
171205
171571
  if (raw == null) return null;
@@ -171250,16 +171616,16 @@ function mapVacuumOperationalState(entity, batteryPercent = batteryFromAttribute
171250
171616
  operationalState = RvcOperationalState4.OperationalState.Error;
171251
171617
  } else {
171252
171618
  if (state.toLowerCase().includes("clean")) {
171253
- logger238.info(
171619
+ logger239.info(
171254
171620
  `Unknown vacuum state "${state}" contains 'clean', treating as Running`
171255
171621
  );
171256
171622
  operationalState = RvcOperationalState4.OperationalState.Running;
171257
171623
  } else {
171258
- logger238.info(`Unknown vacuum state "${state}", treating as Stopped`);
171624
+ logger239.info(`Unknown vacuum state "${state}", treating as Stopped`);
171259
171625
  operationalState = RvcOperationalState4.OperationalState.Stopped;
171260
171626
  }
171261
171627
  }
171262
- logger238.debug(
171628
+ logger239.debug(
171263
171629
  `Vacuum operationalState: "${state}" -> ${RvcOperationalState4.OperationalState[operationalState]}`
171264
171630
  );
171265
171631
  return operationalState;
@@ -171288,7 +171654,7 @@ var VacuumRvcOperationalStateServer = RvcOperationalStateServer2({
171288
171654
  });
171289
171655
 
171290
171656
  // src/matter/endpoints/legacy/vacuum/index.ts
171291
- var logger239 = Logger.get("VacuumDevice");
171657
+ var logger240 = Logger.get("VacuumDevice");
171292
171658
  var VacuumEndpointType = RoboticVacuumCleanerDevice.with(
171293
171659
  BasicInformationServer2,
171294
171660
  VacuumIdentifyServer,
@@ -171302,7 +171668,7 @@ function VacuumDevice(homeAssistantEntity, includeOnOff = false, cleaningModeOpt
171302
171668
  const entityId = homeAssistantEntity.entity.entity_id;
171303
171669
  const attributes9 = homeAssistantEntity.entity.state.attributes;
171304
171670
  const customAreas = homeAssistantEntity.mapping?.customServiceAreas;
171305
- logger239.info(
171671
+ logger240.info(
171306
171672
  `Creating vacuum endpoint for ${entityId}, mapping: ${JSON.stringify(homeAssistantEntity.mapping ?? "none")}`
171307
171673
  );
171308
171674
  const cleanAreaRooms = homeAssistantEntity.mapping?.cleanAreaRooms;
@@ -171315,32 +171681,32 @@ function VacuumDevice(homeAssistantEntity, includeOnOff = false, cleaningModeOpt
171315
171681
  )
171316
171682
  ).set({ homeAssistantEntity });
171317
171683
  if (includeOnOff) {
171318
- logger239.info(`${entityId}: Adding OnOff cluster (vacuumOnOff flag enabled)`);
171684
+ logger240.info(`${entityId}: Adding OnOff cluster (vacuumOnOff flag enabled)`);
171319
171685
  device = device.with(VacuumOnOffServer);
171320
171686
  }
171321
171687
  device = device.with(VacuumPowerSourceServer);
171322
171688
  const roomEntities = homeAssistantEntity.mapping?.roomEntities;
171323
171689
  const rooms = parseVacuumRooms(attributes9);
171324
- logger239.info(
171690
+ logger240.info(
171325
171691
  `${entityId}: customAreas=${customAreas?.length ?? 0}, roomEntities=${JSON.stringify(roomEntities ?? [])}, parsedRooms=${rooms.length}, cleanAreaRooms=${cleanAreaRooms?.length ?? 0}`
171326
171692
  );
171327
171693
  if (cleanAreaRooms && cleanAreaRooms.length > 0) {
171328
- logger239.info(
171694
+ logger240.info(
171329
171695
  `${entityId}: Adding ServiceArea (${cleanAreaRooms.length} HA areas via CLEAN_AREA)`
171330
171696
  );
171331
171697
  device = device.with(createCleanAreaServiceAreaServer(cleanAreaRooms));
171332
171698
  } else if (customAreas && customAreas.length > 0) {
171333
- logger239.info(
171699
+ logger240.info(
171334
171700
  `${entityId}: Adding ServiceArea (${customAreas.length} custom areas)`
171335
171701
  );
171336
171702
  device = device.with(createCustomServiceAreaServer(customAreas));
171337
171703
  } else if (rooms.length > 0 || roomEntities && roomEntities.length > 0) {
171338
- logger239.info(`${entityId}: Adding ServiceArea (${rooms.length} rooms)`);
171704
+ logger240.info(`${entityId}: Adding ServiceArea (${rooms.length} rooms)`);
171339
171705
  device = device.with(
171340
171706
  createVacuumServiceAreaServer(attributes9, roomEntities)
171341
171707
  );
171342
171708
  } else {
171343
- logger239.info(`${entityId}: Adding ServiceArea (default single-area)`);
171709
+ logger240.info(`${entityId}: Adding ServiceArea (default single-area)`);
171344
171710
  device = device.with(createDefaultServiceAreaServer());
171345
171711
  }
171346
171712
  const fanSpeedList = resolveFanSpeedList(
@@ -171351,7 +171717,7 @@ function VacuumDevice(homeAssistantEntity, includeOnOff = false, cleaningModeOpt
171351
171717
  homeAssistantEntity.mapping?.mopIntensityEntity
171352
171718
  );
171353
171719
  if (cleaningModeOptions || fanSpeedList || mopIntensityList) {
171354
- logger239.info(
171720
+ logger240.info(
171355
171721
  `${entityId}: Adding RvcCleanMode (multi-mode, cleaningModeOptions=${JSON.stringify(cleaningModeOptions ?? [])}, fanSpeedList=${JSON.stringify(fanSpeedList ?? [])}, mopIntensityList=${JSON.stringify(mopIntensityList ?? [])})`
171356
171722
  );
171357
171723
  device = device.with(
@@ -171364,7 +171730,7 @@ function VacuumDevice(homeAssistantEntity, includeOnOff = false, cleaningModeOpt
171364
171730
  )
171365
171731
  );
171366
171732
  } else {
171367
- logger239.info(`${entityId}: Adding RvcCleanMode (default single-mode)`);
171733
+ logger240.info(`${entityId}: Adding RvcCleanMode (default single-mode)`);
171368
171734
  device = device.with(createDefaultRvcCleanModeServer());
171369
171735
  }
171370
171736
  return device;
@@ -171530,7 +171896,7 @@ var WaterHeaterThermostatServer = ThermostatServer2(
171530
171896
  );
171531
171897
 
171532
171898
  // src/matter/endpoints/legacy/water-heater/index.ts
171533
- var logger240 = Logger.get("WaterHeaterDevice");
171899
+ var logger241 = Logger.get("WaterHeaterDevice");
171534
171900
  var WaterHeaterDeviceType = ThermostatDevice.with(
171535
171901
  BasicInformationServer2,
171536
171902
  IdentifyServer2,
@@ -171546,7 +171912,7 @@ function toMatterTemp2(value) {
171546
171912
  }
171547
171913
  function WaterHeaterDevice(homeAssistantEntity) {
171548
171914
  const attributes9 = homeAssistantEntity.entity.state.attributes;
171549
- logger240.debug(
171915
+ logger241.debug(
171550
171916
  `Creating device for ${homeAssistantEntity.entity.entity_id}, min_temp=${attributes9.min_temp}, max_temp=${attributes9.max_temp}`
171551
171917
  );
171552
171918
  const minLimit = toMatterTemp2(attributes9.min_temp) ?? 0;
@@ -171786,6 +172152,7 @@ var matterDeviceTypeFactories = {
171786
172152
  // Legacy SolarPower alias, kept for existing mappings.
171787
172153
  electrical_sensor: (ha) => ElectricalSensorType.set({ homeAssistantEntity: ha }),
171788
172154
  solar_power: (ha) => ElectricalSensorType.set({ homeAssistantEntity: ha }),
172155
+ evse: (ha) => energyEvseType().set({ homeAssistantEntity: ha }),
171789
172156
  contact_sensor: (ha) => ContactSensorType.set({ homeAssistantEntity: ha }),
171790
172157
  motion_sensor: (ha) => MotionSensorType.set({ homeAssistantEntity: ha }),
171791
172158
  occupancy_sensor: (ha) => OccupancySensorType.set({ homeAssistantEntity: ha }),
@@ -171801,7 +172168,7 @@ var matterDeviceTypeFactories = {
171801
172168
  };
171802
172169
 
171803
172170
  // src/matter/endpoints/composed/user-composed-endpoint.ts
171804
- var logger241 = Logger.get("UserComposedEndpoint");
172171
+ var logger242 = Logger.get("UserComposedEndpoint");
171805
172172
  function stripBasicInformation(type) {
171806
172173
  const behaviors = { ...type.behaviors };
171807
172174
  delete behaviors.bridgedDeviceBasicInformation;
@@ -171877,7 +172244,7 @@ var UserComposedEndpoint = class _UserComposedEndpoint extends Endpoint {
171877
172244
  { vacuumOnOff: registry2.isVacuumOnOffEnabled() }
171878
172245
  );
171879
172246
  if (!primaryType) {
171880
- logger241.warn(
172247
+ logger242.warn(
171881
172248
  `Cannot create endpoint type for primary entity ${primaryEntityId}`
171882
172249
  );
171883
172250
  return void 0;
@@ -171892,7 +172259,7 @@ var UserComposedEndpoint = class _UserComposedEndpoint extends Endpoint {
171892
172259
  if (!sub.entityId) continue;
171893
172260
  const subPayload = buildEntityPayload4(registry2, sub.entityId);
171894
172261
  if (!subPayload) {
171895
- logger241.warn(
172262
+ logger242.warn(
171896
172263
  `Cannot find state for composed sub-entity ${sub.entityId}, it does not exist in Home Assistant (removed or renamed?)`
171897
172264
  );
171898
172265
  continue;
@@ -171907,7 +172274,7 @@ var UserComposedEndpoint = class _UserComposedEndpoint extends Endpoint {
171907
172274
  config11.areaName
171908
172275
  );
171909
172276
  if (!subType) {
171910
- logger241.warn(
172277
+ logger242.warn(
171911
172278
  `Cannot create endpoint type for composed sub-entity ${sub.entityId}`
171912
172279
  );
171913
172280
  continue;
@@ -171920,7 +172287,7 @@ var UserComposedEndpoint = class _UserComposedEndpoint extends Endpoint {
171920
172287
  mappedIds.push(sub.entityId);
171921
172288
  }
171922
172289
  if (parts.length < 2) {
171923
- logger241.warn(
172290
+ logger242.warn(
171924
172291
  `User composed device ${primaryEntityId}: only ${parts.length} sub-endpoint(s), need at least 2 (primary + one sub-entity). Falling back to standalone.`
171925
172292
  );
171926
172293
  return void 0;
@@ -171944,7 +172311,7 @@ var UserComposedEndpoint = class _UserComposedEndpoint extends Endpoint {
171944
172311
  const labels = parts.map(
171945
172312
  (_, i) => i === 0 ? primaryEntityId.split(".")[0] : composedEntities[i - 1]?.entityId?.split(".")[0] ?? "?"
171946
172313
  ).join("+");
171947
- logger241.info(
172314
+ logger242.info(
171948
172315
  `Created user composed device ${primaryEntityId}: ${parts.length} sub-endpoint(s) [${labels}]`
171949
172316
  );
171950
172317
  return endpoint;
@@ -172050,7 +172417,7 @@ function asStandaloneEndpointType(type) {
172050
172417
  }
172051
172418
 
172052
172419
  // src/matter/endpoints/legacy/legacy-endpoint.ts
172053
- var logger242 = Logger.get("LegacyEndpoint");
172420
+ var logger243 = Logger.get("LegacyEndpoint");
172054
172421
  var LegacyEndpoint = class _LegacyEndpoint extends EntityEndpoint {
172055
172422
  static async create(registry2, entityId, mapping, pluginDomainMappings, standalone = false, endpointId, identityAnchor) {
172056
172423
  const deviceRegistry = registry2.deviceOf(entityId);
@@ -172060,25 +172427,25 @@ var LegacyEndpoint = class _LegacyEndpoint extends EntityEndpoint {
172060
172427
  return;
172061
172428
  }
172062
172429
  if (registry2.isAutoBatteryMappingEnabled() && registry2.isBatteryEntityUsed(entityId)) {
172063
- logger242.debug(
172430
+ logger243.debug(
172064
172431
  `Skipping ${entityId} - already auto-assigned as battery to another device`
172065
172432
  );
172066
172433
  return;
172067
172434
  }
172068
172435
  if (registry2.isAutoHumidityMappingEnabled() && registry2.isHumidityEntityUsed(entityId)) {
172069
- logger242.debug(
172436
+ logger243.debug(
172070
172437
  `Skipping ${entityId} - already auto-assigned as humidity to a temperature sensor`
172071
172438
  );
172072
172439
  return;
172073
172440
  }
172074
172441
  if (registry2.isAutoPressureMappingEnabled() && registry2.isPressureEntityUsed(entityId)) {
172075
- logger242.debug(
172442
+ logger243.debug(
172076
172443
  `Skipping ${entityId} - already auto-assigned as pressure to a temperature sensor`
172077
172444
  );
172078
172445
  return;
172079
172446
  }
172080
172447
  if (registry2.isAutoComposedDevicesEnabled() && registry2.isComposedSubEntityUsed(entityId)) {
172081
- logger242.debug(
172448
+ logger243.debug(
172082
172449
  `Skipping ${entityId} - already consumed by a composed device`
172083
172450
  );
172084
172451
  return;
@@ -172098,7 +172465,7 @@ var LegacyEndpoint = class _LegacyEndpoint extends EntityEndpoint {
172098
172465
  humidityEntity: humidityEntityId
172099
172466
  };
172100
172467
  registry2.markHumidityEntityUsed(humidityEntityId);
172101
- logger242.debug(
172468
+ logger243.debug(
172102
172469
  `Auto-assigned humidity ${humidityEntityId} to ${entityId}`
172103
172470
  );
172104
172471
  }
@@ -172117,7 +172484,7 @@ var LegacyEndpoint = class _LegacyEndpoint extends EntityEndpoint {
172117
172484
  pressureEntity: pressureEntityId
172118
172485
  };
172119
172486
  registry2.markPressureEntityUsed(pressureEntityId);
172120
- logger242.debug(
172487
+ logger243.debug(
172121
172488
  `Auto-assigned pressure ${pressureEntityId} to ${entityId}`
172122
172489
  );
172123
172490
  }
@@ -172135,7 +172502,7 @@ var LegacyEndpoint = class _LegacyEndpoint extends EntityEndpoint {
172135
172502
  batteryEntity: batteryEntityId
172136
172503
  };
172137
172504
  registry2.markBatteryEntityUsed(batteryEntityId);
172138
- logger242.debug(
172505
+ logger243.debug(
172139
172506
  `Auto-assigned battery ${batteryEntityId} to ${entityId}`
172140
172507
  );
172141
172508
  }
@@ -172152,7 +172519,7 @@ var LegacyEndpoint = class _LegacyEndpoint extends EntityEndpoint {
172152
172519
  entityId: effectiveMapping?.entityId ?? entityId,
172153
172520
  faultEntity: faultEntityId
172154
172521
  };
172155
- logger242.debug(`Auto-assigned fault ${faultEntityId} to ${entityId}`);
172522
+ logger243.debug(`Auto-assigned fault ${faultEntityId} to ${entityId}`);
172156
172523
  }
172157
172524
  }
172158
172525
  if (!mapping?.powerEntity) {
@@ -172168,7 +172535,7 @@ var LegacyEndpoint = class _LegacyEndpoint extends EntityEndpoint {
172168
172535
  powerEntity: powerEntityId
172169
172536
  };
172170
172537
  registry2.markPowerEntityUsed(powerEntityId);
172171
- logger242.debug(`Auto-assigned power ${powerEntityId} to ${entityId}`);
172538
+ logger243.debug(`Auto-assigned power ${powerEntityId} to ${entityId}`);
172172
172539
  }
172173
172540
  }
172174
172541
  }
@@ -172185,7 +172552,7 @@ var LegacyEndpoint = class _LegacyEndpoint extends EntityEndpoint {
172185
172552
  energyEntity: energyEntityId
172186
172553
  };
172187
172554
  registry2.markEnergyEntityUsed(energyEntityId);
172188
- logger242.debug(
172555
+ logger243.debug(
172189
172556
  `Auto-assigned energy ${energyEntityId} to ${entityId}`
172190
172557
  );
172191
172558
  }
@@ -172201,7 +172568,7 @@ var LegacyEndpoint = class _LegacyEndpoint extends EntityEndpoint {
172201
172568
  entityId: effectiveMapping?.entityId ?? entityId,
172202
172569
  cleaningModeEntity: vacuumEntities.cleaningModeEntity
172203
172570
  };
172204
- logger242.info(
172571
+ logger243.info(
172205
172572
  `Auto-assigned cleaningMode ${vacuumEntities.cleaningModeEntity} to ${entityId}`
172206
172573
  );
172207
172574
  }
@@ -172211,7 +172578,7 @@ var LegacyEndpoint = class _LegacyEndpoint extends EntityEndpoint {
172211
172578
  entityId: effectiveMapping?.entityId ?? entityId,
172212
172579
  suctionLevelEntity: vacuumEntities.suctionLevelEntity
172213
172580
  };
172214
- logger242.info(
172581
+ logger243.info(
172215
172582
  `Auto-assigned suctionLevel ${vacuumEntities.suctionLevelEntity} to ${entityId}`
172216
172583
  );
172217
172584
  }
@@ -172221,7 +172588,7 @@ var LegacyEndpoint = class _LegacyEndpoint extends EntityEndpoint {
172221
172588
  entityId: effectiveMapping?.entityId ?? entityId,
172222
172589
  mopIntensityEntity: vacuumEntities.mopIntensityEntity
172223
172590
  };
172224
- logger242.info(
172591
+ logger243.info(
172225
172592
  `Auto-assigned mopIntensity ${vacuumEntities.mopIntensityEntity} to ${entityId}`
172226
172593
  );
172227
172594
  }
@@ -172231,7 +172598,7 @@ var LegacyEndpoint = class _LegacyEndpoint extends EntityEndpoint {
172231
172598
  entityId: effectiveMapping?.entityId ?? entityId,
172232
172599
  currentRoomEntity: vacuumEntities.currentRoomEntity
172233
172600
  };
172234
- logger242.info(
172601
+ logger243.info(
172235
172602
  `Auto-assigned currentRoom ${vacuumEntities.currentRoomEntity} to ${entityId}`
172236
172603
  );
172237
172604
  }
@@ -172246,7 +172613,7 @@ var LegacyEndpoint = class _LegacyEndpoint extends EntityEndpoint {
172246
172613
  entityId: effectiveMapping?.entityId ?? entityId,
172247
172614
  cleanAreaRooms
172248
172615
  };
172249
- logger242.info(
172616
+ logger243.info(
172250
172617
  `Using ${cleanAreaRooms.length} HA areas via CLEAN_AREA for ${entityId}`
172251
172618
  );
172252
172619
  }
@@ -172267,7 +172634,7 @@ var LegacyEndpoint = class _LegacyEndpoint extends EntityEndpoint {
172267
172634
  rooms: roomsObj
172268
172635
  }
172269
172636
  };
172270
- logger242.debug(
172637
+ logger243.debug(
172271
172638
  `Auto-detected ${valetudoRooms.length} Valetudo segments for ${entityId}`
172272
172639
  );
172273
172640
  } else {
@@ -172284,7 +172651,7 @@ var LegacyEndpoint = class _LegacyEndpoint extends EntityEndpoint {
172284
172651
  rooms: roomsObj
172285
172652
  }
172286
172653
  };
172287
- logger242.debug(
172654
+ logger243.debug(
172288
172655
  `Auto-detected ${roborockRooms.length} Roborock rooms for ${entityId}`
172289
172656
  );
172290
172657
  }
@@ -172293,7 +172660,7 @@ var LegacyEndpoint = class _LegacyEndpoint extends EntityEndpoint {
172293
172660
  }
172294
172661
  }
172295
172662
  if (standalone && ((effectiveMapping?.composedEntities?.length ?? 0) > 0 || effectiveMapping?.climateExposeFan === true)) {
172296
- logger242.warn(
172663
+ logger243.warn(
172297
172664
  `Composed mappings are not supported in server mode, exposing ${entityId} as a flat standalone endpoint`
172298
172665
  );
172299
172666
  }
@@ -172312,7 +172679,7 @@ var LegacyEndpoint = class _LegacyEndpoint extends EntityEndpoint {
172312
172679
  if (composed) {
172313
172680
  return composed;
172314
172681
  }
172315
- logger242.warn(
172682
+ logger243.warn(
172316
172683
  `User composed device creation failed for ${entityId}, falling back to standalone`
172317
172684
  );
172318
172685
  }
@@ -172377,7 +172744,7 @@ var LegacyEndpoint = class _LegacyEndpoint extends EntityEndpoint {
172377
172744
  if (composed) {
172378
172745
  return composed;
172379
172746
  }
172380
- logger242.warn(
172747
+ logger243.warn(
172381
172748
  `Companion fan creation failed for ${entityId}, falling back to standalone`
172382
172749
  );
172383
172750
  }
@@ -172457,11 +172824,11 @@ var LegacyEndpoint = class _LegacyEndpoint extends EntityEndpoint {
172457
172824
  }
172458
172825
  if (mappedChanged) {
172459
172826
  this.pendingMappedChange = true;
172460
- logger242.debug(
172827
+ logger243.debug(
172461
172828
  `Mapped entity change detected for ${this.entityId}, forcing update`
172462
172829
  );
172463
172830
  }
172464
- logger242.debug(
172831
+ logger243.debug(
172465
172832
  `State update received for ${this.entityId}: state=${state.state}`
172466
172833
  );
172467
172834
  this.lastState = state;
@@ -173040,7 +173407,7 @@ import {
173040
173407
  getCollection
173041
173408
  } from "home-assistant-js-websocket";
173042
173409
  import { atLeastHaVersion } from "home-assistant-js-websocket/dist/util.js";
173043
- var logger243 = Logger.get("SubscribeEntities");
173410
+ var logger244 = Logger.get("SubscribeEntities");
173044
173411
  function processEvent(store, updates) {
173045
173412
  const state = { ...store.state };
173046
173413
  if (updates.a) {
@@ -173066,7 +173433,7 @@ function processEvent(store, updates) {
173066
173433
  for (const entityId in updates.c) {
173067
173434
  let entityState = state[entityId];
173068
173435
  if (!entityState) {
173069
- logger243.warn("Received state update for unknown entity", entityId);
173436
+ logger244.warn("Received state update for unknown entity", entityId);
173070
173437
  continue;
173071
173438
  }
173072
173439
  entityState = { ...entityState };
@@ -173155,7 +173522,7 @@ var subscribeEntities = (conn, onChange, entityIds) => {
173155
173522
  // src/services/bridges/entity-isolation-service.ts
173156
173523
  init_esm();
173157
173524
  init_diagnostic_event_bus();
173158
- var logger244 = Logger.get("EntityIsolation");
173525
+ var logger245 = Logger.get("EntityIsolation");
173159
173526
  var EntityIsolationServiceImpl = class {
173160
173527
  isolatedEntities = /* @__PURE__ */ new Map();
173161
173528
  isolationCallbacks = /* @__PURE__ */ new Map();
@@ -173220,13 +173587,13 @@ var EntityIsolationServiceImpl = class {
173220
173587
  }
173221
173588
  const parsed = this.parseEndpointPath(msg);
173222
173589
  if (!parsed) {
173223
- logger244.warn("Could not parse entity from error:", msg);
173590
+ logger245.warn("Could not parse entity from error:", msg);
173224
173591
  return false;
173225
173592
  }
173226
173593
  const { bridgeId, entityName } = parsed;
173227
173594
  const callback = this.isolationCallbacks.get(bridgeId);
173228
173595
  if (!callback) {
173229
- logger244.warn(
173596
+ logger245.warn(
173230
173597
  `No isolation callback registered for bridge ${bridgeId}, entity: ${entityName}`
173231
173598
  );
173232
173599
  return false;
@@ -173241,7 +173608,7 @@ var EntityIsolationServiceImpl = class {
173241
173608
  reason,
173242
173609
  failedAt: (/* @__PURE__ */ new Date()).toISOString()
173243
173610
  });
173244
- logger244.warn(
173611
+ logger245.warn(
173245
173612
  `Isolating entity "${entityName}" from bridge ${bridgeId} due to: ${reason}`
173246
173613
  );
173247
173614
  diagnosticEventBus.emit("entity_error", `Entity isolated: ${entityName}`, {
@@ -173253,7 +173620,7 @@ var EntityIsolationServiceImpl = class {
173253
173620
  await callback(entityName);
173254
173621
  return true;
173255
173622
  } catch (e) {
173256
- logger244.error(`Failed to isolate entity ${entityName}:`, e);
173623
+ logger245.error(`Failed to isolate entity ${entityName}:`, e);
173257
173624
  return false;
173258
173625
  }
173259
173626
  }
@@ -174771,11 +175138,11 @@ function makeWarmStartState(state, now = (/* @__PURE__ */ new Date()).toISOStrin
174771
175138
  return { ...state, last_updated: now };
174772
175139
  }
174773
175140
  var ServerModeBridge = class {
174774
- constructor(logger247, dataProvider, endpointManager, server) {
175141
+ constructor(logger248, dataProvider, endpointManager, server) {
174775
175142
  this.dataProvider = dataProvider;
174776
175143
  this.endpointManager = endpointManager;
174777
175144
  this.server = server;
174778
- this.log = logger247.get(`ServerModeBridge / ${dataProvider.id}`);
175145
+ this.log = logger248.get(`ServerModeBridge / ${dataProvider.id}`);
174779
175146
  }
174780
175147
  dataProvider;
174781
175148
  endpointManager;
@@ -174865,6 +175232,7 @@ var ServerModeBridge = class {
174865
175232
  const sessionList = sessions.map((s) => {
174866
175233
  const subCount = s.subscriptions.size;
174867
175234
  totalSubscriptions += subCount;
175235
+ const subscriptions = summarizeSubscriptions(s.subscriptions);
174868
175236
  const fi = typeof s.fabric?.fabricIndex === "number" ? s.fabric.fabricIndex : null;
174869
175237
  if (fi !== null) {
174870
175238
  const existing = fabricMap.get(fi) ?? {
@@ -174886,6 +175254,7 @@ var ServerModeBridge = class {
174886
175254
  peerNodeId: String(s.peerNodeId),
174887
175255
  fabricIndex: fi,
174888
175256
  subscriptionCount: subCount,
175257
+ subscriptions,
174889
175258
  lastActiveMsAgo,
174890
175259
  lastAnyActivityMsAgo,
174891
175260
  lastImRequestMsAgo,
@@ -175803,7 +176172,7 @@ function ServerModeVacuumDevice(homeAssistantEntity, includeOnOff = false, clean
175803
176172
  }
175804
176173
 
175805
176174
  // src/matter/endpoints/server-mode-vacuum-endpoint.ts
175806
- var logger245 = Logger.get("ServerModeVacuumEndpoint");
176175
+ var logger246 = Logger.get("ServerModeVacuumEndpoint");
175807
176176
  var ServerModeVacuumEndpoint = class _ServerModeVacuumEndpoint extends EntityEndpoint {
175808
176177
  static async create(registry2, entityId, mapping, endpointId) {
175809
176178
  const deviceRegistry = registry2.deviceOf(entityId);
@@ -175816,7 +176185,7 @@ var ServerModeVacuumEndpoint = class _ServerModeVacuumEndpoint extends EntityEnd
175816
176185
  if (mapping?.disableBatteryMapping && mapping.batteryEntity) {
175817
176186
  effectiveMapping = { ...mapping, batteryEntity: void 0 };
175818
176187
  }
175819
- logger245.info(
176188
+ logger246.info(
175820
176189
  `${entityId}: device_id=${entity.device_id}, manualBattery=${mapping?.batteryEntity ?? "none"}`
175821
176190
  );
175822
176191
  if (entity.device_id) {
@@ -175831,15 +176200,15 @@ var ServerModeVacuumEndpoint = class _ServerModeVacuumEndpoint extends EntityEnd
175831
176200
  batteryEntity: batteryEntityId
175832
176201
  };
175833
176202
  registry2.markBatteryEntityUsed(batteryEntityId);
175834
- logger245.info(`${entityId}: Auto-assigned battery ${batteryEntityId}`);
176203
+ logger246.info(`${entityId}: Auto-assigned battery ${batteryEntityId}`);
175835
176204
  } else {
175836
176205
  const attrs = state.attributes;
175837
176206
  if (attrs.battery_level != null || attrs.battery != null) {
175838
- logger245.info(
176207
+ logger246.info(
175839
176208
  `${entityId}: No battery entity found, using battery attribute from vacuum state`
175840
176209
  );
175841
176210
  } else {
175842
- logger245.warn(
176211
+ logger246.warn(
175843
176212
  `${entityId}: No battery entity found for device ${entity.device_id}`
175844
176213
  );
175845
176214
  }
@@ -175854,7 +176223,7 @@ var ServerModeVacuumEndpoint = class _ServerModeVacuumEndpoint extends EntityEnd
175854
176223
  entityId: effectiveMapping?.entityId ?? entityId,
175855
176224
  cleaningModeEntity: vacuumEntities.cleaningModeEntity
175856
176225
  };
175857
- logger245.info(
176226
+ logger246.info(
175858
176227
  `${entityId}: Auto-assigned cleaningMode ${vacuumEntities.cleaningModeEntity}`
175859
176228
  );
175860
176229
  }
@@ -175864,7 +176233,7 @@ var ServerModeVacuumEndpoint = class _ServerModeVacuumEndpoint extends EntityEnd
175864
176233
  entityId: effectiveMapping?.entityId ?? entityId,
175865
176234
  suctionLevelEntity: vacuumEntities.suctionLevelEntity
175866
176235
  };
175867
- logger245.info(
176236
+ logger246.info(
175868
176237
  `${entityId}: Auto-assigned suctionLevel ${vacuumEntities.suctionLevelEntity}`
175869
176238
  );
175870
176239
  }
@@ -175874,7 +176243,7 @@ var ServerModeVacuumEndpoint = class _ServerModeVacuumEndpoint extends EntityEnd
175874
176243
  entityId: effectiveMapping?.entityId ?? entityId,
175875
176244
  mopIntensityEntity: vacuumEntities.mopIntensityEntity
175876
176245
  };
175877
- logger245.info(
176246
+ logger246.info(
175878
176247
  `${entityId}: Auto-assigned mopIntensity ${vacuumEntities.mopIntensityEntity}`
175879
176248
  );
175880
176249
  }
@@ -175884,7 +176253,7 @@ var ServerModeVacuumEndpoint = class _ServerModeVacuumEndpoint extends EntityEnd
175884
176253
  entityId: effectiveMapping?.entityId ?? entityId,
175885
176254
  currentRoomEntity: vacuumEntities.currentRoomEntity
175886
176255
  };
175887
- logger245.info(
176256
+ logger246.info(
175888
176257
  `${entityId}: Auto-assigned currentRoom ${vacuumEntities.currentRoomEntity}`
175889
176258
  );
175890
176259
  }
@@ -175899,7 +176268,7 @@ var ServerModeVacuumEndpoint = class _ServerModeVacuumEndpoint extends EntityEnd
175899
176268
  entityId: effectiveMapping?.entityId ?? entityId,
175900
176269
  cleanAreaRooms
175901
176270
  };
175902
- logger245.info(
176271
+ logger246.info(
175903
176272
  `${entityId}: Using ${cleanAreaRooms.length} HA areas via CLEAN_AREA`
175904
176273
  );
175905
176274
  }
@@ -175920,7 +176289,7 @@ var ServerModeVacuumEndpoint = class _ServerModeVacuumEndpoint extends EntityEnd
175920
176289
  rooms: roomsObj
175921
176290
  }
175922
176291
  };
175923
- logger245.info(
176292
+ logger246.info(
175924
176293
  `${entityId}: Auto-detected ${valetudoRooms.length} Valetudo segments`
175925
176294
  );
175926
176295
  } else {
@@ -175937,14 +176306,14 @@ var ServerModeVacuumEndpoint = class _ServerModeVacuumEndpoint extends EntityEnd
175937
176306
  rooms: roomsObj
175938
176307
  }
175939
176308
  };
175940
- logger245.info(
176309
+ logger246.info(
175941
176310
  `${entityId}: Auto-detected ${roborockRooms.length} Roborock rooms`
175942
176311
  );
175943
176312
  }
175944
176313
  }
175945
176314
  }
175946
176315
  } else {
175947
- logger245.warn(`${entityId}: No device_id, cannot auto-assign battery`);
176316
+ logger246.warn(`${entityId}: No device_id, cannot auto-assign battery`);
175948
176317
  }
175949
176318
  const payload = {
175950
176319
  entity_id: entityId,
@@ -176017,11 +176386,11 @@ var ServerModeVacuumEndpoint = class _ServerModeVacuumEndpoint extends EntityEnd
176017
176386
  }
176018
176387
  if (mappedChanged) {
176019
176388
  this.pendingMappedChange = true;
176020
- logger245.debug(
176389
+ logger246.debug(
176021
176390
  `Mapped entity change detected for ${this.entityId}, forcing update`
176022
176391
  );
176023
176392
  }
176024
- logger245.debug(
176393
+ logger246.debug(
176025
176394
  `State update received for ${this.entityId}: state=${state.state}`
176026
176395
  );
176027
176396
  this.lastState = state;
@@ -176599,10 +176968,10 @@ var BridgeEnvironmentFactory = class extends BridgeFactory {
176599
176968
  // src/core/ioc/app-environment.ts
176600
176969
  var AppEnvironment = class _AppEnvironment extends EnvironmentBase {
176601
176970
  constructor(rootEnv, options) {
176602
- const logger247 = rootEnv.get(LoggerService);
176971
+ const logger248 = rootEnv.get(LoggerService);
176603
176972
  super({
176604
176973
  id: "App",
176605
- log: logger247.get("AppContainer"),
176974
+ log: logger248.get("AppContainer"),
176606
176975
  parent: rootEnv
176607
176976
  });
176608
176977
  this.options = options;
@@ -176616,8 +176985,8 @@ var AppEnvironment = class _AppEnvironment extends EnvironmentBase {
176616
176985
  }
176617
176986
  construction;
176618
176987
  async init() {
176619
- const logger247 = this.get(LoggerService);
176620
- this.set(LoggerService, logger247);
176988
+ const logger248 = this.get(LoggerService);
176989
+ this.set(LoggerService, logger248);
176621
176990
  this.set(AppStorage, new AppStorage(await this.load(StorageService)));
176622
176991
  this.set(BridgeStorage, new BridgeStorage(await this.load(AppStorage)));
176623
176992
  this.set(
@@ -176638,7 +177007,7 @@ var AppEnvironment = class _AppEnvironment extends EnvironmentBase {
176638
177007
  );
176639
177008
  this.set(
176640
177009
  HomeAssistantClient,
176641
- new HomeAssistantClient(logger247, this.options.homeAssistant)
177010
+ new HomeAssistantClient(logger248, this.options.homeAssistant)
176642
177011
  );
176643
177012
  this.set(
176644
177013
  HomeAssistantConfig,
@@ -176646,7 +177015,7 @@ var AppEnvironment = class _AppEnvironment extends EnvironmentBase {
176646
177015
  );
176647
177016
  this.set(
176648
177017
  HomeAssistantActions,
176649
- new HomeAssistantActions(logger247, await this.load(HomeAssistantClient))
177018
+ new HomeAssistantActions(logger248, await this.load(HomeAssistantClient))
176650
177019
  );
176651
177020
  this.set(
176652
177021
  HomeAssistantRegistry,
@@ -176682,7 +177051,7 @@ var AppEnvironment = class _AppEnvironment extends EnvironmentBase {
176682
177051
  this.set(
176683
177052
  WebApi,
176684
177053
  new WebApi(
176685
- logger247,
177054
+ logger248,
176686
177055
  await this.load(BridgeService),
176687
177056
  await this.load(HomeAssistantClient),
176688
177057
  await this.load(HomeAssistantRegistry),
@@ -176703,7 +177072,7 @@ var AppEnvironment = class _AppEnvironment extends EnvironmentBase {
176703
177072
 
176704
177073
  // src/matter/patches/patch-level-control-tlv.ts
176705
177074
  init_esm();
176706
- var logger246 = Logger.get("PatchLevelControlTlv");
177075
+ var logger247 = Logger.get("PatchLevelControlTlv");
176707
177076
  var optionalFieldModels = /* @__PURE__ */ new WeakSet();
176708
177077
  var fieldModelMandatoryGetterPatched = false;
176709
177078
  function patchLevelControlTlv() {
@@ -176759,11 +177128,11 @@ function patchLevelControlTlv() {
176759
177128
  patched++;
176760
177129
  }
176761
177130
  if (patched > 0) {
176762
- logger246.info(
177131
+ logger247.info(
176763
177132
  `Patched ${patched} LevelControl TLV schema(s): transitionTime is now optional (Google Home compatibility)`
176764
177133
  );
176765
177134
  } else {
176766
- logger246.warn(
177135
+ logger247.warn(
176767
177136
  "Failed to patch LevelControl TLV schemas, field definitions not found. Google Home brightness adjustment may not work.",
176768
177137
  {
176769
177138
  moveToLevel: describeFields(