feat: add native charging station telemetry and aliased lock status
This commit is contained in:
1 parent
df4a6f36a3
commit
59292517b7
24 files changed
+1756
-1304
No files matched your search
@@ -261,8 +261,8 @@ export function unstackLhCards(root: ParentNode): void {
|
||||
.sort((a, b) => b.y - a.y);
|
||||
for (const it of items) {
|
||||
let bottom = it.y;
|
||||
// Hydraulic cards contain several readings: use nearby free columns before stacking them out of view.
|
||||
if (it.el.classList.contains("live-card-hydronic") && width > it.w + 16 && height > it.h + 16) {
|
||||
// Multi-reading equipment cards use nearby free columns before stacking out of view.
|
||||
if ((it.el.classList.contains("live-card-hydronic") || it.el.classList.contains("live-card-charging")) && width > it.w + 16 && height > it.h + 16) {
|
||||
const xs = [it.x, it.w / 2 + 8, width - it.w / 2 - 8, ...placed.flatMap((p) => [p.x0 - it.w / 2 - 8, p.x1 + it.w / 2 + 8])]
|
||||
.filter((x) => x >= it.w / 2 + 8 && x <= width - it.w / 2 - 8).sort((a, b) => Math.abs(a - it.x) - Math.abs(b - it.x));
|
||||
const ys = [Math.max(it.h + 8, Math.min(height - 8, bottom)), ...placed.flatMap((p) => [p.y0 - 8, p.y1 + it.h + 8])].filter((y) => y >= it.h + 8 && y <= height - 8);
|
||||
@@ -345,8 +345,9 @@ function roomClimateCard(hass: HomeAssistant | undefined, c: RoomClimateCard, i:
|
||||
|
||||
function furniturePowerCard(hass: HomeAssistant | undefined, c: FurniturePowerCard, i: number): TemplateResult {
|
||||
const power = c.power === null ? "–" : `${c.power < 0 ? "−" : ""}${watts(hass, c.power)}`;
|
||||
return html`<div class="live-card live-card-power" data-i=${i} data-furniture=${c.id} role="group" aria-label=${c.name}>
|
||||
<div class="live-power-name">${c.name}</div><div class="live-row"><span aria-hidden="true">⚡</span><b>${power}</b>${trendButton(hass, [c.powerEntity], c.name)}</div>
|
||||
return html`<div class="live-card live-card-power ${(c.readings ?? []).length ? "live-card-charging" : ""}" data-i=${i} data-furniture=${c.id} role="group" aria-label=${c.name}>
|
||||
<div class="live-power-name">${c.name}</div>${c.powerEntity ? html`<div class="live-row"><span aria-hidden="true">⚡</span><b>${power}</b>${trendButton(hass, [c.powerEntity], c.name)}</div>` : nothing}
|
||||
${(c.readings ?? []).map((r) => html`<div class="live-row live-charging-row" data-reading=${r.id}><span class="live-charging-label" title=${r.label}><span aria-hidden="true">${r.icon}</span> ${r.label}</span><b title=${r.text}>${r.text}</b>${trendButton(hass, [r.entity], r.label)}</div>`)}
|
||||
</div>`;
|
||||
}
|
||||
|
||||
@@ -363,6 +364,11 @@ export const liveCardStyles = css`
|
||||
.live-card-power .live-row { align-items:center; gap:6px; }
|
||||
.live-card-power .live-row b { margin-left:auto; color:color-mix(in srgb,#ffca8a 80%,var(--nf-text)); font-variant-numeric:tabular-nums; }
|
||||
.live-card-power nf-trend-button { margin-left:0; }
|
||||
.live-card-power.live-card-charging { max-width:min(320px,calc(100vw - 24px)); }
|
||||
.live-card-power .live-charging-row { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.4fr) 18px; align-items:center; column-gap:6px; min-height:18px; }
|
||||
.live-charging-label { color:var(--nf-muted); font-size:10px; overflow:hidden; text-overflow:ellipsis; }
|
||||
.live-charging-row b { font-size:11px; overflow:hidden; text-overflow:ellipsis; }
|
||||
.live-charging-row nf-trend-button { grid-column:3; }
|
||||
.live-cards {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
|
||||
Reference in new issue
Block a user