Skip to content

Commit

Permalink
bump 1.8.0
Browse files Browse the repository at this point in the history
## [1.8.0] - 2021-10-26
## Changes
- added possibility Record Game DVR
- rebuild connection proces to console
- fixed Authorization Manager error on first run
- removed 'Undefined Input', not nedded any more
- code cleanup
  • Loading branch information
grzegorz914 committed Oct 26, 2021
1 parent 0df7739 commit 5e55e87
Show file tree
Hide file tree
Showing 8 changed files with 465 additions and 467 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [1.8.0] - 2021-10-26
## Changes
- added possibility Record Game DVR
- rebuild connection proces to console
- fixed Authorization Manager error on first run
- removed 'Undefined Input', not nedded any more
- code cleanup


## [1.7.9] - 2021-09-26
## Changes
- config.schema update
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ Install and use [Homebridge Config UI X](https://github.com/oznu/homebridge-conf
| `filterApps` | If enabled, Apps will be hidden and not displayed in the inputs list, only available if `webApiControl` enabled. | Optional |
| `filterSystemApps` | If enabled, System Apps (Accessory, TV) will be hidden and not displayed in the inputs list, only available if `webApiControl` enabled. | Optional |
| `filterDlc` | If enabled, Dlc will be hidden and not displayed in the inputs list, only available if `webApiControl` enabled. | Optional |
| `rebootControl` | If enabled, reboot console will be possible, only available if `webApiControl` enabled. | Optional |
| `rebootControl` | If enabled, reboot Console will be possible with extra button, only available if `webApiControl` enabled. | Optional |
| `recordGameDvr` | If enabled, record Game DVR will be possible with extra button. | Optional |
| `inputs.name` | Here set *Input Name* which You want expose to the *Homebridge/HomeKit*, `Television`, `Dashboard`, `Accessory`, `Settings` inputs are created by default. | Required |
| `inputs.reference` | Required to identify current running app. | Required |
| `inputs.oneStoreProductId` | Required to switch apps. | Optional |
Expand Down Expand Up @@ -125,6 +126,7 @@ Install and use [Homebridge Config UI X](https://github.com/oznu/homebridge-conf
"filterSystemApps": false,
"filterDlc": false,
"rebootControl": false,
"recordGameDvr": false,
"inputs": [
{
"name": "A Way Out",
Expand Down
12 changes: 10 additions & 2 deletions config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,22 @@
"required": false
},
"rebootControl": {
"title": "Enable reboot control",
"title": "Reboot Console",
"type": "boolean",
"default": false,
"description": "This enable possibility reboot console if web api is enabled.",
"description": "This enable possibility reboot Console if web api is enabled.",
"required": false,
"condition": {
"functionBody": "return model.devices[arrayIndices].webApiControl === true;"
}
},
"recordGameDvr": {
"title": "Record Game DVR",
"type": "boolean",
"default": false,
"description": "This enable possibility record Game DVR.",
"required": false
},
"getInputsFromDevice": {
"title": "Load inputs from device",
"type": "boolean",
Expand Down Expand Up @@ -434,6 +441,7 @@
"devices[].disableLogInfo",
"devices[].switchInfoMenu",
"devices[].rebootControl",
"devices[].recordGameDvr",
"devices[].refreshInterval",
"devices[].volumeControl"
]
Expand Down
30 changes: 16 additions & 14 deletions homebridge-ui/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,39 +34,41 @@ class PluginUiServer extends HomebridgePluginUiServer {
uhs: ''
});

webApiCheck._authentication._tokensFile = authTokenFile;
webApiCheck.isAuthenticated().then(() => {
try {
webApiCheck._authentication._tokensFile = authTokenFile;
const isAuthenticated = await webApiCheck.isAuthenticated();
this.data = {
res: 'Console already authenticated',
status: 0
}
}).catch(() => {
} catch (error) {
if (token != undefined) {
webApiCheck._authentication.getTokenRequest(token).then((authToken) => {
webApiCheck._authentication._tokens.oauth = authToken;
const oauth2URI = webApiCheck._authentication.generateAuthorizationUrl();
this.data = {
res: oauth2URI,
status: 1
}
try {
const authenticationData = await webApiCheck._authentication.getTokenRequest(token);
webApiCheck._authentication._tokens.oauth = authenticationData;
webApiCheck._authentication.saveTokens();
this.data = {
res: 'Console successfully authenticated and *autToken* file saved',
status: 3
}
}).catch(() => {
} catch (error) {
this.data = {
res: 'Authorization and Token file saved error.',
res: 'Authorization and Token file save error.',
status: 4
}
});
};
} else {
this.data = {
res: 'Authorization link empty, check *authToken* file.',
status: 2
}
}
const oauth2URI = webApiCheck._authentication.generateAuthorizationUrl();
this.data = {
res: oauth2URI,
status: 1
}
});
};

return this.data;
} catch (e) {
Expand Down
Loading

0 comments on commit 5e55e87

Please sign in to comment.