From 737b174953dbe316e94a88c5f6839ecb0664c68f Mon Sep 17 00:00:00 2001 From: xiaoshi <115949669+xiaoshi930@users.noreply.github.com> Date: Fri, 28 Nov 2025 21:49:28 +0800 Subject: [PATCH] Update xiaoshi-device-todo-card.js --- xiaoshi-device-todo-card.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/xiaoshi-device-todo-card.js b/xiaoshi-device-todo-card.js index dec9b7a..d9d95b9 100644 --- a/xiaoshi-device-todo-card.js +++ b/xiaoshi-device-todo-card.js @@ -941,12 +941,12 @@ class XiaoshiTodoCard extends LitElement { } _handleRefresh() { + this._handleClick(); this._loadTodoData(); - navigator.vibrate(50); } _handleEntityClick(entity) { - navigator.vibrate(50); + this._handleClick(); // 点击实体时打开实体详情页 if (entity.entity_id) { const evt = new Event('hass-more-info', { composed: true }); @@ -955,6 +955,17 @@ class XiaoshiTodoCard extends LitElement { } } + _handleClick(){ + if (navigator.vibrate) { + navigator.vibrate(50); + } + else if (navigator.webkitVibrate) { + navigator.webkitVibrate(50); + } + else { + } + } + async _addTodoItem(entityId, item, description = '', due = '') { try { const params = {