Skip to content

Commit 5befc5a

Browse files
authored
Update fast-search-card.js
1 parent 2579fde commit 5befc5a

File tree

1 file changed

+33
-34
lines changed

1 file changed

+33
-34
lines changed

dist/fast-search-card.js

Lines changed: 33 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -8469,33 +8469,25 @@ class FastSearchCard extends HTMLElement {
84698469
getCoverTimerPresets() {
84708470
return `
84718471
<button class="timer-control-preset" data-action="open" title="Öffnen">
8472-
<svg width="24px" height="24px" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
8473-
<path d="M18 15l-6-6-6 6"/>
8474-
</svg>
8475-
8472+
<!-- Bestehender Öffnen SVG -->
84768473
</button>
84778474

84788475
<button class="timer-control-preset" data-action="close" title="Schließen">
8479-
<svg width="24px" height="24px" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
8480-
<path d="M6 9l6 6 6-6"/>
8481-
</svg>
8482-
8483-
</button>
8484-
8485-
<button class="timer-control-preset" data-action="set_position_25" title="25% öffnen">
8486-
<svg width="24px" height="24px" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
8487-
<rect x="3" y="3" width="18" height="18" rx="2" ry="2"/>
8488-
<path d="M3 12h6"/>
8489-
</svg>
8490-
8476+
<!-- Bestehender Schließen SVG -->
84918477
</button>
84928478

8493-
<button class="timer-control-preset" data-action="set_position_75" title="75% öffnen">
8494-
<svg width="24px" height="24px" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
8495-
<rect x="3" y="3" width="18" height="18" rx="2" ry="2"/>
8496-
<path d="M3 12h15"/>
8479+
<button class="timer-control-preset" data-action="set_position_50" title="50% öffnen">
8480+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" color="currentColor">
8481+
<path d="M12 18C15.3137 18 18 15.3137 18 12C18 8.68629 15.3137 6 12 6C8.68629 6 6 8.68629 6 12C6 15.3137 8.68629 18 12 18Z"/>
8482+
<path d="M22 12L23 12"/>
8483+
<path d="M12 2V1"/>
8484+
<path d="M12 23V22"/>
8485+
<path d="M20 20L19 19"/>
8486+
<path d="M20 4L19 5"/>
8487+
<path d="M4 20L5 19"/>
8488+
<path d="M4 4L5 5"/>
8489+
<path d="M1 12L2 12"/>
84978490
</svg>
8498-
84998491
</button>
85008492
`;
85018493
}
@@ -8844,8 +8836,7 @@ class FastSearchCard extends HTMLElement {
88448836
// Cover
88458837
'open': 'Öffnen',
88468838
'close': 'Schließen',
8847-
'set_position_25': '25% öffnen',
8848-
'set_position_75': '75% öffnen',
8839+
'set_position_50': '50% öffnen',
88498840

88508841
// Generic
88518842
'toggle': 'Umschalten'
@@ -9614,20 +9605,15 @@ class FastSearchCard extends HTMLElement {
96149605
return { service: 'cover.open_cover', serviceData: {} };
96159606
case 'close':
96169607
return { service: 'cover.close_cover', serviceData: {} };
9617-
case 'set_position_25':
9618-
return {
9619-
service: 'cover.set_cover_position',
9620-
serviceData: { position: 25 }
9621-
};
9622-
case 'set_position_75':
9608+
case 'set_position_50':
96239609
return {
96249610
service: 'cover.set_cover_position',
9625-
serviceData: { position: 75 }
9611+
serviceData: { position: 50 }
96269612
};
96279613
default:
96289614
return { service: 'cover.close_cover', serviceData: {} };
96299615
}
9630-
}
9616+
}
96319617

96329618
getMediaActionData(action) {
96339619
switch (action) {
@@ -10078,10 +10064,12 @@ class FastSearchCard extends HTMLElement {
1007810064
actionType = 'play';
1007910065
} else if (action.includes('Pause')) {
1008010066
actionType = 'pause';
10081-
} else if (action.includes('Öffnen')) {
10082-
actionType = 'open';
10067+
} else if (action.includes('Öffnen') && !action.includes('%')) {
10068+
actionType = 'cover_open';
1008310069
} else if (action.includes('Schließen')) {
10084-
actionType = 'close';
10070+
actionType = 'cover_close';
10071+
} else if (action.includes('50%')) {
10072+
actionType = 'cover_50'; // ← Nur noch 50%, nicht mehr 25% und 75%
1008510073
}
1008610074

1008710075

@@ -10349,6 +10337,17 @@ class FastSearchCard extends HTMLElement {
1034910337
if (service.includes('climate.turn_off')) return 'Ausschalten';
1035010338
}
1035110339
return 'Aktion';
10340+
10341+
// Cover Actions - anpassen
10342+
if (service.includes('cover.open_cover')) return 'Öffnen';
10343+
if (service.includes('cover.close_cover')) return 'Schließen';
10344+
if (service.includes('cover.set_cover_position')) {
10345+
if (serviceData && serviceData.position) {
10346+
if (serviceData.position === 50) return '50% öffnen'; // ← Spezifisch für 50%
10347+
return `${serviceData.position}% öffnen`; // ← Fallback für andere Werte
10348+
}
10349+
return 'Position setzen';
10350+
}
1035210351
}
1035310352

1035410353
async deleteTimer(timerId, entityId) {

0 commit comments

Comments
 (0)