UNPKG

nubli

Version:
22 lines (21 loc) 784 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const SmartLockCommand_1 = require("./SmartLockCommand"); const states_1 = require("../states"); const smartLock_1 = require("../smartLock"); class ChallengeCommand extends SmartLockCommand_1.SmartLockCommand { constructor() { super(...arguments); this.requiresChallenge = false; } requestData(config) { let identifier = new Buffer(2); identifier.writeUInt16LE(states_1.Command.CHALLENGE, 0); return smartLock_1.SmartLock.prepareCommand(states_1.Command.REQUEST_DATA, identifier); } handleData(command, payload) { this._response.data.challenge = payload; this._complete = true; } } exports.ChallengeCommand = ChallengeCommand;