Skip to content

Commit 911b064

Browse files
authored
Update fast-search-card.js
1 parent f15a0a9 commit 911b064

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

dist/fast-search-card.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)