Skip to content

Commit

Permalink
release 2.19.0
Browse files Browse the repository at this point in the history
  • Loading branch information
grzegorz914 committed May 19, 2024
1 parent 098851c commit 05119d0
Show file tree
Hide file tree
Showing 8 changed files with 137 additions and 51 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@
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/)

## [2.19.0] - (19.05.2024)

## Changes

- added support for service menu access from the input list
- added support for ez adjust menu access from the input list
- config schema updated
- cleanup

## [2.18.0] - (18.05.2024)

## Changes
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,13 @@ Tested with OLED65G6V, 32LM6300PLA, 49SK8500, OLED65C7T, 55SK800PLB, OLED48CX.
| `turnScreenOnOff` | This enable possibility turn the screen ON/OFF, webOS >= 4.0. |
| `turnScreenSaverOnOff` | This enable possibility turn the screen saver ON/OFF, webOS >= 4.0. |
| `sslWebSocket` | If enabled, SSL WebSocket will support TV with new firmware. |
| `serviceMenu` | If enabled, service menu will be available from the input list. |
| `ezAdjustMenu` | If enabled, ez adjust menu will be available from the input list. |
| `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. |
| `disableTvService` | If enabled, TV service will be disabled and prevent display double services if TV already support HomeKit native. |
| `infoButtonCommand` | Here select the function of `I` button in RC app. |
| `enableRestFul` | If enabled, RESTful server will start automatically and respond to any path request. |
| `restFulPort` | Here set the listening `Port` for RESTful server, every device need own port. |
| `restFulDebug` | If enabled, deep log will be present in homebridge console for RESTFul server. |
Expand Down
16 changes: 16 additions & 0 deletions config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1233,6 +1233,20 @@
}
}
},
"serviceMenu": {
"title": "Service Menu",
"type": "boolean",
"default": false,
"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",
Expand Down Expand Up @@ -1631,6 +1645,8 @@
"title": "Device",
"items": [
"devices[].sslWebSocket",
"devices[].serviceMenu",
"devices[].ezAdjustMenu",
"devices[].infoButtonCommand"
]
},
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.18.3",
"version": "2.19.0",
"description": "Homebridge plugin to control LG webOS TV.",
"license": "MIT",
"author": "grzegorz914",
Expand Down
2 changes: 2 additions & 0 deletions sample-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@
"enableRestFul": false,
"restFulPort": 3000,
"restFulDebug": false,
"serviceMenu": false,
"ezAdjustMenu": false,
"enableMqtt": false,
"mqttDebug": false,
"mqttHost": "192.168.1.33",
Expand Down
5 changes: 3 additions & 2 deletions src/constants.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@
"RebootTvWebOs5": "luna://com.webos.service.tv.power/reboot",
"ShowInputPicker": "luna://com.webos.surfacemanager/showInputPicker",
"SetDeviceInfo": "luna://com.webos.service.eim/setDeviceInfo",
"EjectDevice": "luna://com.webos.service.attachedstoragemanager/ejectDevice"
"EjectDevice": "luna://com.webos.service.attachedstoragemanager/ejectDevice",
"ServiceMenu": "com.webos.app.factorywin"
},
"Pairing": {
"forcePairing": false,
Expand Down Expand Up @@ -226,7 +227,6 @@
"com.webos.app.twinlivezoom-intwindemo",
"com.webos.app.twinzoom-inmiracast",
"com.webos.app.tvtutorial",
"com.webos.app.factorywin",
"com.webos.app.inputcommon",
"com.webos.app.mvpdwin",
"com.webos.app.mystarter",
Expand Down Expand Up @@ -307,6 +307,7 @@
"com.webos.app.lgnlp",
"com.webos.app.actionhandler",
"com.webos.app.channeledit",
"com.webos.app.factorywin",
"com.webos.exampleapp.enyoapp.epg",
"com.webos.exampleapp.qmlapp.hbbtv",
"com.webos.exampleapp.qmlapp.client.positive.one",
Expand Down
56 changes: 46 additions & 10 deletions src/lgwebosdevice.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ class LgWebOsDevice extends EventEmitter {
this.soundModes = this.soundModeControl ? device.soundModes || [] : [];
this.soundOutputControl = device.soundOutputControl || false;
this.soundOutputs = this.soundOutputControl ? device.soundOutputs || [] : [];
this.serviceMenu = device.serviceMenu || false;
this.ezAdjustMenu = device.ezAdjustMenu || false;
this.enableDebugMode = device.enableDebugMode || false;
this.disableLogInfo = device.disableLogInfo || false;
this.disableLogDeviceInfo = device.disableLogDeviceInfo || false;
Expand Down Expand Up @@ -238,6 +240,8 @@ class LgWebOsDevice extends EventEmitter {
inputsFile: inputsFile,
channelsFile: channelsFile,
getInputsFromDevice: this.getInputsFromDevice,
serviceMenu: this.serviceMenu,
ezAdjustMenu: this.ezAdjustMenu,
filterSystemApps: this.filterSystemApps,
debugLog: this.enableDebugMode,
sslWebSocket: this.sslWebSocket
Expand Down Expand Up @@ -924,9 +928,41 @@ class LgWebOsDevice extends EventEmitter {
case true:
switch (inputMode) {
case 0:
const screenSaver = 'com.webos.app.screensaver';
const cid = inputReference === screenSaver ? await this.lgWebOsSocket.getCid() : await this.lgWebOsSocket.getCid('App');
const set = inputReference === screenSaver ? await this.lgWebOsSocket.send('alert', CONSTANTS.ApiUrls.TurnOnScreenSaver, undefined, cid, 'Set Screen Saver', `Value: ON`) : await this.lgWebOsSocket.send('request', CONSTANTS.ApiUrls.LaunchApp, { id: inputReference }, cid);
switch (inputReference) {
case 'com.webos.app.screensaver': //screen saver
const cid = await this.lgWebOsSocket.getCid();
await this.lgWebOsSocket.send('alert', CONSTANTS.ApiUrls.TurnOnScreenSaver, undefined, cid, 'Screen Saver', `ON`);
break;
case 'service.menu': //service menu
const payload1 = {
id: CONSTANTS.ApiUrls.ServiceMenu,
params: {
id: "executeFactory",
irKey: "inStart"
}
}
const cid1 = await this.lgWebOsSocket.getCid('App');
await this.lgWebOsSocket.send('request', CONSTANTS.ApiUrls.LaunchApp, payload1, cid1);
break;
case 'ez.adjust': //ez adjust
const payload2 = {
id: CONSTANTS.ApiUrls.ServiceMenu,
params: {
id: "executeFactory",
irKey: "ezAdjust"
}
}
const cid2 = await this.lgWebOsSocket.getCid('App');
await this.lgWebOsSocket.send('request', CONSTANTS.ApiUrls.LaunchApp, payload2, cid2);
break;
default:
const payload3 = {
id: inputReference
}
const cid3 = await this.lgWebOsSocket.getCid('App');
await this.lgWebOsSocket.send('request', CONSTANTS.ApiUrls.LaunchApp, payload3, cid3);
break;
}
break;
case 1:
const liveTv = 'com.webos.app.livetv';
Expand Down Expand Up @@ -1431,7 +1467,7 @@ class LgWebOsDevice extends EventEmitter {
};

const cid = await this.lgWebOsSocket.getCid();
await this.lgWebOsSocket.send('alert', CONSTANTS.ApiUrls.SetSystemSettings, payload, cid, 'Set Backlight', `Value: ${value}`);
await this.lgWebOsSocket.send('alert', CONSTANTS.ApiUrls.SetSystemSettings, payload, cid, 'Backlight', `Value: ${value}`);
const info = this.disableLogInfo ? false : this.emit('message', `set Backlight: ${value}`);
} catch (error) {
this.emit('error', `set Backlight error: ${error}`);
Expand Down Expand Up @@ -1467,7 +1503,7 @@ class LgWebOsDevice extends EventEmitter {
};

const cid = await this.lgWebOsSocket.getCid();
await this.lgWebOsSocket.send('alert', CONSTANTS.ApiUrls.SetSystemSettings, payload, cid, 'Set Brightness', `Value: ${value}`);
await this.lgWebOsSocket.send('alert', CONSTANTS.ApiUrls.SetSystemSettings, payload, cid, 'Brightness', `Value: ${value}`);
const info = this.disableLogInfo ? false : this.emit('message', `set Brightness: ${value}`);
} catch (error) {
this.emit('error', `set Brightness error: ${error}`);
Expand Down Expand Up @@ -1503,7 +1539,7 @@ class LgWebOsDevice extends EventEmitter {
};

const cid = await this.lgWebOsSocket.getCid();
await this.lgWebOsSocket.send('alert', CONSTANTS.ApiUrls.SetSystemSettings, payload, cid, 'Set Contrast', `Value: ${value}`);
await this.lgWebOsSocket.send('alert', CONSTANTS.ApiUrls.SetSystemSettings, payload, cid, 'Contrast', `Value: ${value}`);
const info = this.disableLogInfo ? false : this.emit('message', `set Contrast: ${value}`);
} catch (error) {
this.emit('error', `set Contrast error: ${error}`);
Expand Down Expand Up @@ -1539,7 +1575,7 @@ class LgWebOsDevice extends EventEmitter {
};

const cid = await this.lgWebOsSocket.getCid();
await this.lgWebOsSocket.send('alert', CONSTANTS.ApiUrls.SetSystemSettings, payload, cid, 'Set Color', `Value: ${value}`);
await this.lgWebOsSocket.send('alert', CONSTANTS.ApiUrls.SetSystemSettings, payload, cid, 'Color', `Value: ${value}`);
const info = this.disableLogInfo ? false : this.emit('message', `set Color: ${value}`);
} catch (error) {
this.emit('error', `set Color error: ${error}`);
Expand Down Expand Up @@ -1576,7 +1612,7 @@ class LgWebOsDevice extends EventEmitter {
}

const cid = state ? await this.lgWebOsSocket.getCid() : false;
const set = state ? await this.lgWebOsSocket.send('alert', CONSTANTS.ApiUrls.SetSystemSettings, payload, cid, 'Set Picture Mode', `Value: ${modeName}`) : false;
const set = state ? await this.lgWebOsSocket.send('alert', CONSTANTS.ApiUrls.SetSystemSettings, payload, cid, 'Picture Mode', `Value: ${modeName}`) : false;
const info = this.disableLogInfo ? false : this.emit('message', `set Picture Mode: ${modeName}`);
} catch (error) {
this.emit('error', `set Picture Mode error: ${error}`);
Expand All @@ -1602,7 +1638,7 @@ class LgWebOsDevice extends EventEmitter {
.onSet(async (state) => {
try {
const cid = await this.lgWebOsSocket.getCid();
const set = state ? await this.lgWebOsSocket.send('alert', CONSTANTS.ApiUrls.TurnOnScreenSaver, undefined, cid, 'Set Screen Saver', `Value: ON`) : await this.lgWebOsSocket.send('button', undefined, { name: 'EXIT' });
const set = state ? await this.lgWebOsSocket.send('alert', CONSTANTS.ApiUrls.TurnOnScreenSaver, undefined, cid, 'Screen Saver', `ON`) : await this.lgWebOsSocket.send('button', undefined, { name: 'EXIT' });
const info = this.disableLogInfo ? false : this.emit('message', `set Screen Saver: ${state}`);
} catch (error) {
this.emit('error', `set Color error: ${error}`);
Expand Down Expand Up @@ -1673,7 +1709,7 @@ class LgWebOsDevice extends EventEmitter {
}

const cid = state ? await this.lgWebOsSocket.getCid() : false;
const set = state ? await this.lgWebOsSocket.send('alert', CONSTANTS.ApiUrls.SetSystemSettings, payload, cid, 'Set Sound Mode', `Value: ${modeName}`) : false;
const set = state ? await this.lgWebOsSocket.send('alert', CONSTANTS.ApiUrls.SetSystemSettings, payload, cid, 'Sound Mode', `Value: ${modeName}`) : false;
const info = this.disableLogInfo ? false : this.emit('message', `set Sound Mode: ${modeName}`);
} catch (error) {
this.emit('error', `set Sound Mode error: ${error}`);
Expand Down
Loading

0 comments on commit 05119d0

Please sign in to comment.