feat: Add ability to untrigger after fixed number of seconds (#2350)
- Related: #2342 BREAKING CHANGE: Renames: `untrigger_seconds` to `untrigger_delay_seconds`
This commit is contained in:
@@ -19,6 +19,7 @@ import {
|
||||
CONF_VIEW_TRIGGERS_ACTIONS_TRIGGER,
|
||||
CONF_VIEW_TRIGGERS_ACTIONS_UNTRIGGER,
|
||||
CONF_VIEW_TRIGGERS_FILTER_SELECTED_CAMERA,
|
||||
CONF_VIEW_TRIGGERS_UNTRIGGER_DELAY_SECONDS,
|
||||
} from '../const';
|
||||
import { arrayify } from '../utils/basic';
|
||||
import { AdvancedCameraCardCondition } from './schema/conditions/types';
|
||||
@@ -960,4 +961,8 @@ const UPGRADES = [
|
||||
},
|
||||
},
|
||||
),
|
||||
upgradeMoveToWithOverrides(
|
||||
'view.triggers.untrigger_seconds',
|
||||
CONF_VIEW_TRIGGERS_UNTRIGGER_DELAY_SECONDS,
|
||||
),
|
||||
];
|
||||
|
||||
@@ -67,7 +67,8 @@ export const viewConfigDefault = {
|
||||
trigger: 'update' as const,
|
||||
untrigger: 'none' as const,
|
||||
},
|
||||
untrigger_seconds: 0,
|
||||
untrigger_delay_seconds: 0,
|
||||
untrigger_force_seconds: 0,
|
||||
},
|
||||
keyboard_shortcuts: keyboardShortcutsDefault,
|
||||
};
|
||||
@@ -93,7 +94,12 @@ export const triggersSchema = z.object({
|
||||
show_trigger_status: z
|
||||
.boolean()
|
||||
.default(viewConfigDefault.triggers.show_trigger_status),
|
||||
untrigger_seconds: z.number().default(viewConfigDefault.triggers.untrigger_seconds),
|
||||
untrigger_delay_seconds: z
|
||||
.number()
|
||||
.default(viewConfigDefault.triggers.untrigger_delay_seconds),
|
||||
untrigger_force_seconds: z
|
||||
.number()
|
||||
.default(viewConfigDefault.triggers.untrigger_force_seconds),
|
||||
});
|
||||
export type TriggersOptions = z.infer<typeof triggersSchema>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user