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 ──
|
// ── 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',
|
||||||
|
|||||||
Reference in New Issue
Block a user