mirror of
https://github.com/Matysh/houseplan-card
synced 2026-08-01 00:48:29 +00:00
Live robot vacuums, P1 (docs/VACUUM.md)
The base marker never moves — it is the dock. While the robot cleans, a round pulsing puck (no badge plate) drives the plan over an affine transform solved from vacuum-map coordinates: auto-calibration matches the robot's room list against plan rooms by name, and a three-point wizard covers integrations without room data. The trail rides the integration's own path when offered (it predates the card being opened) and a self-recorded thinned buffer otherwise, lingering ten minutes after docking. Adapters read the Map Extractor / Tasshack / Valetudo attribute dialects through one tolerant parser. Display only — no commands, per the owner's decision. vacuum.ts is pure logic under 8 new unit tests; the marker schema grew an optional vacuum block (56 backend tests); smoke_vacuum drives 19 browser asserts including the wizard end to end.
This commit is contained in:
@@ -923,3 +923,36 @@ def test_check_quota_refuses_when_the_disk_is_nearly_full(tmp_path, monkeypatch)
|
||||
with pytest.raises(plans.QuotaError) as e:
|
||||
plans.check_quota(d, 1, max_bytes=10 ** 12, max_files=10 ** 6)
|
||||
assert e.value.reason == "low_disk_space"
|
||||
|
||||
|
||||
class TestVacuum:
|
||||
"""marker.vacuum (docs/VACUUM.md): optional everywhere, matrices strict."""
|
||||
|
||||
def test_full_object_passes(self):
|
||||
v.MARKER_SCHEMA(_marker(vacuum={
|
||||
"live": True, "trail": True, "room_highlight": False,
|
||||
"source": "camera.robo_map",
|
||||
"calibration": {"0": [0.02, 0.0, 300.0, 0.0, 0.02, 400.0]},
|
||||
"segment_map": {"16": "kitchen"},
|
||||
}))
|
||||
|
||||
def test_absent_and_none_pass(self):
|
||||
v.MARKER_SCHEMA(_marker())
|
||||
v.MARKER_SCHEMA(_marker(vacuum=None))
|
||||
|
||||
def test_bad_matrices_rejected(self):
|
||||
import pytest
|
||||
for bad in (
|
||||
[1, 2, 3, 4, 5], # 5 numbers
|
||||
[1, 2, 3, 4, 5, 6, 7], # 7 numbers
|
||||
[1, 2, 3, 4, 5, float("nan")], # non-finite
|
||||
[1, 2, 3, 4, 5, float("inf")],
|
||||
[1, 2, 3, 4, 5, "x"], # junk type
|
||||
):
|
||||
with pytest.raises(Exception):
|
||||
v.MARKER_SCHEMA(_marker(vacuum={"calibration": {"0": bad}}))
|
||||
|
||||
def test_unknown_keys_rejected(self):
|
||||
import pytest
|
||||
with pytest.raises(Exception):
|
||||
v.MARKER_SCHEMA(_marker(vacuum={"teleport": True}))
|
||||
|
||||
Reference in New Issue
Block a user