From 2c3c3fd42d249fbae05d27a85f6dd02f87e5247a Mon Sep 17 00:00:00 2001 From: xiaoshi <115949669+xiaoshi930@users.noreply.github.com> Date: Fri, 28 Nov 2025 21:48:49 +0800 Subject: [PATCH] Update xiaoshi-device-consumables-card.js --- xiaoshi-device-consumables-card.js | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/xiaoshi-device-consumables-card.js b/xiaoshi-device-consumables-card.js index ea73edc..bb4bb59 100644 --- a/xiaoshi-device-consumables-card.js +++ b/xiaoshi-device-consumables-card.js @@ -906,7 +906,7 @@ class XiaoshiConsumablesCard extends LitElement { .device-name { color: var(--fg-color, #000); - font-size: 9px; + font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; @@ -916,7 +916,7 @@ class XiaoshiConsumablesCard extends LitElement { .device-value { color: var(--fg-color, #000); - font-size: 9px; + font-size: 11px; flex-shrink: 0; font-weight: bold; max-width: 45%; @@ -930,7 +930,7 @@ class XiaoshiConsumablesCard extends LitElement { } .device-unit { - font-size: 9px; + font-size: 11px; color: var(--fg-color, #000); margin-left: 0.5px; font-weight: bold; @@ -1112,12 +1112,12 @@ class XiaoshiConsumablesCard extends LitElement { } _handleRefresh() { + this._handleClick(); this._loadOilPriceData(); - navigator.vibrate(50); } _handleEntityClick(entity) { - navigator.vibrate(50); + this._handleClick(); // 点击实体时打开实体详情页 if (entity.entity_id) { const evt = new Event('hass-more-info', { composed: true }); @@ -1126,6 +1126,17 @@ class XiaoshiConsumablesCard extends LitElement { } } + _handleClick(){ + if (navigator.vibrate) { + navigator.vibrate(50); + } + else if (navigator.webkitVibrate) { + navigator.webkitVibrate(50); + } + else { + } + } + _renderDeviceItem(consumablesData) { let isWarning = false;