File tree Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -12305,13 +12305,26 @@ class FastSearchCard extends HTMLElement {
1230512305
1230612306 console.log(`🎵 Player was playing before TTS: ${wasPlaying}`);
1230712307
12308- // 🆕 NEU: Musik pausieren falls sie läuft
12308+ // 🆕 NEU: Musik pausieren falls sie läuft
1230912309 if (wasPlaying) {
1231012310 console.log(`⏸️ Pausing music for TTS...`);
12311- await this.callMusicAssistantService('media_pause', entityId);
1231212311
12313- // Kurz warten bis Pause durch ist
12314- await new Promise(resolve => setTimeout(resolve, 500));
12312+ // Versuche verschiedene Pause-Methoden
12313+ try {
12314+ await this.callMusicAssistantService('media_pause', entityId);
12315+ await new Promise(resolve => setTimeout(resolve, 300));
12316+
12317+ // Double-check: Ist wirklich pausiert?
12318+ const checkState = this._hass.states[entityId];
12319+ if (checkState?.state === 'playing') {
12320+ console.log(`🔄 First pause failed, trying stop...`);
12321+ await this.callMusicAssistantService('media_stop', entityId);
12322+ await new Promise(resolve => setTimeout(resolve, 200));
12323+ }
12324+
12325+ } catch (error) {
12326+ console.warn(`⚠️ Pause failed:`, error);
12327+ }
1231512328 }
1231612329
1231712330 // Speichere Status für später
You can’t perform that action at this time.
0 commit comments