Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add config to hide LED button #68

Merged
merged 1 commit into from
Feb 28, 2022
Merged
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
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