Skip to content

Commit 82f1b3c

Browse files
authored
Update fast-search-card.js
1 parent 56dc95c commit 82f1b3c

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

dist/fast-search-card.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
import { getUser } from "home-assistant-js-websocket";
2-
3-
41

52

63
// MiniSearch Local Implementation (~5KB)
@@ -14512,13 +14509,15 @@ class FastSearchCard extends HTMLElement {
1451214509
}
1451314510
}
1451414511

14512+
1451514513
async getUserContext() {
1451614514
try {
14517-
const user = await getUser(this._hass.connection);
14518-
console.log('✅ getUser() successful:', user);
14515+
// Direkte WebSocket API-Nutzung statt Import
14516+
const user = await this._hass.callWS({ type: 'auth/current_user' });
14517+
console.log('✅ WebSocket user call successful:', user);
1451914518
return user.id || this.sanitizeUserForLabel(user.name) || 'unknown';
1452014519
} catch (error) {
14521-
console.warn('❌ getUser() failed, using fallback:', error);
14520+
console.warn('❌ WebSocket user call failed, using fallback:', error);
1452214521
const hassUser = this._hass.user;
1452314522
return hassUser?.name ? this.sanitizeUserForLabel(hassUser.name) : 'unknown';
1452414523
}

0 commit comments

Comments
 (0)