Add git information to diagnostics
This commit is contained in:
+8
-3
@@ -39,7 +39,6 @@ import './components/viewer.js';
|
||||
import { isConfigUpgradeable } from './config-mgmt.js';
|
||||
import {
|
||||
CAMERA_BIRDSEYE,
|
||||
CARD_VERSION,
|
||||
MEDIA_PLAYER_SUPPORT_BROWSE_MEDIA,
|
||||
REPO_URL,
|
||||
} from './const.js';
|
||||
@@ -98,6 +97,7 @@ import { ResolvedMediaCache } from './utils/ha/resolved-media.js';
|
||||
import { supportsFeature } from './utils/ha/update.js';
|
||||
import { isValidMediaShowInfo } from './utils/media-info.js';
|
||||
import { View } from './view.js';
|
||||
import pkg from '../package.json';
|
||||
|
||||
/** A note on media callbacks:
|
||||
*
|
||||
@@ -127,7 +127,7 @@ import { View } from './view.js';
|
||||
|
||||
/* eslint no-console: 0 */
|
||||
console.info(
|
||||
`%c FRIGATE-HASS-CARD \n%c ${localize('common.version')} ${CARD_VERSION} `,
|
||||
`%c FRIGATE-HASS-CARD \n%c ${localize('common.version')} ${pkg.version} `,
|
||||
'color: pink; font-weight: bold; background: black',
|
||||
'color: white; font-weight: bold; background: dimgray',
|
||||
);
|
||||
@@ -1385,11 +1385,16 @@ export class FrigateCard extends LitElement {
|
||||
icon: 'mdi:information',
|
||||
context: {
|
||||
ha_version: this._hass.config.version,
|
||||
card_version: CARD_VERSION,
|
||||
card_version: pkg.version,
|
||||
browser: navigator.userAgent,
|
||||
date: new Date(),
|
||||
frigate_version: Object.fromEntries(frigateVersionMap),
|
||||
lang: getLanguage(),
|
||||
git: {
|
||||
...(pkg['gitVersion'] && { build_version: pkg['gitVersion'] }),
|
||||
...(pkg['buildDate'] && { build_date: pkg['buildDate'] }),
|
||||
...(pkg['gitDate'] && { commit_date: pkg['gitDate'] }),
|
||||
},
|
||||
...(this._rawConfig && { config: this._rawConfig }),
|
||||
},
|
||||
});
|
||||
|
||||
+7
-6
@@ -1,5 +1,3 @@
|
||||
export const CARD_VERSION = '4.0.0-rc.1' as const;
|
||||
|
||||
export const CAMERA_BIRDSEYE = 'birdseye' as const;
|
||||
export const REPO_URL = 'https://github.com/dermotduffy/frigate-hass-card' as const;
|
||||
export const TROUBLESHOOTING_URL = `${REPO_URL}#troubleshooting` as const;
|
||||
@@ -7,9 +5,12 @@ export const TROUBLESHOOTING_URL = `${REPO_URL}#troubleshooting` as const;
|
||||
export const CONF_CAMERAS = 'cameras' as const;
|
||||
export const CONF_CAMERAS_ARRAY_CAMERA_ENTITY =
|
||||
`${CONF_CAMERAS}.#.camera_entity` as const;
|
||||
export const CONF_CAMERAS_ARRAY_FRIGATE_CAMERA_NAME = `${CONF_CAMERAS}.#.frigate.camera_name` as const;
|
||||
export const CONF_CAMERAS_ARRAY_FRIGATE_CLIENT_ID = `${CONF_CAMERAS}.#.frigate.client_id` as const;
|
||||
export const CONF_CAMERAS_ARRAY_FRIGATE_LABEL = `${CONF_CAMERAS}.#.frigate.label` as const;
|
||||
export const CONF_CAMERAS_ARRAY_FRIGATE_CAMERA_NAME =
|
||||
`${CONF_CAMERAS}.#.frigate.camera_name` as const;
|
||||
export const CONF_CAMERAS_ARRAY_FRIGATE_CLIENT_ID =
|
||||
`${CONF_CAMERAS}.#.frigate.client_id` as const;
|
||||
export const CONF_CAMERAS_ARRAY_FRIGATE_LABEL =
|
||||
`${CONF_CAMERAS}.#.frigate.label` as const;
|
||||
export const CONF_CAMERAS_ARRAY_FRIGATE_URL = `${CONF_CAMERAS}.#.frigate.url` as const;
|
||||
export const CONF_CAMERAS_ARRAY_FRIGATE_ZONE = `${CONF_CAMERAS}.#.frigate.zone` as const;
|
||||
export const CONF_CAMERAS_ARRAY_ID = `${CONF_CAMERAS}.#.id` as const;
|
||||
@@ -23,7 +24,7 @@ export const CONF_CAMERAS_ARRAY_LIVE_PROVIDER =
|
||||
`${CONF_CAMERAS}.#.live_provider` as const;
|
||||
export const CONF_CAMERAS_ARRAY_DEPENDENCIES_CAMERAS =
|
||||
`${CONF_CAMERAS}.#.dependencies.cameras` as const;
|
||||
export const CONF_CAMERAS_ARRAY_DEPENDENCIES_ALL_CAMERAS =
|
||||
export const CONF_CAMERAS_ARRAY_DEPENDENCIES_ALL_CAMERAS =
|
||||
`${CONF_CAMERAS}.#.dependencies.all_cameras` as const;
|
||||
export const CONF_CAMERAS_ARRAY_TRIGGERS_MOTION =
|
||||
`${CONF_CAMERAS}.#.triggers.motion` as const;
|
||||
|
||||
Reference in New Issue
Block a user