From 24cf64d83eb68ce78c0ce2a463f3064ae8f36a4f Mon Sep 17 00:00:00 2001 From: Grzegorz Date: Tue, 31 Aug 2021 13:22:23 +0200 Subject: [PATCH] bump 1.7.0 ## [1.7.0] - 2021-08-31 ## Changes - code refactorin - added default inputs TV, Settings, Dashboard, Accessory, no need to create it in config - many small changes and stability improvements --- CHANGELOG.md | 6 ++++++ config.schema.json | 4 ++-- index.js | 12 ++++++------ package.json | 2 +- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 90aa643..b48eaef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,12 @@ 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.1] - 2021-08-31 +## Changes +- code refactorin +- added default inputs TV, Settings, Dashboard, Accessory, no need to create it in config +- many small changes and stability improvements + ## [1.6.3] - 2021-08-05 ## Changes - added alternative check current running app if reference app is missing diff --git a/config.schema.json b/config.schema.json index 1b5274d..15e11e2 100644 --- a/config.schema.json +++ b/config.schema.json @@ -3,8 +3,8 @@ "pluginType": "platform", "singular": true, "customUi": true, - "headerDisplay": "This plugin works with Xbox game consoles and are exposed to HomeKit as separate accessories and each needs to be manually paired.\n\n1. Open the Home app on your device.\n2. Tap the Home tab, then tap .\n3. Tap *Add Accessory*, and select *I Don't Have a Code or Cannot Scan*.\n4. Enter the Homebridge PIN, this can be found under the QR code in Homebridge UI or your Homebridge logs, alternatively you can select *Use Camera* and scan the QR code again.", - "footerDisplay": "This plugin works with Xbox game console which is available [here](https://github.com/grzegorz914/homebridge-xbox-tv).", + "headerDisplay": "This plugin works with Xbox game consoles and are exposed to HomeKit as separate accessories and each needs to be manually paired.\n\n1. Open the Home app on your device.\n2. Tap the Home tab, then tap .\n3. Tap *Add Accessory*, and select *I Don't Have a Code or select More Options*.\n4. Select Accessory and Enter the Homebridge PIN, or scan the QR code in Homebridge UI.", + "footerDisplay": "This plugin is available [here](https://github.com/grzegorz914/homebridge-meraki-control).", "schema": { "type": "object", "properties": { diff --git a/index.js b/index.js index 44cfae2..c3a0981 100644 --- a/index.js +++ b/index.js @@ -205,8 +205,8 @@ class xboxTvDevice { this.inputType = 0; this.prefDir = path.join(api.user.storagePath(), 'xboxTv'); - this.devInfoFile = this.prefDir + '/' + 'devInfo_' + this.host.split('.').join(''); this.authTokenFile = this.prefDir + '/' + 'authToken_' + this.host.split('.').join(''); + this.devInfoFile = this.prefDir + '/' + 'devInfo_' + this.host.split('.').join(''); this.inputsFile = this.prefDir + '/' + 'inputs_' + this.host.split('.').join(''); this.inputsNamesFile = this.prefDir + '/' + 'inputsNames_' + this.host.split('.').join(''); this.targetVisibilityInputsFile = this.prefDir + '/' + 'targetVisibilityInputs_' + this.host.split('.').join(''); @@ -224,12 +224,12 @@ class xboxTvDevice { if (fs.existsSync(this.prefDir) == false) { fsPromises.mkdir(this.prefDir); } - if (fs.existsSync(this.devInfoFile) == false) { - fsPromises.writeFile(this.devInfoFile, ''); - } if (fs.existsSync(this.authTokenFile) == false) { fsPromises.writeFile(this.authTokenFile, ''); } + if (fs.existsSync(this.devInfoFile) == false) { + fsPromises.writeFile(this.devInfoFile, ''); + } if (fs.existsSync(this.inputsFile) == false) { fsPromises.writeFile(this.inputsFile, ''); } @@ -1232,8 +1232,8 @@ class xboxTvDevice { const isConfigured = 1; //get input visibility state - const targetVisibility = (savedTargetVisibility[inputTitleId] != undefined) ? savedTargetVisibility[inputTitleId] : (savedTargetVisibility[inputReference] != undefined) ? savedTargetVisibility[inputReference] : (savedTargetVisibility[inputOneStoreProductId] != undefined) ? savedTargetVisibility[inputOneStoreProductId] : 0; - const currentVisibility = targetVisibility; + const currentVisibility = (savedTargetVisibility[inputTitleId] != undefined) ? savedTargetVisibility[inputTitleId] : (savedTargetVisibility[inputReference] != undefined) ? savedTargetVisibility[inputReference] : (savedTargetVisibility[inputOneStoreProductId] != undefined) ? savedTargetVisibility[inputOneStoreProductId] : 0; + const targetVisibility = currentVisibility; const inputService = new Service.InputSource(accessoryName, 'Input ' + i); inputService diff --git a/package.json b/package.json index a631d9a..bc1cfc8 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "displayName": "Xbox TV", "name": "homebridge-xbox-tv", - "version": "1.6.46", + "version": "1.7.0", "description": "Homebridge plugin (https://github.com/homebridge/homebridge) to control Xbox game consoles.", "license": "MIT", "author": "grzegorz914",