mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-21 06:59:09 +00:00
Fix ontime aux actions (#1684)
* switch to base ui * ensure all action types is part of the valitation * update test * atempt to do it in the base-ui way * fix fixing * allow undefide visible on set timer message * fix set time not showing * correct time data for aux set automation --------- Co-authored-by: Carlos Valente <carlosvalente@pm.me>
This commit is contained in:
committed by
GitHub
parent
8d68a4554d
commit
4d359445a7
@@ -54,33 +54,52 @@ export type HTTPOutput = {
|
||||
url: string;
|
||||
};
|
||||
|
||||
const ontimeAuxTriggerAction = [
|
||||
'aux1-start',
|
||||
'aux1-stop',
|
||||
'aux1-pause',
|
||||
'aux2-start',
|
||||
'aux2-stop',
|
||||
'aux2-pause',
|
||||
'aux3-start',
|
||||
'aux3-stop',
|
||||
'aux3-pause',
|
||||
] as const;
|
||||
|
||||
const ontimeAuxSetAction = ['aux1-set', 'aux2-set', 'aux3-set'] as const;
|
||||
|
||||
type OntimeAuxTriggerAction = (typeof ontimeAuxTriggerAction)[number];
|
||||
type OntimeAuxSetAction = (typeof ontimeAuxSetAction)[number];
|
||||
type OntimeMessageSet = 'message-set';
|
||||
type OntimeMessageSecondary = 'message-secondary';
|
||||
|
||||
export type OntimeActionKey = OntimeAuxTriggerAction | OntimeAuxSetAction | OntimeMessageSet | OntimeMessageSecondary;
|
||||
|
||||
export const ontimeActionKeyValues = [
|
||||
...ontimeAuxTriggerAction,
|
||||
...ontimeAuxSetAction,
|
||||
'message-set',
|
||||
'message-secondary',
|
||||
];
|
||||
|
||||
export type OntimeAction =
|
||||
| {
|
||||
type: 'ontime';
|
||||
action:
|
||||
| 'aux1-start'
|
||||
| 'aux1-stop'
|
||||
| 'aux1-pause'
|
||||
| 'aux2-start'
|
||||
| 'aux2-stop'
|
||||
| 'aux2-pause'
|
||||
| 'aux3-start'
|
||||
| 'aux3-stop'
|
||||
| 'aux3-pause';
|
||||
action: OntimeAuxTriggerAction;
|
||||
}
|
||||
| {
|
||||
type: 'ontime';
|
||||
action: 'aux1-set' | 'aux2-set' | 'aux3-set';
|
||||
time: number;
|
||||
action: OntimeAuxSetAction;
|
||||
time: string; //TODO:(automation set aux) not sure what way around to have the string and where to have the ms value
|
||||
}
|
||||
| {
|
||||
type: 'ontime';
|
||||
action: 'message-set';
|
||||
action: OntimeMessageSet;
|
||||
text?: string;
|
||||
visible?: boolean;
|
||||
}
|
||||
| {
|
||||
type: 'ontime';
|
||||
action: 'message-secondary';
|
||||
action: OntimeMessageSecondary;
|
||||
secondarySource: SecondarySource;
|
||||
};
|
||||
|
||||
@@ -24,7 +24,9 @@ export { TimerType } from './definitions/TimerType.type.js';
|
||||
export type { OntimeReport, OntimeEventReport } from './definitions/core/Report.type.js';
|
||||
|
||||
// ---> Automations
|
||||
export { ontimeActionKeyValues } from './definitions/core/Automation.type.js';
|
||||
export type {
|
||||
OntimeActionKey,
|
||||
Automation,
|
||||
AutomationDTO,
|
||||
AutomationFilter,
|
||||
|
||||
Reference in New Issue
Block a user