Skip to content

Commit

Permalink
release v2.20.0
Browse files Browse the repository at this point in the history
  • Loading branch information
grzegorz914 committed Aug 4, 2024
1 parent 8ecc915 commit e07640b
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 7 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.20.0] - (04.08.2024)

## Changes

- added possiblity to set own volume control name and enable/disable prefix
- config schema updated
- bump dependencies
- cleanup

## [2.19.0] - (19.05.2024)

## Changes
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ Tested with OLED65G6V, 32LM6300PLA, 49SK8500, OLED65C7T, 55SK800PLB, OLED48CX.
| `soundOutputs.reference` | Here select output to be exposed in *Homebridge/HomeKit*. |
| `soundModes.displayType` | Here select display type in HomeKit app, possible `0 - None/Disabled`, `1 - Outlet`, `2 - Switch`.|
| `soundOutputs.namePrefix` | Here enable/disable the accessory name as a prefix for sound output.|
| `volumeControlNamePrefix` | Here enable/disable the accessory name as a prefix for volume control name. |
| `volumeControlName` | Here set Your own volume control name or leave empty. |
| `volumeControl` | Here select volume control mode `0 - None/Disabled`, `1 - Slider`, `2 - Fan`. |
| `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. |
Expand Down
16 changes: 16 additions & 0 deletions config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -973,6 +973,20 @@
},
"required": false
},
"volumeControlNamePrefix": {
"title": "Volume Control Name Prefix",
"type": "boolean",
"default": false,
"description": "Here enable/disable the accessory name as a prefix for volume control name.",
"required": false
},
"volumeControlName": {
"title": "Volume Control Name",
"type": "string",
"placeholder": "Name",
"description": "Here set Your own volume control name or leave empty.",
"required": false
},
"volumeControl": {
"title": "Volume",
"type": "integer",
Expand Down Expand Up @@ -1605,6 +1619,8 @@
"key": "devices[]",
"title": "Sound / Volume",
"items": [
"devices[].volumeControlNamePrefix",
"devices[].volumeControlName",
"devices[].volumeControl",
"devices[].soundModeControl",
{
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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.22",
"version": "2.20.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 @@ -102,6 +102,8 @@
"namePrefix": false
}
],
"volumeControlNamePrefix": false,
"volumeControlName": "Volume",
"volumeControl": 0,
"sensorPower": false,
"sensorPixelRefresh": false,
Expand Down
11 changes: 7 additions & 4 deletions src/lgwebosdevice.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ class LgWebOsDevice extends EventEmitter {
this.turnScreenSaverOnOff = device.turnScreenSaverOnOff || false;
this.sslWebSocket = device.sslWebSocket || false;
this.infoButtonCommand = device.infoButtonCommand || 'INFO';
this.volumeControlNamePrefix = device.volumeControlNamePrefix || false;
this.volumeControlName = device.volumeControlName || 'Volume';
this.volumeControl = device.volumeControl || false;

//external integration
Expand Down Expand Up @@ -1345,10 +1347,11 @@ class LgWebOsDevice extends EventEmitter {
//Prepare volume service
if (this.volumeControl) {
const debug = this.enableDebugMode ? this.emit('debug', `Prepare volume service`) : false;
const volumeServiceName = this.volumeControlNamePrefix ? `${accessoryName} ${this.volumeControlName}` : this.volumeControlName;
if (this.volumeControl === 1) {
this.volumeService = accessory.addService(Service.Lightbulb, `${accessoryName} Volume`, 'Volume');
this.volumeService = accessory.addService(Service.Lightbulb, `${volumeServiceName}`, 'Volume');
this.volumeService.addOptionalCharacteristic(Characteristic.ConfiguredName);
this.volumeService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} Volume`);
this.volumeService.setCharacteristic(Characteristic.ConfiguredName, `${volumeServiceName}`);
this.volumeService.getCharacteristic(Characteristic.Brightness)
.onGet(async () => {
const volume = this.volume;
Expand Down Expand Up @@ -1391,9 +1394,9 @@ class LgWebOsDevice extends EventEmitter {
}

if (this.volumeControl === 2) {
this.volumeServiceFan = accessory.addService(Service.Fan, `${accessoryName} Volume`, 'Volume Fan');
this.volumeServiceFan = accessory.addService(Service.Fan, `${volumeServiceName}`, 'Volume Fan');
this.volumeServiceFan.addOptionalCharacteristic(Characteristic.ConfiguredName);
this.volumeServiceFan.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} Volume`);
this.volumeServiceFan.setCharacteristic(Characteristic.ConfiguredName, `${volumeServiceName}`);
this.volumeServiceFan.getCharacteristic(Characteristic.RotationSpeed)
.onGet(async () => {
const volume = this.volume;
Expand Down

0 comments on commit e07640b

Please sign in to comment.