homebridge-xbox-tv 2.12.26 → 2.12.28
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/README.md +18 -11
- package/index.js +10 -1
- package/package.json +2 -2
- package/src/xboxdevice.js +7 -5
package/README.md
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
<span align="center">
|
|
6
6
|
|
|
7
7
|
# Homebridge Xbox TV
|
|
8
|
+
|
|
8
9
|
[](https://github.com/homebridge/homebridge/wiki/Verified-Plugins)
|
|
9
10
|
[](https://www.npmjs.com/package/homebridge-xbox-tv)
|
|
10
11
|
[](https://www.npmjs.com/package/homebridge-xbox-tv)
|
|
@@ -17,6 +18,7 @@ Homebridge plugin for Microsoft game Consoles. Tested with Xbox One X/S and Xbox
|
|
|
17
18
|
</span>
|
|
18
19
|
|
|
19
20
|
## Package Requirements
|
|
21
|
+
|
|
20
22
|
| Package | Installation | Role | Required |
|
|
21
23
|
| --- | --- | --- | --- |
|
|
22
24
|
| [Homebridge](https://github.com/homebridge/homebridge) | [Homebridge Wiki](https://github.com/homebridge/homebridge/wiki) | HomeKit Bridge | Required |
|
|
@@ -24,6 +26,7 @@ Homebridge plugin for Microsoft game Consoles. Tested with Xbox One X/S and Xbox
|
|
|
24
26
|
| [Xbox TV](https://www.npmjs.com/package/homebridge-xbox-tv) | [Plug-In Wiki](https://github.com/grzegorz914/homebridge-xbox-tv/wiki) | Homebridge Plug-In | Required |
|
|
25
27
|
|
|
26
28
|
## About The Plugin
|
|
29
|
+
|
|
27
30
|
* Power ON/OFF short press tile in HomeKit app.
|
|
28
31
|
* Reboot Console with button, rquired `webApiControl` enabled.
|
|
29
32
|
* Record Game DVR with button, rquired `webApiControl` enabled.
|
|
@@ -42,13 +45,14 @@ Homebridge plugin for Microsoft game Consoles. Tested with Xbox One X/S and Xbox
|
|
|
42
45
|
* Publish as JSON data.
|
|
43
46
|
|
|
44
47
|
<p align="center">
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
48
|
+
<a href="https://github.com/grzegorz914/homebridge-xbox-tv"><img alt="Accessory tile in the HomeKit app" src="https://raw.githubusercontent.com/grzegorz914/homebridge-xbox-tv/master/graphics/homekit.png" width="382" /></a>
|
|
49
|
+
<a href="https://github.com/grzegorz914/homebridge-xbox-tv"><img alt="Changing the accessory input" src="https://raw.githubusercontent.com/grzegorz914/homebridge-xbox-tv/master/graphics/inputs.png" width="135" /></a>
|
|
50
|
+
<a href="https://github.com/grzegorz914/homebridge-xbox-tv"><img alt="Arrow pointing to the remote control icon in the control center" src="https://raw.githubusercontent.com/grzegorz914/homebridge-xbox-tv/master/graphics/rc1.png" width="135" /></a>
|
|
51
|
+
<a href="https://github.com/grzegorz914/homebridge-xbox-tv"><img alt="Remote control interface" src="https://raw.githubusercontent.com/grzegorz914/homebridge-xbox-tv/master/graphics/RC.png" width="135" /></a>
|
|
49
52
|
</p>
|
|
50
53
|
|
|
51
54
|
## Authorization Manager
|
|
55
|
+
|
|
52
56
|
* First of all please use built in Authorization Manager.
|
|
53
57
|
* Start new authorization need remove old token first, to clear token use Authorization Manager GUI.
|
|
54
58
|
* Make sure Your web browser do not block pop-up window, if Yes allow pop-up window for this app.
|
|
@@ -58,16 +62,17 @@ Homebridge plugin for Microsoft game Consoles. Tested with Xbox One X/S and Xbox
|
|
|
58
62
|
</p>
|
|
59
63
|
|
|
60
64
|
## Configuration
|
|
65
|
+
|
|
61
66
|
* [Device must have Instant-on power mode enabled](https://support.xbox.com/help/hardware-network/power/learn-about-power-modes)
|
|
62
67
|
* Profile & System > Settings > General > Power mode & startup
|
|
63
68
|
* Console need to allow connect from any 3rd app. *Allow Connections from any device* should be enabled.
|
|
64
69
|
* Profile & System > Settings > Devices & Connections > Remote features > Xbox app preferences.
|
|
65
70
|
* Run this plugin as a [Child Bridge](https://github.com/homebridge/homebridge/wiki/Child-Bridges) (Highly Recommended), this prevent crash Homebridge if plugin crashes.
|
|
66
|
-
* Install and use [Homebridge Config UI X](https://github.com/homebridge/homebridge-config-ui-x/wiki) to configure this plugin.
|
|
67
|
-
* The `sample-config.json` can be edited and used as an alternative (advanced users).
|
|
71
|
+
* Install and use [Homebridge Config UI X](https://github.com/homebridge/homebridge-config-ui-x/wiki) to configure this plugin.
|
|
72
|
+
* The `sample-config.json` can be edited and used as an alternative (advanced users).
|
|
68
73
|
|
|
69
74
|
<p align="center">
|
|
70
|
-
|
|
75
|
+
<a href="https://github.com/grzegorz914/homebridge-xbox-tv"><img src="https://raw.githubusercontent.com/grzegorz914/homebridge-xbox-tv/master/graphics/ustawienia.png" width="840"></a>
|
|
71
76
|
</p>
|
|
72
77
|
|
|
73
78
|
| Key | Description |
|
|
@@ -90,9 +95,10 @@ Homebridge plugin for Microsoft game Consoles. Tested with Xbox One X/S and Xbox
|
|
|
90
95
|
| `buttons.oneStoreProductId` | Here set *Input oneStoreProductId*, only possible if `webApiControl` enabled. |
|
|
91
96
|
| `buttons.displayType` | Here select display type in HomeKit app, possible `0 - None/Disabled`, `1 - Outlet`, `2 - Switch`. |
|
|
92
97
|
| `buttons.namePrefix` | Here enable/disable the accessory name as a prefix for button name.|
|
|
93
|
-
| `sensorPower`| If enabled, then the Power will be exposed as a `
|
|
94
|
-
| `sensorInput`| If enabled, then the Input will be exposed as a `
|
|
95
|
-
| `sensorScreenSaver`| If enabled, then the Screen Saver will be exposed as a `Motion Sensor
|
|
98
|
+
| `sensorPower`| If enabled, then the Power will be exposed as a `Contact Sensor`, fired if power ON. |
|
|
99
|
+
| `sensorInput`| If enabled, then the Input will be exposed as a `Contact Sensor`, fired on every Input change. |
|
|
100
|
+
| `sensorScreenSaver`| If enabled, then the Screen Saver will be exposed as a `Motion Sensor`, fired on change to Screen Saver. |
|
|
101
|
+
| `sensorInputs`| Her create custom Inputs sensor, sensors will be exposed as a `Contact Sensor`, fired if switch to it. |
|
|
96
102
|
| `sensorInputs.name` | Here set own *Name* which You want expose to the *Homebridge/HomeKit* for this sensor. |
|
|
97
103
|
| `sensorInputs.reference` | Here set *Reference* like `Xbox.Dashboard_8wekyb3d8bbwe!Xbox.Dashboard.Application` to be exposed as sensor (active on switch to this Input). |
|
|
98
104
|
| `sensorInputs.displayType` | Here select sensor type to be exposed in HomeKit app, possible `0 - None/Disabled`, `1 - Motion Sensor`, `2 - Occupancy Sensor`, `3 - Contact Sensor`. |
|
|
@@ -122,6 +128,7 @@ Homebridge plugin for Microsoft game Consoles. Tested with Xbox One X/S and Xbox
|
|
|
122
128
|
| `reference`, `oneStoreProductId` | If web Api enabled then all available in `./homebridge/xboxTv/inputs_xxxxxx` file. |
|
|
123
129
|
|
|
124
130
|
## Create App on Azure AD
|
|
131
|
+
|
|
125
132
|
* Go to [Azure Portal](https://portal.azure.com/#blade/Microsoft_AAD_RegisteredApps/ApplicationsListBlade)
|
|
126
133
|
* Register new *App* + *New registration*
|
|
127
134
|
* Enter a name for your app
|
|
@@ -129,6 +136,6 @@ Homebridge plugin for Microsoft game Consoles. Tested with Xbox One X/S and Xbox
|
|
|
129
136
|
* Click register
|
|
130
137
|
* Choose *Redirect URIs* -> *Add a Redirect URI*
|
|
131
138
|
* Click *Add a platform* -> *Mobile and desktop applications*
|
|
132
|
-
* Enter custom redirect URI
|
|
139
|
+
* Enter custom redirect URI *<http://localhost:8888/auth/callback>*
|
|
133
140
|
* From the overview of your app page, copy *Application (client) ID* to `webApiClientId`
|
|
134
141
|
* Save restart plugin and authorize console again and have fun.
|
package/index.js
CHANGED
|
@@ -28,7 +28,16 @@ class XboxPlatform {
|
|
|
28
28
|
|
|
29
29
|
//debug config
|
|
30
30
|
const debug = device.enableDebugMode ? log(`Device: ${device.host} ${device.name}, did finish launching.`) : false;
|
|
31
|
-
const
|
|
31
|
+
const config = {
|
|
32
|
+
...device,
|
|
33
|
+
xboxLiveId: 'removed',
|
|
34
|
+
webApiToken: 'removed',
|
|
35
|
+
webApiClientId: 'removed',
|
|
36
|
+
webApiClientSecret: 'removed',
|
|
37
|
+
mqttUser: 'removed',
|
|
38
|
+
mqttPasswd: 'removed'
|
|
39
|
+
};
|
|
40
|
+
const debug1 = device.enableDebugMode ? log(`Device: ${device.host} ${device.name}, Config: ${JSON.stringify(config, null, 2)}`) : false;
|
|
32
41
|
|
|
33
42
|
//xbox device
|
|
34
43
|
const xboxDevice = new XboxDevice(api, prefDir, device);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"displayName": "Xbox TV",
|
|
3
3
|
"name": "homebridge-xbox-tv",
|
|
4
|
-
"version": "2.12.
|
|
4
|
+
"version": "2.12.28",
|
|
5
5
|
"description": "Homebridge plugin to control Xbox game consoles.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "grzegorz914",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"async-mqtt": "^2.6.3",
|
|
34
34
|
"elliptic": "^6.5.4",
|
|
35
35
|
"hex-to-binary": "^1.0.1",
|
|
36
|
-
"jsrsasign": "^11.
|
|
36
|
+
"jsrsasign": "^11.1.0",
|
|
37
37
|
"uuid": "^9.0.1",
|
|
38
38
|
"ping": "^0.4.4",
|
|
39
39
|
"express": "^4.18.2",
|
package/src/xboxdevice.js
CHANGED
|
@@ -278,11 +278,13 @@ class XboxDevice extends EventEmitter {
|
|
|
278
278
|
.updateCharacteristic(Characteristic.ContactSensorState, power)
|
|
279
279
|
}
|
|
280
280
|
|
|
281
|
-
if (this.sensorInputService) {
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
.
|
|
285
|
-
|
|
281
|
+
if (this.sensorInputService && inputIdentifier !== this.inputIdentifier) {
|
|
282
|
+
for (let i = 0; i < 1; i++) {
|
|
283
|
+
const state = power ? [true, false][i] : false;
|
|
284
|
+
this.sensorInputService
|
|
285
|
+
.updateCharacteristic(Characteristic.ContactSensorState, state)
|
|
286
|
+
this.sensorInputState = state;
|
|
287
|
+
}
|
|
286
288
|
}
|
|
287
289
|
|
|
288
290
|
if (reference !== undefined) {
|