Skip to content

Commit

Permalink
feat(SlotInfo): add optional slot id
Browse files Browse the repository at this point in the history
  • Loading branch information
Balte de Wit committed Jul 24, 2019
1 parent 4464a5b commit a73084b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/commands/slotInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -30,6 +37,8 @@ export class SlotInfoCommand extends AbstractCommand {
params: {}
}

if (this.slotId) res.params['slot id'] = this.slotId + ''

return res
}
}

0 comments on commit a73084b

Please sign in to comment.