Skip to content

Commit 9b62b89

Browse files
authored
Update fast-search-card.js
1 parent 38aecc8 commit 9b62b89

File tree

1 file changed

+64
-70
lines changed

1 file changed

+64
-70
lines changed

dist/fast-search-card.js

Lines changed: 64 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -3452,21 +3452,13 @@ class FastSearchCard extends HTMLElement {
34523452
height: 24px;
34533453
stroke-width: 1;
34543454
}
3455-
3456-
.timer-preset-label {
3457-
font-size: 12px;
3458-
font-weight: 500;
3459-
line-height: 1;
3460-
text-transform: uppercase;
3461-
padding-top: 10px;
3462-
}
34633455

34643456
/* ✅ Hover-Effekte für Icons und Labels */
34653457
.timer-control-preset:hover svg {
34663458
transform: scale(1.1);
34673459
}
34683460

3469-
.timer-control-preset:hover .timer-preset-label {
3461+
.timer-control-preset:hover {
34703462
transform: translateY(-1px);
34713463
}
34723464

@@ -8357,15 +8349,15 @@ class FastSearchCard extends HTMLElement {
83578349
<path d="M1.15 1.878a.514.514 0 0 1 .728-.727l16.971 16.971a.514.514 0 0 1-.727.727z"/>
83588350
</g>
83598351
</svg>
8360-
<span class="timer-preset-label">Aus</span>
8352+
83618353
</button>
83628354

83638355
<button class="timer-control-preset" data-action="turn_on" title="Einschalten">
83648356
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor" color="currentColor">
83658357
<path d="M 5.994 8.065 C 6.334 7.696 6.947 7.833 7.097 8.312 C 7.171 8.55 7.104 8.81 6.922 8.981 C 5.712 10.21 5.035 11.867 5.04 13.593 C 5.04 17.195 7.914 20.11 11.457 20.11 C 14.999 20.11 17.874 17.195 17.874 13.593 C 17.879 11.868 17.202 10.21 15.991 8.981 C 15.627 8.636 15.772 8.025 16.254 7.882 C 16.493 7.81 16.751 7.882 16.92 8.065 C 18.372 9.538 19.184 11.525 19.179 13.593 C 19.179 17.911 15.724 21.415 11.457 21.415 C 7.19 21.415 3.735 17.911 3.735 13.593 C 3.735 11.494 4.557 9.522 5.994 8.065" fill="currentColor"/>
83668358
<path d="M 10.78 3.486 C 10.78 2.984 11.324 2.67 11.759 2.921 C 11.961 3.038 12.086 3.253 12.086 3.486 L 12.086 11.192 C 12.086 11.695 11.542 12.009 11.107 11.757 C 10.905 11.641 10.78 11.425 10.78 11.192 L 10.78 3.486 Z" fill="currentColor"/>
83678359
</svg>
8368-
<span class="timer-preset-label">Ein</span>
8360+
83698361
</button>
83708362

83718363
<button class="timer-control-preset" data-action="dim_30" title="30% Helligkeit">
@@ -8376,7 +8368,7 @@ class FastSearchCard extends HTMLElement {
83768368
<path d="M12 14.3l7.37 -7.37" />
83778369
<path d="M12 19.6l8.85 -8.85" />
83788370
</svg>
8379-
<span class="timer-preset-label">30%</span>
8371+
83808372
</button>
83818373

83828374
<button class="timer-control-preset" data-action="dim_50" title="50% Helligkeit">
@@ -8387,7 +8379,7 @@ class FastSearchCard extends HTMLElement {
83878379
<path d="M12 14.3l7.37 -7.37" />
83888380
<path d="M12 19.6l8.85 -8.85" />
83898381
</svg>
8390-
<span class="timer-preset-label">50%</span>
8382+
83918383
</button>
83928384
`;
83938385
}
@@ -8400,38 +8392,38 @@ class FastSearchCard extends HTMLElement {
84008392
<path d="m15 9-6 6"/>
84018393
<path d="m9 9 6 6"/>
84028394
</svg>
8403-
<span class="timer-preset-label">Aus</span>
8395+
84048396
</button>
84058397

84068398
<button class="timer-control-preset" data-action="heat_24" title="Heizen auf 24°C">
84078399
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
84088400
<path d="M14 14.76V3.5a2.5 2.5 0 0 0-5 0v11.26a4.5 4.5 0 1 0 5 0z"/>
84098401
<circle cx="12" cy="17" r="2"/>
84108402
</svg>
8411-
<span class="timer-preset-label">24°C</span>
8403+
84128404
</button>
84138405

84148406
<button class="timer-control-preset" data-action="cool_22" title="Kühlen auf 22°C">
84158407
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
84168408
<path d="M2 6s1.5-2 5-2 5 2 5 2v14s-1.5-2-5-2-5 2-5 2V6z"/>
84178409
<path d="M7 4v16"/>
84188410
</svg>
8419-
<span class="timer-preset-label">22°C</span>
8411+
84208412
</button>
84218413

84228414
<button class="timer-control-preset" data-action="dry_mode" title="Entfeuchten">
84238415
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
84248416
<path d="M12 2.69l5.66 5.66a8 8 0 1 1-11.31 0z"/>
84258417
<path d="M8 14s1.5 2 4 2 4-2 4-2"/>
84268418
</svg>
8427-
<span class="timer-preset-label">Entfeuchten</span>
8419+
84288420
</button>
84298421

84308422
<button class="timer-control-preset" data-action="fan_only" title="Lüften">
84318423
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
84328424
<path d="M12.5 2c-.8 0-1.5.7-1.5 1.5v6.21l-1.09-.63c-.69-.4-1.58-.16-1.98.53-.4.69-.16 1.58.53 1.98l1.09.63-1.09.63c-.69.4-.93 1.29-.53 1.98.4.69 1.29.93 1.98.53l1.09-.63v6.21c0 .8.7 1.5 1.5 1.5s1.5-.7 1.5-1.5v-6.21l1.09.63c.69.4 1.58.16 1.98-.53.4-.69.16-1.58-.53-1.98L13.5 12l1.09-.63c.69-.4.93-1.29.53-1.98-.4-.69-1.29-.93-1.98-.53L12.5 9.5V3.5c0-.8-.7-1.5-1.5-1.5z"/>
84338425
</svg>
8434-
<span class="timer-preset-label">Lüften</span>
8426+
84358427
</button>
84368428
`;
84378429
}
@@ -8443,28 +8435,28 @@ class FastSearchCard extends HTMLElement {
84438435
<path d="M7 13C7.55228 13 8 12.5523 8 12C8 11.4477 7.55228 11 7 11C6.44772 11 6 11.4477 6 12C6 12.5523 6.44772 13 7 13Z"/>
84448436
<path d="M17 17H7C4.23858 17 2 14.7614 2 12C2 9.23858 4.23858 7 7 7H17C19.7614 7 22 9.23858 22 12C22 14.7614 19.7614 17 17 17Z"/>
84458437
</svg>
8446-
<span class="timer-preset-label">Aus</span>
8438+
84478439
</button>
84488440
<button class="timer-control-preset" data-action="play" title="Abspielen">
84498441
<svg width="24px" height="24px" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1">
84508442
<polygon points="5,3 19,12 5,21"/>
84518443
</svg>
8452-
<span class="timer-preset-label">Play</span>
8444+
84538445
</button>
84548446
<button class="timer-control-preset" data-action="pause" title="Pausieren">
84558447
<svg width="24px" height="24px" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1">
84568448
<rect x="6" y="4" width="4" height="16"/>
84578449
<rect x="14" y="4" width="4" height="16"/>
84588450
</svg>
8459-
<span class="timer-preset-label">Pause</span>
8451+
84608452
</button>
84618453
<button class="timer-control-preset" data-action="volume_down" title="Leiser">
84628454
<svg width="24px" height="24px" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1">
84638455
<polygon points="11,5 6,9 2,9 2,15 6,15 11,19"/>
84648456
<line x1="23" y1="9" x2="17" y2="15"/>
84658457
<line x1="17" y1="9" x2="23" y2="15"/>
84668458
</svg>
8467-
<span class="timer-preset-label">Leiser</span>
8459+
84688460
</button>
84698461
`;
84708462
}
@@ -8475,30 +8467,30 @@ class FastSearchCard extends HTMLElement {
84758467
<svg width="24px" height="24px" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
84768468
<path d="M18 15l-6-6-6 6"/>
84778469
</svg>
8478-
<span class="timer-preset-label">Öffnen</span>
8470+
84798471
</button>
84808472

84818473
<button class="timer-control-preset" data-action="close" title="Schließen">
84828474
<svg width="24px" height="24px" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
84838475
<path d="M6 9l6 6 6-6"/>
84848476
</svg>
8485-
<span class="timer-preset-label">Schließen</span>
8477+
84868478
</button>
84878479

84888480
<button class="timer-control-preset" data-action="set_position_25" title="25% öffnen">
84898481
<svg width="24px" height="24px" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
84908482
<rect x="3" y="3" width="18" height="18" rx="2" ry="2"/>
84918483
<path d="M3 12h6"/>
84928484
</svg>
8493-
<span class="timer-preset-label">25%</span>
8485+
84948486
</button>
84958487

84968488
<button class="timer-control-preset" data-action="set_position_75" title="75% öffnen">
84978489
<svg width="24px" height="24px" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
84988490
<rect x="3" y="3" width="18" height="18" rx="2" ry="2"/>
84998491
<path d="M3 12h15"/>
85008492
</svg>
8501-
<span class="timer-preset-label">75%</span>
8493+
85028494
</button>
85038495
`;
85048496
}
@@ -8510,14 +8502,14 @@ class FastSearchCard extends HTMLElement {
85108502
<path d="M7 13C7.55228 13 8 12.5523 8 12C8 11.4477 7.55228 11 7 11C6.44772 11 6 11.4477 6 12C6 12.5523 6.44772 13 7 13Z"/>
85118503
<path d="M17 17H7C4.23858 17 2 14.7614 2 12C2 9.23858 4.23858 7 7 7H17C19.7614 7 22 9.23858 22 12C22 14.7614 19.7614 17 17 17Z"/>
85128504
</svg>
8513-
<span class="timer-preset-label">Aus</span>
8505+
85148506
</button>
85158507
<button class="timer-control-preset" data-action="turn_on" title="Einschalten">
85168508
<svg width="24px" height="24px" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1">
85178509
<path d="M17 13C17.5523 13 18 12.5523 18 12C18 11.4477 17.5523 11 17 11C16.4477 11 16 11.4477 16 12C16 12.5523 16.4477 13 17 13Z"/>
85188510
<path d="M17 17H7C4.23858 17 2 14.7614 2 12C2 9.23858 4.23858 7 7 7H17C19.7614 7 22 9.23858 22 12C22 14.7614 19.7614 17 17 17Z"/>
85198511
</svg>
8520-
<span class="timer-preset-label">Ein</span>
8512+
85218513
</button>
85228514
`;
85238515
}
@@ -10175,57 +10167,59 @@ class FastSearchCard extends HTMLElement {
1017510167
getPresetIconForAction(action) {
1017610168
console.log('🔍 DEBUG - Action eingegangen:', action);
1017710169

10178-
// Bestimme welche Preset-Funktion und welche Action
1017910170
let presetHTML = '';
10171+
let match = null;
1018010172

10173+
// Light Actions
1018110174
if (action.includes('Einschalten') || action.includes('Ein')) {
10182-
presetHTML = this.getLightTimerPresets(); // Hole komplettes HTML
10183-
// Extrahiere SVG aus turn_on Button
10184-
const match = presetHTML.match(/data-action="turn_on"[^>]*>(.*?)<span class="timer-preset-label">/s);
10185-
if (match) {
10186-
const svgMatch = match[1].match(/<svg[^>]*>.*?<\/svg>/s);
10187-
return svgMatch ? svgMatch[0].replace('width="24"', 'width="16"').replace('height="24"', 'height="16"') : '';
10188-
}
10175+
presetHTML = this.getLightTimerPresets();
10176+
match = presetHTML.match(/data-action="turn_on"[^>]*>(.*?)<\/button>/s);
1018910177
} else if (action.includes('Ausschalten') || action.includes('Aus')) {
1019010178
presetHTML = this.getLightTimerPresets();
10191-
const match = presetHTML.match(/data-action="turn_off"[^>]*>(.*?)<span class="timer-preset-label">/s);
10192-
if (match) {
10193-
const svgMatch = match[1].match(/<svg[^>]*>.*?<\/svg>/s);
10194-
return svgMatch ? svgMatch[0].replace('width="24"', 'width="16"').replace('height="24"', 'height="16"') : '';
10195-
}
10179+
match = presetHTML.match(/data-action="turn_off"[^>]*>(.*?)<\/button>/s);
1019610180
} else if (action.includes('30%')) {
10197-
console.log('🔍 30% gefunden!');
1019810181
presetHTML = this.getLightTimerPresets();
10199-
console.log('🔍 PresetHTML Länge:', presetHTML.length);
10200-
console.log('🔍 PresetHTML enthält dim_30:', presetHTML.includes('data-action="dim_30"'));
10201-
10202-
const match = presetHTML.match(/data-action="dim_30"[^>]*>\s*(.*?)\s*<span class="timer-preset-label">/s);
10203-
console.log('🔍 Match gefunden:', !!match);
10204-
if (match) {
10205-
console.log('🔍 Match[1]:', match[1]);
10206-
const svgMatch = match[1].match(/<svg[^>]*>.*?<\/svg>/s);
10207-
console.log('🔍 SVG Match:', !!svgMatch);
10208-
if (svgMatch) {
10209-
console.log('🔍 SVG:', svgMatch[0]);
10210-
return svgMatch[0].replace('width="24"', 'width="16"').replace('height="24"', 'height="16"');
10211-
}
10212-
}
10182+
match = presetHTML.match(/data-action="dim_30"[^>]*>(.*?)<\/button>/s);
1021310183
} else if (action.includes('50%')) {
10214-
console.log('🔍 50% gefunden!');
1021510184
presetHTML = this.getLightTimerPresets();
10216-
console.log('🔍 PresetHTML Länge:', presetHTML.length);
10217-
console.log('🔍 PresetHTML enthält dim_50:', presetHTML.includes('data-action="dim_50"'));
10218-
10219-
const match = presetHTML.match(/data-action="dim_50"[^>]*>\s*(.*?)\s*<span class="timer-preset-label">/s);
10220-
console.log('🔍 Match gefunden:', !!match);
10221-
if (match) {
10222-
console.log('🔍 Match[1]:', match[1]);
10223-
const svgMatch = match[1].match(/<svg[^>]*>.*?<\/svg>/s);
10224-
console.log('🔍 SVG Match:', !!svgMatch);
10225-
if (svgMatch) {
10226-
console.log('🔍 SVG:', svgMatch[0]);
10227-
return svgMatch[0].replace('width="24"', 'width="16"').replace('height="24"', 'height="16"');
10228-
}
10185+
match = presetHTML.match(/data-action="dim_50"[^>]*>(.*?)<\/button>/s);
10186+
10187+
// Climate Actions
10188+
} else if (action.includes('24°C') || action.includes('Heizen')) {
10189+
presetHTML = this.getClimateTimerPresets();
10190+
match = presetHTML.match(/data-action="heat_24"[^>]*>(.*?)<\/button>/s);
10191+
} else if (action.includes('22°C') || action.includes('Kühlen')) {
10192+
presetHTML = this.getClimateTimerPresets();
10193+
match = presetHTML.match(/data-action="cool_22"[^>]*>(.*?)<\/button>/s);
10194+
} else if (action.includes('Entfeuchten')) {
10195+
presetHTML = this.getClimateTimerPresets();
10196+
match = presetHTML.match(/data-action="dry_mode"[^>]*>(.*?)<\/button>/s);
10197+
} else if (action.includes('Lüften')) {
10198+
presetHTML = this.getClimateTimerPresets();
10199+
match = presetHTML.match(/data-action="fan_only"[^>]*>(.*?)<\/button>/s);
10200+
10201+
// Cover Actions
10202+
} else if (action.includes('Öffnen')) {
10203+
presetHTML = this.getCoverTimerPresets();
10204+
match = presetHTML.match(/data-action="open"[^>]*>(.*?)<\/button>/s);
10205+
} else if (action.includes('Schließen')) {
10206+
presetHTML = this.getCoverTimerPresets();
10207+
match = presetHTML.match(/data-action="close"[^>]*>(.*?)<\/button>/s);
10208+
} else if (action.includes('25%')) {
10209+
presetHTML = this.getCoverTimerPresets();
10210+
match = presetHTML.match(/data-action="set_position_25"[^>]*>(.*?)<\/button>/s);
10211+
} else if (action.includes('75%')) {
10212+
presetHTML = this.getCoverTimerPresets();
10213+
match = presetHTML.match(/data-action="set_position_75"[^>]*>(.*?)<\/button>/s);
10214+
}
10215+
10216+
// SVG extrahieren und anpassen
10217+
if (match) {
10218+
const svgMatch = match[1].match(/<svg[^>]*>.*?<\/svg>/s);
10219+
if (svgMatch) {
10220+
return svgMatch[0]
10221+
.replace(/width="24"/g, 'width="16"')
10222+
.replace(/height="24"/g, 'height="16"');
1022910223
}
1023010224
}
1023110225

0 commit comments

Comments
 (0)