diff --git a/xiaoshi-pad-climate-card.js b/xiaoshi-pad-climate-card.js index 7b53aa8..22af265 100644 --- a/xiaoshi-pad-climate-card.js +++ b/xiaoshi-pad-climate-card.js @@ -166,7 +166,10 @@ class XiaoshiPadClimateCardEditor extends LitElement { if (this.config.show_humidifier_modes === undefined) { this.config.show_humidifier_modes = this._availableModes.hasHumidifierModes; } - if (this.config.show_humidifier_switch === undefined) { + // 加湿器实体时,自动设置显示加湿器开关为 true + if (isHumidifierEntity) { + this.config.show_humidifier_switch = true; + } else if (this.config.show_humidifier_switch === undefined) { this.config.show_humidifier_switch = this._availableModes.hasHumidifierSwitch; } @@ -977,11 +980,11 @@ class XiaoshiPadClimateCardEditor extends LitElement { ${this._renderModeFilter('available_modes', '加湿器模式筛选')} ` : ''} - ${this._availableModes?.hasHumidifierSwitch ? html` + ${this.config.entity?.startsWith('humidifier.') ? html`