Skip to content

Commit 2d30b26

Browse files
authored
Update fast-search-card.js
1 parent 1994859 commit 2d30b26

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

dist/fast-search-card.js

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14758,34 +14758,43 @@ class FastSearchCard extends HTMLElement {
1475814758
return state.attributes.entity_picture || state.attributes.media_image_url || null;
1475914759
}
1476014760

14761-
14762-
1476314761
getVideoUrl(item) {
1476414762
if (!item) return null;
1476514763

1476614764
// Klima-Geräte: State-basierte Video-URLs (lokal gehostet)
1476714765
if (item.domain === 'climate') {
1476814766
const state = this._hass?.states[item.id];
14769-
const isActive = state && state.state !== 'off';
14767+
if (!state) return null;
14768+
14769+
// Nutze die gleiche Logik wie status-indicator-large
14770+
const isActive = this.isEntityActive(state);
14771+
14772+
console.log('🌡️ Klima Debug:', {
14773+
entityId: item.id,
14774+
state: state.state,
14775+
isActive: isActive
14776+
});
1477014777

1477114778
const baseUrl = '/local/fast-search-card/';
14772-
return baseUrl + (isActive ? 'climate-on.mp4' : 'climate-off.mp4');
14779+
const videoFile = isActive ? 'climate-on.mp4' : 'climate-off.mp4';
14780+
14781+
console.log('🎬 Video wird geladen:', videoFile);
14782+
14783+
return baseUrl + videoFile;
1477314784
}
1477414785

14775-
// 1. Custom Data Video URL prüfen
14786+
// Rest bleibt gleich...
1477614787
if (item.custom_data?.video_url) {
1477714788
return item.custom_data.video_url;
1477814789
}
1477914790

14780-
// 2. Entity Attributes prüfen (falls Home Assistant Entity)
1478114791
if (this._hass && item.id) {
1478214792
const state = this._hass.states[item.id];
1478314793
if (state?.attributes?.video_url) {
1478414794
return state.attributes.video_url;
1478514795
}
1478614796
}
1478714797

14788-
// 3. Kein Video gefunden
1478914798
return null;
1479014799
}
1479114800

0 commit comments

Comments
 (0)