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) {