Skip to content

Commit

Permalink
Update editor.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
madmicio authored Nov 12, 2023
1 parent db46798 commit 4300726
Showing 1 changed file with 31 additions and 13 deletions.
44 changes: 31 additions & 13 deletions src/editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,19 @@ class LgRemoteControlEditor extends LitElement {
<br>`
}

setRemoteName(remoteNameValue) {
remoteNameValue = remoteNameValue ?? this._config.name;
let heading = 'Remote Control Name (option):';
return html`
${heading}<br>
<input type="text" name="name" id="name" style="background-color:var(--label-badge-text-color);width: 37.8ch;padding: .6em; font-size: 1em;" .value="${remoteNameValue}"
@input=${this.configChanged}
<br><br>
`;
}

selectMac(macValue) {
// Imposta un valore di esempio predefinito

macValue = macValue ?? '00:11:22:33:44:55';

let heading = 'MAC Address:';
return html`
${heading}<br>
Expand Down Expand Up @@ -337,16 +345,26 @@ class LgRemoteControlEditor extends LitElement {
}

return html`
${this.getLgTvEntityDropdown(this._config.entity)}
${this.selectMac(this._config.mac)}
${this.selectColors(this._config)}
${this.colorButtonsConfig(this._config)}
${this.getDeviceAVReceiverDropdown(this._config.av_receiver_family)}
${this.getMediaPlayerEntityDropdown(this._config.av_receiver_family)}
${this.setDimensions(this._config.dimensions??{})}
<br>
Other functionalities must be configured manually in YAML editor
`;
${this.getLgTvEntityDropdown(this._config.entity)}
${this.selectMac(this._config.mac)}
${this.setRemoteName(this._config.mac)}
${this.selectColors(this._config)}
${this.colorButtonsConfig(this._config)}
${this.getDeviceAVReceiverDropdown(this._config.av_receiver_family)}
${this.getMediaPlayerEntityDropdown(this._config.av_receiver_family)}
${this.setDimensions(this._config.dimensions??{})}
<br>
<p>Other functionalities must be configured manually in YAML editor</p>
<p>references to <a href="https://github.com/madmicio/LG-WebOS-Remote-Control">https://github.com/madmicio/LG-WebOS-Remote-Control</a></p>
<div class="donations" style="display: flex">
<a href="https://www.buymeacoffee.com/madmicio" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" style="height: 60px !important;width: 217px !important;" ></a>
<form action="https://www.paypal.com/donate" method="post" target="_top">
<input type="hidden" name="hosted_button_id" value="U5VQ9LHM82B7Q" />
<input type="image" src="https://pics.paypal.com/00/s/ODdjZjVlZjAtOWVmYS00NjQyLTkyZTUtNWQ3MmMzMmIxYTcx/file.PNG" border="0" name="submit" title="PayPal - The safer, easier way to pay online!" alt="Donate with PayPal button" style="height:60px;" />
<img alt="" border="0" src="https://www.paypal.com/en_IT/i/scr/pixel.gif" width="1" height="1" />
</form>
</div>
`;
}

static get styles() {
Expand Down

0 comments on commit 4300726

Please sign in to comment.