From 9f4ddb1e88faecc9a25e1180ae610fd5cff9e5ce Mon Sep 17 00:00:00 2001 From: Dermot Duffy Date: Sun, 15 Dec 2024 20:56:36 -0800 Subject: [PATCH] fix: Only include custom integrations in diagnostics (#1765) --- src/utils/diagnostics.ts | 8 ++------ tests/utils/diagnostics.test.ts | 26 +++----------------------- 2 files changed, 5 insertions(+), 29 deletions(-) diff --git a/src/utils/diagnostics.ts b/src/utils/diagnostics.ts index 5b6c4e46..a3ab2a4c 100644 --- a/src/utils/diagnostics.ts +++ b/src/utils/diagnostics.ts @@ -47,13 +47,11 @@ export interface Diagnostics { ha_version?: string; config?: RawFrigateCardConfig; - integrations: { + custom_integrations: { frigate: IntegrationDiagnostics & { devices?: FrigateDevices; }; hass_web_proxy: IntegrationDiagnostics; - reolink: IntegrationDiagnostics; - motioneye: IntegrationDiagnostics; }; } @@ -113,8 +111,7 @@ export const getDiagnostics = async ( ...(pkg['gitDate'] && { commit_date: pkg['gitDate'] }), }, ...(hass && { ha_version: hass.config.version }), - integrations: { - reolink: await getIntegrationDiagnostics('reolink', hass), + custom_integrations: { frigate: { ...(await getIntegrationDiagnostics('frigate', hass)), ...(frigateVersionMap.size && { @@ -122,7 +119,6 @@ export const getDiagnostics = async ( }), }, hass_web_proxy: await getIntegrationDiagnostics(HASS_WEB_PROXY_DOMAIN, hass), - motioneye: await getIntegrationDiagnostics('motioneye', hass), }, ...(rawConfig && { config: rawConfig }), }; diff --git a/tests/utils/diagnostics.test.ts b/tests/utils/diagnostics.test.ts index 840f9dff..c596df0d 100644 --- a/tests/utils/diagnostics.test.ts +++ b/tests/utils/diagnostics.test.ts @@ -86,7 +86,7 @@ describe('getDiagnostics', () => { commit_date: 'Wed, 6 Sep 2023 21:27:28 -0700', hash: 'g4cf13b1', }, - integrations: { + custom_integrations: { frigate: { detected: true, devices: { @@ -99,14 +99,6 @@ describe('getDiagnostics', () => { detected: true, version: '0.0.1', }, - motioneye: { - detected: true, - version: '0.0.1', - }, - reolink: { - detected: true, - version: '0.0.1', - }, }, date: now, lang: 'en', @@ -145,19 +137,13 @@ describe('getDiagnostics', () => { commit_date: 'Wed, 6 Sep 2023 21:27:28 -0700', hash: 'g4cf13b1', }, - integrations: { + custom_integrations: { frigate: { detected: false, }, hass_web_proxy: { detected: false, }, - motioneye: { - detected: false, - }, - reolink: { - detected: false, - }, }, date: now, lang: 'en', @@ -177,19 +163,13 @@ describe('getDiagnostics', () => { commit_date: 'Wed, 6 Sep 2023 21:27:28 -0700', hash: 'g4cf13b1', }, - integrations: { + custom_integrations: { frigate: { detected: false, }, hass_web_proxy: { detected: false, }, - motioneye: { - detected: false, - }, - reolink: { - detected: false, - }, }, ha_version: '2023.9.0', date: now,