feat: show scoped utility overviews and compact trend controls
This commit is contained in:
1 parent
2bf5f4a60a
commit
5fd674bb00
17 files changed
+987
-456
No files matched your search
@@ -139,6 +139,13 @@ export function floorUtilityReadings(hass: HomeAssistant, floor: Floor, rooms: r
|
||||
return result;
|
||||
}
|
||||
|
||||
/** Sum the effective floor meters; shared native sources count only once for the building. */
|
||||
export function buildingUtilityReadings(hass: HomeAssistant, floors: readonly Floor[]): UtilityReading[] {
|
||||
const rooms = floors.flatMap((f) => f.rooms);
|
||||
const sources = floors.flatMap((f) => floorUtilityReadings(hass, f, rooms).flatMap((r) => r.sources.map((id) => ({ kind: r.kind, metric: r.metric, period: r.period, id }))));
|
||||
return readings(hass, sources);
|
||||
}
|
||||
|
||||
export function utilityWatched(hass: HomeAssistant, floors: readonly Floor[]): string[] {
|
||||
const rooms = floors.flatMap((f) => f.rooms);
|
||||
return [...new Set(floors.flatMap((f) => [
|
||||
|
||||
Reference in new issue
Block a user