mirror of
https://github.com/Matysh/houseplan-card
synced 2026-07-31 08:28:31 +00:00
feat v1.42.0: room settings — the third settings tier
- four-tier principle fixed in ARCHITECTURE: global > space > room >
device, specific overrides general, unset inherits
- room.settings { fill_mode, temp_source, hum_source } with backend
schema; pure roomFillModeOf + sourceValue (+2 test suites, 114)
- gear on room cards in the Plan editor opens Room settings: rename,
re-area (current area included in the list), fill override (may opt
out of glow darkness), explicit temp/hum source with a searchable
device+entity dropdown; the same section in the creation dialog
- source feeds the room card, tooltip and temp fill; works for rooms
without an HA area (user-feedback case #1)
- smoke_room_settings.mjs (10 checks); TESTING/CHANGELOG/ARCHITECTURE
same-commit
This commit is contained in:
@@ -965,6 +965,22 @@ export function outlineWithout(poly: number[][], cuts: number[][], eps = 1e-6):
|
||||
return cutSegments(edges, cuts, eps);
|
||||
}
|
||||
|
||||
// ---------------- room-level settings (tier 3) ----------------
|
||||
|
||||
/**
|
||||
* Effective fill mode of a room: its own override wins, otherwise the space's.
|
||||
* Four settings tiers (owner's principle, 2026-07-26): global > space > room >
|
||||
* device; the more specific tier overrides the more general one. A room may
|
||||
* override even in a glow space ('none' pulls it out of the darkness).
|
||||
*/
|
||||
export function roomFillModeOf(
|
||||
spaceFill: RoomFillMode,
|
||||
room: { settings?: { fill_mode?: string | null } | null } | null | undefined,
|
||||
): RoomFillMode {
|
||||
const o = room?.settings?.fill_mode;
|
||||
return o === 'none' || o === 'lqi' || o === 'light' || o === 'temp' ? o : spaceFill;
|
||||
}
|
||||
|
||||
// ---------------- marker files ----------------
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user