feat: HA source cards use health-dot indicators
Lint & Test / test (push) Successful in 1m39s

Replace unstyled status-dot classes with the existing health-dot
pattern (green/red glow) matching LED device cards. Tooltip shows
connection status and entity count.
This commit is contained in:
2026-03-31 16:05:01 +03:00
parent b36ddfd395
commit e7c9a568dc
@@ -218,9 +218,15 @@ export async function testHASource(): Promise<void> {
// ── Card rendering ── // ── Card rendering ──
export function createHASourceCard(source: HomeAssistantSource) { export function createHASourceCard(source: HomeAssistantSource) {
const statusDot = source.connected let healthClass: string, healthTitle: string;
? `<span class="status-dot status-dot-active" title="${t('ha_source.connected')}"></span>` if (source.connected) {
: `<span class="status-dot status-dot-inactive" title="${t('ha_source.disconnected')}"></span>`; healthClass = 'health-online';
healthTitle = `${t('ha_source.connected')}${source.entity_count} entities`;
} else {
healthClass = 'health-offline';
healthTitle = t('ha_source.disconnected');
}
const statusDot = `<span class="health-dot ${healthClass}" title="${escapeHtml(healthTitle)}" role="status"></span>`;
return wrapCard({ return wrapCard({
type: 'template-card', type: 'template-card',