From f04970c9237e8bfe232a6fbfdbd5e3103a1bf1d5 Mon Sep 17 00:00:00 2001 From: olzzon Date: Tue, 2 Apr 2024 15:36:50 +0200 Subject: [PATCH] fix: setState when received update from Sisyfos --- .../src/integrations/sisyfos/index.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/timeline-state-resolver/src/integrations/sisyfos/index.ts b/packages/timeline-state-resolver/src/integrations/sisyfos/index.ts index 6259b4737..8d4648f19 100644 --- a/packages/timeline-state-resolver/src/integrations/sisyfos/index.ts +++ b/packages/timeline-state-resolver/src/integrations/sisyfos/index.ts @@ -208,7 +208,14 @@ export class SisyfosMessageDevice extends DeviceWithState { + this._resyncing = true this._sisyfos.reSyncOneChannel(channel) + // Wait for state will be emitted from Sisyfos + // And set TSR state on current time + setTimeout(() => { + this.setState(this.getDeviceState(false), this.getCurrentTime()) + this._resyncing = false + }, 500) return Promise.resolve() } async executeAction( @@ -231,7 +238,7 @@ export class SisyfosMessageDevice extends DeviceWithState ({ result: ActionExecutionResultCode.Ok, })) @@ -244,7 +251,7 @@ export class SisyfosMessageDevice extends DeviceWithState