diff --git a/package.json b/package.json index 8a31b4a..f7bbb5d 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,13 @@ { "name": "node-red-contrib-august", - "version": "1.1.0", + "version": "1.2.0", "description": "Node-RED node to connect to August locks", "main": "index.js", "scripts": {}, "author": "hufftheweevil", "license": "MIT", "dependencies": { - "august-api": "^1.4.0" + "august-api": "^1.5.0" }, "node-red": { "version": ">=2.0.0", diff --git a/red/august-account.html b/red/august-account.html index 3a742c9..445dd41 100644 --- a/red/august-account.html +++ b/red/august-account.html @@ -14,7 +14,8 @@ category: 'config', defaults: { augustId: { type: 'text', required: true }, - validated: { type: 'boolean', value: false } + validated: { type: 'boolean', value: false }, + api: { type: 'text', value: 'August' } }, credentials: { password: { type: 'password', required: true } @@ -28,7 +29,8 @@ let getConfig = () => ({ installId: this.id, augustId: $('#node-config-input-augustId').val(), - password: $('#node-config-input-password').val() + password: $('#node-config-input-password').val(), + api: $('#node-input-api').val() }) let validationContainer = $('#august-validation') @@ -107,6 +109,10 @@ ) }) } + }, + oneditsave: function () { + // Manually save value + this.api = $('#node-input-api').val() } }) @@ -120,6 +126,16 @@ +
+ +
+ +
+
diff --git a/red/august-account.js b/red/august-account.js index 60bef43..b55ef45 100644 --- a/red/august-account.js +++ b/red/august-account.js @@ -16,7 +16,8 @@ module.exports = function (RED) { this.api = new AugustAPI({ installId: config.id, // Use node ID (means any new config node must be validated) augustId: config.augustId, - password: this.credentials.password + password: this.credentials.password, + countryCode: config.api === 'Yale Home' ? 'non-US' : 'US' // Can be any value other than 'US' for Yale Home }) this.api.validated = config.validated // TEST ONLY } catch (err) {