mirror of
https://github.com/Matysh/houseplan-card
synced 2026-07-31 16:38:31 +00:00
Vacuum adapter vs a live Dreame X50 Master
Checked against the real robot at the dacha: room centres arrive as plain x/y next to the bbox, and the active-map name (selected_map, 'Первый этаж'/'Второй этаж') lives on the VACUUM entity, not on the camera — without reading it both floors would silently share one calibration matrix. Parser and card resolver adjusted; the captured attribute shape is now a unit fixture.
This commit is contained in:
@@ -48,6 +48,19 @@ test('readVacTelemetry: Valetudo/Tasshack shapes + junk safety', () => {
|
||||
assert.ok(!isVacSourceState({ attributes: { battery: 1 } }));
|
||||
});
|
||||
|
||||
test('readVacTelemetry: Tasshack room centres come as plain x/y', () => {
|
||||
// shape captured from a live Dreame X50 Master (dacha, 2026-07-31)
|
||||
const t = readVacTelemetry({
|
||||
vacuum_position: { x: 1399, y: -55, a: 181 },
|
||||
rooms: { 2: { room_id: 2, name: 'Кладовка', x0: 800, y0: -2000, x1: 4200, y1: 300, x: 2575, y: -825 } },
|
||||
});
|
||||
assert.equal(t.rooms[0].name, 'Кладовка');
|
||||
// bbox wins when present (both are valid anchors); x/y covers bbox-less dialects
|
||||
assert.equal(t.rooms[0].cx, 2500);
|
||||
const t2 = readVacTelemetry({ vacuum_position: { x: 0, y: 0 }, rooms: { 2: { name: 'Кладовка', x: 2575, y: -825 } } });
|
||||
assert.equal(t2.rooms[0].cx, 2575);
|
||||
});
|
||||
|
||||
test('autoCalibrate matches by name and solves', () => {
|
||||
const f = ([x, y]) => [0.01 * x + 100, -0.01 * y + 900];
|
||||
const vac = [
|
||||
|
||||
Reference in New Issue
Block a user