Skip to content

Commit

Permalink
Add config to hide LED button
Browse files Browse the repository at this point in the history
  • Loading branch information
ian-craig authored and ikaruswill committed Feb 28, 2022
1 parent d11c4fd commit b688bdf
Showing 1 changed file with 40 additions and 28 deletions.
68 changes: 40 additions & 28 deletions fan-xiaomi.js
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ LED
activeElement.classList.remove('active')
}
activeElement = fanboxa.querySelector('.var-led')
if (this.supportedAttributes.led) {
if (this.supportedAttributes.led && !this.config.hide_led_button) {
if (led) {
if (activeElement.classList.contains('active') === false) {
activeElement.classList.add('active')
Expand Down Expand Up @@ -836,6 +836,9 @@ class ContentCardEditor extends LitElement {
}
render() {
return html`
<style>
.row{padding-bottom:5px;}
</style>
<div class="card-config">
<div class="row">
<paper-input
Expand All @@ -846,33 +849,6 @@ class ContentCardEditor extends LitElement {
></paper-input>
</div>
<div class="row">
<ha-formfield label="Disable animation">
<ha-switch
.checked=${this.config.disable_animation}
.configValue="${'disable_animation'}"
@change=${this._valueChanged}
></ha-switch>
</ha-formfield>
</div>
<div class="row">
<ha-formfield label="Use HA standard speeds (low/medium/high)">
<ha-switch
.checked=${this.config.use_standard_speeds}
.configValue="${'use_standard_speeds'}"
@change=${this._valueChanged}
></ha-switch>
</ha-formfield>
</div>
<div class="row">
<ha-formfield label="Show sleep mode button">
<ha-switch
.checked=${this.config.force_sleep_mode_support}
.configValue="${'force_sleep_mode_support'}"
@change=${this._valueChanged}
></ha-switch>
</ha-formfield>
</div>
<div class="row">
<paper-dropdown-menu
label="Platform"
.configValue=${'platform'}
Expand Down Expand Up @@ -902,6 +878,42 @@ class ContentCardEditor extends LitElement {
allow-custom-entity
></ha-entity-picker>
</div>
<div class="row">
<ha-formfield label="Disable animation">
<ha-switch
.checked=${this.config.disable_animation}
.configValue="${'disable_animation'}"
@change=${this._valueChanged}
></ha-switch>
</ha-formfield>
</div>
<div class="row">
<ha-formfield label="Use HA standard speeds (low/medium/high)">
<ha-switch
.checked=${this.config.use_standard_speeds}
.configValue="${'use_standard_speeds'}"
@change=${this._valueChanged}
></ha-switch>
</ha-formfield>
</div>
<div class="row">
<ha-formfield label="Show sleep mode button">
<ha-switch
.checked=${this.config.force_sleep_mode_support}
.configValue="${'force_sleep_mode_support'}"
@change=${this._valueChanged}
></ha-switch>
</ha-formfield>
</div>
<div class="row">
<ha-formfield label="Hide LED button (for supported devices)">
<ha-switch
.checked=${this.config.hide_led_button}
.configValue="${'hide_led_button'}"
@change=${this._valueChanged}
></ha-switch>
</ha-formfield>
</div>
</div>
`
}
Expand Down

0 comments on commit b688bdf

Please sign in to comment.