Skip to content

Commit 67e9022

Browse files
authored
Merge pull request #12 from MichaelAllen/master
Prevent updateConfig from calling loadInputs if there isn't a device paired
2 parents a111bc4 + 4380f21 commit 67e9022

File tree

2 files changed

+28
-20
lines changed

2 files changed

+28
-20
lines changed

index.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,15 @@ instance.prototype.init = function () {
3131
instance.prototype.updateConfig = function (config) {
3232
var self = this;
3333
self.config = config;
34-
self.loadInputs();
34+
35+
if(self.config.host) {
36+
self.tv = new smartcast(self.config.host);
37+
38+
if (self.config.authToken) {
39+
self.tv.pairing.useAuthToken(self.config.authToken);
40+
self.loadInputs();
41+
}
42+
}
3543
};
3644

3745
instance.prototype.loadInputs = function () {

package.json

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
{
2-
"name": "vizio-smartcast",
3-
"version": "1.1.3",
4-
"api_version": "1.0.0",
5-
"keywords": [
6-
"TV"
7-
],
8-
"manufacturer": "VIZIO",
9-
"product": "SmartCast",
10-
"shortname": "smartcast",
11-
"description": "VIZIO SmartCast plugin for Companion",
12-
"main": "index.js",
13-
"scripts": {
14-
"test": "echo \"Error: no test specified\" && exit 1"
15-
},
16-
"author": "Jeffrey Davidsz <[email protected]>",
17-
"license": "MIT",
18-
"dependencies": {
19-
"vizio-smart-cast": "^1.3.0"
20-
}
2+
"name": "vizio-smartcast",
3+
"version": "1.1.4",
4+
"api_version": "1.0.0",
5+
"keywords": [
6+
"TV"
7+
],
8+
"manufacturer": "VIZIO",
9+
"product": "SmartCast",
10+
"shortname": "smartcast",
11+
"description": "VIZIO SmartCast plugin for Companion",
12+
"main": "index.js",
13+
"scripts": {
14+
"test": "echo \"Error: no test specified\" && exit 1"
15+
},
16+
"author": "Jeffrey Davidsz <[email protected]>",
17+
"license": "MIT",
18+
"dependencies": {
19+
"vizio-smart-cast": "^1.3.0"
20+
}
2121
}

0 commit comments

Comments
 (0)