Skip to content

Commit

Permalink
FIX: Rundown Offset Feedback (#98)
Browse files Browse the repository at this point in the history
* always false if no

* remove duplicate variable name

* also check undefined
  • Loading branch information
alex-Arc authored Dec 29, 2024
1 parent 34818fa commit fbd7829
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 3 additions & 2 deletions src/v3/feedbacks/offset.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import { CompanionFeedbackBooleanEvent, CompanionFeedbackDefinition } from '@companion-module/base'
import { OntimeV3 } from '../ontimev3'
import {feedbackId, OffsetState} from '../../enums'
import { feedbackId, OffsetState } from '../../enums'
import { DangerRed, White } from '../../assets/colours'

export function createOffsetFeedbacks(ontime: OntimeV3): { [id: string]: CompanionFeedbackDefinition } {
function offset(feedback: CompanionFeedbackBooleanEvent): boolean {
const state = feedback.options.state as OffsetState | undefined
if (!state) return false
if (ontime.state.runtime.offset === null || ontime.state.runtime.offset === undefined) return false
const margin = Number(feedback.options.margin)
const offset = (ontime.state.runtime.offset ?? 0) / 1000
const offset = ontime.state.runtime.offset / 1000
switch (state) {
case OffsetState.On:
return offset > -margin && offset < margin
Expand Down
4 changes: 0 additions & 4 deletions src/v3/variables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,6 @@ export function variables(): CompanionVariableDefinition[] {
name: 'Aux timer 1 current (milliseconds)',
variableId: variableId.AuxTimerDurationMs + '-1',
},
{
name: 'Aux timer 1 duration (hh:mm:ss)',
variableId: variableId.AuxTimerDurationMs + '-1',
},
{
name: 'Aux timer 1 current (hh:mm:ss)',
variableId: variableId.AuxTimerCurrent + '-1',
Expand Down

0 comments on commit fbd7829

Please sign in to comment.