homebridge-lgwebos-tv 4.2.4 → 4.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/src/lgwebossocket.js +5 -2
- package/src/mqtt.js +2 -4
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"displayName": "LG webOS TV",
|
|
3
3
|
"name": "homebridge-lgwebos-tv",
|
|
4
|
-
"version": "4.2.
|
|
4
|
+
"version": "4.2.6",
|
|
5
5
|
"description": "Homebridge plugin to control LG webOS TV.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "grzegorz914",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"node": "^20 || ^22 || ^24 || ^25"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"mqtt": "^5.
|
|
37
|
+
"mqtt": "^5.15.0",
|
|
38
38
|
"ws": "^8.19.0",
|
|
39
39
|
"express": "^5.2.1"
|
|
40
40
|
},
|
package/src/lgwebossocket.js
CHANGED
|
@@ -94,6 +94,7 @@ class LgWebOsSocket extends EventEmitter {
|
|
|
94
94
|
}
|
|
95
95
|
this.socket = null;
|
|
96
96
|
this.socketConnected = false;
|
|
97
|
+
this.specializedSocketConnected = false;
|
|
97
98
|
this.cidCount = 0;
|
|
98
99
|
this.power = false;
|
|
99
100
|
this.screenState = 'Suspend';
|
|
@@ -365,8 +366,10 @@ class LgWebOsSocket extends EventEmitter {
|
|
|
365
366
|
}
|
|
366
367
|
|
|
367
368
|
//Request specjalized socket
|
|
368
|
-
|
|
369
|
-
|
|
369
|
+
if (!this.specializedSocketConnected) {
|
|
370
|
+
this.specializedSocketId = await this.getCid();
|
|
371
|
+
await this.send('request', ApiUrls.SocketUrl, undefined, this.specializedSocketId);
|
|
372
|
+
}
|
|
370
373
|
|
|
371
374
|
//Send initial power state
|
|
372
375
|
if (!this.power) {
|
package/src/mqtt.js
CHANGED
|
@@ -38,10 +38,8 @@ class Mqtt extends EventEmitter {
|
|
|
38
38
|
}
|
|
39
39
|
});
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
this.emit('subscribed', `MQTT Subscribe topic: ${subscribeTopic}`);
|
|
44
|
-
|
|
41
|
+
/// MQTT v5 subscription results
|
|
42
|
+
this.emit('connected', `MQTT Subscribe topic: ${subscribeTopic}`);
|
|
45
43
|
} catch (error) {
|
|
46
44
|
if (config.logWarn) this.emit('warn', `MQTT Subscribe error: ${error}`);
|
|
47
45
|
}
|