Skip to content

Commit

Permalink
release 2.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
grzegorz914 committed Jul 29, 2023
1 parent 6f74f3e commit 865a997
Show file tree
Hide file tree
Showing 12 changed files with 1,347 additions and 129 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### NOTE!!!
## After update to 2.x.x the plugin settings (xboxLiveId) need to be updated.

## [2.9.0] - (29.07.2023)
## Changes
- added RESTFul server
- use JWT token for lokac api if console authorizen
- code refactor and cleanup
- config.schema updated
- fixed some minor issues
- prepare for next release and features

## [2.8.0] - (20.02.2023)
## Changes
- fix load plugin gui on first start after install
Expand Down
17 changes: 13 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,13 @@ Homebridge plugin for Microsoft game Consoles. Tested with Xbox One X/S and Xbox
* Siri can be used for all functions, some times need create legacy buttons/switches/sensors.
* Automations can be used for all functions, some times need create legacy buttons/switches/sensors.
* Record Game DVR with additional button.
* MQTT publisch topic *Info*, *State*, *Consoles List*, *Profile*, *Apps*, *Storages*, *Status* as payload JSON data.
* RESTful server:
* Request: `http//homebridge_ip_address:port/path`.
* Path: `info`, `state`, `consoleslist`, `profile`, `apps`, `storages`, `status`.
* Respone as JSON data.
* MQTT client:
* Topic: `Info`, `State`, `Consoles List`, `Profile`, `Apps`, `Storages`, `Status`.
* Publish as JSON data.

