Allow camera capabilities to be configured.
This commit is contained in:
+45
-1
@@ -1,4 +1,8 @@
|
||||
import { HomeAssistant, LovelaceCardConfig, Themes } from '@dermotduffy/custom-card-helpers';
|
||||
import {
|
||||
HomeAssistant,
|
||||
LovelaceCardConfig,
|
||||
Themes,
|
||||
} from '@dermotduffy/custom-card-helpers';
|
||||
import { StyleInfo } from 'lit/directives/style-map.js';
|
||||
import { z } from 'zod';
|
||||
|
||||
@@ -87,6 +91,46 @@ export interface CardHelpers {
|
||||
}>;
|
||||
}
|
||||
|
||||
export type PTZMovementType = 'relative' | 'continuous';
|
||||
|
||||
export interface PTZCapabilities {
|
||||
panTilt?: PTZMovementType[];
|
||||
zoom?: PTZMovementType[];
|
||||
presets?: string[];
|
||||
}
|
||||
|
||||
export interface CapabilitiesRaw {
|
||||
live?: boolean;
|
||||
substream?: boolean;
|
||||
|
||||
clips?: boolean;
|
||||
recordings?: boolean;
|
||||
snapshots?: boolean;
|
||||
|
||||
'favorite-events'?: boolean;
|
||||
'favorite-recordings'?: boolean;
|
||||
|
||||
seek?: boolean;
|
||||
|
||||
ptz?: PTZCapabilities;
|
||||
|
||||
menu?: boolean;
|
||||
}
|
||||
|
||||
export type CapabilityKey = keyof CapabilitiesRaw;
|
||||
export const capabilityKeys: readonly [CapabilityKey, ...CapabilityKey[]] = [
|
||||
'clips',
|
||||
'favorite-events',
|
||||
'favorite-recordings',
|
||||
'live',
|
||||
'menu',
|
||||
'ptz',
|
||||
'recordings',
|
||||
'seek',
|
||||
'snapshots',
|
||||
'substream',
|
||||
] as const;
|
||||
|
||||
// *************************************************************************
|
||||
// Home Assistant API types.
|
||||
// *************************************************************************
|
||||
|
||||
Reference in New Issue
Block a user