Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
grzegorz914 committed Jun 28, 2024
1 parent a25e0e6 commit 53b236e
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 34 deletions.
58 changes: 29 additions & 29 deletions config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1000,7 +1000,7 @@
}
],
"description": "Here select what a volume control mode You want to use. If select *None/Disabled* only hardware buttons in RC app can be used to control volume.",
"required": true
"required": false
},
"soundModeControl": {
"title": "Sound Modes",
Expand Down Expand Up @@ -1245,32 +1245,11 @@
"description": "This enable access to the service menu from input list.",
"required": false
},
"ezAdjustMenu": {
"title": "EZ Adjust Menu",
"type": "boolean",
"default": false,
"description": "This enable access to the ez adjust menu from input list.",
"required": false
},
"enableDebugMode": {
"title": "Debug",
"type": "boolean",
"default": false,
"description": "This enable debug mode.",
"required": false
},
"disableLogInfo": {
"title": "Disable Log Info",
"type": "boolean",
"default": false,
"description": "This disable logging values and states on every it change.",
"required": false
},
"disableLogDeviceInfo": {
"title": "Disable Log Device Info",
"sslWebSocket": {
"title": "SSL WebSocket",
"type": "boolean",
"default": false,
"description": "This disable log device info by every connections device to the network.",
"description": "This enable SSL WebSocket, support TV with new firmware.",
"required": false
},
"disableTvService": {
Expand All @@ -1280,11 +1259,11 @@
"description": "This disable TV service and prevent display double services if TV already support HomeKit native.",
"required": false
},
"sslWebSocket": {
"title": "SSL WebSocket",
"ezAdjustMenu": {
"title": "EZ Adjust Menu",
"type": "boolean",
"default": false,
"description": "This enable SSL WebSocket, support TV with new firmware.",
"description": "This enable access to the ez adjust menu from input list.",
"required": false
},
"infoButtonCommand": {
Expand Down Expand Up @@ -1342,7 +1321,28 @@
}
],
"description": "Here select the function of info button in RC.",
"required": true
"required": false
},
"enableDebugMode": {
"title": "Debug",
"type": "boolean",
"default": false,
"description": "This enable debug mode.",
"required": false
},
"disableLogInfo": {
"title": "Disable Log Info",
"type": "boolean",
"default": false,
"description": "This disable logging values and states on every it change.",
"required": false
},
"disableLogDeviceInfo": {
"title": "Disable Log Device Info",
"type": "boolean",
"default": false,
"description": "This disable log device info by every connections device to the network.",
"required": false
},
"enableRestFul": {
"title": "Enable",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"displayName": "LG webOS TV",
"name": "homebridge-lgwebos-tv",
"version": "2.19.8",
"version": "2.19.10",
"description": "Homebridge plugin to control LG webOS TV.",
"license": "MIT",
"author": "grzegorz914",
Expand Down
12 changes: 8 additions & 4 deletions src/lgwebossocket.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,14 @@ class LgWebOsSocket extends EventEmitter {
};

//Request specjalized socket
await new Promise(resolve => setTimeout(resolve, 2000));
await new Promise(resolve => setTimeout(resolve, 1500));
this.specjalizedSockedId = await this.getCid();
try {
this.specjalizedSockedId = await this.getCid();
await this.send('request', CONSTANTS.ApiUrls.SocketUrl, undefined, this.specjalizedSockedId);
} catch (error) {
this.emit('error', `Request specjalized socket error: ${error}`);
this.emit('error', `Request specjalized socket error: ${error}.`);
await new Promise(resolve => setTimeout(resolve, 5000));
await this.send('request', CONSTANTS.ApiUrls.SocketUrl, undefined, this.specjalizedSockedId);
};
break;
case 'error':
Expand Down Expand Up @@ -160,9 +162,11 @@ class LgWebOsSocket extends EventEmitter {
} catch (error) {
this.emit('error', `Request system info error: ${error}`);
};
}).on('error', (error) => {
}).on('error', async (error) => {
const debug = debugLog ? this.emit('debug', `Specjalized socket connect error: ${error}.`) : false;
specializedSocket.emit('disconnect');
await new Promise(resolve => setTimeout(resolve, 5000));
await this.send('request', CONSTANTS.ApiUrls.SocketUrl, undefined, this.specjalizedSockedId);
}).on('disconnect', () => {
const message = this.specjalizedSocketConnected ? this.emit('message', 'Specjalized socket disconnected.') : false;
this.specjalizedSocketConnected = false;
Expand Down

0 comments on commit 53b236e

Please sign in to comment.