Update xiaoshi-pad-climate-card.js

This commit is contained in:
xiaoshi
2026-01-25 20:01:09 +08:00
committed by GitHub
parent 1908ec0fae
commit d0c11c3f08

View File

@@ -1980,11 +1980,9 @@ _renderExtraButtons(buttonType = 1) {
if (name.includes('防冻')) return isActive ? 'mdi:snowflake' : 'mdi:snowflake-off';
if (name.includes('防烫伤')) return isActive ? 'mdi:fire' : 'mdi:fire-off';
if (name.includes('按键锁')) return isActive ? 'mdi:lock-open' : 'mdi:lock-open-variant';
if (name.includes('息屏')) return 'mdi:lightbulb-off';
return null;
};
switch(domain) {
case 'switch':
case 'light':
@@ -2011,7 +2009,7 @@ _renderExtraButtons(buttonType = 1) {
return html`
<div class="side-extra-button" style="cursor: default; --bg-color: ${bgColor};">
<div class="side-value" style="color: ${displayValueColor}; font-size: 12px;">${displayValue}</div>
<div class="side-value" style="color: ${displayValueColor}; font-size: 11px; font-weight: bold; white-space: nowrap">${displayValue}</div>
<span class="side-text" style="color: ${fgColor};">${displayName}</span>
</div>
`;
@@ -2029,15 +2027,14 @@ _renderExtraButtons(buttonType = 1) {
`;
case 'select':
const options = entity.attributes.options || [];
const firstOption = options[0] || '';
const selectDisplayValue = firstOption.slice(0, 4);
const state = entity.state || '';
const selectDisplayValue = state.slice(0, 4);
return html`
<div class="side-extra-button"
@click=${() => this._handleExtraButtonClick(buttonEntityId, domain)}
style="cursor: default; --bg-color: ${bgColor};">
<div class="side-value" style="color: ${fgColor}; font-size: 12px;">${selectDisplayValue}</div>
<div class="side-value" style="color: ${fgColor}; font-size: 11px; font-weight: bold; white-space: nowrap">${selectDisplayValue}</div>
<span class="side-text" style="color: ${fgColor};">${displayName}</span>
</div>
`;