Skip to content

Commit

Permalink
fix ex int
Browse files Browse the repository at this point in the history
  • Loading branch information
grzegorz914 committed Sep 7, 2024
1 parent 14dbab5 commit c6cfebe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
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": "3.1.7",
"version": "3.1.8",
"description": "Homebridge plugin to control Xbox game consoles.",
"license": "MIT",
"author": "grzegorz914",
Expand Down
12 changes: 6 additions & 6 deletions src/xboxdevice.js
Original file line number Diff line number Diff line change
Expand Up @@ -313,12 +313,12 @@ class XboxDevice extends EventEmitter {
//RESTFul server
const restFulEnabled = this.restFul.enable || false;
if (restFulEnabled) {
this.restFul = new RestFul({
this.restFul1 = new RestFul({
port: this.restFul.port || 3000,
debug: this.restFul.debug || false
});

this.restFul.on('connected', (message) => {
this.restFul1.on('connected', (message) => {
this.restFulConnected = true;
this.emit('success', message);
})
Expand All @@ -340,7 +340,7 @@ class XboxDevice extends EventEmitter {
//mqtt client
const mqttEnabled = this.mqtt.enable || false;
if (mqttEnabled) {
this.mqtt = new Mqtt({
this.mqtt1 = new Mqtt({
host: this.mqtt.host,
port: this.mqtt.port || 1883,
clientId: this.mqtt.clientId || `xbox_${Math.random().toString(16).slice(3)}`,
Expand All @@ -350,7 +350,7 @@ class XboxDevice extends EventEmitter {
debug: this.mqtt.debug || false
});

this.mqtt.on('connected', (message) => {
this.mqtt1.on('connected', (message) => {
this.mqttConnected = true;
this.emit('success', message);
})
Expand Down Expand Up @@ -433,10 +433,10 @@ class XboxDevice extends EventEmitter {
this.emit('message', message);
})
.on('restFul', (path, data) => {
const restFul = this.restFulConnected ? this.restFul.update(path, data) : false;
const restFul = this.restFulConnected ? this.restFul1.update(path, data) : false;
})
.on('mqtt', (topic, message) => {
const mqtt = this.mqttConnected ? this.mqtt.emit('publish', topic, message) : false;
const mqtt = this.mqttConnected ? this.mqtt1.emit('publish', topic, message) : false;
});

//connect to local api
Expand Down

0 comments on commit c6cfebe

Please sign in to comment.