feat: Add 'doorbell' configuration profile (#2511)
This commit is contained in:
committed by
dermotduffy
parent
ef9c9c8d5c
commit
406176eebc
@@ -229,7 +229,9 @@ export class CameraManager {
|
||||
}
|
||||
|
||||
const hasAutoTriggers = (config: CameraConfig): boolean => {
|
||||
return config.triggers.motion || config.triggers.occupancy;
|
||||
return (
|
||||
config.triggers.motion || config.triggers.occupancy || config.triggers.doorbell
|
||||
);
|
||||
};
|
||||
|
||||
if (
|
||||
|
||||
@@ -30,9 +30,6 @@ export const CASTING_PROFILE = {
|
||||
[CONF_DIMENSIONS_ASPECT_RATIO_MODE]: 'static',
|
||||
[CONF_DIMENSIONS_ASPECT_RATIO]: '16:9',
|
||||
|
||||
// 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,
|
||||
};
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
import {
|
||||
CONF_CAMERAS_GLOBAL_TRIGGERS_DOORBELL,
|
||||
CONF_VIEW_TRIGGERS_ACTIONS_INTERACTION_MODE,
|
||||
CONF_VIEW_TRIGGERS_ACTIONS_TRIGGER,
|
||||
CONF_VIEW_TRIGGERS_ACTIONS_UNTRIGGER,
|
||||
CONF_VIEW_TRIGGERS_SHOW_TRIGGER_STATUS,
|
||||
} from '../../const.js';
|
||||
|
||||
export const DOORBELL_PROFILE = {
|
||||
// Auto-discover HA `event.*` entities with `device_class: doorbell` on each
|
||||
// camera's device (Ring, UniFi Protect, Nest, DoorBird, Reolink, ...).
|
||||
[CONF_CAMERAS_GLOBAL_TRIGGERS_DOORBELL]: true,
|
||||
|
||||
// Pulse the camera border while the doorbell is ringing.
|
||||
[CONF_VIEW_TRIGGERS_SHOW_TRIGGER_STATUS]: true,
|
||||
|
||||
// Triggers cause calls to start and end.
|
||||
[CONF_VIEW_TRIGGERS_ACTIONS_TRIGGER]: 'call' as const,
|
||||
[CONF_VIEW_TRIGGERS_ACTIONS_UNTRIGGER]: 'call' as const,
|
||||
|
||||
// Ring even while the user is actively touching the dashboard.
|
||||
[CONF_VIEW_TRIGGERS_ACTIONS_INTERACTION_MODE]: 'all' as const,
|
||||
};
|
||||
@@ -1,31 +1,24 @@
|
||||
import {
|
||||
CONF_CAMERAS_GLOBAL_IMAGE_REFRESH_SECONDS,
|
||||
CONF_CAMERAS_GLOBAL_LIVE_PROVIDER,
|
||||
CONF_CAMERAS_GLOBAL_TRIGGERS_OCCUPANCY,
|
||||
CONF_LIVE_AUTO_MUTE,
|
||||
CONF_LIVE_CONTROLS_THUMBNAILS_MODE,
|
||||
CONF_LIVE_CONTROLS_THUMBNAILS_SHOW_DETAILS,
|
||||
CONF_LIVE_CONTROLS_THUMBNAILS_SHOW_DOWNLOAD_CONTROL,
|
||||
CONF_LIVE_CONTROLS_THUMBNAILS_SHOW_FAVORITE_CONTROL,
|
||||
CONF_LIVE_CONTROLS_THUMBNAILS_SHOW_TIMELINE_CONTROL,
|
||||
CONF_LIVE_CONTROLS_TIMELINE_SHOW_RECORDINGS,
|
||||
CONF_LIVE_DRAGGABLE,
|
||||
CONF_LIVE_LAZY_UNLOAD,
|
||||
CONF_LIVE_SHOW_IMAGE_DURING_LOAD,
|
||||
CONF_LIVE_TRANSITION_EFFECT,
|
||||
CONF_MEDIA_GALLERY_CONTROLS_THUMBNAILS_SHOW_DETAILS,
|
||||
CONF_MEDIA_GALLERY_CONTROLS_THUMBNAILS_SHOW_DOWNLOAD_CONTROL,
|
||||
CONF_MEDIA_GALLERY_CONTROLS_THUMBNAILS_SHOW_FAVORITE_CONTROL,
|
||||
CONF_MEDIA_GALLERY_CONTROLS_THUMBNAILS_SHOW_TIMELINE_CONTROL,
|
||||
CONF_MEDIA_VIEWER_AUTO_MUTE,
|
||||
CONF_MEDIA_VIEWER_AUTO_PAUSE,
|
||||
CONF_MEDIA_VIEWER_AUTO_PLAY,
|
||||
CONF_MEDIA_VIEWER_CONTROLS_NEXT_PREVIOUS_STYLE,
|
||||
CONF_MEDIA_VIEWER_CONTROLS_THUMBNAILS_MODE,
|
||||
CONF_MEDIA_VIEWER_CONTROLS_THUMBNAILS_SHOW_DETAILS,
|
||||
CONF_MEDIA_VIEWER_CONTROLS_THUMBNAILS_SHOW_DOWNLOAD_CONTROL,
|
||||
CONF_MEDIA_VIEWER_CONTROLS_THUMBNAILS_SHOW_FAVORITE_CONTROL,
|
||||
CONF_MEDIA_VIEWER_CONTROLS_THUMBNAILS_SHOW_TIMELINE_CONTROL,
|
||||
CONF_MEDIA_VIEWER_CONTROLS_TIMELINE_SHOW_RECORDINGS,
|
||||
CONF_MEDIA_VIEWER_DRAGGABLE,
|
||||
CONF_MEDIA_VIEWER_SNAPSHOT_CLICK_PLAYS_CLIP,
|
||||
@@ -44,9 +37,7 @@ import {
|
||||
CONF_STATUS_BAR_STYLE,
|
||||
CONF_TIMELINE_CONTROLS_THUMBNAILS_MODE,
|
||||
CONF_TIMELINE_CONTROLS_THUMBNAILS_SHOW_DETAILS,
|
||||
CONF_TIMELINE_CONTROLS_THUMBNAILS_SHOW_DOWNLOAD_CONTROL,
|
||||
CONF_TIMELINE_CONTROLS_THUMBNAILS_SHOW_FAVORITE_CONTROL,
|
||||
CONF_TIMELINE_CONTROLS_THUMBNAILS_SHOW_TIMELINE_CONTROL,
|
||||
CONF_TIMELINE_SHOW_RECORDINGS,
|
||||
CONF_VIEW_TRIGGERS_ACTIONS_TRIGGER,
|
||||
} from '../../const.js';
|
||||
@@ -94,28 +85,19 @@ export const LOW_PERFORMANCE_PROFILE = {
|
||||
// Hide several buttons that are otherwise visible by default.
|
||||
[`${CONF_MENU_BUTTONS_IRIS}.enabled`]: false,
|
||||
[`${CONF_MENU_BUTTONS_TIMELINE}.enabled`]: false,
|
||||
[`${CONF_MENU_BUTTONS_TIMELINE}.enabled`]: false,
|
||||
|
||||
// If the media player button is present media player entity fetches are
|
||||
// required on initialization.
|
||||
[`${CONF_MENU_BUTTONS_MEDIA_PLAYER}.enabled`]: false,
|
||||
|
||||
// Disable all options in thumbnails.
|
||||
[CONF_MEDIA_GALLERY_CONTROLS_THUMBNAILS_SHOW_DOWNLOAD_CONTROL]: false,
|
||||
// Disable thumbnail controls that are otherwise on by default.
|
||||
[CONF_MEDIA_GALLERY_CONTROLS_THUMBNAILS_SHOW_FAVORITE_CONTROL]: false,
|
||||
[CONF_MEDIA_GALLERY_CONTROLS_THUMBNAILS_SHOW_TIMELINE_CONTROL]: false,
|
||||
[CONF_MEDIA_GALLERY_CONTROLS_THUMBNAILS_SHOW_DETAILS]: false,
|
||||
[CONF_LIVE_CONTROLS_THUMBNAILS_SHOW_DOWNLOAD_CONTROL]: false,
|
||||
[CONF_LIVE_CONTROLS_THUMBNAILS_SHOW_FAVORITE_CONTROL]: false,
|
||||
[CONF_LIVE_CONTROLS_THUMBNAILS_SHOW_TIMELINE_CONTROL]: false,
|
||||
[CONF_LIVE_CONTROLS_THUMBNAILS_SHOW_DETAILS]: false,
|
||||
[CONF_MEDIA_VIEWER_CONTROLS_THUMBNAILS_SHOW_DOWNLOAD_CONTROL]: false,
|
||||
[CONF_MEDIA_VIEWER_CONTROLS_THUMBNAILS_SHOW_FAVORITE_CONTROL]: false,
|
||||
[CONF_MEDIA_VIEWER_CONTROLS_THUMBNAILS_SHOW_TIMELINE_CONTROL]: false,
|
||||
[CONF_MEDIA_VIEWER_CONTROLS_THUMBNAILS_SHOW_DETAILS]: false,
|
||||
[CONF_TIMELINE_CONTROLS_THUMBNAILS_SHOW_DOWNLOAD_CONTROL]: false,
|
||||
[CONF_TIMELINE_CONTROLS_THUMBNAILS_SHOW_FAVORITE_CONTROL]: false,
|
||||
[CONF_TIMELINE_CONTROLS_THUMBNAILS_SHOW_TIMELINE_CONTROL]: false,
|
||||
[CONF_TIMELINE_CONTROLS_THUMBNAILS_SHOW_DETAILS]: false,
|
||||
|
||||
// Disable all optional performance related features.
|
||||
@@ -133,7 +115,6 @@ export const LOW_PERFORMANCE_PROFILE = {
|
||||
// Clicking on a snapshot should not play a clip.
|
||||
[CONF_MEDIA_VIEWER_SNAPSHOT_CLICK_PLAYS_CLIP]: false,
|
||||
|
||||
[CONF_CAMERAS_GLOBAL_TRIGGERS_OCCUPANCY]: false,
|
||||
[CONF_CAMERAS_GLOBAL_LIVE_PROVIDER]: 'image',
|
||||
|
||||
// Refresh the live camera image every 10 seconds (same as stock Home
|
||||
|
||||
@@ -4,11 +4,13 @@ import { ProfileType } from '../schema/profiles.js';
|
||||
import { advancedCameraCardConfigSchema } from '../schema/types.js';
|
||||
import { RawAdvancedCameraCardConfig } from '../types.js';
|
||||
import { CASTING_PROFILE } from './casting.js';
|
||||
import { DOORBELL_PROFILE } from './doorbell.js';
|
||||
import { LOW_PERFORMANCE_PROFILE } from './low-performance.js';
|
||||
import { SCRUBBING_PROFILE } from './scrubbing.js';
|
||||
|
||||
const PROFILES = {
|
||||
casting: CASTING_PROFILE,
|
||||
doorbell: DOORBELL_PROFILE,
|
||||
'low-performance': LOW_PERFORMANCE_PROFILE,
|
||||
scrubbing: SCRUBBING_PROFILE,
|
||||
};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
const PROFILES = ['casting', 'low-performance', 'scrubbing'] as const;
|
||||
const PROFILES = ['casting', 'doorbell', 'low-performance', 'scrubbing'] as const;
|
||||
export type ProfileType = (typeof PROFILES)[number];
|
||||
export const profilesSchema = z.enum(PROFILES).array().optional();
|
||||
|
||||
+2
-2
@@ -132,8 +132,8 @@ export const CONF_CAMERAS_ARRAY_MEDIA_FOLDERS =
|
||||
const CONF_CAMERAS_GLOBAL = 'cameras_global' as const;
|
||||
export const CONF_CAMERAS_GLOBAL_LIVE_PROVIDER =
|
||||
`${CONF_CAMERAS_GLOBAL}.live_provider` as const;
|
||||
export const CONF_CAMERAS_GLOBAL_TRIGGERS_OCCUPANCY =
|
||||
`${CONF_CAMERAS_GLOBAL}.triggers.occupancy` as const;
|
||||
export const CONF_CAMERAS_GLOBAL_TRIGGERS_DOORBELL =
|
||||
`${CONF_CAMERAS_GLOBAL}.triggers.doorbell` as const;
|
||||
export const CONF_CAMERAS_GLOBAL_IMAGE_REFRESH_SECONDS =
|
||||
`${CONF_CAMERAS_GLOBAL}.image.refresh_seconds` as const;
|
||||
export const CONF_CAMERAS_GLOBAL_DIMENSIONS_LAYOUT =
|
||||
|
||||
@@ -850,6 +850,7 @@ export class AdvancedCameraCardEditor extends LitElement implements LovelaceCard
|
||||
private _profiles: EditorSelectOption[] = [
|
||||
{ value: '', label: '' },
|
||||
{ value: 'casting', label: localize('config.profiles.casting') },
|
||||
{ value: 'doorbell', label: localize('config.profiles.doorbell') },
|
||||
{ value: 'low-performance', label: localize('config.profiles.low-performance') },
|
||||
{ value: 'scrubbing', label: localize('config.profiles.scrubbing') },
|
||||
];
|
||||
|
||||
@@ -580,6 +580,7 @@
|
||||
},
|
||||
"profiles": {
|
||||
"casting": "Casting",
|
||||
"doorbell": "Doorbell",
|
||||
"editor_label": "Configuration profiles",
|
||||
"low-performance": "Low performance",
|
||||
"scrubbing": "Video scrubbing"
|
||||
|
||||
Reference in New Issue
Block a user