diff --git a/xiaoshi-device-ha-info-button.js b/xiaoshi-device-ha-info-button.js
index f4dff5c..5e27e5a 100644
--- a/xiaoshi-device-ha-info-button.js
+++ b/xiaoshi-device-ha-info-button.js
@@ -93,7 +93,6 @@ class XiaoshiHaInfoButtonEditor extends LitElement {
-
- ${!hideIcon ? html`
` : ''}
+
+ ${!hideIcon ? html`` : ''}
${displayText}
`;
@@ -1845,7 +1863,17 @@ export class XiaoshiHaInfoButton extends LitElement {
`;
} else {
// 普通模式:显示文本和数量
- const textColor = warningCount === 0 ? fgColor : 'rgb(255, 0, 0)';
+ // 应用锁定白色功能,但预警颜色(红色)不受影响
+ let textColor, iconColor;
+ if (warningCount === 0) {
+ // 非预警状态:根据锁定白色设置决定颜色
+ textColor = lockWhiteFg ? 'rgb(255, 255, 255)' : fgColor;
+ iconColor = lockWhiteFg ? 'rgb(255, 255, 255)' : fgColor;
+ } else {
+ // 预警状态:始终使用红色,不受锁定白色影响
+ textColor = 'rgb(255, 0, 0)';
+ iconColor = lockWhiteFg ? 'rgb(255, 255, 255)' : fgColor;
+ }
// 构建显示文本
let displayText = buttonText;
@@ -1867,7 +1895,7 @@ export class XiaoshiHaInfoButton extends LitElement {
buttonHtml = html`
- ${!hideIcon ? html`` : ''}
+ ${!hideIcon ? html`` : ''}
${displayText}
`;