mirror of
https://github.com/mtan93/homebridge.git
synced 2026-03-08 05:31:55 +00:00
Fix the issue with transaction ID
Update hap-nodejs to fix #497-183825263
This commit is contained in:
@@ -36,12 +36,12 @@ inherits(BridgeSetupSession, EventEmitter);
|
|||||||
|
|
||||||
BridgeSetupSession.prototype.handleWriteRequest = function(request) {
|
BridgeSetupSession.prototype.handleWriteRequest = function(request) {
|
||||||
if (request.type === "Negotiate") {
|
if (request.type === "Negotiate") {
|
||||||
this.transactionID = request.tid;
|
this.transactionID = request.tid + 1;
|
||||||
this.preferedLanguage = request.language;
|
this.preferedLanguage = request.language;
|
||||||
this.validSession = true
|
this.validSession = true
|
||||||
|
|
||||||
var respDict = {
|
var respDict = {
|
||||||
"tid": this.transactionID + 1,
|
"tid": this.transactionID,
|
||||||
"type": "Negotiate",
|
"type": "Negotiate",
|
||||||
"sid": this.sessionUUID,
|
"sid": this.sessionUUID,
|
||||||
"attachment": {
|
"attachment": {
|
||||||
@@ -91,7 +91,8 @@ BridgeSetupSession.prototype.pluginResponseHandler = function(response, type, re
|
|||||||
this.emit('newConfig', type, this.currentPluginName, replace, config);
|
this.emit('newConfig', type, this.currentPluginName, replace, config);
|
||||||
this.presentMainMenu();
|
this.presentMainMenu();
|
||||||
} else if (response) {
|
} else if (response) {
|
||||||
response.tid = this.transactionID + 1;
|
this.transactionID += 1;
|
||||||
|
response.tid = this.transactionID;
|
||||||
response.sid = this.sessionUUID;
|
response.sid = this.sessionUUID;
|
||||||
|
|
||||||
this.sendResponse(response);
|
this.sendResponse(response);
|
||||||
@@ -101,8 +102,10 @@ BridgeSetupSession.prototype.pluginResponseHandler = function(response, type, re
|
|||||||
BridgeSetupSession.prototype.presentMainMenu = function() {
|
BridgeSetupSession.prototype.presentMainMenu = function() {
|
||||||
this.currentStage = 1;
|
this.currentStage = 1;
|
||||||
|
|
||||||
|
this.transactionID += 1;
|
||||||
|
|
||||||
var respDict = {
|
var respDict = {
|
||||||
"tid": this.transactionID + 1,
|
"tid": this.transactionID,
|
||||||
"sid": this.sessionUUID,
|
"sid": this.sessionUUID,
|
||||||
"type": "Interface",
|
"type": "Interface",
|
||||||
"interface": "list",
|
"interface": "list",
|
||||||
@@ -123,8 +126,10 @@ BridgeSetupSession.prototype.presentManagePlatformMenu = function() {
|
|||||||
}
|
}
|
||||||
this.listOfPlatforms = listOfPlatforms;
|
this.listOfPlatforms = listOfPlatforms;
|
||||||
|
|
||||||
|
this.transactionID += 1;
|
||||||
|
|
||||||
var respDict = {
|
var respDict = {
|
||||||
"tid": this.transactionID + 1,
|
"tid": this.transactionID,
|
||||||
"type": "Interface",
|
"type": "Interface",
|
||||||
"sid": this.sessionUUID,
|
"sid": this.sessionUUID,
|
||||||
"interface": "list",
|
"interface": "list",
|
||||||
@@ -142,8 +147,10 @@ BridgeSetupSession.prototype.presentManageAccessoryMenu = function() {
|
|||||||
this.currentConfig = config;
|
this.currentConfig = config;
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
|
|
||||||
|
this.transactionID += 1;
|
||||||
|
|
||||||
var respDict = {
|
var respDict = {
|
||||||
"tid": this.transactionID + 1,
|
"tid": this.transactionID,
|
||||||
"type": "Interface",
|
"type": "Interface",
|
||||||
"sid": this.sessionUUID,
|
"sid": this.sessionUUID,
|
||||||
"interface": "instruction",
|
"interface": "instruction",
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"chalk": "^1.1.1",
|
"chalk": "^1.1.1",
|
||||||
"commander": "2.8.1",
|
"commander": "2.8.1",
|
||||||
"hap-nodejs": "0.2.0",
|
"hap-nodejs": "0.2.1",
|
||||||
"semver": "5.0.3",
|
"semver": "5.0.3",
|
||||||
"node-persist": "^0.0.8"
|
"node-persist": "^0.0.8"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user