homebridge-xbox-tv 2.9.0 → 2.9.2
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.
package/CHANGELOG.md
CHANGED
|
@@ -10,7 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
10
10
|
## [2.9.0] - (29.07.2023)
|
|
11
11
|
## Changes
|
|
12
12
|
- added RESTFul server
|
|
13
|
-
- use JWT token for
|
|
13
|
+
- use JWT token for lokal api if console authorizen
|
|
14
14
|
- code refactor and cleanup
|
|
15
15
|
- config.schema updated
|
|
16
16
|
- fixed some minor issues
|
package/config.schema.json
CHANGED
|
@@ -495,7 +495,7 @@
|
|
|
495
495
|
"title": "Xbox Live User",
|
|
496
496
|
"type": "string",
|
|
497
497
|
"placeholder": "abcdefg@hotmail.com",
|
|
498
|
-
"description": "Here set
|
|
498
|
+
"description": "Here set *User* for your Xbox Live account, not used at this time.",
|
|
499
499
|
"required": true,
|
|
500
500
|
"condition": {
|
|
501
501
|
"functionBody": "return model.devices[arrayIndices].webApiControl === true;"
|
|
@@ -505,7 +505,7 @@
|
|
|
505
505
|
"title": "Xbox Live Password",
|
|
506
506
|
"type": "string",
|
|
507
507
|
"placeholder": "abcdefg@hotmail.com",
|
|
508
|
-
"description": "Here set
|
|
508
|
+
"description": "Here set *Password* for your Xbox Live account, not used at this time.",
|
|
509
509
|
"required": true,
|
|
510
510
|
"condition": {
|
|
511
511
|
"functionBody": "return model.devices[arrayIndices].webApiControl === true;"
|
|
@@ -525,7 +525,7 @@
|
|
|
525
525
|
"title": "Client ID",
|
|
526
526
|
"type": "string",
|
|
527
527
|
"placeholder": "a34ac209-edab-4b08-91e7-a4558d8da1bd",
|
|
528
|
-
"description": "Here set your own Client ID from Azure AD
|
|
528
|
+
"description": "Here set your own Client ID from Azure AD or leave empty if you do not have own account.",
|
|
529
529
|
"required": false,
|
|
530
530
|
"condition": {
|
|
531
531
|
"functionBody": "return model.devices[arrayIndices].webApiControl === true;"
|
|
@@ -535,7 +535,7 @@
|
|
|
535
535
|
"title": "Client Secret",
|
|
536
536
|
"type": "string",
|
|
537
537
|
"placeholder": "Client Secret",
|
|
538
|
-
"description": "Here set your Client Secret from Azure AD
|
|
538
|
+
"description": "Here set your Client Secret from Azure AD or leave empty if you do not have own account.",
|
|
539
539
|
"required": false,
|
|
540
540
|
"condition": {
|
|
541
541
|
"functionBody": "return model.devices[arrayIndices].webApiControl === true;"
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
<div>
|
|
2
2
|
<img src="homebridge-xbox-tv.png" style="text-align: center;" height="150" />
|
|
3
3
|
</div>
|
|
4
|
+
<div id="consoles">
|
|
5
|
+
</div>
|
|
4
6
|
<div id="authorizationManager" style="display: none;" class="card card-body">
|
|
5
7
|
<form id="configForm">
|
|
6
8
|
<div class="text-center">
|
|
@@ -45,14 +47,14 @@
|
|
|
45
47
|
const button = document.createElement("button");
|
|
46
48
|
button.setAttribute("type", "button");
|
|
47
49
|
button.setAttribute("id", `button${i}`);
|
|
48
|
-
button.setAttribute("class", "btn btn-
|
|
49
|
-
button.innerText = pluginConfig[0].devices[i].name || '
|
|
50
|
-
|
|
51
|
-
button.style.height = '34x';
|
|
52
|
-
document.body.appendChild(button);
|
|
50
|
+
button.setAttribute("class", "btn btn-primary");
|
|
51
|
+
button.innerText = pluginConfig[0].devices[i].name || 'Name not set';
|
|
52
|
+
document.getElementById("consoles").appendChild(button);
|
|
53
53
|
|
|
54
54
|
//get actuall value on console select
|
|
55
55
|
document.getElementById(`button${i}`).addEventListener('click', async () => {
|
|
56
|
+
document.getElementById(`button${i}`).focus();
|
|
57
|
+
|
|
56
58
|
document.getElementById('deviceName').innerHTML = pluginConfig[0].devices[i].name || '';
|
|
57
59
|
document.getElementById('deviceHost').value = pluginConfig[0].devices[i].host || '';
|
|
58
60
|
document.getElementById('deviceLiveId').value = pluginConfig[0].devices[i].xboxLiveId || '';
|
package/package.json
CHANGED
package/src/constans.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"ClientId": "a34ac209-edab-4b08-91e7-a4558d8da1bd",
|
|
5
5
|
"Scopes": "XboxLive.signin XboxLive.offline_access",
|
|
6
6
|
"Url": {
|
|
7
|
-
"oauth2": "https://login.live.com/oauth20_authorize.srf
|
|
7
|
+
"oauth2": "https://login.live.com/oauth20_authorize.srf",
|
|
8
8
|
"AccessToken": "https://login.live.com/oauth20_token.srf",
|
|
9
9
|
"RefreshToken": "https://login.live.com/oauth20_token.srf",
|
|
10
10
|
"UserToken": "https://user.auth.xboxlive.com/user/authenticate",
|
|
@@ -225,7 +225,7 @@ class AUTHENTICATION {
|
|
|
225
225
|
"redirect_uri": CONSTANS.Url.Redirect
|
|
226
226
|
}
|
|
227
227
|
const params = QueryString.stringify(payload);
|
|
228
|
-
const oauth2URI = `${CONSTANS.Url.oauth2}
|
|
228
|
+
const oauth2URI = `${CONSTANS.Url.oauth2}?${params}`;
|
|
229
229
|
resolve(oauth2URI);
|
|
230
230
|
} catch (error) {
|
|
231
231
|
reject(error);
|
|
@@ -9,7 +9,7 @@ class CATALOG {
|
|
|
9
9
|
this.httpClient = new HttpClient();
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
searchTitle(query, marketLocale = '
|
|
12
|
+
searchTitle(query, marketLocale = 'US', languagesLocale = 'en-US') {
|
|
13
13
|
return new Promise(async (resolve, reject) => {
|
|
14
14
|
try {
|
|
15
15
|
const searchParams = {
|
|
@@ -30,7 +30,7 @@ class CATALOG {
|
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
getProductId(query, marketLocale = '
|
|
33
|
+
getProductId(query, marketLocale = 'US', languagesLocale = 'en-US') {
|
|
34
34
|
return new Promise(async (resolve, reject) => {
|
|
35
35
|
try {
|
|
36
36
|
const searchParams = {
|
package/src/xboxdevice.js
CHANGED
|
@@ -144,7 +144,7 @@ class XboxDevice extends EventEmitter {
|
|
|
144
144
|
this.mqtt = new Mqtt({
|
|
145
145
|
host: this.mqttHost,
|
|
146
146
|
port: this.mqttPort,
|
|
147
|
-
prefix: `${this.
|
|
147
|
+
prefix: `${this.mqttPrefix}/${this.name}`,
|
|
148
148
|
auth: this.mqttAuth,
|
|
149
149
|
user: this.mqttUser,
|
|
150
150
|
passwd: this.mqttPasswd,
|