feat: Add new casting profile (#1575)

* feat: Add new `casting` profile

* Set some additional flags for casting
This commit is contained in:
Dermot Duffy
2024-09-23 20:24:35 -07:00
committed by GitHub
parent d203f529f8
commit 1e0a990855
12 changed files with 78 additions and 6 deletions
+23
View File
@@ -0,0 +1,23 @@
import {
CONF_CAMERAS_GLOBAL_IMAGE_REFRESH_SECONDS,
CONF_DIMENSIONS_ASPECT_RATIO,
CONF_LIVE_AUTO_UNMUTE,
CONF_LIVE_CONTROLS_BUILTIN,
CONF_LIVE_SHOW_IMAGE_DURING_LOAD,
CONF_MEDIA_VIEWER_CONTROLS_BUILTIN,
CONF_MENU_STYLE,
} from '../../const.js';
export const CASTING_PROFILE = {
[CONF_MENU_STYLE]: 'none' as const,
[CONF_LIVE_AUTO_UNMUTE]: ['selected', 'visible'],
[CONF_DIMENSIONS_ASPECT_RATIO]: '16:9',
[CONF_LIVE_CONTROLS_BUILTIN]: false,
[CONF_MEDIA_VIEWER_CONTROLS_BUILTIN]: false,
// These values are defaults anyway unless another profile (e.g.
// low-performance) is also selected, but at pretty important to a good
// experience so are reset here.
[CONF_CAMERAS_GLOBAL_IMAGE_REFRESH_SECONDS]: 1,
[CONF_LIVE_SHOW_IMAGE_DURING_LOAD]: true,
};
+3 -1
View File
@@ -1,10 +1,12 @@
import { deepRemoveDefaults } from '../../utils/zod.js';
import { getConfigValue, setConfigValue } from '../management.js';
import { ProfileType, RawFrigateCardConfig, frigateCardConfigSchema } from '../types.js';
import { deepRemoveDefaults } from '../../utils/zod.js';
import { CASTING_PROFILE } from './casting.js';
import { LOW_PERFORMANCE_PROFILE } from './low-performance.js';
import { SCRUBBING_PROFILE } from './scrubbing.js';
const PROFILES = {
casting: CASTING_PROFILE,
'low-performance': LOW_PERFORMANCE_PROFILE,
scrubbing: SCRUBBING_PROFILE,
};
+1 -1
View File
@@ -1973,7 +1973,7 @@ export interface CardWideConfig {
// *************************************************************************
// *** Profile Configuration ***
// *************************************************************************
const PROFILES = ['low-performance', 'scrubbing'] as const;
const PROFILES = ['casting', 'low-performance', 'scrubbing'] as const;
export type ProfileType = (typeof PROFILES)[number];
export const profilesSchema = z.enum(PROFILES).array().optional();
+1
View File
@@ -611,6 +611,7 @@ export class FrigateCardEditor extends LitElement implements LovelaceCardEditor
protected _profiles: EditorSelectOption[] = [
{ value: '', label: '' },
{ value: 'casting', label: localize('config.profiles.casting') },
{ value: 'low-performance', label: localize('config.profiles.low-performance') },
{ value: 'scrubbing', label: localize('config.profiles.scrubbing') },
];
+1
View File
@@ -413,6 +413,7 @@
"warning": "Aquesta targeta està en mode de perfil baix, de manera que els valors predeterminats han canviat per optimitzar el rendiment"
},
"profiles": {
"casting": "",
"editor_label": "",
"low-performance": "",
"scrubbing": ""
+1
View File
@@ -413,6 +413,7 @@
"warning": "This card is in low profile mode so defaults have changed to optimize performance"
},
"profiles": {
"casting": "Casting",
"editor_label": "Configuration profiles",
"low-performance": "Low performance",
"scrubbing": "Video scrubbing"
+1
View File
@@ -413,6 +413,7 @@
"warning": "Cette carte est en mode profil bas, les paramètres par défaut ont donc été modifiés pour optimiser les performances."
},
"profiles": {
"casting": "",
"editor_label": "Configuration des profils",
"low-performance": "Basse performance",
"scrubbing": "Balayage vidéo"
+1
View File
@@ -413,6 +413,7 @@
"warning": "Questa scheda è in modalità basso profilo, quindi le impostazioni predefinite sono state modificate per ottimizzare le prestazioni"
},
"profiles": {
"casting": "",
"editor_label": "",
"low-performance": "",
"scrubbing": ""
+1
View File
@@ -413,6 +413,7 @@
"warning": "Este cartão está no modo de baixo desempenho, então os padrões foram alterados para otimizar o desempenho"
},
"profiles": {
"casting": "",
"editor_label": "",
"low-performance": "",
"scrubbing": ""
+1
View File
@@ -413,6 +413,7 @@
"warning": "Avisos"
},
"profiles": {
"casting": "",
"editor_label": "",
"low-performance": "",
"scrubbing": ""