Compare commits

...

5 Commits
v1.0.7 ... main

Author SHA1 Message Date
xiaoshi
7d052410ad Update README.md 2026-02-11 17:34:52 +08:00
xiaoshi
995c1d023f Update xiaoshi-pad-card.js 2026-01-29 18:17:48 +08:00
xiaoshi
d53396235f Update xiaoshi-pad-climate-card.js 2026-01-29 18:17:32 +08:00
xiaoshi
3bf2f2476d Update xiaoshi-pad-card.js 2026-01-27 21:06:33 +08:00
xiaoshi
05daf09aff Update xiaoshi-pad-climate-card.js 2026-01-27 21:06:21 +08:00
3 changed files with 26 additions and 12 deletions

View File

@@ -5,7 +5,15 @@
type: module
~~~
## 功能1分布卡(温度分布、湿度分布)
## 功能1空调卡/加湿器卡/热水器卡/水暖毯卡
**引用示例**
**详细配置参照可视化编辑器
~~~
type: custom:xiaoshi-pad-climate-card
~~~
## 功能2分布卡(温度分布、湿度分布)
**引用示例**
~~~
type: custom:xiaoshi-pad-grid-card

View File

@@ -1,4 +1,4 @@
console.info("%c 消逝卡-平板端 \n%c v 1.0.7 ", "color: red; font-weight: bold; background: black", "color: white; font-weight: bold; background: black");
console.info("%c 消逝卡-平板端 \n%c v 1.0.9 ", "color: red; font-weight: bold; background: black", "color: white; font-weight: bold; background: black");
const loadCards = () => {
import('./xiaoshi-pad-climate-card.js');

View File

@@ -2859,7 +2859,7 @@ class XiaoshiPadClimateCard extends LitElement {
climateState === '宠物洗' || climateState === '厨房用') activeColor = 'rgb(254,111,33)';
else if (climateState === 'dry') activeColor = 'rgb(255,151,0)';
else if (climateState === 'fan' || climateState === 'fan_only') activeColor = 'rgb(0,188,213)';
else if (climateState === 'auto') activeColor = 'rgb(147,112,219)';
else if (climateState === 'auto') activeColor = 'rgb(47,96,49)';
}
return html`
@@ -2890,8 +2890,14 @@ class XiaoshiPadClimateCard extends LitElement {
`;
}
_handleClick() {
navigator.vibrate(50);
_handleClick(){
const hapticEvent = new Event('haptic', {
bubbles: true,
cancelable: false,
composed: true
});
hapticEvent.detail = 'light';
this.dispatchEvent(hapticEvent);
}
_formatSeconds(totalSeconds) {
@@ -2991,7 +2997,7 @@ _renderExtraButtons(buttonType = 1) {
else if (state === '自定义' || state === 'AI控温' || state === '婴童洗' || state === '舒适洗' || state === '宠物洗' || state === '厨房用') activeColor = 'rgb(254,111,33)';
else if (state === 'dry') activeColor = 'rgb(255,151,0)';
else if (state === 'fan' || state === 'fan_only') activeColor = 'rgb(0,188,213)';
else if (state === 'auto') activeColor = 'rgb(147,112,219)';
else if (state === 'auto') activeColor = 'rgb(47,96,49)';
else if (isHumidifierEntity) activeColor = 'rgb(33,150,243)';
const buttonConfigKey = buttonType === 1 ? 'buttons' : 'buttons2';
@@ -3205,7 +3211,7 @@ _renderExtraButtons(buttonType = 1) {
else if (state === 'heat' && mode === 'heat') bgColor = 'rgb(254,111,33)';
else if (state === 'dry' && mode === 'dry') bgColor = 'rgb(255,151,0)';
else if (state === 'fan_only' && mode === 'fan_only') bgColor = 'rgb(0,188,213)';
else if (state === 'auto' && mode === 'auto') bgColor = 'rgb(147,112,219)';
else if (state === 'auto' && mode === 'auto') bgColor = 'rgb(47,96,49)';
else if (state === 'off' && mode === 'off') bgColor = theme === 'on' ? 'rgb(180,180,180)' : 'rgb(150,150,150)';
}
@@ -3251,7 +3257,7 @@ _renderExtraButtons(buttonType = 1) {
else if (state === 'heat') bgColor = 'rgb(254,111,33)';
else if (state === 'dry') bgColor = 'rgb(255,151,0)';
else if (state === 'fan_only') bgColor = 'rgb(0,188,213)';
else if (state === 'auto') bgColor = 'rgb(147,112,219)';
else if (state === 'auto') bgColor = 'rgb(47,96,49)';
else if (state === 'off') bgColor = theme === 'on' ? 'rgb(180,180,180)' : 'rgb(150,150,150)';
}
@@ -3304,7 +3310,7 @@ _renderExtraButtons(buttonType = 1) {
else if (state === 'heat') bgColor = 'rgb(254,111,33)';
else if (state === 'dry') bgColor = 'rgb(255,151,0)';
else if (state === 'fan_only') bgColor = 'rgb(0,188,213)';
else if (state === 'auto') bgColor = 'rgb(147,112,219)';
else if (state === 'auto') bgColor = 'rgb(47,96,49)';
else if (state === 'off') bgColor = theme === 'on' ? 'rgb(180,180,180)' : 'rgb(150,150,150)';
}
@@ -3351,7 +3357,7 @@ _renderExtraButtons(buttonType = 1) {
else if (state === 'heat') bgColor = 'rgb(254,111,33)';
else if (state === 'dry') bgColor = 'rgb(255,151,0)';
else if (state === 'fan_only') bgColor = 'rgb(0,188,213)';
else if (state === 'auto') bgColor = 'rgb(147,112,219)';
else if (state === 'auto') bgColor = 'rgb(47,96,49)';
else if (state === 'off') bgColor = theme === 'on' ? 'rgb(180,180,180)' : 'rgb(150,150,150)';
}
@@ -3398,7 +3404,7 @@ _renderExtraButtons(buttonType = 1) {
else if (state === 'heat') bgColor = 'rgb(254,111,33)';
else if (state === 'dry') bgColor = 'rgb(255,151,0)';
else if (state === 'fan_only') bgColor = 'rgb(0,188,213)';
else if (state === 'auto') bgColor = 'rgb(147,112,219)';
else if (state === 'auto') bgColor = 'rgb(47,96,49)';
else if (state === 'off') bgColor = theme === 'on' ? 'rgb(180,180,180)' : 'rgb(150,150,150)';
}
@@ -3592,7 +3598,7 @@ _renderExtraButtons(buttonType = 1) {
else if (mainEntityState === 'heat') bgColor = 'rgb(254,111,33)';
else if (mainEntityState === 'dry') bgColor = 'rgb(255,151,0)';
else if (mainEntityState === 'fan_only') bgColor = 'rgb(0,188,213)';
else if (mainEntityState === 'auto') bgColor = 'rgb(147,112,219)';
else if (mainEntityState === 'auto') bgColor = 'rgb(47,96,49)';
else if (mainEntityState === 'off') bgColor = theme === 'on' ? 'rgb(180,180,180)' : 'rgb(150,150,150)';
else bgColor = 'rgb(33,150,243)'; // 默认蓝色
}