mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-16 12:53:32 +00:00
feat: ontime actions in automation
This commit is contained in:
committed by
Carlos Valente
parent
636f78e21e
commit
5fb30c75c4
@@ -1,3 +1,4 @@
|
||||
import type { SecondarySource } from '../runtime/MessageControl.type.js';
|
||||
import type { TimerLifeCycle } from './TimerLifecycle.type.js';
|
||||
|
||||
export type AutomationSettings = {
|
||||
@@ -38,7 +39,7 @@ export type AutomationFilter = {
|
||||
value: string; // we use string but would coerce to the field value
|
||||
};
|
||||
|
||||
export type AutomationOutput = OSCOutput | HTTPOutput;
|
||||
export type AutomationOutput = OSCOutput | HTTPOutput | OntimeAction;
|
||||
|
||||
export type OSCOutput = {
|
||||
type: 'osc';
|
||||
@@ -52,3 +53,25 @@ export type HTTPOutput = {
|
||||
type: 'http';
|
||||
url: string;
|
||||
};
|
||||
|
||||
export type OntimeAction =
|
||||
| {
|
||||
type: 'ontime';
|
||||
action: 'aux-start' | 'aux-stop' | 'aux-pause';
|
||||
}
|
||||
| {
|
||||
type: 'ontime';
|
||||
action: 'aux-set';
|
||||
time: number;
|
||||
}
|
||||
| {
|
||||
type: 'ontime';
|
||||
action: 'message-set';
|
||||
text?: string;
|
||||
visible?: boolean;
|
||||
}
|
||||
| {
|
||||
type: 'ontime';
|
||||
action: 'message-secondary';
|
||||
secondarySource: SecondarySource;
|
||||
};
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
export type SecondarySource = 'aux' | 'external' | null;
|
||||
|
||||
export type TimerMessage = {
|
||||
text: string;
|
||||
visible: boolean;
|
||||
blink: boolean;
|
||||
blackout: boolean;
|
||||
secondarySource: 'aux' | 'external' | null;
|
||||
secondarySource: SecondarySource;
|
||||
};
|
||||
|
||||
export type MessageState = {
|
||||
|
||||
@@ -26,6 +26,7 @@ export type {
|
||||
FilterRule,
|
||||
HTTPOutput,
|
||||
NormalisedAutomation,
|
||||
OntimeAction,
|
||||
OSCOutput,
|
||||
Trigger,
|
||||
TriggerDTO,
|
||||
@@ -80,7 +81,7 @@ export type {
|
||||
export { type Log, LogLevel, type LogMessage, LogOrigin } from './definitions/runtime/Logger.type.js';
|
||||
export { Playback } from './definitions/runtime/Playback.type.js';
|
||||
export { TimerLifeCycle, timerLifecycleValues } from './definitions/core/TimerLifecycle.type.js';
|
||||
export type { TimerMessage, MessageState } from './definitions/runtime/MessageControl.type.js';
|
||||
export type { TimerMessage, MessageState, SecondarySource } from './definitions/runtime/MessageControl.type.js';
|
||||
|
||||
export type { Runtime } from './definitions/runtime/Runtime.type.js';
|
||||
export type { RuntimeStore } from './definitions/runtime/RuntimeStore.type.js';
|
||||
@@ -104,5 +105,6 @@ export {
|
||||
isKeyOfType,
|
||||
isOSCOutput,
|
||||
isHTTPOutput,
|
||||
isOntimeAction,
|
||||
} from './utils/guards.js';
|
||||
export type { MaybeNumber, MaybeString } from './utils/utils.type.js';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { AutomationOutput, HTTPOutput, OSCOutput } from '../definitions/core/Automation.type.js';
|
||||
import type { AutomationOutput, HTTPOutput, OntimeAction, OSCOutput } from '../definitions/core/Automation.type.js';
|
||||
import type { OntimeBlock, OntimeDelay, OntimeEvent, PlayableEvent } from '../definitions/core/OntimeEvent.type.js';
|
||||
import { SupportedEvent } from '../definitions/core/OntimeEvent.type.js';
|
||||
import type { OntimeRundownEntry } from '../definitions/core/Rundown.type.js';
|
||||
@@ -41,3 +41,7 @@ export function isOSCOutput(output: AutomationOutput): output is OSCOutput {
|
||||
export function isHTTPOutput(output: AutomationOutput): output is HTTPOutput {
|
||||
return output.type === 'http';
|
||||
}
|
||||
|
||||
export function isOntimeAction(output: AutomationOutput): output is OntimeAction {
|
||||
return output.type === 'ontime';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user