File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change 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 }
You can’t perform that action at this time.
0 commit comments