Unify value source icons across dropdowns and card badges

Extract getValueSourceIcon() into value-sources.js and use it for
brightness source dropdowns and card badges in both LED and KC targets.
Icons now match value source cards: 📊 static, 🔄 animated, 🎵 audio,
🕐 adaptive_time, 🌤️ adaptive_scene.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-25 01:41:13 +03:00
parent 16f29bee30
commit e0e744095e
3 changed files with 16 additions and 6 deletions

View File

@@ -255,9 +255,15 @@ export async function deleteValueSource(sourceId) {
// ── Card rendering (used by streams.js) ───────────────────────
const _vsTypeIcons = { static: '📊', animated: '🔄', audio: '🎵', adaptive_time: '🕐', adaptive_scene: '🌤️' };
/** Return the emoji icon for a given value source type. */
export function getValueSourceIcon(sourceType) {
return _vsTypeIcons[sourceType] || '🎚️';
}
export function createValueSourceCard(src) {
const typeIcons = { static: '📊', animated: '🔄', audio: '🎵', adaptive_time: '🕐', adaptive_scene: '🌤️' };
const icon = typeIcons[src.source_type] || '🎚️';
const icon = getValueSourceIcon(src.source_type);
let propsHtml = '';
if (src.source_type === 'static') {