Skip to content

Commit a406ebd

Browse files
authored
Update fast-search-card.js
1 parent 3f5defa commit a406ebd

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

β€Ždist/fast-search-card.jsβ€Ž

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8349,26 +8349,19 @@ class FastSearchCard extends HTMLElement {
83498349
<path d="M1.15 1.878a.514.514 0 0 1 .728-.727l16.971 16.971a.514.514 0 0 1-.727.727z"/>
83508350
</g>
83518351
</svg>
8352-
83538352
</button>
83548353

83558354
<button class="timer-control-preset" data-action="turn_on" title="Einschalten">
83568355
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor" color="currentColor">
83578356
<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"/>
83588357
<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"/>
83598358
</svg>
8360-
83618359
</button>
83628360

83638361
<button class="timer-control-preset" data-action="dim_30" title="30% Helligkeit">
83648362
<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">
8365-
<path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0" />
8366-
<path d="M12 3v18" />
8367-
<path d="M12 9l4.65 -4.65" />
8368-
<path d="M12 14.3l7.37 -7.37" />
8369-
<path d="M12 19.6l8.85 -8.85" />
8363+
<path d="M3 11.5066C3 16.7497 7.25034 21 12.4934 21C16.2209 21 19.4466 18.8518 21 15.7259C12.4934 15.7259 8.27411 11.5066 8.27411 3C5.14821 4.55344 3 7.77915 3 11.5066Z"/>
83708364
</svg>
8371-
83728365
</button>
83738366

83748367
<button class="timer-control-preset" data-action="dim_50" title="50% Helligkeit">
@@ -8379,7 +8372,6 @@ class FastSearchCard extends HTMLElement {
83798372
<path d="M12 14.3l7.37 -7.37" />
83808373
<path d="M12 19.6l8.85 -8.85" />
83818374
</svg>
8382-
83838375
</button>
83848376
`;
83858377
}
@@ -10164,25 +10156,35 @@ class FastSearchCard extends HTMLElement {
1016410156
});
1016510157
}
1016610158

10159+
1016710160
getPresetIconForAction(action) {
1016810161
console.log('πŸ” DEBUG - Action eingegangen:', action);
10162+
console.log('πŸ” DEBUG - Action Type:', typeof action);
1016910163

1017010164
let presetHTML = '';
1017110165
let match = null;
1017210166

1017310167
// Light Actions
1017410168
if (action.includes('Einschalten') || action.includes('Ein')) {
10169+
console.log('πŸ” Einschalten erkannt');
1017510170
presetHTML = this.getLightTimerPresets();
1017610171
match = presetHTML.match(/data-action="turn_on"[^>]*>(.*?)<\/button>/s);
1017710172
} else if (action.includes('Ausschalten') || action.includes('Aus')) {
10173+
console.log('πŸ” Ausschalten erkannt');
1017810174
presetHTML = this.getLightTimerPresets();
1017910175
match = presetHTML.match(/data-action="turn_off"[^>]*>(.*?)<\/button>/s);
1018010176
} else if (action.includes('30%')) {
10177+
console.log('πŸ” 30% erkannt');
1018110178
presetHTML = this.getLightTimerPresets();
10179+
console.log('πŸ” PresetHTML LΓ€nge:', presetHTML.length);
1018210180
match = presetHTML.match(/data-action="dim_30"[^>]*>(.*?)<\/button>/s);
10181+
console.log('πŸ” Match gefunden:', !!match);
1018310182
} else if (action.includes('50%')) {
10183+
console.log('πŸ” 50% erkannt');
1018410184
presetHTML = this.getLightTimerPresets();
1018510185
match = presetHTML.match(/data-action="dim_50"[^>]*>(.*?)<\/button>/s);
10186+
console.log('πŸ” Match gefunden:', !!match);
10187+
1018610188

1018710189
// Climate Actions
1018810190
} else if (action.includes('24Β°C') || action.includes('Heizen')) {

0 commit comments

Comments
Β (0)