fix: Only include custom integrations in diagnostics (#1765)

This commit is contained in:
Dermot Duffy
2024-12-15 20:56:36 -08:00
committed by GitHub
parent dab9ff3045
commit 9f4ddb1e88
2 changed files with 5 additions and 29 deletions
+2 -6
View File
@@ -47,13 +47,11 @@ export interface Diagnostics {
ha_version?: string; ha_version?: string;
config?: RawFrigateCardConfig; config?: RawFrigateCardConfig;
integrations: { custom_integrations: {
frigate: IntegrationDiagnostics & { frigate: IntegrationDiagnostics & {
devices?: FrigateDevices; devices?: FrigateDevices;
}; };
hass_web_proxy: IntegrationDiagnostics; hass_web_proxy: IntegrationDiagnostics;
reolink: IntegrationDiagnostics;
motioneye: IntegrationDiagnostics;
}; };
} }
@@ -113,8 +111,7 @@ export const getDiagnostics = async (
...(pkg['gitDate'] && { commit_date: pkg['gitDate'] }), ...(pkg['gitDate'] && { commit_date: pkg['gitDate'] }),
}, },
...(hass && { ha_version: hass.config.version }), ...(hass && { ha_version: hass.config.version }),
integrations: { custom_integrations: {
reolink: await getIntegrationDiagnostics('reolink', hass),
frigate: { frigate: {
...(await getIntegrationDiagnostics('frigate', hass)), ...(await getIntegrationDiagnostics('frigate', hass)),
...(frigateVersionMap.size && { ...(frigateVersionMap.size && {
@@ -122,7 +119,6 @@ export const getDiagnostics = async (
}), }),
}, },
hass_web_proxy: await getIntegrationDiagnostics(HASS_WEB_PROXY_DOMAIN, hass), hass_web_proxy: await getIntegrationDiagnostics(HASS_WEB_PROXY_DOMAIN, hass),
motioneye: await getIntegrationDiagnostics('motioneye', hass),
}, },
...(rawConfig && { config: rawConfig }), ...(rawConfig && { config: rawConfig }),
}; };
+3 -23
View File
@@ -86,7 +86,7 @@ describe('getDiagnostics', () => {
commit_date: 'Wed, 6 Sep 2023 21:27:28 -0700', commit_date: 'Wed, 6 Sep 2023 21:27:28 -0700',
hash: 'g4cf13b1', hash: 'g4cf13b1',
}, },
integrations: { custom_integrations: {
frigate: { frigate: {
detected: true, detected: true,
devices: { devices: {
@@ -99,14 +99,6 @@ describe('getDiagnostics', () => {
detected: true, detected: true,
version: '0.0.1', version: '0.0.1',
}, },
motioneye: {
detected: true,
version: '0.0.1',
},
reolink: {
detected: true,
version: '0.0.1',
},
}, },
date: now, date: now,
lang: 'en', lang: 'en',
@@ -145,19 +137,13 @@ describe('getDiagnostics', () => {
commit_date: 'Wed, 6 Sep 2023 21:27:28 -0700', commit_date: 'Wed, 6 Sep 2023 21:27:28 -0700',
hash: 'g4cf13b1', hash: 'g4cf13b1',
}, },
integrations: { custom_integrations: {
frigate: { frigate: {
detected: false, detected: false,
}, },
hass_web_proxy: { hass_web_proxy: {
detected: false, detected: false,
}, },
motioneye: {
detected: false,
},
reolink: {
detected: false,
},
}, },
date: now, date: now,
lang: 'en', lang: 'en',
@@ -177,19 +163,13 @@ describe('getDiagnostics', () => {
commit_date: 'Wed, 6 Sep 2023 21:27:28 -0700', commit_date: 'Wed, 6 Sep 2023 21:27:28 -0700',
hash: 'g4cf13b1', hash: 'g4cf13b1',
}, },
integrations: { custom_integrations: {
frigate: { frigate: {
detected: false, detected: false,
}, },
hass_web_proxy: { hass_web_proxy: {
detected: false, detected: false,
}, },
motioneye: {
detected: false,
},
reolink: {
detected: false,
},
}, },
ha_version: '2023.9.0', ha_version: '2023.9.0',
date: now, date: now,