File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -9591,7 +9591,25 @@ class FastSearchCard extends HTMLElement {
95919591
95929592 console.log('📋 Alle Scheduler Items (korrekte API):', allSchedules);
95939593
9594- // ... Filter-Code bleibt gleich ...
9594+ // WICHTIG: Filter für diese Entity UND nur echte Timer (dieser Code fehlte!)
9595+ const entityTimers = allSchedules.filter(schedule => {
9596+ // Prüfe ob diese Entity in den timeslots/actions vorkommt
9597+ const belongsToEntity = schedule.timeslots && schedule.timeslots.some(slot =>
9598+ slot.actions && slot.actions.some(action => action.entity_id === entityId)
9599+ );
9600+ // Timer = einmalige Ausführung (erkennt man am Namen oder fehlendem repeat_type)
9601+ const isTimer = !schedule.weekdays ||
9602+ schedule.weekdays.length === 0 ||
9603+ (schedule.name && schedule.name.includes('min)')) || // Timer haben oft "(30min)" im Namen
9604+ schedule.repeat_type === 'once' ||
9605+ !schedule.repeat_type;
9606+ // DEBUG: Zeige alle relevanten Schedules
9607+ if (belongsToEntity) {
9608+ console.log(`🔍 TIMER DEBUG - Schedule: ${schedule.name}, weekdays: ${JSON.stringify(schedule.weekdays)}, isTimer: ${isTimer}`);
9609+ }
9610+
9611+ return belongsToEntity && isTimer;
9612+ });
95959613
95969614 console.log(`🎯 Timer für ${entityId}:`, entityTimers);
95979615
You can’t perform that action at this time.
0 commit comments