mirror of
https://github.com/xiaoshi930/xiaoshi-pad-card.git
synced 2026-02-12 06:33:49 +00:00
Compare commits
21 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e15cdfccaa | ||
|
|
c0f45717d4 | ||
|
|
d57f69d4b9 | ||
|
|
1ba54782c0 | ||
|
|
240ce4e4ef | ||
|
|
9d0fbaead4 | ||
|
|
b357b69fa5 | ||
|
|
0d61619f8d | ||
|
|
953e414a61 | ||
|
|
8974f122b6 | ||
|
|
6060663a24 | ||
|
|
22e7325a06 | ||
|
|
67f13a23ca | ||
|
|
56e85c834f | ||
|
|
367a47d33b | ||
|
|
6501aeead7 | ||
|
|
c93735be82 | ||
|
|
740bac1c63 | ||
|
|
85d413baa1 | ||
|
|
128d24328b | ||
|
|
de64a44599 |
@@ -1233,16 +1233,10 @@ class XiaoshiBalanceButton extends LitElement {
|
||||
// 设置主题属性
|
||||
this.setAttribute('theme', this._evaluateTheme());
|
||||
|
||||
//button新元素 开始
|
||||
setTimeout(() => {
|
||||
this._loadOilPriceData();
|
||||
}, 50);
|
||||
//button新元素 结束
|
||||
|
||||
// 每300秒刷新一次数据,减少频繁刷新
|
||||
this._refreshInterval = setInterval(() => {
|
||||
this._loadOilPriceData();
|
||||
}, 300000);
|
||||
}, 3000);
|
||||
}
|
||||
|
||||
_evaluateTheme() {
|
||||
@@ -1662,7 +1656,7 @@ class XiaoshiBalanceButton extends LitElement {
|
||||
const buttonIcon = this.config.button_icon || 'mdi:cellphone';
|
||||
|
||||
// 设置背景颜色
|
||||
const buttonBgColor = transparentBg ? 'transparent' : bgColor;
|
||||
const buttonBgColor = transparentBg ? 'transparent' : theme === 'on' ? 'rgb(255, 255, 255, 0.6)' : 'rgb(83, 83, 83, 0.6)';
|
||||
|
||||
// 获取显示模式
|
||||
const displayMode = this.config.display_mode || 'min_value';
|
||||
|
||||
@@ -1301,17 +1301,11 @@ class XiaoshiConsumablesButton extends LitElement {
|
||||
|
||||
// 设置主题属性
|
||||
this.setAttribute('theme', this._evaluateTheme());
|
||||
|
||||
//button新元素 开始
|
||||
setTimeout(() => {
|
||||
this._loadOilPriceData();
|
||||
}, 50);
|
||||
//button新元素 结束
|
||||
|
||||
// 每300秒刷新一次数据,减少频繁刷新
|
||||
this._refreshInterval = setInterval(() => {
|
||||
this._loadOilPriceData();
|
||||
}, 300000);
|
||||
}, 3000);
|
||||
}
|
||||
|
||||
_evaluateTheme() {
|
||||
@@ -1869,7 +1863,7 @@ class XiaoshiConsumablesButton extends LitElement {
|
||||
const buttonIcon = this.config.button_icon || 'mdi:battery-sync';
|
||||
|
||||
// 设置背景颜色
|
||||
const buttonBgColor = transparentBg ? 'transparent' : bgColor;
|
||||
const buttonBgColor = transparentBg ? 'transparent' : theme === 'on' ? 'rgb(255, 255, 255, 0.6)' : 'rgb(83, 83, 83, 0.6)';
|
||||
|
||||
// 检查是否需要自动隐藏(只有数据加载完成且数量为0时才考虑隐藏)
|
||||
const shouldAutoHide = this._dataLoaded && autoHide && warningCount === 0;
|
||||
|
||||
@@ -405,7 +405,7 @@ template: 测试模板(最好引用模板,否则大概率会报错)'>
|
||||
}
|
||||
customElements.define('xiaoshi-ha-info-button-editor', XiaoshiHaInfoButtonEditor);
|
||||
|
||||
export class XiaoshiHaInfoButton extends LitElement {
|
||||
class XiaoshiHaInfoButton extends LitElement {
|
||||
static get properties() {
|
||||
return {
|
||||
hass: Object,
|
||||
@@ -802,18 +802,11 @@ export class XiaoshiHaInfoButton extends LitElement {
|
||||
// 设置主题属性
|
||||
this.setAttribute('theme', this._evaluateTheme());
|
||||
|
||||
//button新元素 开始
|
||||
setTimeout(() => {
|
||||
this._loadUpdateData();
|
||||
this._loadOfflineDevices();
|
||||
}, 50);
|
||||
//button新元素 结束
|
||||
|
||||
// 每300秒刷新一次数据,减少频繁刷新
|
||||
this._refreshInterval = setInterval(() => {
|
||||
this._loadUpdateData();
|
||||
this._loadOfflineDevices();
|
||||
}, 300000);
|
||||
}, 3000);
|
||||
}
|
||||
|
||||
_evaluateTheme() {
|
||||
@@ -1799,7 +1792,7 @@ export class XiaoshiHaInfoButton extends LitElement {
|
||||
const buttonIcon = this.config.button_icon || 'mdi:home-assistant';
|
||||
|
||||
// 设置背景颜色
|
||||
const buttonBgColor = transparentBg ? 'transparent' : bgColor;
|
||||
const buttonBgColor = transparentBg ? 'transparent' : theme === 'on' ? 'rgb(255, 255, 255, 0.6)' : 'rgb(83, 83, 83, 0.6)';
|
||||
|
||||
// 检查是否需要自动隐藏(只有数据加载完成且数量为0时才考虑隐藏)
|
||||
const shouldAutoHide = this._dataLoaded && autoHide && warningCount === 0;
|
||||
|
||||
@@ -153,7 +153,7 @@ class XiaoshiHaInfoCardEditor extends LitElement {
|
||||
}
|
||||
customElements.define('xiaoshi-ha-info-card-editor', XiaoshiHaInfoCardEditor);
|
||||
|
||||
export class XiaoshiHaInfoCard extends LitElement {
|
||||
class XiaoshiHaInfoCard extends LitElement {
|
||||
static get properties() {
|
||||
return {
|
||||
hass: Object,
|
||||
|
||||
@@ -1122,19 +1122,13 @@ class XiaoshiTodoButton extends LitElement {
|
||||
super.connectedCallback();
|
||||
this._loadTodoData();
|
||||
|
||||
|
||||
//button新元素 开始
|
||||
setTimeout(() => {
|
||||
this._loadTodoData();
|
||||
}, 50);
|
||||
//button新元素 结束
|
||||
// 设置主题属性
|
||||
this.setAttribute('theme', this._evaluateTheme());
|
||||
|
||||
// 每300秒刷新一次数据,减少频繁刷新
|
||||
this._refreshInterval = setInterval(() => {
|
||||
this._loadTodoData();
|
||||
}, 300000);
|
||||
}, 3000);
|
||||
}
|
||||
|
||||
_evaluateTheme() {
|
||||
@@ -1636,7 +1630,7 @@ class XiaoshiTodoButton extends LitElement {
|
||||
const buttonIcon = this.config.button_icon || 'mdi:clipboard-list';
|
||||
|
||||
// 设置背景颜色
|
||||
const buttonBgColor = transparentBg ? 'transparent' : bgColor;
|
||||
const buttonBgColor = transparentBg ? 'transparent' : theme === 'on' ? 'rgb(255, 255, 255, 0.6)' : 'rgb(83, 83, 83, 0.6)';
|
||||
|
||||
// 检查是否需要自动隐藏(只有数据加载完成且数量为0时才考虑隐藏)
|
||||
const shouldAutoHide = this._dataLoaded && autoHide && totalIncompleteCount === 0;
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
console.info("%c 消逝卡-平板端 \n%c v 0.2.1 ", "color: red; font-weight: bold; background: black", "color: white; font-weight: bold; background: black");
|
||||
console.info("%c 消逝卡-平板端 \n%c v 0.2.5 ", "color: red; font-weight: bold; background: black", "color: white; font-weight: bold; background: black");
|
||||
|
||||
const loadCards = async () => {
|
||||
await import('./xiaoshi-pad-grid-card.js');
|
||||
await import('./xiaoshi-device-balance-card.js');
|
||||
await import('./xiaoshi-device-balance-button.js');
|
||||
await import('./xiaoshi-device-todo-card.js');
|
||||
await import('./xiaoshi-device-todo-button.js');
|
||||
await import('./xiaoshi-device-consumables-card.js');
|
||||
await import('./xiaoshi-device-consumables-button.js');
|
||||
await import('./xiaoshi-device-ha-info-card.js');
|
||||
await import('./xiaoshi-device-ha-info-button.js');
|
||||
const loadCards = () => {
|
||||
import('./xiaoshi-pad-grid-card.js');
|
||||
import('./xiaoshi-device-balance-card.js');
|
||||
import('./xiaoshi-device-balance-button.js');
|
||||
import('./xiaoshi-device-todo-card.js');
|
||||
import('./xiaoshi-device-todo-button.js');
|
||||
import('./xiaoshi-device-consumables-card.js');
|
||||
import('./xiaoshi-device-consumables-button.js');
|
||||
import('./xiaoshi-device-ha-info-card.js');
|
||||
import('./xiaoshi-device-ha-info-button.js');
|
||||
|
||||
window.customCards = window.customCards || [];
|
||||
window.customCards.push(...cardConfigs);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { LitElement, html, css } from "https://unpkg.com/lit-element@2.4.0/lit-element.js?module";
|
||||
|
||||
export class XiaoshiPadGridCard extends LitElement {
|
||||
class XiaoshiPadGridCard extends LitElement {
|
||||
static get properties() {
|
||||
return {
|
||||
hass: Object,
|
||||
|
||||
Reference in New Issue
Block a user