@riddix/hamh 2.1.0-alpha.466 → 2.1.0-alpha.467

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.
@@ -1743,8 +1743,8 @@ var init_Cancelable = __esm({
1743
1743
  };
1744
1744
  return result;
1745
1745
  }
1746
- static set logger(logger195) {
1747
- this.#logger = logger195;
1746
+ static set logger(logger196) {
1747
+ this.#logger = logger196;
1748
1748
  }
1749
1749
  static get logger() {
1750
1750
  return this.#logger;
@@ -3422,13 +3422,13 @@ var init_Logger = __esm({
3422
3422
  *
3423
3423
  * @deprecated use {@link destinations}
3424
3424
  */
3425
- static addLogger(identifier, logger195, options) {
3425
+ static addLogger(identifier, logger196, options) {
3426
3426
  if (identifier in this.destinations) {
3427
3427
  throw new ImplementationError(`Logger "${identifier}" already exists`);
3428
3428
  }
3429
3429
  const dest = LogDestination({ name: identifier });
3430
3430
  const legacy = adaptDestinationToLegacy(dest);
3431
- legacy.log = logger195;
3431
+ legacy.log = logger196;
3432
3432
  if (options?.defaultLogLevel !== void 0) {
3433
3433
  legacy.defaultLogLevel = options.defaultLogLevel;
3434
3434
  }
@@ -5538,8 +5538,8 @@ function Construction(subject, initializer) {
5538
5538
  }
5539
5539
  }
5540
5540
  function unhandledError(...args) {
5541
- const logger195 = Logger.get(subject.constructor.name);
5542
- logger195.error(...args);
5541
+ const logger196 = Logger.get(subject.constructor.name);
5542
+ logger196.error(...args);
5543
5543
  }
5544
5544
  function createErrorHandler(name) {
5545
5545
  return (e) => {
@@ -135998,11 +135998,11 @@ var init_Api = __esm({
135998
135998
  }
135999
135999
  Api2.resourceFor = resourceFor;
136000
136000
  function log(level, facility, id, ...message) {
136001
- let logger195 = loggers.get(facility);
136002
- if (!logger195) {
136003
- loggers.set(facility, logger195 = Logger.get(facility));
136001
+ let logger196 = loggers.get(facility);
136002
+ if (!logger196) {
136003
+ loggers.set(facility, logger196 = Logger.get(facility));
136004
136004
  }
136005
- logger195[level](Diagnostic.via(id || "(anon)"), message);
136005
+ logger196[level](Diagnostic.via(id || "(anon)"), message);
136006
136006
  }
136007
136007
  Api2.log = log;
136008
136008
  function logRequest(facility, id, method, target) {
@@ -147233,10 +147233,10 @@ var init_home_assistant_actions = __esm({
147233
147233
  circuitBreakerResetMs: 3e4
147234
147234
  };
147235
147235
  HomeAssistantActions = class extends Service {
147236
- constructor(logger195, client, config10) {
147236
+ constructor(logger196, client, config10) {
147237
147237
  super("HomeAssistantActions");
147238
147238
  this.client = client;
147239
- this.log = logger195.get(this);
147239
+ this.log = logger196.get(this);
147240
147240
  this.config = { ...defaultConfig, ...config10 };
147241
147241
  this.circuitBreaker = new CircuitBreaker(
147242
147242
  this.config.circuitBreakerThreshold,
@@ -147608,10 +147608,10 @@ var DiagnosticService = class {
147608
147608
  };
147609
147609
 
147610
147610
  // src/api/access-log.ts
147611
- function accessLogger(logger195) {
147611
+ function accessLogger(logger196) {
147612
147612
  return (req, res, next) => {
147613
147613
  res.on("finish", () => {
147614
- logger195.debug(
147614
+ logger196.debug(
147615
147615
  `${req.method} ${decodeURI(req.originalUrl)} ${res.statusCode} ${res.statusMessage} from ${req.socket.remoteAddress}`
147616
147616
  );
147617
147617
  });
@@ -150318,7 +150318,7 @@ var WebSocketApi = class {
150318
150318
 
150319
150319
  // src/api/web-api.ts
150320
150320
  var WebApi = class extends Service {
150321
- constructor(logger195, bridgeService, haClient, haRegistry, bridgeStorage, mappingStorage, lockCredentialStorage, settingsStorage, props) {
150321
+ constructor(logger196, bridgeService, haClient, haRegistry, bridgeStorage, mappingStorage, lockCredentialStorage, settingsStorage, props) {
150322
150322
  super("WebApi");
150323
150323
  this.bridgeService = bridgeService;
150324
150324
  this.haClient = haClient;
@@ -150328,8 +150328,8 @@ var WebApi = class extends Service {
150328
150328
  this.lockCredentialStorage = lockCredentialStorage;
150329
150329
  this.settingsStorage = settingsStorage;
150330
150330
  this.props = props;
150331
- this.logger = logger195;
150332
- this.log = logger195.get(this);
150331
+ this.logger = logger196;
150332
+ this.log = logger196.get(this);
150333
150333
  this.accessLogger = accessLogger(this.log.createChild("Access Log"));
150334
150334
  this.startTime = Date.now();
150335
150335
  this.wsApi = new WebSocketApi(
@@ -150762,12 +150762,12 @@ var CustomStorage = class extends StorageBackendDisk {
150762
150762
 
150763
150763
  // src/core/app/storage.ts
150764
150764
  function storage(environment, options) {
150765
- const logger195 = environment.get(LoggerService).get("CustomStorage");
150765
+ const logger196 = environment.get(LoggerService).get("CustomStorage");
150766
150766
  const location2 = resolveStorageLocation(options.location);
150767
150767
  fs6.mkdirSync(location2, { recursive: true });
150768
150768
  const storageService = environment.get(StorageService);
150769
150769
  storageService.location = location2;
150770
- storageService.factory = (ns) => new CustomStorage(logger195, path6.resolve(location2, ns));
150770
+ storageService.factory = (ns) => new CustomStorage(logger196, path6.resolve(location2, ns));
150771
150771
  }
150772
150772
  function resolveStorageLocation(storageLocation) {
150773
150773
  const homedir = os3.homedir();
@@ -151121,10 +151121,10 @@ import {
151121
151121
  getConfig
151122
151122
  } from "home-assistant-js-websocket";
151123
151123
  var HomeAssistantClient = class extends Service {
151124
- constructor(logger195, options) {
151124
+ constructor(logger196, options) {
151125
151125
  super("HomeAssistantClient");
151126
151126
  this.options = options;
151127
- this.log = logger195.get(this);
151127
+ this.log = logger196.get(this);
151128
151128
  }
151129
151129
  static Options = /* @__PURE__ */ Symbol.for("HomeAssistantClientProps");
151130
151130
  _connection;
@@ -164374,10 +164374,10 @@ function ensureCommissioningConfig(server) {
164374
164374
  // src/services/bridges/bridge.ts
164375
164375
  var AUTO_FORCE_SYNC_INTERVAL_MS = 9e4;
164376
164376
  var Bridge = class {
164377
- constructor(env, logger195, dataProvider, endpointManager) {
164377
+ constructor(env, logger196, dataProvider, endpointManager) {
164378
164378
  this.dataProvider = dataProvider;
164379
164379
  this.endpointManager = endpointManager;
164380
- this.log = logger195.get(`Bridge / ${dataProvider.id}`);
164380
+ this.log = logger196.get(`Bridge / ${dataProvider.id}`);
164381
164381
  this.server = new BridgeServerNode(
164382
164382
  env,
164383
164383
  this.dataProvider,
@@ -165992,6 +165992,9 @@ var AirPurifierHepaFilterMonitoringServer = HepaFilterMonitoringServer2(config2)
165992
165992
  // src/matter/endpoints/legacy/fan/behaviors/fan-fan-control-server.ts
165993
165993
  init_dist();
165994
165994
 
165995
+ // src/matter/behaviors/fan-control-server.ts
165996
+ init_esm();
165997
+
165995
165998
  // src/utils/converters/fan-mode.ts
165996
165999
  var FanMode = class _FanMode {
165997
166000
  constructor(mode, sequence) {
@@ -166347,6 +166350,7 @@ function setOptimisticOnOff(entityId, expectedOnOff) {
166347
166350
  }
166348
166351
 
166349
166352
  // src/matter/behaviors/fan-control-server.ts
166353
+ var logger161 = Logger.get("FanControlServer");
166350
166354
  var defaultStepSize = 33.33;
166351
166355
  var minSpeedMax = 3;
166352
166356
  var maxSpeedMax = 100;
@@ -166365,6 +166369,9 @@ var FeaturedBase4 = FanControlServer.with(
166365
166369
  windSupport: { naturalWind: true, sleepWind: true }
166366
166370
  });
166367
166371
  var FanControlServerBase = class extends FeaturedBase4 {
166372
+ // Track last non-zero fan speed for restore on turn-on (#225)
166373
+ lastNonZeroPercent = 0;
166374
+ lastNonZeroSpeed = 0;
166368
166375
  async initialize() {
166369
166376
  if (this.features.multiSpeed) {
166370
166377
  if (this.state.speedMax == null || this.state.speedMax < minSpeedMax) {
@@ -166372,6 +166379,16 @@ var FanControlServerBase = class extends FeaturedBase4 {
166372
166379
  }
166373
166380
  }
166374
166381
  await super.initialize();
166382
+ const ps = this.state.percentSetting;
166383
+ if (ps != null && ps > 0) {
166384
+ this.lastNonZeroPercent = ps;
166385
+ }
166386
+ if (this.features.multiSpeed) {
166387
+ const ss = this.state.speedSetting;
166388
+ if (ss != null && ss > 0) {
166389
+ this.lastNonZeroSpeed = ss;
166390
+ }
166391
+ }
166375
166392
  const homeAssistant = await this.agent.load(HomeAssistantEntityBehavior);
166376
166393
  this.update(homeAssistant.entity);
166377
166394
  this.reactTo(homeAssistant.onChange, this.update);
@@ -166404,6 +166421,12 @@ var FanControlServerBase = class extends FeaturedBase4 {
166404
166421
  this.targetWindSettingChanged
166405
166422
  );
166406
166423
  }
166424
+ if (this.agent.has(OnOffBehavior)) {
166425
+ this.reactTo(
166426
+ this.agent.get(OnOffBehavior).events.onOff$Changed,
166427
+ this.onOffChanged
166428
+ );
166429
+ }
166407
166430
  }
166408
166431
  update(entity) {
166409
166432
  if (!entity.state) {
@@ -166456,16 +166479,20 @@ var FanControlServerBase = class extends FeaturedBase4 {
166456
166479
  }
166457
166480
  const fanModeSequence = this.getFanModeSequence();
166458
166481
  const fanMode = config10.isInAutoMode(entity.state, this.agent) ? FanMode.create(FanControl3.FanMode.Auto, fanModeSequence) : FanMode.fromSpeedPercent(percentage, fanModeSequence);
166482
+ if (percentage > 0) {
166483
+ this.lastNonZeroPercent = percentage;
166484
+ this.lastNonZeroSpeed = speed;
166485
+ }
166459
166486
  const isOff = percentage === 0;
166460
166487
  try {
166461
166488
  applyPatchState(this.state, {
166462
- ...isOff ? {} : { percentSetting: percentage },
166489
+ percentSetting: isOff ? 0 : percentage,
166463
166490
  percentCurrent: percentage,
166464
166491
  fanMode: fanMode.mode,
166465
166492
  fanModeSequence,
166466
166493
  ...this.features.multiSpeed ? {
166467
166494
  speedMax,
166468
- ...isOff ? {} : { speedSetting: speed },
166495
+ speedSetting: isOff ? 0 : speed,
166469
166496
  speedCurrent: speed
166470
166497
  } : {},
166471
166498
  ...this.features.airflowDirection ? {
@@ -166653,6 +166680,23 @@ var FanControlServerBase = class extends FeaturedBase4 {
166653
166680
  homeAssistant.callAction(this.state.config.setWindMode(mode, this.agent));
166654
166681
  });
166655
166682
  }
166683
+ // Cross-cluster: restore fan speed on controller-initiated turn-on.
166684
+ // When a controller sends OnOff.on() and percentSetting is 0, Apple Home
166685
+ // may default to 100%. Restoring the last non-zero value avoids this (#225).
166686
+ onOffChanged(onOff, _oldValue, context) {
166687
+ if (transactionIsOffline(context)) {
166688
+ return;
166689
+ }
166690
+ if (onOff && this.lastNonZeroPercent > 0) {
166691
+ try {
166692
+ applyPatchState(this.state, {
166693
+ percentSetting: this.lastNonZeroPercent,
166694
+ ...this.features.multiSpeed && this.lastNonZeroSpeed > 0 ? { speedSetting: this.lastNonZeroSpeed } : {}
166695
+ });
166696
+ } catch {
166697
+ }
166698
+ }
166699
+ }
166656
166700
  // Cross-cluster sync: keep OnOff in sync with FanControl per Matter spec
166657
166701
  // §4.4.6.6.1. matter.js does not implement this automatically.
166658
166702
  syncOnOff(on) {
@@ -166662,7 +166706,10 @@ var FanControlServerBase = class extends FeaturedBase4 {
166662
166706
  applyPatchState(onOffState, { onOff: on });
166663
166707
  const entityId = this.agent.get(HomeAssistantEntityBehavior).entity.entity_id;
166664
166708
  setOptimisticOnOff(entityId, on);
166665
- } catch {
166709
+ } catch (e) {
166710
+ logger161.debug(
166711
+ `syncOnOff(${on}) failed: ${e instanceof Error ? e.message : String(e)}`
166712
+ );
166666
166713
  }
166667
166714
  }
166668
166715
  mapWindModeToSetting(mode) {
@@ -166748,7 +166795,7 @@ var FanOnOffServer = OnOffServer2({
166748
166795
  });
166749
166796
 
166750
166797
  // src/matter/endpoints/composed/composed-air-purifier-endpoint.ts
166751
- var logger161 = Logger.get("ComposedAirPurifierEndpoint");
166798
+ var logger162 = Logger.get("ComposedAirPurifierEndpoint");
166752
166799
  function createTemperatureConfig(temperatureEntityId) {
166753
166800
  return {
166754
166801
  getValue(_entity, agent) {
@@ -166906,7 +166953,7 @@ var ComposedAirPurifierEndpoint = class _ComposedAirPurifierEndpoint extends End
166906
166953
  config10.humidityEntityId ? "+Hum" : "",
166907
166954
  config10.batteryEntityId ? "+Bat" : ""
166908
166955
  ].filter(Boolean).join("");
166909
- logger161.info(`Created air purifier ${primaryEntityId}: ${clusterLabels}`);
166956
+ logger162.info(`Created air purifier ${primaryEntityId}: ${clusterLabels}`);
166910
166957
  return endpoint;
166911
166958
  }
166912
166959
  constructor(type, entityId, id, trackedEntityIds, mappedEntityIds) {
@@ -167002,7 +167049,7 @@ init_home_assistant_entity_behavior();
167002
167049
  // src/matter/behaviors/pressure-measurement-server.ts
167003
167050
  init_esm();
167004
167051
  init_home_assistant_entity_behavior();
167005
- var logger162 = Logger.get("PressureMeasurementServer");
167052
+ var logger163 = Logger.get("PressureMeasurementServer");
167006
167053
  var MIN_PRESSURE = 300;
167007
167054
  var MAX_PRESSURE = 1100;
167008
167055
  var PressureMeasurementServerBase = class extends PressureMeasurementServer {
@@ -167030,7 +167077,7 @@ var PressureMeasurementServerBase = class extends PressureMeasurementServer {
167030
167077
  }
167031
167078
  const rounded = Math.round(value);
167032
167079
  if (rounded < MIN_PRESSURE || rounded > MAX_PRESSURE) {
167033
- logger162.warn(
167080
+ logger163.warn(
167034
167081
  `Pressure value ${rounded} (raw: ${value}) for ${entity.entity_id} is outside valid range [${MIN_PRESSURE}-${MAX_PRESSURE}], ignoring`
167035
167082
  );
167036
167083
  return null;
@@ -167049,7 +167096,7 @@ function PressureMeasurementServer2(config10) {
167049
167096
  }
167050
167097
 
167051
167098
  // src/matter/endpoints/composed/composed-sensor-endpoint.ts
167052
- var logger163 = Logger.get("ComposedSensorEndpoint");
167099
+ var logger164 = Logger.get("ComposedSensorEndpoint");
167053
167100
  var temperatureConfig = {
167054
167101
  getValue(entity, agent) {
167055
167102
  const fallbackUnit = agent.env.get(HomeAssistantConfig).unitSystem.temperature;
@@ -167213,7 +167260,7 @@ var ComposedSensorEndpoint = class _ComposedSensorEndpoint extends Endpoint {
167213
167260
  if (config10.pressureEntityId && pressSub) {
167214
167261
  endpoint.subEndpoints.set(config10.pressureEntityId, pressSub);
167215
167262
  }
167216
- logger163.info(
167263
+ logger164.info(
167217
167264
  `Created composed sensor ${primaryEntityId} with ${parts.length} sub-endpoint(s): T${humSub ? "+H" : ""}${pressSub ? "+P" : ""}${config10.batteryEntityId ? "+Bat" : ""}`
167218
167265
  );
167219
167266
  return endpoint;
@@ -167340,7 +167387,7 @@ init_home_assistant_entity_behavior();
167340
167387
  // src/matter/behaviors/mode-select-server.ts
167341
167388
  init_esm();
167342
167389
  init_home_assistant_entity_behavior();
167343
- var logger164 = Logger.get("ModeSelectServer");
167390
+ var logger165 = Logger.get("ModeSelectServer");
167344
167391
  var ModeSelectServerBase = class extends ModeSelectServer {
167345
167392
  async initialize() {
167346
167393
  await super.initialize();
@@ -167369,13 +167416,13 @@ var ModeSelectServerBase = class extends ModeSelectServer {
167369
167416
  const options = config10.getOptions(homeAssistant.entity);
167370
167417
  const { newMode } = request;
167371
167418
  if (newMode < 0 || newMode >= options.length) {
167372
- logger164.warn(
167419
+ logger165.warn(
167373
167420
  `[${homeAssistant.entityId}] Invalid mode ${newMode}, options: [${options.join(", ")}]`
167374
167421
  );
167375
167422
  return;
167376
167423
  }
167377
167424
  const option = options[newMode];
167378
- logger164.info(
167425
+ logger165.info(
167379
167426
  `[${homeAssistant.entityId}] changeToMode(${newMode}) -> "${option}"`
167380
167427
  );
167381
167428
  applyPatchState(this.state, { currentMode: newMode });
@@ -167820,7 +167867,7 @@ var WaterLeakDetectorType = WaterLeakDetectorDevice.with(
167820
167867
  );
167821
167868
 
167822
167869
  // src/matter/endpoints/legacy/binary-sensor/index.ts
167823
- var logger165 = Logger.get("BinarySensorDevice");
167870
+ var logger166 = Logger.get("BinarySensorDevice");
167824
167871
  var deviceClasses = {
167825
167872
  [BinarySensorDeviceClass.CarbonMonoxide]: CoAlarmType,
167826
167873
  [BinarySensorDeviceClass.Gas]: CoAlarmType,
@@ -167870,11 +167917,11 @@ function BinarySensorDevice(homeAssistantEntity) {
167870
167917
  const originalTypeName = type.name;
167871
167918
  if (hasBattery && batteryTypes.has(type)) {
167872
167919
  type = batteryTypes.get(type);
167873
- logger165.info(
167920
+ logger166.info(
167874
167921
  `[${entityId}] Using battery variant: ${originalTypeName} -> ${type.name}, batteryAttr=${hasBatteryAttr}, batteryEntity=${homeAssistantEntity.mapping?.batteryEntity ?? "none"}`
167875
167922
  );
167876
167923
  } else if (hasBattery) {
167877
- logger165.warn(
167924
+ logger166.warn(
167878
167925
  `[${entityId}] Has battery but no variant available for ${originalTypeName}`
167879
167926
  );
167880
167927
  }
@@ -168030,7 +168077,7 @@ init_home_assistant_entity_behavior();
168030
168077
  // src/matter/behaviors/thermostat-server.ts
168031
168078
  init_esm();
168032
168079
  init_home_assistant_entity_behavior();
168033
- var logger166 = Logger.get("ThermostatServer");
168080
+ var logger167 = Logger.get("ThermostatServer");
168034
168081
  var SystemMode = Thermostat3.SystemMode;
168035
168082
  var RunningMode = Thermostat3.ThermostatRunningMode;
168036
168083
  var nudgingSetpoints = /* @__PURE__ */ new Set();
@@ -168088,7 +168135,7 @@ var HeatingAndCoolingFeaturedBase = ThermostatServer.with("Heating", "Cooling").
168088
168135
  );
168089
168136
  function thermostatPreInitialize(self) {
168090
168137
  const currentLocal = self.state.localTemperature;
168091
- logger166.debug(
168138
+ logger167.debug(
168092
168139
  `initialize: features - heating=${self.features.heating}, cooling=${self.features.cooling}`
168093
168140
  );
168094
168141
  const localValue = typeof currentLocal === "number" && !Number.isNaN(currentLocal) ? currentLocal : currentLocal === null ? null : 2100;
@@ -168111,7 +168158,7 @@ function thermostatPreInitialize(self) {
168111
168158
  const coolingValue = typeof currentCooling === "number" && !Number.isNaN(currentCooling) ? currentCooling : 2400;
168112
168159
  self.state.occupiedCoolingSetpoint = coolingValue;
168113
168160
  }
168114
- logger166.debug(
168161
+ logger167.debug(
168115
168162
  `initialize: after force-set - local=${self.state.localTemperature}`
168116
168163
  );
168117
168164
  self.state.thermostatRunningState = runningStateAllOff;
@@ -168193,7 +168240,7 @@ var ThermostatServerBase = class extends FullFeaturedBase {
168193
168240
  maxCoolLimit,
168194
168241
  "cool"
168195
168242
  );
168196
- logger166.debug(
168243
+ logger167.debug(
168197
168244
  `update: limits heat=[${minHeatLimit}, ${maxHeatLimit}], cool=[${minCoolLimit}, ${maxCoolLimit}], systemMode=${systemMode}, runningMode=${runningMode}`
168198
168245
  );
168199
168246
  const controlSequence = config10.getControlSequence(entity.state, this.agent);
@@ -168265,18 +168312,18 @@ var ThermostatServerBase = class extends FullFeaturedBase {
168265
168312
  */
168266
168313
  // biome-ignore lint/correctness/noUnusedPrivateClassMembers: Called via thermostatPostInitialize + prototype copy
168267
168314
  heatingSetpointChanging(value, _oldValue, context) {
168268
- logger166.debug(
168315
+ logger167.debug(
168269
168316
  `heatingSetpointChanging: value=${value}, oldValue=${_oldValue}, isOffline=${transactionIsOffline(context)}`
168270
168317
  );
168271
168318
  if (transactionIsOffline(context)) {
168272
- logger166.debug(
168319
+ logger167.debug(
168273
168320
  "heatingSetpointChanging: skipping - transaction is offline"
168274
168321
  );
168275
168322
  return;
168276
168323
  }
168277
168324
  const next = Temperature.celsius(value / 100);
168278
168325
  if (!next) {
168279
- logger166.debug("heatingSetpointChanging: skipping - invalid temperature");
168326
+ logger167.debug("heatingSetpointChanging: skipping - invalid temperature");
168280
168327
  return;
168281
168328
  }
168282
168329
  this.agent.asLocalActor(() => {
@@ -168287,7 +168334,7 @@ var ThermostatServerBase = class extends FullFeaturedBase {
168287
168334
  this.agent
168288
168335
  );
168289
168336
  const currentMode = this.state.systemMode;
168290
- logger166.debug(
168337
+ logger167.debug(
168291
168338
  `heatingSetpointChanging: supportsRange=${supportsRange}, systemMode=${currentMode}, features.heating=${this.features.heating}, features.cooling=${this.features.cooling}`
168292
168339
  );
168293
168340
  if (!supportsRange) {
@@ -168297,12 +168344,12 @@ var ThermostatServerBase = class extends FullFeaturedBase {
168297
168344
  const isOff = currentMode === Thermostat3.SystemMode.Off;
168298
168345
  if (isOff && this.features.heating) {
168299
168346
  if (nudgingSetpoints.has(homeAssistant.entityId)) {
168300
- logger166.debug(
168347
+ logger167.debug(
168301
168348
  `heatingSetpointChanging: skipping auto-resume - nudge write in progress`
168302
168349
  );
168303
168350
  return;
168304
168351
  }
168305
- logger166.info(
168352
+ logger167.info(
168306
168353
  `heatingSetpointChanging: auto-resume - switching to Heat (was Off)`
168307
168354
  );
168308
168355
  const modeAction = config10.setSystemMode(
@@ -168311,17 +168358,17 @@ var ThermostatServerBase = class extends FullFeaturedBase {
168311
168358
  );
168312
168359
  homeAssistant.callAction(modeAction);
168313
168360
  } else if (!isAutoMode && !isHeatingMode) {
168314
- logger166.debug(
168361
+ logger167.debug(
168315
168362
  `heatingSetpointChanging: skipping - not in heating/auto mode (mode=${currentMode}, haMode=${haHvacMode})`
168316
168363
  );
168317
168364
  return;
168318
168365
  }
168319
- logger166.debug(
168366
+ logger167.debug(
168320
168367
  `heatingSetpointChanging: proceeding - isAutoMode=${isAutoMode}, isHeatingMode=${isHeatingMode}, isOff=${isOff}, haMode=${haHvacMode}`
168321
168368
  );
168322
168369
  }
168323
168370
  const coolingSetpoint = this.features.cooling ? this.state.occupiedCoolingSetpoint : value;
168324
- logger166.debug(
168371
+ logger167.debug(
168325
168372
  `heatingSetpointChanging: calling setTemperature with heat=${next.celsius(true)}, cool=${coolingSetpoint}`
168326
168373
  );
168327
168374
  this.setTemperature(
@@ -168360,12 +168407,12 @@ var ThermostatServerBase = class extends FullFeaturedBase {
168360
168407
  const isOff = currentMode === Thermostat3.SystemMode.Off;
168361
168408
  if (isOff && !this.features.heating && this.features.cooling) {
168362
168409
  if (nudgingSetpoints.has(homeAssistant.entityId)) {
168363
- logger166.debug(
168410
+ logger167.debug(
168364
168411
  `coolingSetpointChanging: skipping auto-resume - nudge write in progress`
168365
168412
  );
168366
168413
  return;
168367
168414
  }
168368
- logger166.info(
168415
+ logger167.info(
168369
168416
  `coolingSetpointChanging: auto-resume - switching to Cool (was Off)`
168370
168417
  );
168371
168418
  const modeAction = config10.setSystemMode(
@@ -168374,12 +168421,12 @@ var ThermostatServerBase = class extends FullFeaturedBase {
168374
168421
  );
168375
168422
  homeAssistant.callAction(modeAction);
168376
168423
  } else if (!isAutoMode && !isCoolingMode) {
168377
- logger166.debug(
168424
+ logger167.debug(
168378
168425
  `coolingSetpointChanging: skipping - not in cooling/auto mode (mode=${currentMode}, haMode=${haHvacMode})`
168379
168426
  );
168380
168427
  return;
168381
168428
  }
168382
- logger166.debug(
168429
+ logger167.debug(
168383
168430
  `coolingSetpointChanging: proceeding - isAutoMode=${isAutoMode}, isCoolingMode=${isCoolingMode}, isOff=${isOff}, haMode=${haHvacMode}`
168384
168431
  );
168385
168432
  }
@@ -168456,7 +168503,7 @@ var ThermostatServerBase = class extends FullFeaturedBase {
168456
168503
  const effectiveMax = max ?? 5e3;
168457
168504
  if (value == null || Number.isNaN(value)) {
168458
168505
  const defaultValue = type === "heat" ? 2e3 : 2400;
168459
- logger166.debug(
168506
+ logger167.debug(
168460
168507
  `${type} setpoint is undefined, using default: ${defaultValue}`
168461
168508
  );
168462
168509
  return Math.max(effectiveMin, Math.min(effectiveMax, defaultValue));
@@ -168920,7 +168967,7 @@ init_home_assistant_entity_behavior();
168920
168967
  init_esm();
168921
168968
  init_home_assistant_actions();
168922
168969
  init_home_assistant_entity_behavior();
168923
- var logger167 = Logger.get("WindowCoveringServer");
168970
+ var logger168 = Logger.get("WindowCoveringServer");
168924
168971
  var MovementStatus = WindowCovering3.MovementStatus;
168925
168972
  var FeaturedBase5 = WindowCoveringServer.with(
168926
168973
  "Lift",
@@ -169004,7 +169051,7 @@ var WindowCoveringServerBase = class _WindowCoveringServerBase extends FeaturedB
169004
169051
  );
169005
169052
  const currentTilt100ths = currentTilt != null ? currentTilt * 100 : null;
169006
169053
  const isStopped = movementStatus === MovementStatus.Stopped;
169007
- logger167.debug(
169054
+ logger168.debug(
169008
169055
  `Cover update for ${entity.entity_id}: state=${state.state}, lift=${currentLift}%, tilt=${currentTilt}%, movement=${MovementStatus[movementStatus]}`
169009
169056
  );
169010
169057
  const appliedPatch = applyPatchState(
@@ -169043,9 +169090,9 @@ var WindowCoveringServerBase = class _WindowCoveringServerBase extends FeaturedB
169043
169090
  );
169044
169091
  if (Object.keys(appliedPatch).length > 0) {
169045
169092
  const hasOperationalChange = "operationalStatus" in appliedPatch;
169046
- const log = hasOperationalChange ? logger167.info : logger167.debug;
169093
+ const log = hasOperationalChange ? logger168.info : logger168.debug;
169047
169094
  log.call(
169048
- logger167,
169095
+ logger168,
169049
169096
  `Cover ${entity.entity_id} state changed: ${JSON.stringify(appliedPatch)}`
169050
169097
  );
169051
169098
  }
@@ -169053,7 +169100,7 @@ var WindowCoveringServerBase = class _WindowCoveringServerBase extends FeaturedB
169053
169100
  async handleMovement(type, _, direction, targetPercent100ths) {
169054
169101
  const currentLift = this.state.currentPositionLiftPercent100ths ?? 0;
169055
169102
  const currentTilt = this.state.currentPositionTiltPercent100ths ?? 0;
169056
- logger167.info(
169103
+ logger168.info(
169057
169104
  `handleMovement: type=${MovementType[type]}, direction=${MovementDirection[direction]}, target=${targetPercent100ths}, currentLift=${currentLift}, currentTilt=${currentTilt}, absolutePosition=${this.features.absolutePosition}`
169058
169105
  );
169059
169106
  if (type === MovementType.Lift) {
@@ -169089,13 +169136,13 @@ var WindowCoveringServerBase = class _WindowCoveringServerBase extends FeaturedB
169089
169136
  handleLiftOpen() {
169090
169137
  const homeAssistant = this.agent.get(HomeAssistantEntityBehavior);
169091
169138
  const action = this.state.config.openCoverLift(void 0, this.agent);
169092
- logger167.info(`handleLiftOpen: calling action=${action.action}`);
169139
+ logger168.info(`handleLiftOpen: calling action=${action.action}`);
169093
169140
  homeAssistant.callAction(action);
169094
169141
  }
169095
169142
  handleLiftClose() {
169096
169143
  const homeAssistant = this.agent.get(HomeAssistantEntityBehavior);
169097
169144
  const action = this.state.config.closeCoverLift(void 0, this.agent);
169098
- logger167.info(`handleLiftClose: calling action=${action.action}`);
169145
+ logger168.info(`handleLiftClose: calling action=${action.action}`);
169099
169146
  homeAssistant.callAction(action);
169100
169147
  }
169101
169148
  handleGoToLiftPosition(targetPercent100ths) {
@@ -169116,7 +169163,7 @@ var WindowCoveringServerBase = class _WindowCoveringServerBase extends FeaturedB
169116
169163
  this.lastLiftCommandTime = now;
169117
169164
  const isFirstInSequence = timeSinceLastCommand > _WindowCoveringServerBase.COMMAND_SEQUENCE_THRESHOLD_MS;
169118
169165
  const debounceMs = isFirstInSequence ? _WindowCoveringServerBase.DEBOUNCE_INITIAL_MS : _WindowCoveringServerBase.DEBOUNCE_SUBSEQUENT_MS;
169119
- logger167.debug(
169166
+ logger168.debug(
169120
169167
  `Lift command: target=${targetPosition}%, debounce=${debounceMs}ms (${isFirstInSequence ? "initial" : "subsequent"})`
169121
169168
  );
169122
169169
  if (this.liftDebounceTimer) {
@@ -169165,7 +169212,7 @@ var WindowCoveringServerBase = class _WindowCoveringServerBase extends FeaturedB
169165
169212
  this.lastTiltCommandTime = now;
169166
169213
  const isFirstInSequence = timeSinceLastCommand > _WindowCoveringServerBase.COMMAND_SEQUENCE_THRESHOLD_MS;
169167
169214
  const debounceMs = isFirstInSequence ? _WindowCoveringServerBase.DEBOUNCE_INITIAL_MS : _WindowCoveringServerBase.DEBOUNCE_SUBSEQUENT_MS;
169168
- logger167.debug(
169215
+ logger168.debug(
169169
169216
  `Tilt command: target=${targetPosition}%, debounce=${debounceMs}ms (${isFirstInSequence ? "initial" : "subsequent"})`
169170
169217
  );
169171
169218
  if (this.tiltDebounceTimer) {
@@ -169224,7 +169271,7 @@ function adjustPositionForWriting(position, flags2, matterSemantics) {
169224
169271
  }
169225
169272
 
169226
169273
  // src/matter/endpoints/legacy/cover/behaviors/cover-window-covering-server.ts
169227
- var logger168 = Logger.get("CoverWindowCoveringServer");
169274
+ var logger169 = Logger.get("CoverWindowCoveringServer");
169228
169275
  var attributes5 = (entity) => entity.attributes;
169229
169276
  var MATTER_SEMANTIC_PLATFORMS = [
169230
169277
  // Currently empty - no known platforms use Matter semantics by default
@@ -169242,7 +169289,7 @@ var adjustPositionForReading2 = (position, agent) => {
169242
169289
  const { featureFlags } = agent.env.get(BridgeDataProvider);
169243
169290
  const matterSem = usesMatterSemantics(agent);
169244
169291
  const result = adjustPositionForReading(position, featureFlags, matterSem);
169245
- logger168.debug(`adjustPositionForReading: HA=${position}%, result=${result}%`);
169292
+ logger169.debug(`adjustPositionForReading: HA=${position}%, result=${result}%`);
169246
169293
  return result;
169247
169294
  };
169248
169295
  var adjustPositionForWriting2 = (position, agent) => {
@@ -169346,7 +169393,7 @@ var config5 = {
169346
169393
  var CoverWindowCoveringServer = WindowCoveringServer2(config5);
169347
169394
 
169348
169395
  // src/matter/endpoints/legacy/cover/index.ts
169349
- var logger169 = Logger.get("CoverDevice");
169396
+ var logger170 = Logger.get("CoverDevice");
169350
169397
  var CoverPowerSourceServer = PowerSourceServer2({
169351
169398
  getBatteryPercent: (entity, agent) => {
169352
169399
  const homeAssistant = agent.get(HomeAssistantEntityBehavior);
@@ -169373,7 +169420,7 @@ var CoverDeviceType = (supportedFeatures, hasBattery, entityId) => {
169373
169420
  features2.add("PositionAwareLift");
169374
169421
  features2.add("AbsolutePosition");
169375
169422
  } else {
169376
- logger169.warn(
169423
+ logger170.warn(
169377
169424
  `[${entityId}] Cover has no support_open feature (supported_features=${supportedFeatures}), adding Lift anyway`
169378
169425
  );
169379
169426
  features2.add("Lift");
@@ -169390,7 +169437,7 @@ var CoverDeviceType = (supportedFeatures, hasBattery, entityId) => {
169390
169437
  features2.add("AbsolutePosition");
169391
169438
  }
169392
169439
  }
169393
- logger169.info(
169440
+ logger170.info(
169394
169441
  `[${entityId}] Creating WindowCovering with features: [${[...features2].join(", ")}], supported_features=${supportedFeatures}`
169395
169442
  );
169396
169443
  const baseBehaviors = [
@@ -169411,11 +169458,11 @@ function CoverDevice(homeAssistantEntity) {
169411
169458
  const hasBatteryEntity = !!homeAssistantEntity.mapping?.batteryEntity;
169412
169459
  const hasBattery = hasBatteryAttr || hasBatteryEntity;
169413
169460
  if (hasBattery) {
169414
- logger169.info(
169461
+ logger170.info(
169415
169462
  `[${entityId}] Creating cover with PowerSource cluster, batteryAttr=${hasBatteryAttr}, batteryEntity=${homeAssistantEntity.mapping?.batteryEntity ?? "none"}`
169416
169463
  );
169417
169464
  } else {
169418
- logger169.debug(
169465
+ logger170.debug(
169419
169466
  `[${entityId}] Creating cover without battery (batteryAttr=${hasBatteryAttr}, batteryEntity=${homeAssistantEntity.mapping?.batteryEntity ?? "none"})`
169420
169467
  );
169421
169468
  }
@@ -169431,7 +169478,7 @@ function CoverDevice(homeAssistantEntity) {
169431
169478
  // src/matter/behaviors/generic-switch-server.ts
169432
169479
  init_esm();
169433
169480
  init_home_assistant_entity_behavior();
169434
- var logger170 = Logger.get("GenericSwitchServer");
169481
+ var logger171 = Logger.get("GenericSwitchServer");
169435
169482
  var FeaturedBase6 = SwitchServer.with(
169436
169483
  "MomentarySwitch",
169437
169484
  "MomentarySwitchRelease",
@@ -169442,7 +169489,7 @@ var GenericSwitchServerBase = class extends FeaturedBase6 {
169442
169489
  await super.initialize();
169443
169490
  const homeAssistant = await this.agent.load(HomeAssistantEntityBehavior);
169444
169491
  const entityId = homeAssistant.entityId;
169445
- logger170.debug(`[${entityId}] GenericSwitch initialized`);
169492
+ logger171.debug(`[${entityId}] GenericSwitch initialized`);
169446
169493
  this.reactTo(homeAssistant.onChange, this.handleEventChange);
169447
169494
  }
169448
169495
  handleEventChange() {
@@ -169453,7 +169500,7 @@ var GenericSwitchServerBase = class extends FeaturedBase6 {
169453
169500
  const eventType = attrs.event_type;
169454
169501
  if (!eventType) return;
169455
169502
  const entityId = homeAssistant.entityId;
169456
- logger170.debug(`[${entityId}] Event fired: ${eventType}`);
169503
+ logger171.debug(`[${entityId}] Event fired: ${eventType}`);
169457
169504
  this.triggerPress(eventType);
169458
169505
  }
169459
169506
  triggerPress(eventType) {
@@ -169767,7 +169814,7 @@ init_nodejs();
169767
169814
 
169768
169815
  // src/matter/behaviors/color-control-server.ts
169769
169816
  init_home_assistant_entity_behavior();
169770
- var logger171 = Logger.get("ColorControlServer");
169817
+ var logger172 = Logger.get("ColorControlServer");
169771
169818
  var optimisticColorState = /* @__PURE__ */ new Map();
169772
169819
  var OPTIMISTIC_TIMEOUT_MS3 = 3e3;
169773
169820
  var OPTIMISTIC_TOLERANCE2 = 5;
@@ -169800,7 +169847,7 @@ var ColorControlServerBase = class extends FeaturedBase7 {
169800
169847
  if (this.state.startUpColorTemperatureMireds == null) {
169801
169848
  this.state.startUpColorTemperatureMireds = defaultMireds;
169802
169849
  }
169803
- logger171.debug(
169850
+ logger172.debug(
169804
169851
  `initialize: set ColorTemperature defaults - min=${this.state.colorTempPhysicalMinMireds}, max=${this.state.colorTempPhysicalMaxMireds}, current=${this.state.colorTemperatureMireds}`
169805
169852
  );
169806
169853
  }
@@ -170240,7 +170287,7 @@ init_dist();
170240
170287
  // src/matter/behaviors/electrical-energy-measurement-server.ts
170241
170288
  init_esm();
170242
170289
  init_home_assistant_entity_behavior();
170243
- var logger172 = Logger.get("ElectricalEnergyMeasurementServer");
170290
+ var logger173 = Logger.get("ElectricalEnergyMeasurementServer");
170244
170291
  var FeaturedBase8 = ElectricalEnergyMeasurementServer.with("CumulativeEnergy", "ImportedEnergy");
170245
170292
  var ElectricalEnergyMeasurementServerBase = class extends FeaturedBase8 {
170246
170293
  async initialize() {
@@ -170249,7 +170296,7 @@ var ElectricalEnergyMeasurementServerBase = class extends FeaturedBase8 {
170249
170296
  const entityId = homeAssistant.entityId;
170250
170297
  const energyEntity = homeAssistant.state.mapping?.energyEntity;
170251
170298
  if (energyEntity) {
170252
- logger172.debug(
170299
+ logger173.debug(
170253
170300
  `[${entityId}] ElectricalEnergyMeasurement using mapped energy entity: ${energyEntity}`
170254
170301
  );
170255
170302
  }
@@ -170301,7 +170348,7 @@ var HaElectricalEnergyMeasurementServer = ElectricalEnergyMeasurementServerBase.
170301
170348
  // src/matter/behaviors/electrical-power-measurement-server.ts
170302
170349
  init_esm();
170303
170350
  init_home_assistant_entity_behavior();
170304
- var logger173 = Logger.get("ElectricalPowerMeasurementServer");
170351
+ var logger174 = Logger.get("ElectricalPowerMeasurementServer");
170305
170352
  var ElectricalPowerMeasurementServerBase = class extends ElectricalPowerMeasurementServer {
170306
170353
  async initialize() {
170307
170354
  await super.initialize();
@@ -170309,7 +170356,7 @@ var ElectricalPowerMeasurementServerBase = class extends ElectricalPowerMeasurem
170309
170356
  const entityId = homeAssistant.entityId;
170310
170357
  const powerEntity = homeAssistant.state.mapping?.powerEntity;
170311
170358
  if (powerEntity) {
170312
- logger173.debug(
170359
+ logger174.debug(
170313
170360
  `[${entityId}] ElectricalPowerMeasurement using mapped power entity: ${powerEntity}`
170314
170361
  );
170315
170362
  }
@@ -170405,7 +170452,7 @@ init_home_assistant_entity_behavior();
170405
170452
  // src/matter/behaviors/lock-server.ts
170406
170453
  init_esm();
170407
170454
  init_home_assistant_entity_behavior();
170408
- var logger174 = Logger.get("LockServer");
170455
+ var logger175 = Logger.get("LockServer");
170409
170456
  function hasStoredCredentialHelper(env, entityId) {
170410
170457
  try {
170411
170458
  const storage2 = env.get(LockCredentialStorage);
@@ -170563,7 +170610,7 @@ var LockServerWithPinBase = class extends PinCredentialBase {
170563
170610
  const homeAssistant = this.agent.get(HomeAssistantEntityBehavior);
170564
170611
  const action = this.state.config.lock(void 0, this.agent);
170565
170612
  const hasPinProvided = !!request.pinCode;
170566
- logger174.debug(
170613
+ logger175.debug(
170567
170614
  `lockDoor called for ${homeAssistant.entityId}, PIN provided: ${hasPinProvided}`
170568
170615
  );
170569
170616
  if (request.pinCode) {
@@ -170576,12 +170623,12 @@ var LockServerWithPinBase = class extends PinCredentialBase {
170576
170623
  const homeAssistant = this.agent.get(HomeAssistantEntityBehavior);
170577
170624
  const action = this.state.config.unlock(void 0, this.agent);
170578
170625
  const hasPinProvided = !!request.pinCode;
170579
- logger174.debug(
170626
+ logger175.debug(
170580
170627
  `unlockDoor called for ${homeAssistant.entityId}, PIN provided: ${hasPinProvided}, requirePin: ${this.state.requirePinForRemoteOperation}`
170581
170628
  );
170582
170629
  if (this.state.requirePinForRemoteOperation) {
170583
170630
  if (!request.pinCode) {
170584
- logger174.info(
170631
+ logger175.info(
170585
170632
  `unlockDoor REJECTED for ${homeAssistant.entityId} - no PIN provided`
170586
170633
  );
170587
170634
  throw new StatusResponseError(
@@ -170591,12 +170638,12 @@ var LockServerWithPinBase = class extends PinCredentialBase {
170591
170638
  }
170592
170639
  const providedPin = new TextDecoder().decode(request.pinCode);
170593
170640
  if (!this.verifyStoredPin(homeAssistant.entityId, providedPin)) {
170594
- logger174.info(
170641
+ logger175.info(
170595
170642
  `unlockDoor REJECTED for ${homeAssistant.entityId} - invalid PIN`
170596
170643
  );
170597
170644
  throw new StatusResponseError("Invalid PIN code", StatusCode.Failure);
170598
170645
  }
170599
- logger174.debug(`unlockDoor PIN verified for ${homeAssistant.entityId}`);
170646
+ logger175.debug(`unlockDoor PIN verified for ${homeAssistant.entityId}`);
170600
170647
  action.data = { ...action.data, code: providedPin };
170601
170648
  }
170602
170649
  homeAssistant.callAction(action);
@@ -170757,7 +170804,7 @@ var LockServerWithPinAndUnboltBase = class extends PinCredentialUnboltBase {
170757
170804
  const homeAssistant = this.agent.get(HomeAssistantEntityBehavior);
170758
170805
  const action = this.state.config.lock(void 0, this.agent);
170759
170806
  const hasPinProvided = !!request.pinCode;
170760
- logger174.debug(
170807
+ logger175.debug(
170761
170808
  `lockDoor called for ${homeAssistant.entityId}, PIN provided: ${hasPinProvided}`
170762
170809
  );
170763
170810
  if (request.pinCode) {
@@ -170771,12 +170818,12 @@ var LockServerWithPinAndUnboltBase = class extends PinCredentialUnboltBase {
170771
170818
  const unlatchConfig = this.state.config.unlatch;
170772
170819
  const action = unlatchConfig ? unlatchConfig(void 0, this.agent) : this.state.config.unlock(void 0, this.agent);
170773
170820
  const hasPinProvided = !!request.pinCode;
170774
- logger174.debug(
170821
+ logger175.debug(
170775
170822
  `unlockDoor called for ${homeAssistant.entityId}, PIN provided: ${hasPinProvided}, requirePin: ${this.state.requirePinForRemoteOperation}, usingUnlatch: ${!!unlatchConfig}`
170776
170823
  );
170777
170824
  if (this.state.requirePinForRemoteOperation) {
170778
170825
  if (!request.pinCode) {
170779
- logger174.info(
170826
+ logger175.info(
170780
170827
  `unlockDoor REJECTED for ${homeAssistant.entityId} - no PIN provided`
170781
170828
  );
170782
170829
  throw new StatusResponseError(
@@ -170786,12 +170833,12 @@ var LockServerWithPinAndUnboltBase = class extends PinCredentialUnboltBase {
170786
170833
  }
170787
170834
  const providedPin = new TextDecoder().decode(request.pinCode);
170788
170835
  if (!verifyStoredPinHelper(this.env, homeAssistant.entityId, providedPin)) {
170789
- logger174.info(
170836
+ logger175.info(
170790
170837
  `unlockDoor REJECTED for ${homeAssistant.entityId} - invalid PIN`
170791
170838
  );
170792
170839
  throw new StatusResponseError("Invalid PIN code", StatusCode.Failure);
170793
170840
  }
170794
- logger174.debug(`unlockDoor PIN verified for ${homeAssistant.entityId}`);
170841
+ logger175.debug(`unlockDoor PIN verified for ${homeAssistant.entityId}`);
170795
170842
  action.data = { ...action.data, code: providedPin };
170796
170843
  }
170797
170844
  homeAssistant.callAction(action);
@@ -170806,12 +170853,12 @@ var LockServerWithPinAndUnboltBase = class extends PinCredentialUnboltBase {
170806
170853
  }
170807
170854
  const action = unlatchConfig(void 0, this.agent);
170808
170855
  const hasPinProvided = !!request.pinCode;
170809
- logger174.debug(
170856
+ logger175.debug(
170810
170857
  `unboltDoor called for ${homeAssistant.entityId}, PIN provided: ${hasPinProvided}, requirePin: ${this.state.requirePinForRemoteOperation}`
170811
170858
  );
170812
170859
  if (this.state.requirePinForRemoteOperation) {
170813
170860
  if (!request.pinCode) {
170814
- logger174.info(
170861
+ logger175.info(
170815
170862
  `unboltDoor REJECTED for ${homeAssistant.entityId} - no PIN provided`
170816
170863
  );
170817
170864
  throw new StatusResponseError(
@@ -170821,12 +170868,12 @@ var LockServerWithPinAndUnboltBase = class extends PinCredentialUnboltBase {
170821
170868
  }
170822
170869
  const providedPin = new TextDecoder().decode(request.pinCode);
170823
170870
  if (!verifyStoredPinHelper(this.env, homeAssistant.entityId, providedPin)) {
170824
- logger174.info(
170871
+ logger175.info(
170825
170872
  `unboltDoor REJECTED for ${homeAssistant.entityId} - invalid PIN`
170826
170873
  );
170827
170874
  throw new StatusResponseError("Invalid PIN code", StatusCode.Failure);
170828
170875
  }
170829
- logger174.debug(`unboltDoor PIN verified for ${homeAssistant.entityId}`);
170876
+ logger175.debug(`unboltDoor PIN verified for ${homeAssistant.entityId}`);
170830
170877
  action.data = { ...action.data, code: providedPin };
170831
170878
  }
170832
170879
  homeAssistant.callAction(action);
@@ -170996,7 +171043,7 @@ init_home_assistant_entity_behavior();
170996
171043
  init_dist();
170997
171044
  init_esm();
170998
171045
  init_home_assistant_entity_behavior();
170999
- var logger175 = Logger.get("MediaPlayerKeypadInputServer");
171046
+ var logger176 = Logger.get("MediaPlayerKeypadInputServer");
171000
171047
  var MediaPlayerKeypadInputServer = class extends KeypadInputServer {
171001
171048
  sendKey(request) {
171002
171049
  const homeAssistant = this.agent.get(HomeAssistantEntityBehavior);
@@ -171007,12 +171054,12 @@ var MediaPlayerKeypadInputServer = class extends KeypadInputServer {
171007
171054
  const features2 = attributes7.supported_features ?? 0;
171008
171055
  const action = this.mapKeyToAction(request.keyCode, features2);
171009
171056
  if (!action) {
171010
- logger175.debug(
171057
+ logger176.debug(
171011
171058
  `Unsupported key code ${request.keyCode} for ${homeAssistant.entityId}`
171012
171059
  );
171013
171060
  return { status: KeypadInput3.Status.UnsupportedKey };
171014
171061
  }
171015
- logger175.debug(
171062
+ logger176.debug(
171016
171063
  `sendKey(${request.keyCode}) \u2192 ${action} for ${homeAssistant.entityId}`
171017
171064
  );
171018
171065
  homeAssistant.callAction({ action });
@@ -171291,7 +171338,7 @@ init_home_assistant_entity_behavior();
171291
171338
  // src/matter/behaviors/speaker-level-control-server.ts
171292
171339
  init_esm();
171293
171340
  init_home_assistant_entity_behavior();
171294
- var logger176 = Logger.get("SpeakerLevelControlServer");
171341
+ var logger177 = Logger.get("SpeakerLevelControlServer");
171295
171342
  var optimisticLevelState2 = /* @__PURE__ */ new Map();
171296
171343
  var OPTIMISTIC_TIMEOUT_MS4 = 3e3;
171297
171344
  var OPTIMISTIC_TOLERANCE3 = 5;
@@ -171327,7 +171374,7 @@ var SpeakerLevelControlServerBase = class extends FeaturedBase9 {
171327
171374
  currentLevel = Math.min(Math.max(minLevel, currentLevel), maxLevel);
171328
171375
  }
171329
171376
  const entityId = this.agent.get(HomeAssistantEntityBehavior).entity.entity_id;
171330
- logger176.debug(
171377
+ logger177.debug(
171331
171378
  `[${entityId}] Volume update: HA=${currentLevelPercent != null ? Math.round(currentLevelPercent * 100) : "null"}% -> currentLevel=${currentLevel}`
171332
171379
  );
171333
171380
  const optimistic = optimisticLevelState2.get(entity.entity_id);
@@ -171375,7 +171422,7 @@ var SpeakerLevelControlServerBase = class extends FeaturedBase9 {
171375
171422
  const config10 = this.state.config;
171376
171423
  const entityId = homeAssistant.entity.entity_id;
171377
171424
  const levelPercent = level / 254;
171378
- logger176.debug(
171425
+ logger177.debug(
171379
171426
  `[${entityId}] Volume command: level=${level} -> HA volume_level=${levelPercent}`
171380
171427
  );
171381
171428
  const current = config10.getValuePercent(
@@ -172701,7 +172748,7 @@ var TvocConcentrationMeasurementServer = class extends TvocConcentrationMeasurem
172701
172748
  };
172702
172749
 
172703
172750
  // src/matter/endpoints/legacy/sensor/devices/tvoc-sensor.ts
172704
- var logger177 = Logger.get("TvocSensor");
172751
+ var logger178 = Logger.get("TvocSensor");
172705
172752
  function airQualityFromUgm3(value) {
172706
172753
  if (value <= 300) return AirQuality3.AirQualityEnum.Good;
172707
172754
  if (value <= 1e3) return AirQuality3.AirQualityEnum.Fair;
@@ -172739,17 +172786,17 @@ var TvocAirQualityServer = class extends TvocAirQualityServerBase {
172739
172786
  const attributes7 = entity.state.attributes;
172740
172787
  const deviceClass = attributes7.device_class;
172741
172788
  let airQuality = AirQuality3.AirQualityEnum.Unknown;
172742
- logger177.debug(
172789
+ logger178.debug(
172743
172790
  `[${entity.entity_id}] TVOC update: state="${state}", device_class="${deviceClass}"`
172744
172791
  );
172745
172792
  if (state != null && !Number.isNaN(+state)) {
172746
172793
  const value = +state;
172747
172794
  airQuality = deviceClass === SensorDeviceClass.volatile_organic_compounds ? airQualityFromUgm3(value) : airQualityFromPpb(value);
172748
- logger177.debug(
172795
+ logger178.debug(
172749
172796
  `[${entity.entity_id}] TVOC value=${value} (${deviceClass}) -> airQuality=${AirQuality3.AirQualityEnum[airQuality]}`
172750
172797
  );
172751
172798
  } else {
172752
- logger177.warn(
172799
+ logger178.warn(
172753
172800
  `[${entity.entity_id}] TVOC state not a valid number: "${state}"`
172754
172801
  );
172755
172802
  }
@@ -172962,7 +173009,7 @@ init_home_assistant_entity_behavior();
172962
173009
  // src/matter/behaviors/pm25-concentration-measurement-server.ts
172963
173010
  init_esm();
172964
173011
  init_home_assistant_entity_behavior();
172965
- var logger178 = Logger.get("Pm25ConcentrationMeasurementServer");
173012
+ var logger179 = Logger.get("Pm25ConcentrationMeasurementServer");
172966
173013
  var Pm25ConcentrationMeasurementServerBase = Pm25ConcentrationMeasurementServer.with(
172967
173014
  ConcentrationMeasurement3.Feature.NumericMeasurement
172968
173015
  );
@@ -172986,11 +173033,11 @@ var Pm25ConcentrationMeasurementServer2 = class extends Pm25ConcentrationMeasure
172986
173033
  if (this.state.measurementMedium === void 0) {
172987
173034
  this.state.measurementMedium = ConcentrationMeasurement3.MeasurementMedium.Air;
172988
173035
  }
172989
- logger178.debug(
173036
+ logger179.debug(
172990
173037
  "Pm25ConcentrationMeasurementServer: before super.initialize()"
172991
173038
  );
172992
173039
  await super.initialize();
172993
- logger178.debug(
173040
+ logger179.debug(
172994
173041
  "Pm25ConcentrationMeasurementServer: after super.initialize()"
172995
173042
  );
172996
173043
  const homeAssistant = await this.agent.load(HomeAssistantEntityBehavior);
@@ -173013,7 +173060,7 @@ var Pm25ConcentrationMeasurementServer2 = class extends Pm25ConcentrationMeasure
173013
173060
  };
173014
173061
 
173015
173062
  // src/matter/endpoints/legacy/sensor/devices/pm25-sensor.ts
173016
- var logger179 = Logger.get("Pm25AirQualityServer");
173063
+ var logger180 = Logger.get("Pm25AirQualityServer");
173017
173064
  var Pm25AirQualityServerBase = AirQualityServer.with(
173018
173065
  AirQuality3.Feature.Fair,
173019
173066
  AirQuality3.Feature.Moderate,
@@ -173025,9 +173072,9 @@ var Pm25AirQualityServer = class extends Pm25AirQualityServerBase {
173025
173072
  if (this.state.airQuality === void 0) {
173026
173073
  this.state.airQuality = AirQuality3.AirQualityEnum.Unknown;
173027
173074
  }
173028
- logger179.debug("Pm25AirQualityServer: before super.initialize()");
173075
+ logger180.debug("Pm25AirQualityServer: before super.initialize()");
173029
173076
  await super.initialize();
173030
- logger179.debug("Pm25AirQualityServer: after super.initialize()");
173077
+ logger180.debug("Pm25AirQualityServer: after super.initialize()");
173031
173078
  const homeAssistant = await this.agent.load(HomeAssistantEntityBehavior);
173032
173079
  this.update(homeAssistant.entity);
173033
173080
  this.reactTo(homeAssistant.onChange, this.update);
@@ -173382,7 +173429,7 @@ init_home_assistant_entity_behavior();
173382
173429
  init_dist();
173383
173430
  init_esm();
173384
173431
  init_home_assistant_entity_behavior();
173385
- var logger180 = Logger.get("VacuumIdentifyServer");
173432
+ var logger181 = Logger.get("VacuumIdentifyServer");
173386
173433
  var VacuumIdentifyServer = class extends IdentifyServer2 {
173387
173434
  triggerEffect(effect) {
173388
173435
  this.#locate("triggerEffect");
@@ -173399,11 +173446,11 @@ var VacuumIdentifyServer = class extends IdentifyServer2 {
173399
173446
  const features2 = homeAssistant.entity.state.attributes.supported_features ?? 0;
173400
173447
  const hasLocate = testBit(features2, VacuumDeviceFeature.LOCATE);
173401
173448
  if (!hasLocate) {
173402
- logger180.warn(
173449
+ logger181.warn(
173403
173450
  `${source} for ${homeAssistant.entityId} \u2014 LOCATE not in supported_features (${features2}), calling vacuum.locate anyway`
173404
173451
  );
173405
173452
  } else {
173406
- logger180.info(`${source} \u2192 vacuum.locate for ${homeAssistant.entityId}`);
173453
+ logger181.info(`${source} \u2192 vacuum.locate for ${homeAssistant.entityId}`);
173407
173454
  }
173408
173455
  homeAssistant.callAction({ action: "vacuum.locate" });
173409
173456
  }
@@ -173694,11 +173741,11 @@ init_esm();
173694
173741
 
173695
173742
  // src/matter/behaviors/service-area-server.ts
173696
173743
  init_esm();
173697
- var logger181 = Logger.get("ServiceAreaServer");
173744
+ var logger182 = Logger.get("ServiceAreaServer");
173698
173745
  var ServiceAreaServerBase = class extends ServiceAreaBehavior {
173699
173746
  selectAreas(request) {
173700
173747
  const { newAreas } = request;
173701
- logger181.info(
173748
+ logger182.info(
173702
173749
  `ServiceArea selectAreas called with: ${JSON.stringify(newAreas)}`
173703
173750
  );
173704
173751
  const uniqueAreas = [...new Set(newAreas)];
@@ -173707,14 +173754,14 @@ var ServiceAreaServerBase = class extends ServiceAreaBehavior {
173707
173754
  (id) => !supportedAreaIds.includes(id)
173708
173755
  );
173709
173756
  if (invalidAreas.length > 0) {
173710
- logger181.warn(`Invalid area IDs requested: ${invalidAreas.join(", ")}`);
173757
+ logger182.warn(`Invalid area IDs requested: ${invalidAreas.join(", ")}`);
173711
173758
  return {
173712
173759
  status: ServiceArea3.SelectAreasStatus.UnsupportedArea,
173713
173760
  statusText: `Invalid area IDs: ${invalidAreas.join(", ")}`
173714
173761
  };
173715
173762
  }
173716
173763
  this.state.selectedAreas = uniqueAreas;
173717
- logger181.info(
173764
+ logger182.info(
173718
173765
  `ServiceArea: Stored ${uniqueAreas.length} areas for cleaning: ${uniqueAreas.join(", ")}`
173719
173766
  );
173720
173767
  return {
@@ -173735,7 +173782,7 @@ var ServiceAreaServerBase = class extends ServiceAreaBehavior {
173735
173782
  ServiceAreaServerBase2.State = State;
173736
173783
  })(ServiceAreaServerBase || (ServiceAreaServerBase = {}));
173737
173784
  function ServiceAreaServer2(initialState) {
173738
- logger181.info(
173785
+ logger182.info(
173739
173786
  `Creating ServiceAreaServer with ${initialState.supportedAreas.length} areas`
173740
173787
  );
173741
173788
  return ServiceAreaServerBase.set({
@@ -173748,7 +173795,7 @@ var ServiceAreaWithMaps = ServiceAreaBehavior.with(ServiceArea3.Feature.Maps);
173748
173795
  var ServiceAreaServerWithMapsBase = class extends ServiceAreaWithMaps {
173749
173796
  selectAreas(request) {
173750
173797
  const { newAreas } = request;
173751
- logger181.info(
173798
+ logger182.info(
173752
173799
  `ServiceArea selectAreas called with: ${JSON.stringify(newAreas)}`
173753
173800
  );
173754
173801
  const uniqueAreas = [...new Set(newAreas)];
@@ -173757,14 +173804,14 @@ var ServiceAreaServerWithMapsBase = class extends ServiceAreaWithMaps {
173757
173804
  (id) => !supportedAreaIds.includes(id)
173758
173805
  );
173759
173806
  if (invalidAreas.length > 0) {
173760
- logger181.warn(`Invalid area IDs requested: ${invalidAreas.join(", ")}`);
173807
+ logger182.warn(`Invalid area IDs requested: ${invalidAreas.join(", ")}`);
173761
173808
  return {
173762
173809
  status: ServiceArea3.SelectAreasStatus.UnsupportedArea,
173763
173810
  statusText: `Invalid area IDs: ${invalidAreas.join(", ")}`
173764
173811
  };
173765
173812
  }
173766
173813
  this.state.selectedAreas = uniqueAreas;
173767
- logger181.info(
173814
+ logger182.info(
173768
173815
  `ServiceArea: Stored ${uniqueAreas.length} areas for cleaning: ${uniqueAreas.join(", ")}`
173769
173816
  );
173770
173817
  return {
@@ -173785,14 +173832,14 @@ var ServiceAreaServerWithMapsBase = class extends ServiceAreaWithMaps {
173785
173832
  ServiceAreaServerWithMapsBase2.State = State;
173786
173833
  })(ServiceAreaServerWithMapsBase || (ServiceAreaServerWithMapsBase = {}));
173787
173834
  function ServiceAreaServerWithMaps(initialState) {
173788
- logger181.info(
173835
+ logger182.info(
173789
173836
  `Creating ServiceAreaServer with Maps: ${initialState.supportedAreas.length} areas, ${initialState.supportedMaps.length} maps`
173790
173837
  );
173791
173838
  for (const map of initialState.supportedMaps) {
173792
173839
  const areaCount = initialState.supportedAreas.filter(
173793
173840
  (a) => a.mapId === map.mapId
173794
173841
  ).length;
173795
- logger181.info(` Map ${map.mapId}: "${map.name}" (${areaCount} areas)`);
173842
+ logger182.info(` Map ${map.mapId}: "${map.name}" (${areaCount} areas)`);
173796
173843
  }
173797
173844
  return ServiceAreaServerWithMapsBase.set({
173798
173845
  supportedAreas: initialState.supportedAreas,
@@ -173803,7 +173850,7 @@ function ServiceAreaServerWithMaps(initialState) {
173803
173850
  }
173804
173851
 
173805
173852
  // src/matter/endpoints/legacy/vacuum/behaviors/vacuum-service-area-server.ts
173806
- var logger182 = Logger.get("VacuumServiceAreaServer");
173853
+ var logger183 = Logger.get("VacuumServiceAreaServer");
173807
173854
  function toAreaId(roomId) {
173808
173855
  if (typeof roomId === "number") {
173809
173856
  return roomId;
@@ -173882,13 +173929,13 @@ function createVacuumServiceAreaServer(attributes7, roomEntities, includeUnnamed
173882
173929
  let rooms;
173883
173930
  if (roomEntities && roomEntities.length > 0) {
173884
173931
  rooms = buttonEntitiesToRooms(roomEntities, attributes7);
173885
- logger182.info(
173932
+ logger183.info(
173886
173933
  `Using ${rooms.length} button entities as rooms: ${rooms.map((r) => r.name).join(", ")}`
173887
173934
  );
173888
173935
  } else {
173889
173936
  rooms = parseVacuumRooms(attributes7, includeUnnamedRooms);
173890
173937
  if (rooms.length > 0) {
173891
- logger182.info(
173938
+ logger183.info(
173892
173939
  `Using ${rooms.length} rooms from attributes: ${rooms.map((r) => r.name).join(", ")}`
173893
173940
  );
173894
173941
  }
@@ -173942,7 +173989,7 @@ function createCustomServiceAreaServer(customAreas) {
173942
173989
  landmarkInfo: null
173943
173990
  }
173944
173991
  }));
173945
- logger182.info(
173992
+ logger183.info(
173946
173993
  `Using ${customAreas.length} custom service areas: ${customAreas.map((a) => a.name).join(", ")}`
173947
173994
  );
173948
173995
  return ServiceAreaServer2({
@@ -173953,7 +174000,7 @@ function createCustomServiceAreaServer(customAreas) {
173953
174000
  }
173954
174001
 
173955
174002
  // src/matter/endpoints/legacy/vacuum/behaviors/vacuum-rvc-run-mode-server.ts
173956
- var logger183 = Logger.get("VacuumRvcRunModeServer");
174003
+ var logger184 = Logger.get("VacuumRvcRunModeServer");
173957
174004
  function buildSupportedModes2(attributes7, includeUnnamedRooms = false, customAreas) {
173958
174005
  const modes = [
173959
174006
  {
@@ -173999,12 +174046,12 @@ function handleCustomServiceAreas(selectedAreas, customAreas, homeAssistant, ser
173999
174046
  const matched = selectedAreas.map((areaId) => customAreas[areaId - 1]).filter(Boolean);
174000
174047
  serviceArea.state.selectedAreas = [];
174001
174048
  if (matched.length === 0) {
174002
- logger183.warn(
174049
+ logger184.warn(
174003
174050
  `Custom service areas: no match for selected IDs ${selectedAreas.join(", ")}`
174004
174051
  );
174005
174052
  return { action: "vacuum.start" };
174006
174053
  }
174007
- logger183.info(
174054
+ logger184.info(
174008
174055
  `Custom service areas: calling ${matched.length} service(s): ${matched.map((a) => `${a.service} (${a.name})`).join(", ")}`
174009
174056
  );
174010
174057
  for (let i = 1; i < matched.length; i++) {
@@ -174033,7 +174080,7 @@ var vacuumRvcRunModeConfig = {
174033
174080
  VacuumState.mop_cleaning
174034
174081
  ];
174035
174082
  const isCleaning = cleaningStates.includes(state);
174036
- logger183.debug(
174083
+ logger184.debug(
174037
174084
  `Vacuum state: "${state}", isCleaning: ${isCleaning}, currentMode: ${isCleaning ? "Cleaning" : "Idle"}`
174038
174085
  );
174039
174086
  return isCleaning ? 1 /* Cleaning */ : 0 /* Idle */;
@@ -174072,7 +174119,7 @@ var vacuumRvcRunModeConfig = {
174072
174119
  }
174073
174120
  }
174074
174121
  if (buttonEntityIds.length > 0) {
174075
- logger183.info(
174122
+ logger184.info(
174076
174123
  `Roborock: Pressing button entities for selected rooms: ${buttonEntityIds.join(", ")}`
174077
174124
  );
174078
174125
  serviceArea.state.selectedAreas = [];
@@ -174101,14 +174148,14 @@ var vacuumRvcRunModeConfig = {
174101
174148
  }
174102
174149
  }
174103
174150
  if (roomIds.length > 0) {
174104
- logger183.info(
174151
+ logger184.info(
174105
174152
  `Starting cleaning with selected areas: ${roomIds.join(", ")}`
174106
174153
  );
174107
174154
  serviceArea.state.selectedAreas = [];
174108
174155
  const vacuumEntityId = homeAssistant.entityId;
174109
174156
  if (vacuumEntityId.startsWith("vacuum.valetudo_")) {
174110
174157
  const identifier = vacuumEntityId.replace(/^vacuum\.valetudo_/, "");
174111
- logger183.info(
174158
+ logger184.info(
174112
174159
  `Valetudo vacuum: Using mqtt.publish segment_cleanup for rooms: ${roomIds.join(", ")}`
174113
174160
  );
174114
174161
  return {
@@ -174128,7 +174175,7 @@ var vacuumRvcRunModeConfig = {
174128
174175
  if (targetMapName) {
174129
174176
  const vacName = vacuumEntityId.replace("vacuum.", "");
174130
174177
  const selectedMapEntity = `select.${vacName}_selected_map`;
174131
- logger183.info(
174178
+ logger184.info(
174132
174179
  `Dreame multi-floor: switching to map "${targetMapName}" via ${selectedMapEntity}`
174133
174180
  );
174134
174181
  homeAssistant.callAction({
@@ -174155,7 +174202,7 @@ var vacuumRvcRunModeConfig = {
174155
174202
  }
174156
174203
  if (isEcovacsVacuum(attributes7)) {
174157
174204
  const roomIdStr = roomIds.join(",");
174158
- logger183.info(
174205
+ logger184.info(
174159
174206
  `Ecovacs vacuum: Using spot_area for rooms: ${roomIdStr}`
174160
174207
  );
174161
174208
  return {
@@ -174170,14 +174217,14 @@ var vacuumRvcRunModeConfig = {
174170
174217
  }
174171
174218
  };
174172
174219
  }
174173
- logger183.warn(
174220
+ logger184.warn(
174174
174221
  `Room cleaning via send_command not supported for this vacuum type. Rooms: ${roomIds.join(", ")}. Falling back to vacuum.start`
174175
174222
  );
174176
174223
  }
174177
174224
  }
174178
174225
  } catch {
174179
174226
  }
174180
- logger183.info("Starting regular cleaning (no areas selected)");
174227
+ logger184.info("Starting regular cleaning (no areas selected)");
174181
174228
  return { action: "vacuum.start" };
174182
174229
  },
174183
174230
  returnToBase: () => ({ action: "vacuum.return_to_base" }),
@@ -174192,7 +174239,7 @@ var vacuumRvcRunModeConfig = {
174192
174239
  const homeAssistant = agent.get(HomeAssistantEntityBehavior);
174193
174240
  const entity = homeAssistant.entity;
174194
174241
  const attributes7 = entity.state.attributes;
174195
- logger183.info(`cleanRoom called: roomMode=${roomMode}`);
174242
+ logger184.info(`cleanRoom called: roomMode=${roomMode}`);
174196
174243
  const customAreas = homeAssistant.state.mapping?.customServiceAreas;
174197
174244
  if (customAreas && customAreas.length > 0) {
174198
174245
  const sorted = [...customAreas].sort(
@@ -174201,7 +174248,7 @@ var vacuumRvcRunModeConfig = {
174201
174248
  const areaIndex = roomMode - ROOM_MODE_BASE2 - 1;
174202
174249
  if (areaIndex >= 0 && areaIndex < sorted.length) {
174203
174250
  const area = sorted[areaIndex];
174204
- logger183.info(
174251
+ logger184.info(
174205
174252
  `cleanRoom: custom service area "${area.name}" \u2192 ${area.service}`
174206
174253
  );
174207
174254
  return {
@@ -174213,7 +174260,7 @@ var vacuumRvcRunModeConfig = {
174213
174260
  }
174214
174261
  const rooms = parseVacuumRooms(attributes7);
174215
174262
  const numericIdFromMode = getRoomIdFromMode(roomMode);
174216
- logger183.info(
174263
+ logger184.info(
174217
174264
  `cleanRoom: numericIdFromMode=${numericIdFromMode}, available rooms: ${JSON.stringify(rooms.map((r) => ({ id: r.id, name: r.name, modeValue: getRoomModeValue(r) })))}`
174218
174265
  );
174219
174266
  const room = rooms.find((r) => getRoomModeValue(r) === roomMode);
@@ -174222,7 +174269,7 @@ var vacuumRvcRunModeConfig = {
174222
174269
  const vacuumEntityId = entity.entity_id;
174223
174270
  if (vacuumEntityId.startsWith("vacuum.valetudo_")) {
174224
174271
  const identifier = vacuumEntityId.replace(/^vacuum\.valetudo_/, "");
174225
- logger183.info(
174272
+ logger184.info(
174226
174273
  `Valetudo vacuum: Using mqtt.publish segment_cleanup for room ${room.name} (id: ${commandId3})`
174227
174274
  );
174228
174275
  return {
@@ -174242,7 +174289,7 @@ var vacuumRvcRunModeConfig = {
174242
174289
  if (room.mapName) {
174243
174290
  const vacuumName = vacuumEntityId.replace("vacuum.", "");
174244
174291
  const selectedMapEntity = `select.${vacuumName}_selected_map`;
174245
- logger183.info(
174292
+ logger184.info(
174246
174293
  `Dreame multi-floor: switching to map "${room.mapName}" via ${selectedMapEntity}`
174247
174294
  );
174248
174295
  homeAssistant.callAction({
@@ -174251,7 +174298,7 @@ var vacuumRvcRunModeConfig = {
174251
174298
  data: { option: room.mapName }
174252
174299
  });
174253
174300
  }
174254
- logger183.debug(
174301
+ logger184.debug(
174255
174302
  `Dreame vacuum detected, using dreame_vacuum.vacuum_clean_segment for room ${room.name} (commandId: ${commandId3}, id: ${room.id})`
174256
174303
  );
174257
174304
  return {
@@ -174262,7 +174309,7 @@ var vacuumRvcRunModeConfig = {
174262
174309
  };
174263
174310
  }
174264
174311
  if (isRoborockVacuum(attributes7) || isXiaomiMiotVacuum(attributes7)) {
174265
- logger183.debug(
174312
+ logger184.debug(
174266
174313
  `Using vacuum.send_command with app_segment_clean for room ${room.name} (commandId: ${commandId3}, id: ${room.id})`
174267
174314
  );
174268
174315
  return {
@@ -174275,7 +174322,7 @@ var vacuumRvcRunModeConfig = {
174275
174322
  }
174276
174323
  if (isEcovacsVacuum(attributes7)) {
174277
174324
  const roomIdStr = String(commandId3);
174278
- logger183.info(
174325
+ logger184.info(
174279
174326
  `Ecovacs vacuum: Using spot_area for room ${room.name} (id: ${roomIdStr})`
174280
174327
  );
174281
174328
  return {
@@ -174290,7 +174337,7 @@ var vacuumRvcRunModeConfig = {
174290
174337
  }
174291
174338
  };
174292
174339
  }
174293
- logger183.warn(
174340
+ logger184.warn(
174294
174341
  `Room cleaning via send_command not supported for this vacuum type. Room: ${room.name} (id=${commandId3}). Falling back to vacuum.start`
174295
174342
  );
174296
174343
  }
@@ -174306,20 +174353,20 @@ function createVacuumRvcRunModeServer(attributes7, includeUnnamedRooms = false,
174306
174353
  includeUnnamedRooms,
174307
174354
  customAreas
174308
174355
  );
174309
- logger183.info(
174356
+ logger184.info(
174310
174357
  `Creating VacuumRvcRunModeServer with ${rooms.length} rooms, ${supportedModes.length} total modes`
174311
174358
  );
174312
174359
  if (rooms.length > 0) {
174313
- logger183.info(`Rooms found: ${rooms.map((r) => r.name).join(", ")}`);
174360
+ logger184.info(`Rooms found: ${rooms.map((r) => r.name).join(", ")}`);
174314
174361
  }
174315
174362
  if (filteredCount > 0) {
174316
174363
  const filtered = allRooms.filter((r) => !rooms.some((x) => x.id === r.id));
174317
- logger183.info(
174364
+ logger184.info(
174318
174365
  `Filtered out ${filteredCount} unnamed room(s): ${filtered.map((r) => r.name).join(", ")}`
174319
174366
  );
174320
174367
  }
174321
174368
  if (allRooms.length === 0) {
174322
- logger183.debug(
174369
+ logger184.debug(
174323
174370
  `No rooms found. Attributes: rooms=${JSON.stringify(attributes7.rooms)}, segments=${JSON.stringify(attributes7.segments)}, room_list=${attributes7.room_list}`
174324
174371
  );
174325
174372
  }
@@ -174377,7 +174424,7 @@ init_rvc_clean_mode();
174377
174424
 
174378
174425
  // src/matter/behaviors/rvc-clean-mode-server.ts
174379
174426
  init_home_assistant_entity_behavior();
174380
- var logger184 = Logger.get("RvcCleanModeServerBase");
174427
+ var logger185 = Logger.get("RvcCleanModeServerBase");
174381
174428
  var RvcCleanModeServerBase = class _RvcCleanModeServerBase extends RvcCleanModeServer {
174382
174429
  // Pending mode from a recent changeToMode command.
174383
174430
  // Prevents stale HA state (from a different entity like select.xxx)
@@ -174420,14 +174467,14 @@ var RvcCleanModeServerBase = class _RvcCleanModeServerBase extends RvcCleanModeS
174420
174467
  const homeAssistant = this.agent.get(HomeAssistantEntityBehavior);
174421
174468
  const { newMode } = request;
174422
174469
  if (newMode !== this.state.currentMode && !this.state.supportedModes.some((m) => m.mode === newMode)) {
174423
- logger184.warn(`changeToMode(${newMode}) rejected: unsupported mode`);
174470
+ logger185.warn(`changeToMode(${newMode}) rejected: unsupported mode`);
174424
174471
  return {
174425
174472
  status: ModeBase3.ModeChangeStatus.UnsupportedMode,
174426
174473
  statusText: `Unsupported mode: ${newMode}`
174427
174474
  };
174428
174475
  }
174429
174476
  const modeLabel = this.state.supportedModes.find((m) => m.mode === newMode);
174430
- logger184.info(
174477
+ logger185.info(
174431
174478
  `changeToMode(${newMode}) "${modeLabel?.label ?? "unknown"}" for ${homeAssistant.entityId}`
174432
174479
  );
174433
174480
  this.pendingMode = newMode;
@@ -174435,7 +174482,7 @@ var RvcCleanModeServerBase = class _RvcCleanModeServerBase extends RvcCleanModeS
174435
174482
  this.state.currentMode = newMode;
174436
174483
  const action = this.state.config.setCleanMode(newMode, this.agent);
174437
174484
  if (action) {
174438
- logger184.info(
174485
+ logger185.info(
174439
174486
  `changeToMode: dispatching action ${action.action} \u2192 ${action.target ?? homeAssistant.entityId}`
174440
174487
  );
174441
174488
  homeAssistant.callAction(action);
@@ -174468,7 +174515,7 @@ function RvcCleanModeServer2(config10, initialState) {
174468
174515
  }
174469
174516
 
174470
174517
  // src/matter/endpoints/legacy/vacuum/behaviors/vacuum-rvc-clean-mode-server.ts
174471
- var logger185 = Logger.get("VacuumRvcCleanModeServer");
174518
+ var logger186 = Logger.get("VacuumRvcCleanModeServer");
174472
174519
  var MODE_VACUUM = 0;
174473
174520
  var MODE_VACUUM_AND_MOP = 1;
174474
174521
  var MODE_MOP = 2;
@@ -174767,7 +174814,7 @@ function findMatchingCleanOption(ct, availableOptions) {
174767
174814
  if (match) return match;
174768
174815
  }
174769
174816
  }
174770
- logger185.warn(
174817
+ logger186.warn(
174771
174818
  `No match for ${CLEAN_TYPE_LABELS[ct]} in [${availableOptions.join(", ")}]`
174772
174819
  );
174773
174820
  return aliases[0];
@@ -174776,7 +174823,7 @@ function buildCleaningModeAction(targetCleanType, agent) {
174776
174823
  const selectEntityId = getCleaningModeSelectEntity(agent);
174777
174824
  const { options } = readSelectEntity(selectEntityId, agent);
174778
174825
  const optionToUse = findMatchingCleanOption(targetCleanType, options);
174779
- logger185.info(
174826
+ logger186.info(
174780
174827
  `Switching cleaning mode to: ${optionToUse} via ${selectEntityId}`
174781
174828
  );
174782
174829
  return {
@@ -174865,7 +174912,7 @@ function createCleanModeConfig(fanSpeedList, mopIntensityList, cleaningModeOptio
174865
174912
  }
174866
174913
  }
174867
174914
  if (speedMode !== void 0) {
174868
- logger185.debug(
174915
+ logger186.debug(
174869
174916
  `Current mode: Vacuum + fan_speed="${speedState}" -> mode ${speedMode}`
174870
174917
  );
174871
174918
  return speedMode;
@@ -174886,7 +174933,7 @@ function createCleanModeConfig(fanSpeedList, mopIntensityList, cleaningModeOptio
174886
174933
  }
174887
174934
  }
174888
174935
  if (mopMode !== void 0) {
174889
- logger185.debug(
174936
+ logger186.debug(
174890
174937
  `Current mode: Mop + intensity="${state}" -> mode ${mopMode}`
174891
174938
  );
174892
174939
  return mopMode;
@@ -174904,14 +174951,14 @@ function createCleanModeConfig(fanSpeedList, mopIntensityList, cleaningModeOptio
174904
174951
  const homeAssistant = agent.get(HomeAssistantEntityBehavior);
174905
174952
  const vacuumEntityId = homeAssistant.entityId;
174906
174953
  const mapping = homeAssistant.state.mapping;
174907
- logger185.info(
174954
+ logger186.info(
174908
174955
  `setCleanMode(${mode}) for ${vacuumEntityId} \u2014 suctionEntity=${mapping?.suctionLevelEntity ?? "none"}, mopEntity=${mapping?.mopIntensityEntity ?? "none"}, fanSpeedList=${JSON.stringify(fanSpeedList ?? [])}, mopIntensityList=${JSON.stringify(mopIntensityList ?? [])}, customTags=${JSON.stringify(customFanSpeedTags ?? {})}`
174909
174956
  );
174910
174957
  if (mopIntensityList && mopIntensityList.length > 0 && isMopIntensityMode(mode)) {
174911
174958
  const mopIndex = mode - MOP_INTENSITY_MODE_BASE;
174912
174959
  const mopName = mopIntensityList[mopIndex];
174913
174960
  if (!mopName) {
174914
- logger185.warn(`Invalid mop intensity mode index: ${mopIndex}`);
174961
+ logger186.warn(`Invalid mop intensity mode index: ${mopIndex}`);
174915
174962
  return void 0;
174916
174963
  }
174917
174964
  if (hasCleanTypes) {
@@ -174924,18 +174971,18 @@ function createCleanModeConfig(fanSpeedList, mopIntensityList, cleaningModeOptio
174924
174971
  mapping.mopIntensityEntity,
174925
174972
  agent
174926
174973
  );
174927
- logger185.info(
174974
+ logger186.info(
174928
174975
  `Mop intensity entity ${mapping.mopIntensityEntity}: current="${state}", options=${JSON.stringify(options ?? [])}`
174929
174976
  );
174930
174977
  let option = matchMopIntensityOption(mopName, options);
174931
174978
  if (!option && options && mopIndex < options.length) {
174932
174979
  option = options[mopIndex];
174933
- logger185.info(
174980
+ logger186.info(
174934
174981
  `Positional match for mop "${mopName}" -> "${option}" (index ${mopIndex})`
174935
174982
  );
174936
174983
  }
174937
174984
  if (option) {
174938
- logger185.info(
174985
+ logger186.info(
174939
174986
  `Setting mop intensity to: ${option} via ${mapping.mopIntensityEntity}`
174940
174987
  );
174941
174988
  return {
@@ -174944,11 +174991,11 @@ function createCleanModeConfig(fanSpeedList, mopIntensityList, cleaningModeOptio
174944
174991
  target: mapping.mopIntensityEntity
174945
174992
  };
174946
174993
  }
174947
- logger185.warn(
174994
+ logger186.warn(
174948
174995
  `No match for mop intensity "${mopName}" in options: [${(options ?? []).join(", ")}]`
174949
174996
  );
174950
174997
  } else {
174951
- logger185.warn(
174998
+ logger186.warn(
174952
174999
  `Mop intensity mode ${mode} requested but no mopIntensityEntity configured`
174953
175000
  );
174954
175001
  }
@@ -174958,7 +175005,7 @@ function createCleanModeConfig(fanSpeedList, mopIntensityList, cleaningModeOptio
174958
175005
  const fanSpeedIndex = mode - FAN_SPEED_MODE_BASE;
174959
175006
  const fanSpeedName = fanSpeedList[fanSpeedIndex];
174960
175007
  if (!fanSpeedName) {
174961
- logger185.warn(`Invalid fan speed mode index: ${fanSpeedIndex}`);
175008
+ logger186.warn(`Invalid fan speed mode index: ${fanSpeedIndex}`);
174962
175009
  return void 0;
174963
175010
  }
174964
175011
  if (mapping?.suctionLevelEntity) {
@@ -174971,7 +175018,7 @@ function createCleanModeConfig(fanSpeedList, mopIntensityList, cleaningModeOptio
174971
175018
  mapping.suctionLevelEntity,
174972
175019
  agent
174973
175020
  );
174974
- logger185.info(
175021
+ logger186.info(
174975
175022
  `Suction entity ${mapping.suctionLevelEntity}: current="${state}", options=${JSON.stringify(options ?? [])}`
174976
175023
  );
174977
175024
  let option = matchFanSpeedOption(
@@ -174981,12 +175028,12 @@ function createCleanModeConfig(fanSpeedList, mopIntensityList, cleaningModeOptio
174981
175028
  );
174982
175029
  if (!option && options && fanSpeedIndex < options.length) {
174983
175030
  option = options[fanSpeedIndex];
174984
- logger185.info(
175031
+ logger186.info(
174985
175032
  `Positional match for fan "${fanSpeedName}" -> "${option}" (index ${fanSpeedIndex})`
174986
175033
  );
174987
175034
  }
174988
175035
  if (option) {
174989
- logger185.info(
175036
+ logger186.info(
174990
175037
  `Setting suction to: ${option} via ${mapping.suctionLevelEntity}`
174991
175038
  );
174992
175039
  return {
@@ -174995,7 +175042,7 @@ function createCleanModeConfig(fanSpeedList, mopIntensityList, cleaningModeOptio
174995
175042
  target: mapping.suctionLevelEntity
174996
175043
  };
174997
175044
  }
174998
- logger185.warn(
175045
+ logger186.warn(
174999
175046
  `No match for fan speed "${fanSpeedName}" in suction options: [${(options ?? []).join(", ")}]`
175000
175047
  );
175001
175048
  return void 0;
@@ -175005,7 +175052,7 @@ function createCleanModeConfig(fanSpeedList, mopIntensityList, cleaningModeOptio
175005
175052
  buildCleaningModeAction(0 /* Sweeping */, agent)
175006
175053
  );
175007
175054
  }
175008
- logger185.info(
175055
+ logger186.info(
175009
175056
  `Setting fan speed to: ${fanSpeedName} via vacuum.set_fan_speed`
175010
175057
  );
175011
175058
  return {
@@ -175015,7 +175062,7 @@ function createCleanModeConfig(fanSpeedList, mopIntensityList, cleaningModeOptio
175015
175062
  };
175016
175063
  }
175017
175064
  if (!hasCleanTypes) {
175018
- logger185.debug(
175065
+ logger186.debug(
175019
175066
  `Ignoring cleaning type change (mode=${mode}): no cleaning mode entity`
175020
175067
  );
175021
175068
  return void 0;
@@ -175027,7 +175074,7 @@ function createCleanModeConfig(fanSpeedList, mopIntensityList, cleaningModeOptio
175027
175074
  agent
175028
175075
  );
175029
175076
  const optionToUse = findMatchingCleanOption(cleanType, availableOptions);
175030
- logger185.info(
175077
+ logger186.info(
175031
175078
  `Setting cleaning mode to: ${optionToUse} (mode=${mode}) via ${selectEntityId}`
175032
175079
  );
175033
175080
  return {
@@ -175045,10 +175092,10 @@ function createVacuumRvcCleanModeServer(_attributes, fanSpeedList, mopIntensityL
175045
175092
  cleaningModeOptions,
175046
175093
  customFanSpeedTags
175047
175094
  );
175048
- logger185.info(
175095
+ logger186.info(
175049
175096
  `Creating VacuumRvcCleanModeServer with ${supportedModes.length} modes (fanSpeedList=${JSON.stringify(fanSpeedList ?? [])}, mopIntensityList=${JSON.stringify(mopIntensityList ?? [])}, cleaningModeOptions=${JSON.stringify(cleaningModeOptions ?? [])}, customTags=${JSON.stringify(customFanSpeedTags ?? {})})`
175050
175097
  );
175051
- logger185.info(
175098
+ logger186.info(
175052
175099
  `Modes: ${supportedModes.map((m) => `${m.mode}:${m.label}[${m.modeTags.map((t) => t.value).join(",")}]`).join(", ")}`
175053
175100
  );
175054
175101
  const initialState = {
@@ -175126,7 +175173,7 @@ init_rvc_operational_state();
175126
175173
  init_home_assistant_entity_behavior();
175127
175174
  var OperationalState4 = RvcOperationalState3.OperationalState;
175128
175175
  var ErrorState = RvcOperationalState3.ErrorState;
175129
- var logger186 = Logger.get("RvcOperationalStateServer");
175176
+ var logger187 = Logger.get("RvcOperationalStateServer");
175130
175177
  var activeStates = /* @__PURE__ */ new Set([
175131
175178
  OperationalState4.Running,
175132
175179
  OperationalState4.SeekingCharger
@@ -175168,7 +175215,7 @@ var RvcOperationalStateServerBase = class extends RvcOperationalStateServer {
175168
175215
  }
175169
175216
  });
175170
175217
  if (activeStates.has(previousState) && !activeStates.has(newState)) {
175171
- logger186.info(
175218
+ logger187.info(
175172
175219
  `Operation completed: ${OperationalState4[previousState]} -> ${OperationalState4[newState]}`
175173
175220
  );
175174
175221
  try {
@@ -175181,7 +175228,7 @@ var RvcOperationalStateServerBase = class extends RvcOperationalStateServer {
175181
175228
  this.context
175182
175229
  );
175183
175230
  } catch (e) {
175184
- logger186.debug("Failed to emit operationCompletion event:", e);
175231
+ logger187.debug("Failed to emit operationCompletion event:", e);
175185
175232
  }
175186
175233
  }
175187
175234
  }
@@ -175216,7 +175263,7 @@ var RvcOperationalStateServerBase = class extends RvcOperationalStateServer {
175216
175263
  const homeAssistant = this.agent.get(HomeAssistantEntityBehavior);
175217
175264
  homeAssistant.callAction(goHomeAction(void 0, this.agent));
175218
175265
  } else {
175219
- logger186.warn("GoHome command received but no goHome action configured");
175266
+ logger187.warn("GoHome command received but no goHome action configured");
175220
175267
  }
175221
175268
  return {
175222
175269
  commandResponseState: {
@@ -175236,7 +175283,7 @@ function RvcOperationalStateServer2(config10) {
175236
175283
  }
175237
175284
 
175238
175285
  // src/matter/endpoints/legacy/vacuum/behaviors/vacuum-rvc-operational-state-server.ts
175239
- var logger187 = Logger.get("VacuumRvcOperationalStateServer");
175286
+ var logger188 = Logger.get("VacuumRvcOperationalStateServer");
175240
175287
  function isCharging(entity) {
175241
175288
  const attrs = entity.attributes;
175242
175289
  if (attrs.battery_icon?.includes("charging")) return true;
@@ -175278,16 +175325,16 @@ var VacuumRvcOperationalStateServer = RvcOperationalStateServer2({
175278
175325
  operationalState = RvcOperationalState3.OperationalState.Error;
175279
175326
  } else {
175280
175327
  if (state.toLowerCase().includes("clean")) {
175281
- logger187.info(
175328
+ logger188.info(
175282
175329
  `Unknown vacuum state "${state}" contains 'clean', treating as Running`
175283
175330
  );
175284
175331
  operationalState = RvcOperationalState3.OperationalState.Running;
175285
175332
  } else {
175286
- logger187.info(`Unknown vacuum state "${state}", treating as Paused`);
175333
+ logger188.info(`Unknown vacuum state "${state}", treating as Paused`);
175287
175334
  operationalState = RvcOperationalState3.OperationalState.Paused;
175288
175335
  }
175289
175336
  }
175290
- logger187.debug(
175337
+ logger188.debug(
175291
175338
  `Vacuum operationalState: "${state}" -> ${RvcOperationalState3.OperationalState[operationalState]}`
175292
175339
  );
175293
175340
  return operationalState;
@@ -175308,7 +175355,7 @@ var VacuumRvcOperationalStateServer = RvcOperationalStateServer2({
175308
175355
  });
175309
175356
 
175310
175357
  // src/matter/endpoints/legacy/vacuum/index.ts
175311
- var logger188 = Logger.get("VacuumDevice");
175358
+ var logger189 = Logger.get("VacuumDevice");
175312
175359
  var VacuumEndpointType = RoboticVacuumCleanerDevice.with(
175313
175360
  BasicInformationServer2,
175314
175361
  VacuumIdentifyServer,
@@ -175322,7 +175369,7 @@ function VacuumDevice(homeAssistantEntity, includeOnOff = false, minimalClusters
175322
175369
  const entityId = homeAssistantEntity.entity.entity_id;
175323
175370
  const attributes7 = homeAssistantEntity.entity.state.attributes;
175324
175371
  const customAreas = homeAssistantEntity.mapping?.customServiceAreas;
175325
- logger188.info(
175372
+ logger189.info(
175326
175373
  `Creating vacuum endpoint for ${entityId}, mapping: ${JSON.stringify(homeAssistantEntity.mapping ?? "none")}`
175327
175374
  );
175328
175375
  let device = VacuumEndpointType.with(
@@ -175333,7 +175380,7 @@ function VacuumDevice(homeAssistantEntity, includeOnOff = false, minimalClusters
175333
175380
  )
175334
175381
  ).set({ homeAssistantEntity });
175335
175382
  if (includeOnOff) {
175336
- logger188.info(`${entityId}: Adding OnOff cluster (vacuumOnOff flag enabled)`);
175383
+ logger189.info(`${entityId}: Adding OnOff cluster (vacuumOnOff flag enabled)`);
175337
175384
  device = device.with(VacuumOnOffServer);
175338
175385
  }
175339
175386
  if (!minimalClusters) {
@@ -175341,24 +175388,24 @@ function VacuumDevice(homeAssistantEntity, includeOnOff = false, minimalClusters
175341
175388
  }
175342
175389
  const roomEntities = homeAssistantEntity.mapping?.roomEntities;
175343
175390
  const rooms = parseVacuumRooms(attributes7);
175344
- logger188.info(
175391
+ logger189.info(
175345
175392
  `${entityId}: customAreas=${customAreas?.length ?? 0}, roomEntities=${JSON.stringify(roomEntities ?? [])}, parsedRooms=${rooms.length}`
175346
175393
  );
175347
175394
  if (customAreas && customAreas.length > 0) {
175348
- logger188.info(
175395
+ logger189.info(
175349
175396
  `${entityId}: Adding ServiceArea (${customAreas.length} custom areas)`
175350
175397
  );
175351
175398
  device = device.with(createCustomServiceAreaServer(customAreas));
175352
175399
  } else if (rooms.length > 0 || roomEntities && roomEntities.length > 0) {
175353
- logger188.info(`${entityId}: Adding ServiceArea (${rooms.length} rooms)`);
175400
+ logger189.info(`${entityId}: Adding ServiceArea (${rooms.length} rooms)`);
175354
175401
  device = device.with(
175355
175402
  createVacuumServiceAreaServer(attributes7, roomEntities)
175356
175403
  );
175357
175404
  } else if (!minimalClusters) {
175358
- logger188.info(`${entityId}: Adding ServiceArea (default single-area)`);
175405
+ logger189.info(`${entityId}: Adding ServiceArea (default single-area)`);
175359
175406
  device = device.with(createDefaultServiceAreaServer());
175360
175407
  } else {
175361
- logger188.info(`${entityId}: Skipping ServiceArea (minimal clusters mode)`);
175408
+ logger189.info(`${entityId}: Skipping ServiceArea (minimal clusters mode)`);
175362
175409
  }
175363
175410
  const fanSpeedList = resolveFanSpeedList(
175364
175411
  attributes7,
@@ -175368,7 +175415,7 @@ function VacuumDevice(homeAssistantEntity, includeOnOff = false, minimalClusters
175368
175415
  homeAssistantEntity.mapping?.mopIntensityEntity
175369
175416
  );
175370
175417
  if (cleaningModeOptions || fanSpeedList || mopIntensityList) {
175371
- logger188.info(
175418
+ logger189.info(
175372
175419
  `${entityId}: Adding RvcCleanMode (multi-mode, cleaningModeOptions=${JSON.stringify(cleaningModeOptions ?? [])}, fanSpeedList=${JSON.stringify(fanSpeedList ?? [])}, mopIntensityList=${JSON.stringify(mopIntensityList ?? [])})`
175373
175420
  );
175374
175421
  device = device.with(
@@ -175381,7 +175428,7 @@ function VacuumDevice(homeAssistantEntity, includeOnOff = false, minimalClusters
175381
175428
  )
175382
175429
  );
175383
175430
  } else {
175384
- logger188.info(`${entityId}: Adding RvcCleanMode (default single-mode)`);
175431
+ logger189.info(`${entityId}: Adding RvcCleanMode (default single-mode)`);
175385
175432
  device = device.with(createDefaultRvcCleanModeServer());
175386
175433
  }
175387
175434
  return device;
@@ -175536,7 +175583,7 @@ var WaterHeaterThermostatServer = ThermostatServer2(
175536
175583
  );
175537
175584
 
175538
175585
  // src/matter/endpoints/legacy/water-heater/index.ts
175539
- var logger189 = Logger.get("WaterHeaterDevice");
175586
+ var logger190 = Logger.get("WaterHeaterDevice");
175540
175587
  var WaterHeaterDeviceType = ThermostatDevice.with(
175541
175588
  BasicInformationServer2,
175542
175589
  IdentifyServer2,
@@ -175552,7 +175599,7 @@ function toMatterTemp2(value) {
175552
175599
  }
175553
175600
  function WaterHeaterDevice(homeAssistantEntity) {
175554
175601
  const attributes7 = homeAssistantEntity.entity.state.attributes;
175555
- logger189.debug(
175602
+ logger190.debug(
175556
175603
  `Creating device for ${homeAssistantEntity.entity.entity_id}, min_temp=${attributes7.min_temp}, max_temp=${attributes7.max_temp}`
175557
175604
  );
175558
175605
  const minLimit = toMatterTemp2(attributes7.min_temp) ?? 0;
@@ -175742,7 +175789,7 @@ var matterDeviceTypeFactories = {
175742
175789
  };
175743
175790
 
175744
175791
  // src/matter/endpoints/legacy/legacy-endpoint.ts
175745
- var logger190 = Logger.get("LegacyEndpoint");
175792
+ var logger191 = Logger.get("LegacyEndpoint");
175746
175793
  var LegacyEndpoint = class _LegacyEndpoint extends EntityEndpoint {
175747
175794
  static async create(registry2, entityId, mapping) {
175748
175795
  const deviceRegistry = registry2.deviceOf(entityId);
@@ -175752,25 +175799,25 @@ var LegacyEndpoint = class _LegacyEndpoint extends EntityEndpoint {
175752
175799
  return;
175753
175800
  }
175754
175801
  if (registry2.isAutoBatteryMappingEnabled() && registry2.isBatteryEntityUsed(entityId)) {
175755
- logger190.debug(
175802
+ logger191.debug(
175756
175803
  `Skipping ${entityId} - already auto-assigned as battery to another device`
175757
175804
  );
175758
175805
  return;
175759
175806
  }
175760
175807
  if (registry2.isAutoHumidityMappingEnabled() && registry2.isHumidityEntityUsed(entityId)) {
175761
- logger190.debug(
175808
+ logger191.debug(
175762
175809
  `Skipping ${entityId} - already auto-assigned as humidity to a temperature sensor`
175763
175810
  );
175764
175811
  return;
175765
175812
  }
175766
175813
  if (registry2.isAutoPressureMappingEnabled() && registry2.isPressureEntityUsed(entityId)) {
175767
- logger190.debug(
175814
+ logger191.debug(
175768
175815
  `Skipping ${entityId} - already auto-assigned as pressure to a temperature sensor`
175769
175816
  );
175770
175817
  return;
175771
175818
  }
175772
175819
  if (registry2.isAutoComposedDevicesEnabled() && registry2.isComposedSubEntityUsed(entityId)) {
175773
- logger190.debug(
175820
+ logger191.debug(
175774
175821
  `Skipping ${entityId} - already consumed by a composed device`
175775
175822
  );
175776
175823
  return;
@@ -175790,7 +175837,7 @@ var LegacyEndpoint = class _LegacyEndpoint extends EntityEndpoint {
175790
175837
  humidityEntity: humidityEntityId
175791
175838
  };
175792
175839
  registry2.markHumidityEntityUsed(humidityEntityId);
175793
- logger190.debug(
175840
+ logger191.debug(
175794
175841
  `Auto-assigned humidity ${humidityEntityId} to ${entityId}`
175795
175842
  );
175796
175843
  }
@@ -175809,7 +175856,7 @@ var LegacyEndpoint = class _LegacyEndpoint extends EntityEndpoint {
175809
175856
  pressureEntity: pressureEntityId
175810
175857
  };
175811
175858
  registry2.markPressureEntityUsed(pressureEntityId);
175812
- logger190.debug(
175859
+ logger191.debug(
175813
175860
  `Auto-assigned pressure ${pressureEntityId} to ${entityId}`
175814
175861
  );
175815
175862
  }
@@ -175826,7 +175873,7 @@ var LegacyEndpoint = class _LegacyEndpoint extends EntityEndpoint {
175826
175873
  batteryEntity: batteryEntityId
175827
175874
  };
175828
175875
  registry2.markBatteryEntityUsed(batteryEntityId);
175829
- logger190.debug(
175876
+ logger191.debug(
175830
175877
  `Auto-assigned battery ${batteryEntityId} to ${entityId}`
175831
175878
  );
175832
175879
  }
@@ -175844,7 +175891,7 @@ var LegacyEndpoint = class _LegacyEndpoint extends EntityEndpoint {
175844
175891
  powerEntity: powerEntityId
175845
175892
  };
175846
175893
  registry2.markPowerEntityUsed(powerEntityId);
175847
- logger190.debug(`Auto-assigned power ${powerEntityId} to ${entityId}`);
175894
+ logger191.debug(`Auto-assigned power ${powerEntityId} to ${entityId}`);
175848
175895
  }
175849
175896
  }
175850
175897
  }
@@ -175861,7 +175908,7 @@ var LegacyEndpoint = class _LegacyEndpoint extends EntityEndpoint {
175861
175908
  energyEntity: energyEntityId
175862
175909
  };
175863
175910
  registry2.markEnergyEntityUsed(energyEntityId);
175864
- logger190.debug(
175911
+ logger191.debug(
175865
175912
  `Auto-assigned energy ${energyEntityId} to ${entityId}`
175866
175913
  );
175867
175914
  }
@@ -175877,7 +175924,7 @@ var LegacyEndpoint = class _LegacyEndpoint extends EntityEndpoint {
175877
175924
  entityId: effectiveMapping?.entityId ?? entityId,
175878
175925
  cleaningModeEntity: vacuumEntities.cleaningModeEntity
175879
175926
  };
175880
- logger190.debug(
175927
+ logger191.debug(
175881
175928
  `Auto-assigned cleaningMode ${vacuumEntities.cleaningModeEntity} to ${entityId}`
175882
175929
  );
175883
175930
  }
@@ -175887,7 +175934,7 @@ var LegacyEndpoint = class _LegacyEndpoint extends EntityEndpoint {
175887
175934
  entityId: effectiveMapping?.entityId ?? entityId,
175888
175935
  suctionLevelEntity: vacuumEntities.suctionLevelEntity
175889
175936
  };
175890
- logger190.debug(
175937
+ logger191.debug(
175891
175938
  `Auto-assigned suctionLevel ${vacuumEntities.suctionLevelEntity} to ${entityId}`
175892
175939
  );
175893
175940
  }
@@ -175897,7 +175944,7 @@ var LegacyEndpoint = class _LegacyEndpoint extends EntityEndpoint {
175897
175944
  entityId: effectiveMapping?.entityId ?? entityId,
175898
175945
  mopIntensityEntity: vacuumEntities.mopIntensityEntity
175899
175946
  };
175900
- logger190.debug(
175947
+ logger191.debug(
175901
175948
  `Auto-assigned mopIntensity ${vacuumEntities.mopIntensityEntity} to ${entityId}`
175902
175949
  );
175903
175950
  }
@@ -175918,7 +175965,7 @@ var LegacyEndpoint = class _LegacyEndpoint extends EntityEndpoint {
175918
175965
  rooms: roomsObj
175919
175966
  }
175920
175967
  };
175921
- logger190.debug(
175968
+ logger191.debug(
175922
175969
  `Auto-detected ${valetudoRooms.length} Valetudo segments for ${entityId}`
175923
175970
  );
175924
175971
  } else {
@@ -175935,7 +175982,7 @@ var LegacyEndpoint = class _LegacyEndpoint extends EntityEndpoint {
175935
175982
  rooms: roomsObj
175936
175983
  }
175937
175984
  };
175938
- logger190.debug(
175985
+ logger191.debug(
175939
175986
  `Auto-detected ${roborockRooms.length} Roborock rooms for ${entityId}`
175940
175987
  );
175941
175988
  }
@@ -176037,11 +176084,11 @@ var LegacyEndpoint = class _LegacyEndpoint extends EntityEndpoint {
176037
176084
  return;
176038
176085
  }
176039
176086
  if (mappedChanged) {
176040
- logger190.debug(
176087
+ logger191.debug(
176041
176088
  `Mapped entity change detected for ${this.entityId}, forcing update`
176042
176089
  );
176043
176090
  }
176044
- logger190.debug(
176091
+ logger191.debug(
176045
176092
  `State update received for ${this.entityId}: state=${state.state}`
176046
176093
  );
176047
176094
  this.lastState = state;
@@ -176080,7 +176127,7 @@ import {
176080
176127
  getCollection
176081
176128
  } from "home-assistant-js-websocket";
176082
176129
  import { atLeastHaVersion } from "home-assistant-js-websocket/dist/util.js";
176083
- var logger191 = Logger.get("SubscribeEntities");
176130
+ var logger192 = Logger.get("SubscribeEntities");
176084
176131
  function processEvent(store, updates) {
176085
176132
  const state = { ...store.state };
176086
176133
  if (updates.a) {
@@ -176106,7 +176153,7 @@ function processEvent(store, updates) {
176106
176153
  for (const entityId in updates.c) {
176107
176154
  let entityState = state[entityId];
176108
176155
  if (!entityState) {
176109
- logger191.warn("Received state update for unknown entity", entityId);
176156
+ logger192.warn("Received state update for unknown entity", entityId);
176110
176157
  continue;
176111
176158
  }
176112
176159
  entityState = { ...entityState };
@@ -176176,7 +176223,7 @@ var subscribeEntities = (conn, onChange, entityIds) => entitiesColl(conn, entity
176176
176223
 
176177
176224
  // src/services/bridges/entity-isolation-service.ts
176178
176225
  init_esm();
176179
- var logger192 = Logger.get("EntityIsolation");
176226
+ var logger193 = Logger.get("EntityIsolation");
176180
176227
  var EntityIsolationServiceImpl = class {
176181
176228
  isolatedEntities = /* @__PURE__ */ new Map();
176182
176229
  isolationCallbacks = /* @__PURE__ */ new Map();
@@ -176241,13 +176288,13 @@ var EntityIsolationServiceImpl = class {
176241
176288
  }
176242
176289
  const parsed = this.parseEndpointPath(msg);
176243
176290
  if (!parsed) {
176244
- logger192.warn("Could not parse entity from error:", msg);
176291
+ logger193.warn("Could not parse entity from error:", msg);
176245
176292
  return false;
176246
176293
  }
176247
176294
  const { bridgeId, entityName } = parsed;
176248
176295
  const callback = this.isolationCallbacks.get(bridgeId);
176249
176296
  if (!callback) {
176250
- logger192.warn(
176297
+ logger193.warn(
176251
176298
  `No isolation callback registered for bridge ${bridgeId}, entity: ${entityName}`
176252
176299
  );
176253
176300
  return false;
@@ -176258,14 +176305,14 @@ var EntityIsolationServiceImpl = class {
176258
176305
  }
176259
176306
  const reason = `${classification}. Entity isolated to protect bridge stability.`;
176260
176307
  this.isolatedEntities.set(key, { entityId: entityName, reason });
176261
- logger192.warn(
176308
+ logger193.warn(
176262
176309
  `Isolating entity "${entityName}" from bridge ${bridgeId} due to: ${reason}`
176263
176310
  );
176264
176311
  try {
176265
176312
  await callback(entityName);
176266
176313
  return true;
176267
176314
  } catch (e) {
176268
- logger192.error(`Failed to isolate entity ${entityName}:`, e);
176315
+ logger193.error(`Failed to isolate entity ${entityName}:`, e);
176269
176316
  return false;
176270
176317
  }
176271
176318
  }
@@ -177131,11 +177178,11 @@ var BridgeRegistry = class _BridgeRegistry {
177131
177178
  init_dist();
177132
177179
  var AUTO_FORCE_SYNC_INTERVAL_MS2 = 9e4;
177133
177180
  var ServerModeBridge = class {
177134
- constructor(logger195, dataProvider, endpointManager, server) {
177181
+ constructor(logger196, dataProvider, endpointManager, server) {
177135
177182
  this.dataProvider = dataProvider;
177136
177183
  this.endpointManager = endpointManager;
177137
177184
  this.server = server;
177138
- this.log = logger195.get(`ServerModeBridge / ${dataProvider.id}`);
177185
+ this.log = logger196.get(`ServerModeBridge / ${dataProvider.id}`);
177139
177186
  }
177140
177187
  log;
177141
177188
  status = {
@@ -177537,7 +177584,7 @@ function ServerModeVacuumDevice(homeAssistantEntity, includeOnOff = false, minim
177537
177584
  }
177538
177585
 
177539
177586
  // src/matter/endpoints/server-mode-vacuum-endpoint.ts
177540
- var logger193 = Logger.get("ServerModeVacuumEndpoint");
177587
+ var logger194 = Logger.get("ServerModeVacuumEndpoint");
177541
177588
  var ServerModeVacuumEndpoint = class _ServerModeVacuumEndpoint extends EntityEndpoint {
177542
177589
  static async create(registry2, entityId, mapping) {
177543
177590
  const deviceRegistry = registry2.deviceOf(entityId);
@@ -177547,7 +177594,7 @@ var ServerModeVacuumEndpoint = class _ServerModeVacuumEndpoint extends EntityEnd
177547
177594
  return void 0;
177548
177595
  }
177549
177596
  let effectiveMapping = mapping;
177550
- logger193.info(
177597
+ logger194.info(
177551
177598
  `${entityId}: device_id=${entity.device_id}, manualBattery=${mapping?.batteryEntity ?? "none"}`
177552
177599
  );
177553
177600
  if (entity.device_id) {
@@ -177562,9 +177609,9 @@ var ServerModeVacuumEndpoint = class _ServerModeVacuumEndpoint extends EntityEnd
177562
177609
  batteryEntity: batteryEntityId
177563
177610
  };
177564
177611
  registry2.markBatteryEntityUsed(batteryEntityId);
177565
- logger193.info(`${entityId}: Auto-assigned battery ${batteryEntityId}`);
177612
+ logger194.info(`${entityId}: Auto-assigned battery ${batteryEntityId}`);
177566
177613
  } else {
177567
- logger193.warn(
177614
+ logger194.warn(
177568
177615
  `${entityId}: No battery entity found for device ${entity.device_id}`
177569
177616
  );
177570
177617
  }
@@ -177578,7 +177625,7 @@ var ServerModeVacuumEndpoint = class _ServerModeVacuumEndpoint extends EntityEnd
177578
177625
  entityId: effectiveMapping?.entityId ?? entityId,
177579
177626
  cleaningModeEntity: vacuumEntities.cleaningModeEntity
177580
177627
  };
177581
- logger193.info(
177628
+ logger194.info(
177582
177629
  `${entityId}: Auto-assigned cleaningMode ${vacuumEntities.cleaningModeEntity}`
177583
177630
  );
177584
177631
  }
@@ -177588,7 +177635,7 @@ var ServerModeVacuumEndpoint = class _ServerModeVacuumEndpoint extends EntityEnd
177588
177635
  entityId: effectiveMapping?.entityId ?? entityId,
177589
177636
  suctionLevelEntity: vacuumEntities.suctionLevelEntity
177590
177637
  };
177591
- logger193.info(
177638
+ logger194.info(
177592
177639
  `${entityId}: Auto-assigned suctionLevel ${vacuumEntities.suctionLevelEntity}`
177593
177640
  );
177594
177641
  }
@@ -177598,7 +177645,7 @@ var ServerModeVacuumEndpoint = class _ServerModeVacuumEndpoint extends EntityEnd
177598
177645
  entityId: effectiveMapping?.entityId ?? entityId,
177599
177646
  mopIntensityEntity: vacuumEntities.mopIntensityEntity
177600
177647
  };
177601
- logger193.info(
177648
+ logger194.info(
177602
177649
  `${entityId}: Auto-assigned mopIntensity ${vacuumEntities.mopIntensityEntity}`
177603
177650
  );
177604
177651
  }
@@ -177619,7 +177666,7 @@ var ServerModeVacuumEndpoint = class _ServerModeVacuumEndpoint extends EntityEnd
177619
177666
  rooms: roomsObj
177620
177667
  }
177621
177668
  };
177622
- logger193.info(
177669
+ logger194.info(
177623
177670
  `${entityId}: Auto-detected ${valetudoRooms.length} Valetudo segments`
177624
177671
  );
177625
177672
  } else {
@@ -177636,14 +177683,14 @@ var ServerModeVacuumEndpoint = class _ServerModeVacuumEndpoint extends EntityEnd
177636
177683
  rooms: roomsObj
177637
177684
  }
177638
177685
  };
177639
- logger193.info(
177686
+ logger194.info(
177640
177687
  `${entityId}: Auto-detected ${roborockRooms.length} Roborock rooms`
177641
177688
  );
177642
177689
  }
177643
177690
  }
177644
177691
  }
177645
177692
  } else {
177646
- logger193.warn(`${entityId}: No device_id \u2014 cannot auto-assign battery`);
177693
+ logger194.warn(`${entityId}: No device_id \u2014 cannot auto-assign battery`);
177647
177694
  }
177648
177695
  const payload = {
177649
177696
  entity_id: entityId,
@@ -177706,11 +177753,11 @@ var ServerModeVacuumEndpoint = class _ServerModeVacuumEndpoint extends EntityEnd
177706
177753
  return;
177707
177754
  }
177708
177755
  if (mappedChanged) {
177709
- logger193.debug(
177756
+ logger194.debug(
177710
177757
  `Mapped entity change detected for ${this.entityId}, forcing update`
177711
177758
  );
177712
177759
  }
177713
- logger193.debug(
177760
+ logger194.debug(
177714
177761
  `State update received for ${this.entityId}: state=${state.state}`
177715
177762
  );
177716
177763
  this.lastState = state;
@@ -178100,10 +178147,10 @@ var BridgeEnvironmentFactory = class extends BridgeFactory {
178100
178147
  // src/core/ioc/app-environment.ts
178101
178148
  var AppEnvironment = class _AppEnvironment extends EnvironmentBase {
178102
178149
  constructor(rootEnv, options) {
178103
- const logger195 = rootEnv.get(LoggerService);
178150
+ const logger196 = rootEnv.get(LoggerService);
178104
178151
  super({
178105
178152
  id: "App",
178106
- log: logger195.get("AppContainer"),
178153
+ log: logger196.get("AppContainer"),
178107
178154
  parent: rootEnv
178108
178155
  });
178109
178156
  this.options = options;
@@ -178116,8 +178163,8 @@ var AppEnvironment = class _AppEnvironment extends EnvironmentBase {
178116
178163
  }
178117
178164
  construction;
178118
178165
  async init() {
178119
- const logger195 = this.get(LoggerService);
178120
- this.set(LoggerService, logger195);
178166
+ const logger196 = this.get(LoggerService);
178167
+ this.set(LoggerService, logger196);
178121
178168
  this.set(AppStorage, new AppStorage(await this.load(StorageService)));
178122
178169
  this.set(BridgeStorage, new BridgeStorage(await this.load(AppStorage)));
178123
178170
  this.set(
@@ -178134,7 +178181,7 @@ var AppEnvironment = class _AppEnvironment extends EnvironmentBase {
178134
178181
  );
178135
178182
  this.set(
178136
178183
  HomeAssistantClient,
178137
- new HomeAssistantClient(logger195, this.options.homeAssistant)
178184
+ new HomeAssistantClient(logger196, this.options.homeAssistant)
178138
178185
  );
178139
178186
  this.set(
178140
178187
  HomeAssistantConfig,
@@ -178142,7 +178189,7 @@ var AppEnvironment = class _AppEnvironment extends EnvironmentBase {
178142
178189
  );
178143
178190
  this.set(
178144
178191
  HomeAssistantActions,
178145
- new HomeAssistantActions(logger195, await this.load(HomeAssistantClient))
178192
+ new HomeAssistantActions(logger196, await this.load(HomeAssistantClient))
178146
178193
  );
178147
178194
  this.set(
178148
178195
  HomeAssistantRegistry,
@@ -178163,7 +178210,7 @@ var AppEnvironment = class _AppEnvironment extends EnvironmentBase {
178163
178210
  this.set(
178164
178211
  WebApi,
178165
178212
  new WebApi(
178166
- logger195,
178213
+ logger196,
178167
178214
  await this.load(BridgeService),
178168
178215
  await this.load(HomeAssistantClient),
178169
178216
  await this.load(HomeAssistantRegistry),
@@ -178188,7 +178235,7 @@ init_nodejs();
178188
178235
  init_level_control();
178189
178236
 
178190
178237
  // src/matter/patches/patch-level-control-tlv.ts
178191
- var logger194 = Logger.get("PatchLevelControlTlv");
178238
+ var logger195 = Logger.get("PatchLevelControlTlv");
178192
178239
  function patchLevelControlTlv() {
178193
178240
  let patched = 0;
178194
178241
  const moveToLevelFields = LevelControl3.TlvMoveToLevelRequest.fieldDefinitions;
@@ -178202,11 +178249,11 @@ function patchLevelControlTlv() {
178202
178249
  patched++;
178203
178250
  }
178204
178251
  if (patched > 0) {
178205
- logger194.info(
178252
+ logger195.info(
178206
178253
  `Patched ${patched} LevelControl TLV schema(s): transitionTime is now optional (Google Home compatibility)`
178207
178254
  );
178208
178255
  } else {
178209
- logger194.warn(
178256
+ logger195.warn(
178210
178257
  "Failed to patch LevelControl TLV schemas \u2014 field definitions not found. Google Home brightness adjustment may not work."
178211
178258
  );
178212
178259
  }