mirror of
https://github.com/Matysh/houseplan-card
synced 2026-07-31 08:28:31 +00:00
feat v1.14.0: per-space display settings, hand-drawn spaces, manual-testing checklist
- space dialog 'Display' section: room borders/names toggles, color+opacity, fill by zigbee signal or lights (tri-state: on/off/no-lights) - draggable room name labels persisted as layout rl_<roomId> - 'no image, outline by hand' space source with canvas orientation; image optional now; switching an existing space to draw detaches its plan - demo/ synthetic-home harness lives in the repo (serve.mjs + smokes + icons gen) - docs/TESTING.md checklist (same-commit update policy); self-run found and fixed: plan_url not detached on image->draw, _stateClass crash on states without entity_id; perf measured (162 devices ~14ms build) - backend: SPACE_DISPLAY_SCHEMA validation (+test)
This commit is contained in:
@@ -97,3 +97,22 @@ def test_layout_schema():
|
||||
v.LAYOUT_SCHEMA({"dev1": {"x": 0.1, "y": 0.2, "s": "f1"}})
|
||||
with pytest.raises(vol.Invalid):
|
||||
v.LAYOUT_SCHEMA({"dev1": {"x": 0.1}})
|
||||
|
||||
|
||||
def test_space_display_settings():
|
||||
"""Per-space display settings validate; garbage color/mode is rejected."""
|
||||
ok = {
|
||||
"id": "f1", "title": "Floor 1", "aspect": 1.0, "view_box": [0, 0, 1, 1],
|
||||
"rooms": [], "settings": {
|
||||
"show_borders": True, "show_names": False,
|
||||
"room_color": "#3ea6ff", "room_opacity": 0.5, "fill_mode": "lqi",
|
||||
},
|
||||
}
|
||||
v.SPACE_SCHEMA(ok)
|
||||
import pytest as _pytest
|
||||
bad_color = dict(ok, settings={"room_color": "javascript:x"})
|
||||
with _pytest.raises(Exception):
|
||||
v.SPACE_SCHEMA(bad_color)
|
||||
bad_mode = dict(ok, settings={"fill_mode": "rainbow"})
|
||||
with _pytest.raises(Exception):
|
||||
v.SPACE_SCHEMA(bad_mode)
|
||||
|
||||
Reference in New Issue
Block a user