Skip to content

@mega-yfue/eufy-sdk / VacuumMapStore

Class: VacuumMapStore

Holds the current map for one device, and answers questions about it.

Created empty and filled by VacuumMapStore.apply. Every getter answers undefined until the pieces it needs have arrived, rather than answering from a partial map.

Constructors

Constructor

ts
new VacuumMapStore(): VacuumMapStore;

Returns

VacuumMapStore

Accessors

currentRoom

Get Signature

ts
get currentRoom(): VacuumRoom | undefined;

Which room the robot is standing in, or undefined.

undefined covers every honest reason there is no answer: no pose yet, no room outline yet, no room list yet, a robot outside the mapped area, or a cell belonging to no room. None of those is an error, and none should be reported as a guess.

Returns

VacuumRoom | undefined


snapshot

Get Signature

ts
get snapshot(): VacuumMapSnapshot;

What the store holds right now. A new object whenever anything changed, the same one when not.

Returns

VacuumMapSnapshot

Methods

apply()

ts
apply(piece): boolean;

Take one piece, and say whether it changed anything.

false means the piece was stale — an older revision of a map already held — and was dropped. The device repeats its map frequently, so the return is what tells a repeat from a change.

Parameters

piece

VacuumMapPiece

Returns

boolean


clear()

ts
clear(): void;

Forget everything. For a device going away, or a caller starting over.

Returns

void

Independent and unofficial. Not affiliated with, endorsed by, or sponsored by Anker Innovations, Anker eufy, or eufy. "Anker eufy", "eufy" and "Anker" are trademarks of their respective owners. Use responsibly — rapid or failed logins can trigger captcha or temporary cooldowns.