diff --git a/CHANGELOG.md b/CHANGELOG.md index b48eaef..8ec1bd6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/README.md b/README.md index d3d6ea4..49acec4 100644 --- a/README.md +++ b/README.md @@ -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 | diff --git a/config.schema.json b/config.schema.json index 15e11e2..7d04171 100644 --- a/config.schema.json +++ b/config.schema.json @@ -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", @@ -383,6 +413,9 @@ "devices[].switchInfoMenu", "devices[].rebootControl", "devices[].getInputsFromDevice", + "devices[].filterGames", + "devices[].filterApps", + "devices[].filterDlc", "devices[].refreshInterval", "devices[].volumeControl" ] diff --git a/homebridge-ui/public/index.html b/homebridge-ui/public/index.html index 819d48f..11e1020 100644 --- a/homebridge-ui/public/index.html +++ b/homebridge-ui/public/index.html @@ -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); diff --git a/index.js b/index.js index 005c7ba..0dd079f 100644 --- a/index.js +++ b/index.js @@ -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 || []; @@ -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; diff --git a/package-lock.json b/package-lock.json index 3a90018..02fecb5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { "name": "homebridge-xbox-tv", - "version": "1.6.14-beta11", + "version": "1.7.0", "lockfileVersion": 2, "requires": true, "packages": { "": { - "version": "1.6.14-beta11", + "version": "1.7.0", "license": "MIT", "dependencies": { "@homebridge/plugin-ui-utils": "0.0.19", diff --git a/package.json b/package.json index 04db0f6..d9f128f 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/sample-config.json b/sample-config.json index 918f963..144b40c 100644 --- a/sample-config.json +++ b/sample-config.json @@ -31,6 +31,9 @@ "volumeControl": 0, "switchInfoMenu": false, "getInputsFromDevice": false, + "filterGames": false, + "filterApps": false, + "filterDlc": false, "rebootControl": false, "inputs": [{ "name": "A Way Out",