EV-03: car charger seam, Alfen HA driver, read-only Car card
Read-only: nothing in this change writes to the charger. - app/chargers.py: ChargerDriver, AlfenHaDriver, UnavailableCharger, ChargerReading, CarTracker - options ev_charger/ev_current_entity/ev_max_a/ev_phases (default off), Settings group, validator, census - Car card on Home, unreachable row and notification, two-writer info row, MQTT sensors - car out of the House tile and the house profile - tools/chargersim.py charger model, test_ev03.py Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -113,7 +113,8 @@
|
||||
const setup = S.setup_only === true;
|
||||
banner($("#home-banner"), S.level, setup ? t("setup_only.name") : S.banner, structured ? S.state.sub : setup ? t("setup_only.description") : "", S.level === "bad" ? "alert" : null);
|
||||
["#c-now", "#c-plan", "#c-peak", "#c-attn"].forEach((id) => { $(id).hidden = !structured; });
|
||||
if (structured) { renderNow(); renderPlan(); renderPeak(); renderAttention(); }
|
||||
if (structured) { renderNow(); renderCar(); renderPlan(); renderPeak(); renderAttention(); }
|
||||
else $("#c-car").hidden = true;
|
||||
renderControl(structured, setup);
|
||||
renderDetails(!structured && !setup);
|
||||
renderBatteries(force);
|
||||
@@ -145,6 +146,20 @@
|
||||
h("div", { class: "small muted", style: "grid-column:1/-1" }, b.now))));
|
||||
}
|
||||
|
||||
/* ---------------- Home: the car (read only) ---------------- */
|
||||
function renderCar() {
|
||||
const c = S.car;
|
||||
$("#c-car").hidden = !c;
|
||||
if (!c) return;
|
||||
const chip = $("#car-chip");
|
||||
chip.textContent = c.chip;
|
||||
chip.className = "chip" + (c.kind === "warn" ? " rs" : c.kind === "ok" ? " now" : "");
|
||||
$("#car-big").textContent = c.big;
|
||||
$("#car-today").textContent = c.today || "";
|
||||
$("#car-today").hidden = !c.today;
|
||||
$("#car-why").textContent = c.why;
|
||||
}
|
||||
|
||||
/* ---------------- Home: today's plan ---------------- */
|
||||
const LEGEND = [["cheap", "background:var(--cheap)"], ["dear", "background:repeating-linear-gradient(135deg,var(--dear) 0 3px,transparent 3px 5px)"],
|
||||
["grid", "background:var(--accent)"], ["give", "background:repeating-linear-gradient(135deg,var(--house) 0 3px,transparent 3px 5px)"],
|
||||
|
||||
Reference in New Issue
Block a user