<p align="left">
<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>
Expand Down Expand Up @@ -70,7 +76,6 @@ Homebridge plugin for Microsoft game Consoles. Tested with Xbox One X/S and Xbox
| `name` | Here set the accessory *Name* to be displayed in *Homebridge/HomeKit*. |
| `host` | Here set the *Hsostname or Address IP* of Console.|
| `xboxLiveId` | On your console select Profile > Settings > System > Console info, listed as **Xbox network device ID**. *You can only find the Xbox network device ID in Settings on your console, this is different from your console serial number*. |
| `webApiControl` | This enable control Xbox over Web Api. Additional functions are available in `Advanced Settings` section. |
| `getInputsFromDevice`| If enabled, apps will be loaded from device, only available if `webApiControl` enabled. |
| `filterGames` | If enabled, Games will be hidden and not displayed in the inputs list, only available if `webApiControl` enabled. |
| `filterApps` | If enabled, Apps will be hidden and not displayed in the inputs list, only available if `webApiControl` enabled. |
Expand All @@ -90,17 +95,21 @@ Homebridge plugin for Microsoft game Consoles. Tested with Xbox One X/S and Xbox
| `sensorInputs.name` | Here set own *Name* which You want expose to the *Homebridge/HomeKit* for this sensor. |
| `sensorInputs.reference` | Here set *Reference* like `Xbox.Dashboard_8wekyb3d8bbwe!Xbox.Dashboard.Application` to be exposed as sensor (active on switch to this Input). |
| `sensorInputs.displayType` | Here select sensor type to be exposed in HomeKit app, possible `None/Disabled`, `Motion Sensor`, `Occupancy Sensor`, `Contact Sensor`. |
| `webApiControl` | This enable control Xbox over Web Api. Additional functions are available in `Advanced Settings` section. |
| `webApiPowerOnOff` | This enable power ON/OFF control over Web Api. |
| `xboxLiveUser` | Prepare for feature use. |
| `xboxLivePasswd` | Prepare for feature use. |
| `xboxWebApiToken` | Required if `webApiControl` enabled. |
| `clientId` | If You create app on Azure AD then You can use your own Client Id. |
| `clientSecret` | If You create app on Azure AD then You can use own Client Secret. |
| `userToken` | Alternate authorization method. |
| `userHash` | Alternate authorization method. |
| `enableDebugMode` | If enabled, deep log will be present in homebridge console. |
| `disableLogInfo` | If enabled, disable log info, all values and state will not be displayed in Homebridge log console. |
| `disableLogDeviceInfo` | If enabled, add ability to disable log device info by every connections device to the network. |
| `infoButtonCommand` | Here select the function of `I` button in RC app. |
| `volumeControl` | Here choice what a additional volume control mode You want to use (`None/Disabled`, `Lightbulb`, `Fan`), not working yet. |
| `enableRestFul` | If enabled, RESTful server will start automatically and respond to any path request. |
| `restFulPort` | Here set the listening `Port` for RESTful server. |
| `restFulDebug` | If enabled, deep log will be present in homebridge console for RESTFul server. |
| `enableMqtt` | If enabled, MQTT Broker will start automatically and publish all awailable PV installation data. |
| `mqttHost` | Here set the *IP Address* or *Hostname* for MQTT Broker. |
| `mqttPort` | Here set the *Port* for MQTT Broker, default 1883. |
Expand Down
63 changes: 40 additions & 23 deletions config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -541,26 +541,6 @@
"functionBody": "return model.devices[arrayIndices].webApiControl === true;"
}
},
"userToken": {
"title": "User Token",
"type": "string",
"placeholder": "User Token",
"description": "Optional authorization method for future use.",
"required": false,
"condition": {
"functionBody": "return model.devices[arrayIndices].webApiControl === true;"
}
},
"userHash": {
"title": "User Hash",
"type": "string",
"placeholder": "User Hash",
"description": "Optional authorization method for future use.",
"required": false,
"condition": {
"functionBody": "return model.devices[arrayIndices].webApiControl === true;"
}
},
"enableDebugMode": {
"title": "Debug",
"type": "boolean",
Expand Down Expand Up @@ -658,6 +638,33 @@
],
"required": true
},
"enableRestFul": {
"title": "Enable",
"type": "boolean",
"default": false,
"required": false,
"description": "This enable RESTful server."
},
"restFulDebug": {
"title": "Debug",
"type": "boolean",
"default": false,
"required": false,
"description": "This enable debug mode for RESTFul.",
"condition": {
"functionBody": "return model.devices[arrayIndices].enableRestFul === true;"
}
},
"restFulPort": {
"title": "Port",
"type": "integer",
"placeholder": 3000,
"required": true,
"description": "Here set the listening Port for RESTful server.",
"condition": {
"functionBody": "return model.devices[arrayIndices].enableRestFul === true;"
}
},
"enableMqtt": {
"title": "Enable",
"type": "boolean",
Expand Down Expand Up @@ -842,9 +849,7 @@
"devices[].xboxLivePasswd",
"devices[].xboxWebApiToken",
"devices[].clientId",
"devices[].clientSecret",
"devices[].userToken",
"devices[].userHash"
"devices[].clientSecret"
]
},
{
Expand All @@ -861,6 +866,18 @@
"devices[].volumeControl"
]
},
{
"key": "devices[]",
"type": "section",
"title": "RESTful",
"expandable": true,
"expanded": false,
"items": [
"devices[].enableRestFul",
"devices[].restFulDebug",
"devices[].restFulPort"
]
},
{
"key": "devices[]",
"type": "section",
Expand Down
4 changes: 0 additions & 4 deletions homebridge-ui/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,6 @@
const xboxLivePasswd = pluginConfig[0].devices[this.deviceIndex].xboxLivePasswd;
const clientId = pluginConfig[0].devices[this.deviceIndex].clientId;
const clientSecret = pluginConfig[0].devices[this.deviceIndex].clientSecret;
const userToken = pluginConfig[0].devices[this.deviceIndex].userToken;
const userHash = pluginConfig[0].devices[this.deviceIndex].userHash;
const xboxWebApiToken = pluginConfig[0].devices[this.deviceIndex].xboxWebApiToken;

const payload = {
Expand All @@ -156,8 +154,6 @@
xboxLivePasswd: xboxLivePasswd,
clientId: clientId,
clientSecret: clientSecret,
userToken: userToken,
userHash: userHash,
webApiToken: xboxWebApiToken
};
const response = await homebridge.request('/startAuthorization', payload);
Expand Down
2 changes: 0 additions & 2 deletions homebridge-ui/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ class PluginUiServer extends HomebridgePluginUiServer {
xboxLivePasswd: payload.xboxLivePasswd,
clientId: payload.clientId,
clientSecret: payload.clientSecret,
userToken: payload.userToken,
userHash: payload.userHash,
tokensFile: tokensFile
}
const authentication = new Authentication(authConfig);
Expand Down
Loading

0 comments on commit 865a997

Please sign in to comment.