mirror of
https://github.com/xiaoshi930/xiaoshi-pad-card.git
synced 2026-02-11 22:23:48 +00:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7d052410ad | ||
|
|
995c1d023f | ||
|
|
d53396235f | ||
|
|
3bf2f2476d | ||
|
|
05daf09aff |
10
README.md
10
README.md
@@ -5,7 +5,15 @@
|
||||
type: module
|
||||
~~~
|
||||
|
||||
## 功能1:分布卡(温度分布、湿度分布)
|
||||
## 功能1:空调卡/加湿器卡/热水器卡/水暖毯卡
|
||||
**引用示例**
|
||||
**详细配置参照可视化编辑器
|
||||
~~~
|
||||
type: custom:xiaoshi-pad-climate-card
|
||||
~~~
|
||||
|
||||
|
||||
## 功能2:分布卡(温度分布、湿度分布)
|
||||
**引用示例**
|
||||
~~~
|
||||
type: custom:xiaoshi-pad-grid-card
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -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)'; // 默认蓝色
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user