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:
@@ -218,9 +218,15 @@ export async function testHASource(): Promise<void> {
|
||||
// ── Card rendering ──
|
||||
|
||||
export function createHASourceCard(source: HomeAssistantSource) {
|
||||
const statusDot = source.connected
|
||||
? `<span class="status-dot status-dot-active" title="${t('ha_source.connected')}"></span>`
|
||||
: `<span class="status-dot status-dot-inactive" title="${t('ha_source.disconnected')}"></span>`;
|
||||
let healthClass: string, healthTitle: string;
|
||||
if (source.connected) {
|
||||
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({
|
||||
type: 'template-card',
|
||||
|
||||
Reference in New Issue
Block a user