@@ -430,30 +430,9 @@ class FastSearchCard extends HTMLElement {
430430 }
431431 } else if (!this.isDetailView && !this.isSearching) {
432432 this.updateStates();
433- }
434-
435- // NEU: Test unserer User-Context Funktionen
436- if (!oldHass) {
437- // Nur beim ersten Laden testen
438- this.testUserContext();
439- }
440-
433+ }
441434 }
442435
443- async testUserContext() {
444- console.log('🔍 Testing User Context Functions...');
445- try {
446- const userContext = await this.getUserContext();
447- const favoriteLabel = await this.getFavoriteLabel();
448-
449- console.log('✅ User Context:', userContext);
450- console.log('✅ Favorite Label:', favoriteLabel);
451- console.log('✅ User Context Test successful!');
452- } catch (error) {
453- console.error('❌ User Context Test failed:', error);
454- }
455- }
456-
457436 shouldUpdateItems(oldHass, newHass) {
458437 if (!this._config.entities) return false;
459438
@@ -4495,7 +4474,42 @@ class FastSearchCard extends HTMLElement {
44954474 .timer-item {
44964475 position: relative;
44974476 }
4477+
4478+ .favorite-button {
4479+ width: 39px;
4480+ height: 39px;
4481+ border: none;
4482+ background: rgba(255, 255, 255, 0.1);
4483+ border-radius: 50%;
4484+ cursor: pointer;
4485+ display: flex;
4486+ align-items: center;
4487+ justify-content: center;
4488+ transition: all 0.2s ease;
4489+ flex-shrink: 0;
4490+ color: var(--text-secondary);
4491+ padding: 0;
4492+ }
4493+
4494+ .favorite-button:hover {
4495+ background: rgba(255, 255, 255, 0.2);
4496+ transform: scale(1.1);
4497+ }
44984498
4499+ .favorite-button.active {
4500+ color: #ff4757;
4501+ background: rgba(255, 71, 87, 0.2);
4502+ }
4503+
4504+ .favorite-button.active svg {
4505+ fill: #ff4757;
4506+ }
4507+
4508+ .favorite-button svg {
4509+ width: 24px;
4510+ height: 24px;
4511+ transition: all 0.2s ease;
4512+ }
44994513
45004514 </style>
45014515
@@ -8153,6 +8167,11 @@ class FastSearchCard extends HTMLElement {
81538167 <h3 class="detail-name">${item.name}</h3>
81548168 <p class="detail-area">${item.area}</p>
81558169 </div>
8170+ <button class="favorite-button" data-entity-id="${item.id}">
8171+ <svg xmlns="http://www.w3.org/2000/svg" width="39px" height="39px" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linejoin="round" color="currentColor">
8172+ <path d="M22 8.86222C22 10.4087 21.4062 11.8941 20.3458 12.9929C17.9049 15.523 15.5374 18.1613 13.0053 20.5997C12.4249 21.1505 11.5042 21.1304 10.9488 20.5547L3.65376 12.9929C1.44875 10.7072 1.44875 7.01723 3.65376 4.73157C5.88044 2.42345 9.50794 2.42345 11.7346 4.73157L11.9998 5.00642L12.2648 4.73173C13.3324 3.6245 14.7864 3 16.3053 3C17.8242 3 19.2781 3.62444 20.3458 4.73157C21.4063 5.83045 22 7.31577 22 8.86222Z"/>
8173+ </svg>
8174+ </button>
81568175 </div>
81578176 <div class="icon-content">
81588177 <div class="icon-background-wrapper">
0 commit comments