Fix mock device RGBW badge, add icons to audio/value source card badges
Fall back to stored device rgbw field when health check doesn't report it (mock devices have no hardware to query). Add emoji icons to all property badges on audio source and value source cards. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -272,6 +272,13 @@ class ProcessorManager:
|
|||||||
|
|
||||||
ds = self._devices[device_id]
|
ds = self._devices[device_id]
|
||||||
h = ds.health
|
h = ds.health
|
||||||
|
# Fall back to stored device rgbw when health check doesn't report it
|
||||||
|
# (e.g. mock devices have no real hardware to query)
|
||||||
|
rgbw = h.device_rgbw
|
||||||
|
if rgbw is None and self._device_store:
|
||||||
|
dev = self._device_store.get_device(device_id)
|
||||||
|
if dev:
|
||||||
|
rgbw = getattr(dev, "rgbw", False)
|
||||||
return {
|
return {
|
||||||
"device_id": device_id,
|
"device_id": device_id,
|
||||||
"device_online": h.online,
|
"device_online": h.online,
|
||||||
@@ -279,7 +286,7 @@ class ProcessorManager:
|
|||||||
"device_name": h.device_name,
|
"device_name": h.device_name,
|
||||||
"device_version": h.device_version,
|
"device_version": h.device_version,
|
||||||
"device_led_count": h.device_led_count,
|
"device_led_count": h.device_led_count,
|
||||||
"device_rgbw": h.device_rgbw,
|
"device_rgbw": rgbw,
|
||||||
"device_led_type": h.device_led_type,
|
"device_led_type": h.device_led_type,
|
||||||
"device_fps": h.device_fps,
|
"device_fps": h.device_fps,
|
||||||
"device_last_checked": h.last_checked,
|
"device_last_checked": h.last_checked,
|
||||||
|
|||||||
@@ -729,8 +729,8 @@ function renderPictureSourcesList(streams) {
|
|||||||
const parentName = parent ? parent.name : src.audio_source_id;
|
const parentName = parent ? parent.name : src.audio_source_id;
|
||||||
const chLabel = src.channel === 'left' ? 'L' : src.channel === 'right' ? 'R' : 'M';
|
const chLabel = src.channel === 'left' ? 'L' : src.channel === 'right' ? 'R' : 'M';
|
||||||
propsHtml = `
|
propsHtml = `
|
||||||
<span class="stream-card-prop" title="${escapeHtml(t('audio_source.parent'))}">${escapeHtml(parentName)}</span>
|
<span class="stream-card-prop" title="${escapeHtml(t('audio_source.parent'))}">🔊 ${escapeHtml(parentName)}</span>
|
||||||
<span class="stream-card-prop" title="${escapeHtml(t('audio_source.channel'))}">${chLabel}</span>
|
<span class="stream-card-prop" title="${escapeHtml(t('audio_source.channel'))}">📻 ${chLabel}</span>
|
||||||
`;
|
`;
|
||||||
} else {
|
} else {
|
||||||
const devIdx = src.device_index ?? -1;
|
const devIdx = src.device_index ?? -1;
|
||||||
|
|||||||
@@ -267,35 +267,35 @@ export function createValueSourceCard(src) {
|
|||||||
|
|
||||||
let propsHtml = '';
|
let propsHtml = '';
|
||||||
if (src.source_type === 'static') {
|
if (src.source_type === 'static') {
|
||||||
propsHtml = `<span class="stream-card-prop">${t('value_source.type.static')}: ${src.value ?? 1.0}</span>`;
|
propsHtml = `<span class="stream-card-prop">📊 ${t('value_source.type.static')}: ${src.value ?? 1.0}</span>`;
|
||||||
} else if (src.source_type === 'animated') {
|
} else if (src.source_type === 'animated') {
|
||||||
const waveLabel = src.waveform || 'sine';
|
const waveLabel = src.waveform || 'sine';
|
||||||
propsHtml = `
|
propsHtml = `
|
||||||
<span class="stream-card-prop">${escapeHtml(waveLabel)}</span>
|
<span class="stream-card-prop">〰️ ${escapeHtml(waveLabel)}</span>
|
||||||
<span class="stream-card-prop">${src.speed ?? 10} cpm</span>
|
<span class="stream-card-prop">⏱️ ${src.speed ?? 10} cpm</span>
|
||||||
<span class="stream-card-prop">${src.min_value ?? 0}–${src.max_value ?? 1}</span>
|
<span class="stream-card-prop">↕️ ${src.min_value ?? 0}–${src.max_value ?? 1}</span>
|
||||||
`;
|
`;
|
||||||
} else if (src.source_type === 'audio') {
|
} else if (src.source_type === 'audio') {
|
||||||
const audioSrc = _cachedAudioSources.find(a => a.id === src.audio_source_id);
|
const audioSrc = _cachedAudioSources.find(a => a.id === src.audio_source_id);
|
||||||
const audioName = audioSrc ? audioSrc.name : (src.audio_source_id || '-');
|
const audioName = audioSrc ? audioSrc.name : (src.audio_source_id || '-');
|
||||||
const modeLabel = src.mode || 'rms';
|
const modeLabel = src.mode || 'rms';
|
||||||
propsHtml = `
|
propsHtml = `
|
||||||
<span class="stream-card-prop" title="${escapeHtml(t('value_source.audio_source'))}">${escapeHtml(audioName)}</span>
|
<span class="stream-card-prop" title="${escapeHtml(t('value_source.audio_source'))}">🎵 ${escapeHtml(audioName)}</span>
|
||||||
<span class="stream-card-prop">${modeLabel.toUpperCase()}</span>
|
<span class="stream-card-prop">📈 ${modeLabel.toUpperCase()}</span>
|
||||||
<span class="stream-card-prop">${src.min_value ?? 0}–${src.max_value ?? 1}</span>
|
<span class="stream-card-prop">↕️ ${src.min_value ?? 0}–${src.max_value ?? 1}</span>
|
||||||
`;
|
`;
|
||||||
} else if (src.source_type === 'adaptive_time') {
|
} else if (src.source_type === 'adaptive_time') {
|
||||||
const pts = (src.schedule || []).length;
|
const pts = (src.schedule || []).length;
|
||||||
propsHtml = `
|
propsHtml = `
|
||||||
<span class="stream-card-prop">${pts} ${t('value_source.schedule.points')}</span>
|
<span class="stream-card-prop">📍 ${pts} ${t('value_source.schedule.points')}</span>
|
||||||
<span class="stream-card-prop">${src.min_value ?? 0}–${src.max_value ?? 1}</span>
|
<span class="stream-card-prop">↕️ ${src.min_value ?? 0}–${src.max_value ?? 1}</span>
|
||||||
`;
|
`;
|
||||||
} else if (src.source_type === 'adaptive_scene') {
|
} else if (src.source_type === 'adaptive_scene') {
|
||||||
const ps = _cachedStreams.find(s => s.id === src.picture_source_id);
|
const ps = _cachedStreams.find(s => s.id === src.picture_source_id);
|
||||||
const psName = ps ? ps.name : (src.picture_source_id || '-');
|
const psName = ps ? ps.name : (src.picture_source_id || '-');
|
||||||
propsHtml = `
|
propsHtml = `
|
||||||
<span class="stream-card-prop">${escapeHtml(psName)}</span>
|
<span class="stream-card-prop">🖥️ ${escapeHtml(psName)}</span>
|
||||||
<span class="stream-card-prop">${src.scene_behavior || 'complement'}</span>
|
<span class="stream-card-prop">🔄 ${src.scene_behavior || 'complement'}</span>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user