mirror of
https://github.com/xiaoshi930/xiaoshi-pad-card.git
synced 2025-11-28 16:49:42 +00:00
Update xiaoshi-device-todo-card.js
This commit is contained in:
@@ -941,12 +941,12 @@ class XiaoshiTodoCard extends LitElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_handleRefresh() {
|
_handleRefresh() {
|
||||||
|
this._handleClick();
|
||||||
this._loadTodoData();
|
this._loadTodoData();
|
||||||
navigator.vibrate(50);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_handleEntityClick(entity) {
|
_handleEntityClick(entity) {
|
||||||
navigator.vibrate(50);
|
this._handleClick();
|
||||||
// 点击实体时打开实体详情页
|
// 点击实体时打开实体详情页
|
||||||
if (entity.entity_id) {
|
if (entity.entity_id) {
|
||||||
const evt = new Event('hass-more-info', { composed: true });
|
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 = '') {
|
async _addTodoItem(entityId, item, description = '', due = '') {
|
||||||
try {
|
try {
|
||||||
const params = {
|
const params = {
|
||||||
|
|||||||
Reference in New Issue
Block a user