@@ -11340,6 +11340,9 @@ class FastSearchCard extends HTMLElement {
1134011340
1134111341 async ensureFavoritesHelper() {
1134211342 try {
11343+ // Kurz warten damit alle States geladen sind
11344+ await new Promise(resolve => setTimeout(resolve, 1000));
11345+
1134311346 // Prüfen ob Helper bereits existiert
1134411347 const existingHelper = this._hass.states['input_text.fast_search_favorites'];
1134511348
@@ -11348,35 +11351,9 @@ class FastSearchCard extends HTMLElement {
1134811351 return;
1134911352 }
1135011353
11351- console.log('🔧 Erstelle input_text.fast_search_favorites Helper...');
11352-
11353- // Helper erstellen
11354- await this._hass.callService('input_text', 'reload');
11355-
11356- // Konfiguration für den Helper
11357- const helperConfig = {
11358- name: 'Fast Search Favorites',
11359- initial: '{}',
11360- max: 255,
11361- mode: 'text'
11362- };
11363-
11364- // Helper über die Configuration API erstellen
11365- await this._hass.callWS({
11366- type: 'config/config_entries/options/flow/create',
11367- handler: 'input_text',
11368- context: {
11369- source: 'user'
11370- }
11371- });
11372-
11373- console.log('✅ Favorites Helper erfolgreich erstellt');
11374-
11375- } catch (error) {
11376- console.warn('⚠️ Konnte Favorites Helper nicht automatisch erstellen:', error);
11377- console.warn('Bitte erstellen Sie manuell: input_text.fast_search_favorites');
11354+ console.warn('⚠️ input_text.fast_search_favorites Helper nicht gefunden');
1137811355
11379- // Benutzer informieren
11356+ // Benutzer informieren dass Helper fehlt
1138011357 if (this.shadowRoot) {
1138111358 const notification = document.createElement('div');
1138211359 notification.style.cssText = `
@@ -11390,22 +11367,27 @@ class FastSearchCard extends HTMLElement {
1139011367 z-index: 10000;
1139111368 font-size: 14px;
1139211369 max-width: 300px;
11370+ box-shadow: 0 4px 12px rgba(0,0,0,0.3);
1139311371 `;
1139411372 notification.innerHTML = `
1139511373 <strong>Setup erforderlich:</strong><br>
1139611374 Bitte erstellen Sie einen Input Text Helper:<br>
11397- <code>input_text.fast_search_favorites</code>
11375+ <code>input_text.fast_search_favorites</code><br>
11376+ <small>Einstellungen → Geräte & Dienste → Helfer</small>
1139811377 `;
1139911378
1140011379 document.body.appendChild(notification);
1140111380
11402- // Nach 5 Sekunden entfernen
11381+ // Nach 8 Sekunden entfernen
1140311382 setTimeout(() => {
1140411383 if (notification.parentNode) {
1140511384 notification.parentNode.removeChild(notification);
1140611385 }
11407- }, 5000 );
11386+ }, 8000 );
1140811387 }
11388+
11389+ } catch (error) {
11390+ console.error('❌ Fehler beim Prüfen des Favorites Helper:', error);
1140911391 }
1141011392 }
1141111393
0 commit comments