diff --git a/packages/timeline-state-resolver-types/src/integrations/sisyfos.ts b/packages/timeline-state-resolver-types/src/integrations/sisyfos.ts index 156920711..2143d5414 100644 --- a/packages/timeline-state-resolver-types/src/integrations/sisyfos.ts +++ b/packages/timeline-state-resolver-types/src/integrations/sisyfos.ts @@ -35,21 +35,41 @@ export interface SisyfosChannelOptions { export interface TimelineContentSisyfosTriggerValue extends TimelineContentSisyfos { type: TimelineContentTypeSisyfos.TRIGGERVALUE + /** + * If this value changes, commands will be sent to set each channel that is + * mapped to its expected state regardless of whether that state changed + */ triggerValue: string } -export interface TimelineContentSisyfosChannel extends TimelineContentSisyfos, SisyfosChannelOptions { +export interface TimelineContentSisyfosChannel + extends SisyfosTimelineObjectProps, + TimelineContentSisyfos, + SisyfosChannelOptions { type: TimelineContentTypeSisyfos.CHANNEL - resync?: boolean - overridePriority?: number // defaults to 0 - triggerValue?: string } -export interface TimelineContentSisyfosChannels extends TimelineContentSisyfos { +export interface TimelineContentSisyfosChannels extends SisyfosTimelineObjectProps, TimelineContentSisyfos { type: TimelineContentTypeSisyfos.CHANNELS channels: ({ /** The mapping layer to look up the channel from */ mappedLayer: string } & SisyfosChannelOptions)[] +} +interface SisyfosTimelineObjectProps { + /** + * When this is set to true it will do a full resync with Sisyfos, first + * request the remote end's state and then diffing the local state against that + * (depending on channel count this is a slow operation) + */ resync?: boolean + /** + * If you have multiple references to 1 channel in different timeline obejcts, + * the one with the highest overridePriority will be used + */ overridePriority?: number // defaults to 0 + /** + * If this value changes, commands will be sent to set the channels in this + * object to their expected state regardless of wheter the state of these + * channels changed + */ triggerValue?: string } diff --git a/packages/timeline-state-resolver/src/integrations/sisyfos/__tests__/sisyfos.spec.ts b/packages/timeline-state-resolver/src/integrations/sisyfos/__tests__/sisyfos.spec.ts index f4014276f..7053f7004 100644 --- a/packages/timeline-state-resolver/src/integrations/sisyfos/__tests__/sisyfos.spec.ts +++ b/packages/timeline-state-resolver/src/integrations/sisyfos/__tests__/sisyfos.spec.ts @@ -879,8 +879,16 @@ describe('Sisyfos', () => { mappingType: MappingSisyfosType.Channels, }, } + const myTriggerMapping0: Mapping = { + device: DeviceType.SISYFOS, + deviceId: 'mySisyfos', + options: { + mappingType: MappingSisyfosType.Channels, + }, + } const myChannelMapping: Mappings = { sisyfos_channels_base: myChannelMapping0, + sisyfos_channels_base_trigger: myTriggerMapping0, sisyfos_channel_1: myChannelMapping1, sisyfos_channel_2: myChannelMapping2, sisyfos_channels: myChannelMapping3, @@ -932,10 +940,21 @@ describe('Sisyfos', () => { isPgm: 0, }, ], - triggerValue: 'a', overridePriority: -999, }, }, + { + id: 'baseline_trigger', + enable: { + while: 1, + }, + layer: 'sisyfos_channels_base_trigger', + content: { + deviceType: DeviceType.SISYFOS, + type: TimelineContentTypeSisyfos.TRIGGERVALUE, + triggerValue: 'a', + }, + }, { id: 'obj1', enable: { diff --git a/packages/timeline-state-resolver/src/integrations/sisyfos/connection.ts b/packages/timeline-state-resolver/src/integrations/sisyfos/connection.ts index e3eb8d552..f2cb64cb6 100644 --- a/packages/timeline-state-resolver/src/integrations/sisyfos/connection.ts +++ b/packages/timeline-state-resolver/src/integrations/sisyfos/connection.ts @@ -537,6 +537,7 @@ export type SisyfosCommand = export interface SisyfosChannel extends SisyfosChannelAPI { timelineObjIds: string[] + triggerValue?: string } export interface SisyfosState { channels: { [index: string]: SisyfosChannel } diff --git a/packages/timeline-state-resolver/src/integrations/sisyfos/index.ts b/packages/timeline-state-resolver/src/integrations/sisyfos/index.ts index 4c01a1c26..bae91d00e 100644 --- a/packages/timeline-state-resolver/src/integrations/sisyfos/index.ts +++ b/packages/timeline-state-resolver/src/integrations/sisyfos/index.ts @@ -329,6 +329,7 @@ export class SisyfosMessageDevice extends DeviceWithState { @@ -342,8 +343,12 @@ export class SisyfosMessageDevice extends DeviceWithState