@riddix/hamh 2.1.0-alpha.751 → 2.1.0-alpha.752

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.
@@ -124617,6 +124617,43 @@ var init_endpoint_data = __esm({
124617
124617
  }
124618
124618
  });
124619
124619
 
124620
+ // ../common/dist/entity-diagnostics.js
124621
+ function buildEntityDiagnostics(exposed, failed, warnings) {
124622
+ const result = failed.map((f) => ({
124623
+ entityId: f.entityId,
124624
+ status: "failed",
124625
+ reason: f.reason
124626
+ }));
124627
+ const failedIds = new Set(failed.map((f) => f.entityId));
124628
+ const issuesByEntity = /* @__PURE__ */ new Map();
124629
+ for (const w of warnings) {
124630
+ const list3 = issuesByEntity.get(w.entityId) ?? [];
124631
+ list3.push({
124632
+ controller: w.controller,
124633
+ controllerLabel: w.controllerLabel,
124634
+ note: w.note
124635
+ });
124636
+ issuesByEntity.set(w.entityId, list3);
124637
+ }
124638
+ for (const e of exposed) {
124639
+ if (failedIds.has(e.entityId))
124640
+ continue;
124641
+ const issues = issuesByEntity.get(e.entityId);
124642
+ result.push({
124643
+ entityId: e.entityId,
124644
+ deviceTypeId: e.deviceTypeId,
124645
+ status: issues && issues.length > 0 ? "limited" : "ok",
124646
+ ...issues && issues.length > 0 ? { unsupportedBy: issues } : {}
124647
+ });
124648
+ }
124649
+ return result;
124650
+ }
124651
+ var init_entity_diagnostics = __esm({
124652
+ "../common/dist/entity-diagnostics.js"() {
124653
+ "use strict";
124654
+ }
124655
+ });
124656
+
124620
124657
  // ../common/dist/entity-mapping.js
124621
124658
  var init_entity_mapping = __esm({
124622
124659
  "../common/dist/entity-mapping.js"() {
@@ -125249,6 +125286,7 @@ var init_dist = __esm({
125249
125286
  init_diagnostic_event();
125250
125287
  init_domains();
125251
125288
  init_endpoint_data();
125289
+ init_entity_diagnostics();
125252
125290
  init_entity_mapping();
125253
125291
  init_home_assistant_area_registry();
125254
125292
  init_home_assistant_device_registry();
@@ -127081,12 +127119,18 @@ function healthApi(bridgeService, haClient, version2, startTime) {
127081
127119
  const data = b.data;
127082
127120
  const fabrics = data.commissioning?.fabrics ?? [];
127083
127121
  const sessionInfo = b.getSessionInfo();
127122
+ const exposed = b.getExposedDeviceTypes();
127084
127123
  const controllers = [
127085
127124
  ...new Set(
127086
127125
  fabrics.map((f) => classifyController(f.rootVendorId)).filter((c) => c !== void 0)
127087
127126
  )
127088
127127
  ];
127089
- const controllerWarnings = controllers.length > 0 ? computeControllerWarnings(controllers, b.getExposedDeviceTypes()) : [];
127128
+ const controllerWarnings = controllers.length > 0 ? computeControllerWarnings(controllers, exposed) : [];
127129
+ const entityDiagnostics = buildEntityDiagnostics(
127130
+ exposed,
127131
+ data.failedEntities ?? [],
127132
+ controllerWarnings
127133
+ );
127090
127134
  return {
127091
127135
  id: data.id,
127092
127136
  name: data.name,
@@ -127106,6 +127150,7 @@ function healthApi(bridgeService, haClient, version2, startTime) {
127106
127150
  })),
127107
127151
  failedEntityCount: data.failedEntities?.length ?? 0,
127108
127152
  controllerWarnings,
127153
+ entityDiagnostics,
127109
127154
  connectivity: {
127110
127155
  totalSessions: sessionInfo.totalSessions,
127111
127156
  totalSubscriptions: sessionInfo.totalSubscriptions,