From e320cfa193f70dae3ef2277b25d63fd633681a4f Mon Sep 17 00:00:00 2001 From: Sosthene Date: Wed, 3 Sep 2025 15:11:07 +0200 Subject: [PATCH] Pair device right away to prevent errors on prd update operations --- src/simple-server.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/simple-server.ts b/src/simple-server.ts index 26e9b61..320f730 100644 --- a/src/simple-server.ts +++ b/src/simple-server.ts @@ -366,15 +366,14 @@ export class Server { if (!processId || !stateId) { throw new Error('Failed to get process id or state id'); } + // now pair the device before continuing + service.pairDevice(processId, [service.getDeviceAddress()]); await service.handleApiReturn(pairingResult); const udpateResult = await service.createPrdUpdate(processId, stateId); await service.handleApiReturn(udpateResult); const approveResult = await service.approveChange(processId, stateId); await service.handleApiReturn(approveResult); - // now pair the device - service.pairDevice(processId, [service.getDeviceAddress()]); - // Update the device in the database const device = service.dumpDeviceFromMemory(); if (device) {