@riddix/hamh 2.1.0-alpha.733 → 2.1.0-alpha.735

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.
@@ -126800,6 +126800,7 @@ function entityMappingApi(mappingStorage) {
126800
126800
  customFanSpeedTags: body.customFanSpeedTags,
126801
126801
  currentRoomEntity: body.currentRoomEntity,
126802
126802
  cleanedAreaEntity: body.cleanedAreaEntity,
126803
+ disableCustomAreaRoomModes: body.disableCustomAreaRoomModes,
126803
126804
  valetudoIdentifier: body.valetudoIdentifier,
126804
126805
  coverSwapOpenClose: body.coverSwapOpenClose,
126805
126806
  coverSliderDebounceMs: body.coverSliderDebounceMs,
@@ -131420,6 +131421,7 @@ var EntityMappingStorage = class extends Service {
131420
131421
  customFanSpeedTags: request.customFanSpeedTags && Object.keys(request.customFanSpeedTags).length > 0 ? request.customFanSpeedTags : void 0,
131421
131422
  currentRoomEntity: request.currentRoomEntity?.trim() || void 0,
131422
131423
  cleanedAreaEntity: request.cleanedAreaEntity?.trim() || void 0,
131424
+ disableCustomAreaRoomModes: request.disableCustomAreaRoomModes || void 0,
131423
131425
  valetudoIdentifier: request.valetudoIdentifier?.trim() || void 0,
131424
131426
  coverSwapOpenClose: request.coverSwapOpenClose || void 0,
131425
131427
  coverSliderDebounceMs: sanitizeDebounceMs(request.coverSliderDebounceMs),
@@ -131430,7 +131432,7 @@ var EntityMappingStorage = class extends Service {
131430
131432
  climateAutoMode: request.climateAutoMode || void 0,
131431
131433
  composedEntities: request.composedEntities?.filter((e) => e.entityId?.trim()) ?? void 0
131432
131434
  };
131433
- if (!config11.matterDeviceType && !config11.customName && !config11.customProductName && !config11.customVendorName && !config11.customSerialNumber && config11.customVendorId === void 0 && config11.disabled !== true && !config11.filterLifeEntity && !config11.cleaningModeEntity && !config11.temperatureEntity && !config11.humidityEntity && !config11.batteryEntity && !config11.roomEntities && !config11.disableLockPin && !config11.powerEntity && !config11.energyEntity && !config11.pressureEntity && !config11.suctionLevelEntity && !config11.mopIntensityEntity && (!config11.customServiceAreas || config11.customServiceAreas.length === 0) && (!config11.customFanSpeedTags || Object.keys(config11.customFanSpeedTags).length === 0) && !config11.currentRoomEntity && !config11.cleanedAreaEntity && !config11.valetudoIdentifier && !config11.coverSwapOpenClose && !config11.coverSliderDebounceMs && !config11.disableClimateOnOff && !config11.disableClimateFanControl && !config11.climateKeepModeOnIdle && !config11.climateExposeFan && !config11.climateAutoMode && (!config11.composedEntities || config11.composedEntities.length === 0)) {
131435
+ if (!config11.matterDeviceType && !config11.customName && !config11.customProductName && !config11.customVendorName && !config11.customSerialNumber && config11.customVendorId === void 0 && config11.disabled !== true && !config11.filterLifeEntity && !config11.cleaningModeEntity && !config11.temperatureEntity && !config11.humidityEntity && !config11.batteryEntity && !config11.roomEntities && !config11.disableLockPin && !config11.powerEntity && !config11.energyEntity && !config11.pressureEntity && !config11.suctionLevelEntity && !config11.mopIntensityEntity && (!config11.customServiceAreas || config11.customServiceAreas.length === 0) && (!config11.customFanSpeedTags || Object.keys(config11.customFanSpeedTags).length === 0) && !config11.currentRoomEntity && !config11.cleanedAreaEntity && !config11.disableCustomAreaRoomModes && !config11.valetudoIdentifier && !config11.coverSwapOpenClose && !config11.coverSliderDebounceMs && !config11.disableClimateOnOff && !config11.disableClimateFanControl && !config11.climateKeepModeOnIdle && !config11.climateExposeFan && !config11.climateAutoMode && (!config11.composedEntities || config11.composedEntities.length === 0)) {
131434
131436
  bridgeMap.delete(request.entityId);
131435
131437
  } else {
131436
131438
  bridgeMap.set(request.entityId, config11);
@@ -158400,6 +158402,9 @@ var RvcRunModeServerBase = class extends RvcRunModeServer {
158400
158402
  cleaned,
158401
158403
  ordered
158402
158404
  );
158405
+ logger217.debug(
158406
+ `cleanedArea: raw=${raw} baseline=${s.cleanedAreaBaseline} cleaned=${cleaned} sizes=[${ordered.map((o) => `${o.areaId}:${o.sizeSqm}`).join(",")}] -> current=${currentArea} completed=[${completed.join(",")}]`
158407
+ );
158403
158408
  for (const id of completed) {
158404
158409
  s.completedAreas.add(id);
158405
158410
  }
@@ -159125,7 +159130,7 @@ function buildValetudoSegmentAction(vacuumEntityId, segmentIds, valetudoIdentifi
159125
159130
  }
159126
159131
  };
159127
159132
  }
159128
- function buildSupportedModes2(attributes8, includeUnnamedRooms = false, customAreas) {
159133
+ function buildSupportedModes2(attributes8, includeUnnamedRooms = false, customAreas, disableRoomModes = false) {
159129
159134
  const modes = [
159130
159135
  {
159131
159136
  label: "Idle",
@@ -159139,17 +159144,19 @@ function buildSupportedModes2(attributes8, includeUnnamedRooms = false, customAr
159139
159144
  }
159140
159145
  ];
159141
159146
  if (customAreas && customAreas.length > 0) {
159142
- const sorted = [...customAreas].sort(
159143
- (a, b) => a.name.localeCompare(b.name)
159144
- );
159145
- for (let i = 0; i < sorted.length; i++) {
159146
- const modeValue = ROOM_MODE_BASE2 + i + 1;
159147
- if (modeValue > 255) continue;
159148
- modes.push({
159149
- label: sorted[i].name,
159150
- mode: modeValue,
159151
- modeTags: [{ value: RvcRunMode3.ModeTag.Cleaning }]
159152
- });
159147
+ if (!disableRoomModes) {
159148
+ const sorted = [...customAreas].sort(
159149
+ (a, b) => a.name.localeCompare(b.name)
159150
+ );
159151
+ for (let i = 0; i < sorted.length; i++) {
159152
+ const modeValue = ROOM_MODE_BASE2 + i + 1;
159153
+ if (modeValue > 255) continue;
159154
+ modes.push({
159155
+ label: sorted[i].name,
159156
+ mode: modeValue,
159157
+ modeTags: [{ value: RvcRunMode3.ModeTag.Cleaning }]
159158
+ });
159159
+ }
159153
159160
  }
159154
159161
  } else {
159155
159162
  const rooms = parseVacuumRooms(attributes8, includeUnnamedRooms);
@@ -159282,11 +159289,13 @@ var vacuumRvcRunModeConfig = {
159282
159289
  },
159283
159290
  getSupportedModes: (entity, agent) => {
159284
159291
  const attributes8 = entity.attributes;
159285
- const customAreas = agent.get(HomeAssistantEntityBehavior).state.mapping?.customServiceAreas;
159292
+ const mapping = agent.get(HomeAssistantEntityBehavior).state.mapping;
159293
+ const customAreas = mapping?.customServiceAreas;
159286
159294
  return buildSupportedModes2(
159287
159295
  attributes8,
159288
159296
  false,
159289
- customAreas && customAreas.length > 0 ? customAreas : void 0
159297
+ customAreas && customAreas.length > 0 ? customAreas : void 0,
159298
+ mapping?.disableCustomAreaRoomModes
159290
159299
  );
159291
159300
  },
159292
159301
  // biome-ignore lint/suspicious/noConfusingVoidType: Required by ValueSetter<void> interface
@@ -159543,14 +159552,15 @@ var vacuumRvcRunModeConfig = {
159543
159552
  return { action: "vacuum.start" };
159544
159553
  }
159545
159554
  };
159546
- function createVacuumRvcRunModeServer(attributes8, includeUnnamedRooms = false, customAreas) {
159555
+ function createVacuumRvcRunModeServer(attributes8, includeUnnamedRooms = false, customAreas, disableRoomModes = false) {
159547
159556
  const allRooms = parseVacuumRooms(attributes8, true);
159548
159557
  const rooms = includeUnnamedRooms ? allRooms : parseVacuumRooms(attributes8, false);
159549
159558
  const filteredCount = allRooms.length - rooms.length;
159550
159559
  const supportedModes = buildSupportedModes2(
159551
159560
  attributes8,
159552
159561
  includeUnnamedRooms,
159553
- customAreas
159562
+ customAreas,
159563
+ disableRoomModes
159554
159564
  );
159555
159565
  logger220.info(
159556
159566
  `Creating VacuumRvcRunModeServer with ${rooms.length} rooms, ${supportedModes.length} total modes`
@@ -160603,7 +160613,8 @@ function VacuumDevice(homeAssistantEntity, includeOnOff = false, cleaningModeOpt
160603
160613
  cleanAreaRooms && cleanAreaRooms.length > 0 ? createCleanAreaRvcRunModeServer(cleanAreaRooms) : createVacuumRvcRunModeServer(
160604
160614
  attributes8,
160605
160615
  false,
160606
- customAreas && customAreas.length > 0 ? customAreas : void 0
160616
+ customAreas && customAreas.length > 0 ? customAreas : void 0,
160617
+ homeAssistantEntity.mapping?.disableCustomAreaRoomModes
160607
160618
  )
160608
160619
  ).set({ homeAssistantEntity });
160609
160620
  if (includeOnOff) {
@@ -163796,7 +163807,8 @@ function ServerModeVacuumDevice(homeAssistantEntity, includeOnOff = false, clean
163796
163807
  cleanAreaRooms && cleanAreaRooms.length > 0 ? createCleanAreaRvcRunModeServer(cleanAreaRooms) : createVacuumRvcRunModeServer(
163797
163808
  attributes8,
163798
163809
  false,
163799
- customAreas && customAreas.length > 0 ? customAreas : void 0
163810
+ customAreas && customAreas.length > 0 ? customAreas : void 0,
163811
+ homeAssistantEntity.mapping?.disableCustomAreaRoomModes
163800
163812
  )
163801
163813
  ).set({ homeAssistantEntity });
163802
163814
  if (includeOnOff) {