@riddix/hamh 2.1.0-alpha.514 → 2.1.0-alpha.516

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.
@@ -178731,6 +178731,9 @@ var BridgeEndpointManager = class extends Service {
178731
178731
  this.log.debug(`Skipping disabled entity: ${entityId}`);
178732
178732
  continue;
178733
178733
  }
178734
+ if (this.registry.isAutoComposedDevicesEnabled() && this.registry.isComposedSubEntityUsed(entityId)) {
178735
+ continue;
178736
+ }
178734
178737
  if (entityId.length > MAX_ENTITY_ID_LENGTH) {
178735
178738
  const reason = `Entity ID too long (${entityId.length} chars, max ${MAX_ENTITY_ID_LENGTH}). This would cause filesystem errors.`;
178736
178739
  this.log.warn(`Skipping entity: ${entityId}. Reason: ${reason}`);
@@ -179203,6 +179206,23 @@ var BridgeRegistry = class _BridgeRegistry {
179203
179206
  );
179204
179207
  return [];
179205
179208
  }
179209
+ let validSegmentIds;
179210
+ try {
179211
+ const segmentsResponse = await this.client.connection.sendMessagePromise({
179212
+ type: "vacuum/get_segments",
179213
+ entity_id: entityId
179214
+ });
179215
+ if (Array.isArray(segmentsResponse)) {
179216
+ validSegmentIds = new Set(segmentsResponse.map((s) => s.id));
179217
+ _BridgeRegistry.cleanAreaLogger.debug(
179218
+ `${entityId}: Current vacuum segments: ${[...validSegmentIds].join(", ")}`
179219
+ );
179220
+ }
179221
+ } catch {
179222
+ _BridgeRegistry.cleanAreaLogger.debug(
179223
+ `${entityId}: vacuum/get_segments not available, skipping stale entry detection`
179224
+ );
179225
+ }
179206
179226
  const rooms = [];
179207
179227
  for (const haAreaId of Object.keys(areaMapping)) {
179208
179228
  const segments = areaMapping[haAreaId];
@@ -179212,6 +179232,13 @@ var BridgeRegistry = class _BridgeRegistry {
179212
179232
  );
179213
179233
  continue;
179214
179234
  }
179235
+ if (validSegmentIds && !segments.some((sid) => validSegmentIds.has(sid))) {
179236
+ const areaName2 = this.registry.areas.get(haAreaId) ?? haAreaId;
179237
+ _BridgeRegistry.cleanAreaLogger.info(
179238
+ `${entityId}: Skipping stale HA area "${areaName2}" (${haAreaId}) \u2014 segments [${segments.join(", ")}] no longer exist on vacuum`
179239
+ );
179240
+ continue;
179241
+ }
179215
179242
  const areaName = this.registry.areas.get(haAreaId) ?? haAreaId;
179216
179243
  rooms.push({
179217
179244
  areaId: hashAreaId(haAreaId),