Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,21 @@ channels:
number: '503'
```


### Custom button Options
The LG tv remote has more buttons available, also depending on the model.

| Name | Type | Default | Supported options | Description |
| -------------- | ----------- | ------------ | ------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `name` | string | **Required** | A [Supported button](https://www.home-assistant.io/integrations/webostv/#service-webostvbutton) command | |
| `icon` | string | **Required** | 'mdi:netflix'| url of the image to be displayed in the extra button |

```yaml
custom_buttons:
- name: SCREEN_REMOTE
icon: mdi:dots-horizontal
```

### Colors Options
| Name | Type | Default | Supported options | Description |
| -------------- | ----------- | ------------ | ------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
Expand Down
43 changes: 42 additions & 1 deletion lg-remote-control.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,11 @@ class LgRemoteControl extends LitElement {
<button class="btn-flat flat-high ripple" @click=${() => this._channelList()}><ha-icon icon="mdi:format-list-numbered"/></button>
<button class="btn ripple" @click=${() => this._media_player_service("toggle")}><ha-icon icon="mdi:power" style="color: ${stateObj.state === 'off' ? 'black' : 'red'};"/></button>
<button class="btn-flat flat-high ripple" @click=${() => this._show_keypad = !this._show_keypad}>123</button>


</div>


${this._show_inputs ? html`
<!-- ################################# SOURCES ################################# -->
<div class="grid-container-input">
Expand Down Expand Up @@ -353,6 +357,21 @@ class LgRemoteControl extends LitElement {
`}

`}
<!-- ################################# EXTRA BUTTONS ################################# -->
${this.config.custom_buttons ? html`
<div class="grid-container-extra-buttons">
${this.config.custom_buttons.map(button => {
return html`
<button class="btn_extra ripple" @click=${() => this._button(button.name)}>
${LgRemoteControl.getIcon(button.icon)}
</button>
`;
})}
</div>
` : html`
`}
<!-- ################################# EXTRA BUTTONS END ################################# -->

<!-- ################################# SOURCE BUTTONS ################################# -->
${this.config.sources ? html`
<div class="grid-container-source">
Expand Down Expand Up @@ -547,7 +566,7 @@ class LgRemoteControl extends LitElement {
.grid-container-power {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
grid-template-rows: 1fr;
grid-template-rows: 2fr;
background-color: transparent;
overflow: hidden;
width: var(--remotewidth);
Expand Down Expand Up @@ -592,6 +611,16 @@ class LgRemoteControl extends LitElement {
width: var(--remotewidth);
grid-template-areas: "bnt title" ". ." "tv tv-opt" "tv-phone opt" "hdmi line" "phone bluetooth"
}
.grid-container-extra-buttons {
display: grid;
grid-template-columns: 1fr 1fr 1fr 1fr;
grid-template-rows: auto;
background-color: transparent;
width: calc(var(--remotewidth) / 1.03);
overflow: hidden;
margin: auto;
}

.grid-container-source {
display: grid;
grid-template-columns: 1fr 1fr 1fr 1fr;
Expand Down Expand Up @@ -829,6 +858,16 @@ class LgRemoteControl extends LitElement {
width: 100%;
height: 100%;
border-width: 0px;
}
.btn_extra {
background-color: var(--remote-button-color);
color: var(--remote-text-color);
height: 70%;
border-width: 0px;
border-radius: 50%;
margin: calc(var(--remotewidth) / 18.57) auto calc(var(--remotewidth) / 20) auto;
place-items: center;
cursor: pointer;
}
.btn_source {
background-color: var(--remote-button-color);
Expand All @@ -841,6 +880,8 @@ class LgRemoteControl extends LitElement {
place-items: center;
cursor: pointer;
}


.btn-color {
background-color: var(--remote-button-color);
color: var(--remote-text-color);
Expand Down