File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -7867,16 +7867,17 @@ class FastSearchCard extends HTMLElement {
78677867 const isOn = !['off', 'unavailable'].includes(state.state);
78687868 this.callClimateService(isOn ? 'turn_off' : 'turn_on', item.id);
78697869 }
7870- break;
7870+ break;
78717871
78727872 case 'media_player':
78737873 if (action === 'play-pause') {
78747874 const state = this.hass.states[item.id];
78757875 const isPlaying = state?.state === 'playing';
78767876 const service = isPlaying ? 'media_pause' : 'media_play';
7877+ console.log(`🎵 Calling: ${service} for ${item.id}, current state: ${state?.state}`);
78777878 this.hass.callService('media_player', service, { entity_id: item.id });
78787879 }
7879- break;
7880+ break;
78807881
78817882 case 'cover':
78827883 switch (action) {
@@ -12108,10 +12109,7 @@ class FastSearchCard extends HTMLElement {
1210812109 playPauseBtn.addEventListener('click', (e) => {
1210912110 e.preventDefault();
1211012111 e.stopPropagation();
12111- const state = this.hass.states[item.id];
12112- const isPlaying = state?.state === 'playing';
12113- const service = isPlaying ? 'media_pause' : 'media_play';
12114- this.hass.callService('media_player', service, { entity_id: item.id });
12112+ this.handleQuickAction('play-pause', item); // ✅ Verwende existierende Funktion
1211512113 });
1211612114 }
1211712115
You can’t perform that action at this time.
0 commit comments