mirror of
https://github.com/Matysh/houseplan-card
synced 2026-07-31 16:38: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:
@@ -11,6 +11,7 @@ import {
|
||||
alignGuides, segmentAngle, is45,
|
||||
swipeTarget, clampScale,
|
||||
migratePdfUrls,
|
||||
roomFillModeOf,
|
||||
segmentCm, formatLength, roomEdges, roomPoly, pointOnBoundary, pointStrictlyInside, roomsOverlap,
|
||||
mergeRooms, splitRoom, polygonArea, closestPointOnBoundary, isActiveState, snapToWall, openingAmount, fillColorsOf, lerpColor, roomFillStyle, stateIcon, lightColorOf, isAlarmState, parseRoomRef, diffNewDevices,
|
||||
} from '../test-build/logic.js';
|
||||
@@ -800,3 +801,11 @@ test('migratePdfUrls: rebinding rewrites file urls', () => {
|
||||
// без смены id — как есть
|
||||
assert.equal(migratePdfUrls(pdfs, 'x', 'x'), pdfs);
|
||||
});
|
||||
|
||||
test('roomFillModeOf: tier-3 override beats the space, junk inherits', () => {
|
||||
assert.equal(roomFillModeOf('temp', { settings: { fill_mode: 'light' } }), 'light');
|
||||
assert.equal(roomFillModeOf('glow', { settings: { fill_mode: 'none' } }), 'none'); // выход из тьмы
|
||||
assert.equal(roomFillModeOf('temp', {}), 'temp');
|
||||
assert.equal(roomFillModeOf('temp', null), 'temp');
|
||||
assert.equal(roomFillModeOf('temp', { settings: { fill_mode: 'glow' } }), 'temp'); // glow нельзя выбрать per-room
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user