Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All change options #66

Merged
merged 7 commits into from
Jun 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions companion/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "getontime-ontime",
"shortname": "ontime",
"description": "Companion module for ontime",
"version": "4.1.0",
"version": "4.2.0",
"license": "MIT",
"repository": "git+https://github.com/bitfocus/companion-module-getontime-ontime.git",
"bugs": "https://github.com/bitfocus/companion-module-getontime-ontime/issues",
Expand All @@ -14,8 +14,7 @@
},
{
"name": "Fabian Posenau"
}
,
},
{
"name": "Alex Christoffer Rasmussen"
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "getontime-ontime",
"version": "4.1.0",
"version": "4.2.0",
"main": "/dist/index.js",
"license": "MIT",
"prettier": "@companion-module/tools/.prettierrc.json",
Expand Down
5 changes: 5 additions & 0 deletions src/enums.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* maximum allowed time 23:59:59 as seconds
*/
export const MAX_TIME_SECONDS = (23*60*60) + (59*60) + 59

export enum ActionId {
Start = 'start',
Load = 'load',
Expand Down
94 changes: 84 additions & 10 deletions src/v3/actions/changePicker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ import {
combineRgb,
} from '@companion-module/base'
import { OntimeV3 } from '../ontimev3'
import { MAX_TIME_SECONDS } from '../../enums'

const throttledEndpointText =
'This propertiy will cause a recalculation of the rundwon\nand id therfor throttled by ontime'

export function changePicker(
ontime: OntimeV3
Expand Down Expand Up @@ -40,16 +44,6 @@ export function changePicker(
id: 'cue',
isVisible: (opts) => Array.isArray(opts.properties) && opts.properties.includes('cue'),
},
{
type: 'number',
label: 'Duration in Seconds',
id: 'duration',
default: 0,
min: 0,
max: 3600,
step: 1,
isVisible: (opts) => Array.isArray(opts.properties) && opts.properties.includes('duration'),
},
{
type: 'checkbox',
label: 'Is Public',
Expand All @@ -60,6 +54,7 @@ export function changePicker(
{
type: 'checkbox',
label: 'Skip',
tooltip: throttledEndpointText,
id: 'skip',
default: false,
isVisible: (opts) => Array.isArray(opts.properties) && opts.properties.includes('skip'),
Expand All @@ -72,6 +67,85 @@ export function changePicker(
returnType: 'string',
isVisible: (opts) => Array.isArray(opts.properties) && opts.properties.includes('colour'),
},
{
type: 'number',
label: 'Duration',
tooltip: 'In Seconds\n' + throttledEndpointText,
id: 'duration',
default: 0,
min: 0,
max: MAX_TIME_SECONDS,
step: 1,
isVisible: (opts) => Array.isArray(opts.properties) && opts.properties.includes('duration'),
},
{
type: 'number',
label: 'Start Time',
tooltip: 'In Seconds\n' + throttledEndpointText,
id: 'timeStart',
default: 0,
min: 0,
max: MAX_TIME_SECONDS,
step: 1,
isVisible: (opts) => Array.isArray(opts.properties) && opts.properties.includes('timeStart'),
},
{
type: 'number',
label: 'End Time',
tooltip: 'In Seconds\n' + throttledEndpointText,
id: 'timeEnd',
default: 0,
min: 0,
max: MAX_TIME_SECONDS,
step: 1,
isVisible: (opts) => Array.isArray(opts.properties) && opts.properties.includes('timeEnd'),
},
{
type: 'number',
label: 'Warning Time',
id: 'timeWarning',
default: 0,
min: 0,
max: MAX_TIME_SECONDS,
step: 1,
isVisible: (opts) => Array.isArray(opts.properties) && opts.properties.includes('timeWarning'),
},
{
type: 'number',
label: 'Danger Time',
id: 'timeDanger',
default: 0,
min: 0,
max: MAX_TIME_SECONDS,
step: 1,
isVisible: (opts) => Array.isArray(opts.properties) && opts.properties.includes('timeDanger'),
},
{
type: 'dropdown',
label: 'End Action',
id: 'endAction',
choices: [
{ id: 'load-next', label: 'Load Next' },
{ id: 'none', label: 'None' },
{ id: 'stop', label: 'Stop' },
{ id: 'play-next', label: 'Play Next' },
],
default: 'none',
isVisible: (opts) => Array.isArray(opts.properties) && opts.properties.includes('endAction'),
},
{
type: 'dropdown',
label: 'Timer Type',
id: 'timerType',
choices: [
{ id: 'count-down', label: 'Count Down' },
{ id: 'count-up', label: 'Count Up' },
{ id: 'time-to-end', label: 'Time To End' },
{ id: 'clock', label: 'Clock' },
],
default: 'count-down',
isVisible: (opts) => Array.isArray(opts.properties) && opts.properties.includes('timerType'),
},
...generateCustomFieldsOptions(ontime),
]

Expand Down