Skip to content

Commit

Permalink
fix: Only include custom integrations in diagnostics (#1765)
Browse files Browse the repository at this point in the history
  • Loading branch information
dermotduffy authored Dec 16, 2024
1 parent dab9ff3 commit 9f4ddb1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 29 deletions.
8 changes: 2 additions & 6 deletions src/utils/diagnostics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
}

Expand Down Expand Up @@ -113,16 +111,14 @@ 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 && {
devices: Object.fromEntries(frigateVersionMap),
}),
},
hass_web_proxy: await getIntegrationDiagnostics(HASS_WEB_PROXY_DOMAIN, hass),
motioneye: await getIntegrationDiagnostics('motioneye', hass),
},
...(rawConfig && { config: rawConfig }),
};
Expand Down
26 changes: 3 additions & 23 deletions tests/utils/diagnostics.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand All @@ -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',
Expand Down Expand Up @@ -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',
Expand All @@ -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,
Expand Down

0 comments on commit 9f4ddb1

Please sign in to comment.