feat: show metered devices below rooms in utility overview
This commit is contained in:
1 parent
173d02e3cc
commit
df4a6f36a3
14 files changed
+1791
-1577
No files matched your search
@@ -55,7 +55,7 @@ import { fixtureGlow } from "../entities/kinds.ts";
|
||||
import { coverTiltEntity } from "../entities/covers.ts";
|
||||
import { isSymcon, isSymconVariable, nativeBool, nativeText } from "../entities/symcon-values.ts";
|
||||
import { WEATHER_VARIABLE_LABELS } from "../symcon-weather.ts";
|
||||
import { floorUtilityReadings, utilityText } from "../utilities.ts";
|
||||
import { floorUtilityAreas, floorUtilityReadings, utilityText } from "../utilities.ts";
|
||||
import "./utility-report.ts";
|
||||
import "./utility-overview.ts";
|
||||
import { trendButton } from "./trend-button.ts";
|
||||
@@ -2790,7 +2790,7 @@ export class NfView3d extends LitElement {
|
||||
const b = this.building;
|
||||
if (!b || !isSymcon(this.hass) || !this.showEnergy || this.clean || this.roomId || this.panelOpen || (!inline && !this._utilityOverviewVisible)) return nothing;
|
||||
const rooms = b.floors.flatMap((f) => f.rooms), floors = this.floorId ? b.floors.filter((f) => f.id === this.floorId) : b.floors;
|
||||
if (!floors.some((f) => floorUtilityReadings(this.hass, f, rooms).length)) return nothing;
|
||||
if (!floors.some((f) => floorUtilityReadings(this.hass, f, rooms).length || floorUtilityAreas(this.hass, f, rooms, true).length)) return nothing;
|
||||
return html`<nf-utility-overview ?inline=${inline} .hass=${this.hass} .floors=${b.floors} .floorId=${this.floorId} .compact=${this._narrowStage}
|
||||
@utility-open=${(e: CustomEvent<{ floorId: string; roomId: string | null }>) => { e.stopPropagation(); if (e.detail.roomId) this.openRoom(e.detail.floorId, e.detail.roomId); else this.fire("floor-tap", { floorId: e.detail.floorId }); }}></nf-utility-overview>`;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user