From a73084b0099cd9b3bec97358200f682dc8bf76e9 Mon Sep 17 00:00:00 2001 From: Balte de Wit Date: Wed, 24 Jul 2019 11:44:28 +0200 Subject: [PATCH] feat(SlotInfo): add optional slot id --- src/commands/slotInfo.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/commands/slotInfo.ts b/src/commands/slotInfo.ts index 40b8c3c..67998e6 100644 --- a/src/commands/slotInfo.ts +++ b/src/commands/slotInfo.ts @@ -14,6 +14,13 @@ export interface SlotInfoCommandResponse { export class SlotInfoCommand extends AbstractCommand { expectedResponseCode = SynchronousCode.SlotInfo + readonly slotId?: number + + constructor (slotId?: number) { + super() + this.slotId = slotId + } + deserialize (msg: ResponseMessage) { const res: SlotInfoCommandResponse = { slotId: parseInt(msg.params['slot id'], 10), @@ -30,6 +37,8 @@ export class SlotInfoCommand extends AbstractCommand { params: {} } + if (this.slotId) res.params['slot id'] = this.slotId + '' + return res } }