diff --git a/CHANGELOG.md b/CHANGELOG.md index 4bf2b23..a6f3ff7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### NOTE!!! ## After update to 2.x.x the plugin settings (xboxLiveId) need to be updated. +## [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 diff --git a/index.js b/index.js index 499ce37..7c98936 100644 --- a/index.js +++ b/index.js @@ -195,6 +195,7 @@ class xboxTvDevice { this.name = config.name || 'Game console'; this.host = config.host; this.xboxLiveId = config.xboxLiveId; + this.webApiControl = config.webApiControl || false; this.clientId = config.clientId || '5e5ead27-ed60-482d-b3fc-702b28a97404'; this.clientSecret = config.clientSecret || false; this.userToken = config.userToken; diff --git a/package.json b/package.json index df142fa..cec7f59 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "displayName": "Xbox TV", "name": "homebridge-xbox-tv", - "version": "2.2.1", + "version": "2.2.2", "description": "Homebridge plugin (https://github.com/homebridge/homebridge) to control Xbox game consoles.", "license": "MIT", "author": "grzegorz914", diff --git a/src/mqtt.js b/src/mqtt.js index 9876719..9dd1f51 100644 --- a/src/mqtt.js +++ b/src/mqtt.js @@ -30,6 +30,7 @@ class MQTTCLIENT extends EventEmitter { this.isConnected = true; this.emit('connected', 'MQTT Connected.'); } catch (error) { + this.isConnected = false; this.emit('error', `MQTT Connect error: ${error}`); }; }; @@ -44,7 +45,6 @@ class MQTTCLIENT extends EventEmitter { await this.mqttClient.publish(fullTopic, message); const emitDebug = this.mqttDebug ? this.emit('debug', `MQTT publish: ${fullTopic}: ${message}`) : false; } catch (error) { - this.isConnected = false; this.emit('error', `MQTT Publish error: ${error}`); }; };