182 files

This commit is contained in:
Home Assistant Version Control
2026-08-17 12:11:35 +00:00
parent 7dddf6bb13
commit ece15a1c1b
183 changed files with 11457 additions and 3092 deletions
@@ -6,7 +6,8 @@
import { css, html, LitElement, nothing } from "lit";
import { property, state } from "lit/decorators.js";
import { t, ensureLocale } from "../styles";
import { t, ensureLocale, langOf } from "../styles";
import { LS_KEYS, lsGet, lsSet } from "../helpers/storage-keys";
import { describeWsError } from "../ws-errors";
import type { HomeAssistant } from "../types";
@@ -84,7 +85,7 @@ export class MaintenanceBatteryFleetSection extends LitElement {
private _localeReady = false;
private get _lang(): string {
return this.hass?.language || "en";
return langOf(this.hass);
}
connectedCallback(): void {
@@ -232,24 +233,14 @@ export class MaintenanceBatteryFleetSection extends LitElement {
</svg>`;
}
private static readonly _SORT_KEY = "ms_bf_roster_sort";
private static _storedSort(): "name" | "urgency" {
try {
const v = localStorage.getItem(MaintenanceBatteryFleetSection._SORT_KEY);
return v === "name" ? "name" : "urgency";
} catch {
return "urgency";
}
return lsGet(LS_KEYS.batteryRosterSort) === "name" ? "name" : "urgency";
}
private _setSort(mode: "name" | "urgency"): void {
this._rosterSort = mode;
try {
localStorage.setItem(MaintenanceBatteryFleetSection._SORT_KEY, mode);
} catch {
// storage unavailable — the toggle still works for this visit
}
// Storage may be unavailable — the toggle still works for this visit.
lsSet(LS_KEYS.batteryRosterSort, mode);
}
/** Urgency (the default, issue #123): low rows first — emptiest first —