Skip to content

Commit

Permalink
Add specific error handling for setting already set state ( #2 )
Browse files Browse the repository at this point in the history
  • Loading branch information
kodsnutten committed Jul 14, 2017
1 parent fbb68e0 commit 9ed661d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,13 @@ VerisureAccessory.prototype = {
this.log(`***** Response from ${actionValue}-operation: ${JSON.stringify(response)}`);
if (error != null) callback(error, response);
if (response && response.statusCode != 200) {
callback(response);
if (response.statusCode == 400 && response.body && response.body.errorCode == "VAL_00819"){
this.service.setCharacteristic(Characteristic.LockCurrentState, value)
this.value = value;
callback (null);
} else {
callback(response);
}
} else {
this._waitForLockStatusChangeResult(value, callback, response);
}
Expand Down

0 comments on commit 9ed661d

Please sign in to comment.