From 866cbb23d49d0758a1a5fdbb27d7d4f058f68011 Mon Sep 17 00:00:00 2001 From: Grzegorz Date: Sun, 4 Aug 2024 10:16:21 +0200 Subject: [PATCH] release v2.14.0 --- CHANGELOG.md | 268 +++++++++++++++++++++++++++++++++++++++------ README.md | 6 +- config.schema.json | 34 +++++- package-lock.json | 4 +- package.json | 2 +- sample-config.json | 10 +- src/xboxdevice.js | 11 +- 7 files changed, 287 insertions(+), 48 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cc9ab39..cec688d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,33 +1,52 @@ # Changelog + 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). -### NOTE!!! -## After update to 2.x.x the plugin settings (xboxLiveId) need to be updated. +### NOTE +## After update to 2.x.x the plugin settings (xboxLiveId) need to be updated + +## [2.14.0] - (04.08.2024) + +## Changes + +- added possiblity to set own volume control name and enable/disable prefix +- config schema updated +- bump dependencies +- cleanup ## [2.13.0] - (05.03.2024) + ## Changes + - added support to subscribe MQTT and control device - config schema updated - cleanup ## [2.12.0] - (02.01.2024) + ## Changes + - added possibility to disable prefix name for buttons and sensors - config schema updated - cleanup ## [2.11.0] - (29.12.2023) + ## Changes + - added possibility to select display inputs order, possible by `None`, `Alphabetically Name`, `Alphabetically Reference` - config schema updated - cleanup ## [2.10.0] - (26.12.2023) -## After update to this version the plugin properties are changed and console must be authorized and settings need to be corrected. + +## After update to this version the plugin properties are changed and console must be authorized and settings need to be corrected + ## Changes + - full code refactor - added possibility toggle Power control between local/web api - fixed disconnect problem on first run @@ -37,7 +56,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - cleanup ## [2.9.0] - (29.07.2023) + ## Changes + - added RESTFul server - use JWT token for lokal api if console authorizen - code refactor and cleanup @@ -46,7 +67,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - prepare for next release and features ## [2.8.0] - (20.02.2023) + ## Changes + - fix load plugin gui on first start after install - authorization manager updated - added possibility to set IP Address and Xbox Live ID from Authorization Manager. @@ -54,7 +77,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - cleanup ## [2.7.0] - (13.02.2023) + ## Changes + - standarize function of display type and volume control, now volume control -1 None/Disabled, 0 Slider, 1 Fan, please see in readme - config.schema updated - fix expose extra input tile in homekit app @@ -62,7 +87,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - cleanup ## [2.6.0] - (12.02.2023) + ## Changes + - integrate web api library in to the plugin - simplify the authorization manager process(reduced 1 step, correct some words) - bump dependencies @@ -71,8 +98,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - cleanup ## [2.5.0] - (29.01.2023) + ## Changes -- update logging + +- update logging - added new mqtt topics *Consoles List*, *Profile*, *Apps*, *Storages*, *Status* - bump dependencies - stability improwements @@ -80,7 +109,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - cleanup ## [2.4.0] - (24.01.2023) + ## Changes + - added Power Sensor for use with automations (active if power is ON) - added Input Sensor for use with automations (activ on every Input change) - added Screen Saver Sensor for use with automations (active on change to Screen Saver) @@ -89,67 +120,95 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - cleanup ## [2.3.16] - (04.01.2023) + ## Changes + - fix wrong state after power Off - fix display current app - fix save target visibility -- fix save custom names +- fix save custom names ## [2.3.15] - (04.01.2023) + ## Changes + - fix #147 #148 ## [2.3.14] - (03.01.2023) + ## Changes + - code refactor - stability improwements ## [2.3.13] - (31.12.2022) + ## Changes + - dynamic update accessory information ## [2.3.12] - (24.12.2022) + ## Changed + - fix #145 ## [2.3.11] - (18.12.2022) + ## Changed + - fix buttons and switch services ## [2.3.10] - (02.12.2022) + ## Changed + - fix [#143](https://github.com/grzegorz914/homebridge-xbox-tv/issues/143) ## [2.3.9] - (28.11.2022) + ## Changed + - fix [#143](https://github.com/grzegorz914/homebridge-xbox-tv/issues/143) - update dependencies ## [2.3.8] - (02.11.2022) + ## Changed + - fix error with 2.3.7 ## [2.3.7] - (02.11.2022) + ## Changed + - code refactor ## [2.3.6] - (10.09.2022) + ## Changed + - cleanup - added content type properties to inputs - bump dependencies ## [2.3.3] - (29.08.2022) + ## Changed + - cleanup - rebuild mqtt topics ## [2.3.2] - (28.08.2022) + ## Changed + - fix publish MQTT message ## [2.3.0] - (24.08.2022) + ## Changed + - fix MQTT device info - refactor debug and info log - refactor send mqtt message @@ -159,46 +218,62 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - fix [#137](https://github.com/grzegorz914/homebridge-xbox-tv/issues/137) ## [2.2.2] - (09.03.2022) + ## Changed + - MQTT Client connection process ## Fixed + - webApiControl switch state ## [2.2.0] - (27.02.2022) + ## Added + - MQTT Client, publish all device data - possibility to set custom command for Info button in RC ## Changes + - update dependencies - code refactor ## [2.1.3] - (28.01.2022) + ### Fixed + - offset out of range - code refactor ## [2.1.2] - (21.01.2022) + ### Fixed + - [#136](https://github.com/grzegorz914/homebridge-xbox-tv/issues/136) ## [2.1.1] - (21.01.2022) + ### Changed + - refactor debug message logging - update readme ### Fixed + - wrong variables - removed unnecessary async - report unknown message if power on fail ## [2.1.0] - (21.01.2022) + ### Added + - check authorization state of console every 10 min. if powered ON and web api control enabled - check cosole data and installed apps every 10 min. if powered ON and web api control enabled ### Changed + - send status message data only if changed - debug message logging - code refactor @@ -206,6 +281,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - stability and performance improvements ### Fixed + - unexpected set authorization to true however the console is not authorized - data offset out of range [#133](https://github.com/grzegorz914/homebridge-xbox-tv/issues/133) - incorrect client authorization on console @@ -213,53 +289,76 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [2.0.13] - (15.01.2022) ### Added + - Network Troubleshooter as defaul input ### Changed + - removed manual authorization method - code cleanup - redme update ### Fixed + - services calculation count ## [2.0.12] - (09.01.2022) + ### Changed -- code cleanup + +- code cleanup ## [2.0.10/11] - (08.01.2022) + ### Changed -- rebuild device info read and write + +- rebuild device info read and write ## [2.0.9] - (03.01.2022) + ### Added -- ability to disable log device info by every connections device to the network (Advanced Section) + +- ability to disable log device info by every connections device to the network (Advanced Section) ### Fixed + - unexpected power on after power off ## [2.0.8] - 2021-12-29 + ### Added + - prevent load plugin if host or xboxLiveId not set - prepare directory and files synchronously ## [2.0.6] - 2021-12-28 + ### Added + - better handle clientId if not defined in config ## [2.0.3] - 2021-12-28 + ### Added + - Selectable display type of buttons in HomeKit app ## [2.0.2] - 2021-12-28 + ### Changed + - Changed switches to buttons appear in HomeKit accessory ## [2.0.1] - 2021-12-26 + ### Fixed + - RC Control + ## [2.0.0] - 2021-12-25 + ### Added + - Screensaver and Settings TV input as default - Smartglass library (based on @unknownskl code) as standalone packet, completelly rebuilded - Debug mode @@ -269,6 +368,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Clear web api token from plugin config menu ### Changes + - full code rebuild - config.schema updated - dependencies updated @@ -276,47 +376,66 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - removed bramnding ### Fixed -- memmory leak on some scenerious + +- memmory leak on some scenerious - protocol disconnect if send multiple command at once - authorization manager ## [1.8.13] - 2021-12-01 + ### Fixed + - fix authorization UI Manager open URI ## [1.8.12] - 2021-12-01 + ### Fixed + - fix authorization UI Manager ## [1.8.8] - 2021-11-04 + ### Fixed + - fix some connect/disconnect case -- fix some remote command not send +- fix some remote command not send ## [1.8.7] - 2021-11-01 + ### Changes + - performance improvement ## [1.8.6] - 2021-10-30 + ### Fixed + - fix powerOn ## [1.8.3] - 2021-10-30 + ### Fixed + - fix graphic in settings ## [1.8.2] - 2021-10-30 + ### Changes + - code optimize - config.schema update - redme update ## [1.8.1] - 2021-10-26 + ### Fixed + - fixed callback issue ([#105](https://github.com/grzegorz914/homebridge-xbox-tv/issues/105)) ## [1.8.0] - 2021-10-26 + ### Changes + - added possibility Record Game DVR - rebuild connection proces to console - fixed Authorization Manager error on first run @@ -324,52 +443,72 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - code cleanup ## [1.7.9] - 2021-09-26 + ### Changes + - config.schema update ## [1.7.8] - 2021-09-24 + ### Changes + - update authorization manager - code cleanup ## [1.7.5] - 2021-09-05 + ### Changes + - update config schema - extend fiter possibility - code cleanup ## [1.7.3] - 2021-09-03 + ### Changes + - update config schema ## [1.7.2] - 2021-09-03 + ### Changes + - added filter for Games, Apps, Dlc ## [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 - removed unnecessary reference property from buttons in config.json ## [1.6.2] - 2021-08-05 + ### Changes + - added possibility reboot console - added possibility switch to Television input - code and config reconfigured - update config schema ## [1.6.0] - 2021-08-04 + ### Changes + - fixes ## [1.6.0] - 2021-08-04 + ### Changes + - added possibility load inputs list direct from device - chenged config properties, please adapted config to latest one - changed stored files names, may be need authenticate console again or just copy authentication Token to the new created file(authToken_xxxx) @@ -377,183 +516,248 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - code rebuild ## [1.5.0] - 2021-04-11 + ### Changes + - added control over Web Api - code rebuild ## [1.4.0] - 2021-02-19 + ### Changes + - code rebuild, use Characteristic.onSet - require Homebridge 1.3.x or above ## [1.3.10] - 2021-02-15 + ### Added and Fixed + - Add possibility disable log info, options available in config - Fix memory leak ## [1.3.2] - 2021-01-18 + ### Fixed + - Fix log info regarding Input references ([#63](https://github.com/grzegorz914/homebridge-xbox-tv/issues/63)) ## [1.3.1] - 2021-01-06 + ### Fixed + - Fix `getAppChannelLineups` data error. ## [1.3.0] - 2020-11-20 + ### Fixed + - Dependency bump ([#55](https://github.com/grzegorz914/homebridge-xbox-tv/issues/55)) ## [1.2.41] - 2020-11-20 + ### Fixed + - Fix slow response on RC control. ## [1.2.1] - 2020-09-18 + ### Changes + - Updated device category to `TV_SET_TOP_BOX` ([#47](https://github.com/grzegorz914/homebridge-xbox-tv/pull/47)) ## [1.2.0] - 2020-09-17 + ### Changes + - Fix send power on until successful ([#38](https://github.com/grzegorz914/homebridge-xbox-tv/issues/38)) - Fix remote control function ([#28](https://github.com/grzegorz914/homebridge-xbox-tv/issues/28)) - Add `refreshInterval` with a default of five seconds. - Updated config layout. ## [1.1.0] - 2020-09-06 + ### Changes + - Completely reconfigured layout of the configuration schema. ## [1.0.0] - 2020-06-28 + ### Added + - Release version. ## [0.9.0] - 2020-05-23 + ### Added + - Add possibility to select what a type of extra volume control you want to use. None, Slider, Fan. ## [0.8.21] - 2020-05-23 + ### Changes + - Output app reference to log when opening app ([#22](https://github.com/grzegorz914/homebridge-xbox-tv/issues/22), [#26](https://github.com/grzegorz914/homebridge-xbox-tv/issues/26)) - Used for discovering the value to use for `reference` when adding new inputs. ## [0.8.0] - 2020-05-20 + ### Added + - Add mute ON/OFF to the slider volume. ## [0.7.60] - 2020-05-18 + ### Fixed + - Fix bug in RC control. ## [0.7.35] - 2020-05-17 -### Added + +### Added + - Add read console configuration after Homebridge restart and save to `/homebridge_folder/xboxTv/` file. ## [0.7.2] - 2020-05-14 -### Added + +### Added + - Add descriptions in `config.schema.json`. ## [0.7.0] - 2020-05-14 + ### Added + - Revert back with defaults inputs. - Add input type to inputs. - Add other fixes in code to prevent app crash without configured inputs. ## [0.6.0] - 2020-05-14 + ### Breaking Changes + - Update your config.json: Add types to the inputs. ### Default Inputs + ```json "inputs": [ - { - "name": "TV", - "reference": "Microsoft.Xbox.LiveTV_8wekyb3d8bbwe!Microsoft.Xbox.LiveTV.Application", - "type": "HDMI" - }, - { - "name": "Dashboard", - "reference": "Xbox.Dashboard_8wekyb3d8bbwe!Xbox.Dashboard.Application", - "type": "HOME_SCREEN" - }, - { - "name": "Settings", - "reference": "Microsoft.Xbox.Settings_8wekyb3d8bbwe!Xbox.Settings.Application", - "type": "OTHER" - }, - { - "name": "Accessory", - "reference": "Microsoft.XboxDevices_8wekyb3d8bbwe!App", - "type": "OTHER" - } + { + "name": "TV", + "reference": "Microsoft.Xbox.LiveTV_8wekyb3d8bbwe!Microsoft.Xbox.LiveTV.Application", + "type": "HDMI" + }, + { + "name": "Dashboard", + "reference": "Xbox.Dashboard_8wekyb3d8bbwe!Xbox.Dashboard.Application", + "type": "HOME_SCREEN" + }, + { + "name": "Settings", + "reference": "Microsoft.Xbox.Settings_8wekyb3d8bbwe!Xbox.Settings.Application", + "type": "OTHER" + }, + { + "name": "Accessory", + "reference": "Microsoft.XboxDevices_8wekyb3d8bbwe!App", + "type": "OTHER" + } ] ``` ## [0.5.0] - 2020-05-10 + ### Changes + - Code cleanup. - Miscellaneous fixes and performance improvements. ## [0.4.0] - 2020-05-06 + ### Changes + - Adapted to HAP-Node JS lib. ## [0.3.12] - 2020-05-05 + ### Changes + - Cleanup code. ### Breaking Changes + - Update your config.json: replace `apps` with `inputs`. ## [0.3.12] - 2020-05-05 + ### Changes + - Fix and performance improvements. - Corrected logging state. ## [0.3.9] - 2020-05-05 + ### Added + - Add real time read and write data for lightbulb slider volume value. ## [0.2.3] - 2020-04-27 + ### Added + - Add switch ON/OFF volume control. ## [0.2.1] - 2020-04-27 + ### Added + - Add Siri volume control. - Add slider or Brightness volume control. ## [0.1.39] - 2020-04-21 + - Different fixes. ## [0.1.12] - 2020-04-13 + - Fix memory leak. ## [0.1.9] - 2020-04-07 + - Fix store of position in HomeKit favorites. ## [0.1.6] - 2020-04-06 + - Test 2. ## [0.1.5] - 2020-04-05 + - Test 1. ## [0.1.2] - 2020-04-05 + - Some improvements. ## [0.1.1] - 2020-04-05 + - Update `README.md`. - Update `sample-config.json`. ## [0.1.0] - 2020-03-29 + - Fix crash if no device name defined. - Fix `config.schema.json`. - Fix store file inside the Homebridge directory. ## [0.0.118] - 2020-03-29 + - Small fixes. ## [0.0.115] - 2020-03-21 + - Corrections for Homebridge git. - Performance improvements. ## [0.0.1] - 2020-02-05 + - Initial release. diff --git a/README.md b/README.md index d5d6538..c51413c 100644 --- a/README.md +++ b/README.md @@ -102,11 +102,13 @@ Homebridge plugin for Microsoft game Consoles. Tested with Xbox One X/S and Xbox | `webApiToken` | Required if `webApiControl` enabled, use Authorization Manager to get it. | | `webApiClientId` | If You are created App on Azure AD then You can use your own Client Id. | | `webApiClientSecret` | If You are created App on Azure AD then You can use own Client Secret. | +| `volumeControlNamePrefix` | Here enable/disable the accessory name as a prefix for volume control name. | +| `volumeControlName` | Here set Your own volume control name or leave empty. | +| `volumeControl` | Here choice what a additional volume control mode You want to use (`0 - None/Disabled`, `1 - Lightbulb`, `2 - Fan`), not working yet. | +| `infoButtonCommand` | Here select the function of `I` button in RC app. | | `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 (`0 - None/Disabled`, `1 - Lightbulb`, `2 - 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. | diff --git a/config.schema.json b/config.schema.json index 75c5152..6e3bf6a 100644 --- a/config.schema.json +++ b/config.schema.json @@ -648,6 +648,20 @@ "description": "Here select the function of info button in RC.", "required": true }, + "volumeControlNamePrefix": { + "title": "Volume Control Name Prefix", + "type": "boolean", + "default": false, + "description": "Here enable/disable the accessory name as a prefix for volume control name.", + "required": false + }, + "volumeControlName": { + "title": "Volume Control Name", + "type": "string", + "placeholder": "Name", + "description": "Here set Your own volume control name or leave empty.", + "required": false + }, "volumeControl": { "title": "Volume Control", "type": "integer", @@ -889,6 +903,15 @@ "type": "tabarray", "title": "{{ value.title }}", "items": [ + { + "key": "devices[]", + "title": "Volume", + "items": [ + "devices[].volumeControlNamePrefix", + "devices[].volumeControlName", + "devices[].volumeControl" + ] + }, { "key": "devices[]", "title": "Sensors", @@ -918,6 +941,13 @@ } ] }, + { + "key": "devices[]", + "title": "Device", + "items": [ + "devices[].infoButtonCommand" + ] + }, { "key": "devices[]", "title": "Web Api", @@ -935,9 +965,7 @@ "items": [ "devices[].enableDebugMode", "devices[].disableLogInfo", - "devices[].disableLogDeviceInfo", - "devices[].infoButtonCommand", - "devices[].volumeControl" + "devices[].disableLogDeviceInfo" ] }, { diff --git a/package-lock.json b/package-lock.json index c1486e6..2fd1194 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "homebridge-xbox-tv", - "version": "2.13.28", + "version": "2.14.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "homebridge-xbox-tv", - "version": "2.13.28", + "version": "2.14.0", "license": "MIT", "dependencies": { "@homebridge/plugin-ui-utils": "^1.0.3", diff --git a/package.json b/package.json index 6ab9e98..2da80f3 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "displayName": "Xbox TV", "name": "homebridge-xbox-tv", - "version": "2.13.28", + "version": "2.14.0", "description": "Homebridge plugin to control Xbox game consoles.", "license": "MIT", "author": "grzegorz914", diff --git a/sample-config.json b/sample-config.json index 6025fed..7d00f9f 100644 --- a/sample-config.json +++ b/sample-config.json @@ -85,14 +85,16 @@ "webApiToken": "", "webApiClientId": "", "webApiClientSecret": "", + "infoButtonCommand": "nexus", + "volumeControlNamePrefix": false, + "volumeControlName": "Volume", + "volumeControl": 0, "enableDebugMode": false, "disableLogInfo": false, "disableLogDeviceInfo": false, - "infoButtonCommand": "nexus", - "volumeControl": 0, "enableRestFul": false, - "restFulPort": 3000, - "restFulDebug": false, + "restFulPort": 3000, + "restFulDebug": false, "enableMqtt": false, "mqttDebug": false, "mqttHost": "192.168.1.33", diff --git a/src/xboxdevice.js b/src/xboxdevice.js index 5a42149..1d4e35a 100644 --- a/src/xboxdevice.js +++ b/src/xboxdevice.js @@ -47,6 +47,8 @@ class XboxDevice extends EventEmitter { this.disableLogDeviceInfo = device.disableLogDeviceInfo || false; this.infoButtonCommand = device.infoButtonCommand || 'nexus'; this.volumeControl = device.volumeControl || false; + this.volumeControlNamePrefix = device.volumeControlNamePrefix || false; + this.volumeControlName = device.volumeControlName || 'Volume'; //external integration this.restFulConnected = false; @@ -949,10 +951,11 @@ class XboxDevice extends EventEmitter { //Prepare volume service if (this.volumeControl) { const debug = !this.enableDebugMode ? false : this.emit('debug', `Prepare volume service`); + const volumeServiceName = this.volumeControlNamePrefix ? `${accessoryName} ${this.volumeControlName}` : this.volumeControlName; if (this.volumeControl === 1) { - this.volumeService = accessory.addService(Service.Lightbulb, `${accessoryName} Volume`, 'Volume'); + this.volumeService = accessory.addService(Service.Lightbulb, `${volumeServiceName}`, 'Volume'); this.volumeService.addOptionalCharacteristic(Characteristic.ConfiguredName); - this.volumeService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} Volume`); + this.volumeService.setCharacteristic(Characteristic.ConfiguredName, `${volumeServiceName}`); this.volumeService.getCharacteristic(Characteristic.Brightness) .onGet(async () => { const volume = this.volume; @@ -974,9 +977,9 @@ class XboxDevice extends EventEmitter { } if (this.volumeControl === 2) { - this.volumeServiceFan = accessory.addService(Service.Fan, `${accessoryName} Volume`, 'Volume'); + this.volumeServiceFan = accessory.addService(Service.Fan, `${volumeServiceName}`, 'Volume'); this.volumeServiceFan.addOptionalCharacteristic(Characteristic.ConfiguredName); - this.volumeServiceFan.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} Volume`); + this.volumeServiceFan.setCharacteristic(Characteristic.ConfiguredName, `${volumeServiceName}`); this.volumeServiceFan.getCharacteristic(Characteristic.RotationSpeed) .onGet(async () => { const volume = this.volume;