homebridge-xbox-tv 2.8.2-beta.21 → 2.8.2-beta.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
const devices = { 'devices': [] };
|
|
43
43
|
pluginConfig.push(devices);
|
|
44
44
|
await homebridge.updatePluginConfig(pluginConfig);
|
|
45
|
-
|
|
45
|
+
homebridge.showSchemaForm();
|
|
46
46
|
return;
|
|
47
47
|
}
|
|
48
48
|
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
|
|
92
92
|
//watch for changes to the config button
|
|
93
93
|
document.getElementById('configButton').addEventListener('click', async () => {
|
|
94
|
-
const showHideSettings = this.configButtonState ?
|
|
94
|
+
const showHideSettings = this.configButtonState ? homebridge.hideSchemaForm() : homebridge.showSchemaForm();
|
|
95
95
|
this.configButtonState = !this.configButtonState;
|
|
96
96
|
});
|
|
97
97
|
|
|
@@ -106,8 +106,8 @@
|
|
|
106
106
|
const setButtonName = tokenLength1 <= 10 ? document.getElementById('startAuthorizationButton').innerText = "Start authorization" : false;
|
|
107
107
|
const setButtonMode = tokenLength1 <= 10 ? document.getElementById('startAuthorizationButton').removeAttribute('disabled') : false;
|
|
108
108
|
|
|
109
|
-
await homebridge.savePluginConfig(pluginConfig);
|
|
110
109
|
await homebridge.updatePluginConfig(pluginConfig);
|
|
110
|
+
await homebridge.savePluginConfig(pluginConfig);
|
|
111
111
|
});
|
|
112
112
|
|
|
113
113
|
//clear token file
|
|
@@ -121,7 +121,6 @@
|
|
|
121
121
|
const response = await homebridge.request('/clearToken', payload);
|
|
122
122
|
|
|
123
123
|
if (response) {
|
|
124
|
-
pluginConfig[0].devices[this.deviceIndex].xboxWebApiToken = '';
|
|
125
124
|
document.querySelector('#deviceTokenInput').value = '';
|
|
126
125
|
document.getElementById('startAuthorizationButton').removeAttribute("disabled");
|
|
127
126
|
document.getElementById('startAuthorizationButton').innerText = "Start authorization";
|
|
@@ -130,9 +129,10 @@
|
|
|
130
129
|
document.getElementById('info').innerHTML = 'Web Api Token cleared, now You can start new authorization process.';
|
|
131
130
|
document.getElementById('info').style.color = 'green';
|
|
132
131
|
homebridge.toast.info('Web Api Token cleared!', 'Info!');
|
|
132
|
+
pluginConfig[0].devices[this.deviceIndex].xboxWebApiToken = '';
|
|
133
133
|
|
|
134
|
-
await homebridge.savePluginConfig(pluginConfig);
|
|
135
134
|
await homebridge.updatePluginConfig(pluginConfig);
|
|
135
|
+
await homebridge.savePluginConfig(pluginConfig);
|
|
136
136
|
};
|
|
137
137
|
|
|
138
138
|
homebridge.hideSpinner();
|
|
@@ -183,7 +183,7 @@
|
|
|
183
183
|
document.getElementById('deviceWebApiControl').disabled = true;
|
|
184
184
|
|
|
185
185
|
// open the oauth2 URI for authentication
|
|
186
|
-
const authWindow = await window.open(info, "_blank");
|
|
186
|
+
const authWindow = await window.homebridge.open(info, "_blank");
|
|
187
187
|
document.getElementById('info').innerHTML = JSON.stringify(authWindow);
|
|
188
188
|
// get the authorization code from the URL
|
|
189
189
|
authWindow.addEventListener('load', async () => {
|
|
@@ -201,8 +201,8 @@
|
|
|
201
201
|
document.getElementById('startAuthorizationButton').innerText = "Check state";
|
|
202
202
|
document.getElementById('deviceWebApiControl').disabled = false;
|
|
203
203
|
|
|
204
|
-
await homebridge.savePluginConfig(pluginConfig);
|
|
205
204
|
await homebridge.updatePluginConfig(pluginConfig)
|
|
205
|
+
await homebridge.savePluginConfig(pluginConfig);
|
|
206
206
|
break;
|
|
207
207
|
case 3:
|
|
208
208
|
document.getElementById('info').innerHTML = 'Authorization or Token save error!!!.';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"displayName": "Xbox TV",
|
|
3
3
|
"name": "homebridge-xbox-tv",
|
|
4
|
-
"version": "2.8.2-beta.
|
|
4
|
+
"version": "2.8.2-beta.22",
|
|
5
5
|
"description": "Homebridge plugin (https://github.com/homebridge/homebridge) to control Xbox game consoles.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "grzegorz914",
|