Skip to content

Commit

Permalink
bump 1.7.2
Browse files Browse the repository at this point in the history
## Changes
- added filter for Games, Apps, Dlc
  • Loading branch information
grzegorz914 committed Sep 3, 2021
1 parent 24c953a commit 82a852c
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 5 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ 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.7.2] - 2021-09-03
## Changes
- added filter for Games, Apps, Dlc

## [1.7.1] - 2021-08-31
## Changes
- code refactorin
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ Install and use [Homebridge Config UI X](https://github.com/oznu/homebridge-conf
| `switchInfoMenu`| If `true` then the `I` button will toggle its behaviour in the Apple Remote in Control Center and `PowerModeSelection` in settings |
| `disableLogInfo`| If `true` then disable log info, all values and state will not be displayed in Homebridge log console |
| `getInputsFromDevice`| If `true` then enable possibility get apps direct from device, only available if `webApiControl` is enabled |
| `filterGames`| If `true` Games will be hidden and not displayed in the inputs list, only available if `webApiControl` is enabled |
| `filterApps`| If `true` Apps will be hidden and not displayed in the inputs list, only available if `webApiControl` is enabled |
| `filterDlc`| If `true` Dlc will be hidden and not displayed in the inputs list, only available if `webApiControl` is enabled |
| `rebootControl`| If `true` then enable possibility reboot console, only available if `webApiControl` is enabled |
| `inputs` | Configure apps/inputs which will be published and appear in HomeKit app in the device tile as inputs list, `Television`, `Dashboard`, `Accessory`, `Settings` inputs are created by default. |
| `buttons` | same as inputs but appear in HomeKit.app as extra tile |
Expand Down
33 changes: 33 additions & 0 deletions config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,36 @@
"functionBody": "return model.devices[arrayIndices].webApiControl === true;"
}
},
"filterGames": {
"title": "Hide games",
"type": "boolean",
"default": false,
"required": false,
"description": "If enabled, Games will be hidden and not displayed in the inputs list.",
"condition": {
"functionBody": "return model.devices[arrayIndices].getInputsFromDevice === true;"
}
},
"filterApps": {
"title": "Hide Apps",
"type": "boolean",
"default": false,
"required": false,
"description": "If enabled, Apps will be hidden and not displayed in the inputs list.",
"condition": {
"functionBody": "return model.devices[arrayIndices].getInputsFromDevice === true;"
}
},
"filterDlc": {
"title": "Hide DLC",
"type": "boolean",
"default": false,
"required": false,
"description": "If enabled, DLC will be hidden and not displayed in the inputs list.",
"condition": {
"functionBody": "return model.devices[arrayIndices].getInputsFromDevice === true;"
}
},
"rebootControl": {
"title": "Enable reboot control",
"type": "boolean",
Expand Down Expand Up @@ -383,6 +413,9 @@
"devices[].switchInfoMenu",
"devices[].rebootControl",
"devices[].getInputsFromDevice",
"devices[].filterGames",
"devices[].filterApps",
"devices[].filterDlc",
"devices[].refreshInterval",
"devices[].volumeControl"
]
Expand Down
2 changes: 1 addition & 1 deletion homebridge-ui/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
button.setAttribute("id", "button" + i);
button.setAttribute("class", "btn btn-primary");
button.innerText = pluginConfig[0].devices[i].name;
button.style.width = '150px';
button.style.width = '160px';
button.style.height = '38x';
document.body.appendChild(button);

Expand Down
8 changes: 7 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ class xboxTvDevice {
this.volumeControl = config.volumeControl || 0;
this.switchInfoMenu = config.switchInfoMenu || false;
this.getInputsFromDevice = config.getInputsFromDevice || false;
this.filterGames = config.filterGames || false
this.filterApps = config.filterGames || false
this.filterDlc = config.filterGames || false
this.rebootControl = config.rebootControl || false;
this.inputs = config.inputs || [];
this.buttons = config.buttons || [];
Expand Down Expand Up @@ -485,7 +488,10 @@ class xboxTvDevice {
'oneStoreProductId': oneStoreProductId,
'type': type
};
this.installedAppsArr.push(inputsObj);
const filterGames = this.filterGames ? (contentType != 'Game') : true;
const filterApps = this.filterApps ? (contentType != 'App') : true;
const filterDlc = this.filterDlc ? (contentType != 'Dlc') : true;
const push = (filterGames && filterApps && filterDlc) ? this.installedAppsArr.push(inputsObj) : false;
}

this.installedAppsData = installedAppsData;
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"displayName": "Xbox TV",
"name": "homebridge-xbox-tv",
"version": "1.7.1",
"version": "1.7.2",
"description": "Homebridge plugin (https://github.com/homebridge/homebridge) to control Xbox game consoles.",
"license": "MIT",
"author": "grzegorz914",
Expand Down
3 changes: 3 additions & 0 deletions sample-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
"volumeControl": 0,
"switchInfoMenu": false,
"getInputsFromDevice": false,
"filterGames": false,
"filterApps": false,
"filterDlc": false,
"rebootControl": false,
"inputs": [{
"name": "A Way Out",
Expand Down

0 comments on commit 82a852c

Please sign in to comment.