@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
new VacuumMapStore(): VacuumMapStore;Returns
VacuumMapStore
Accessors
currentRoom
Get Signature
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
get snapshot(): VacuumMapSnapshot;What the store holds right now. A new object whenever anything changed, the same one when not.
Returns
Methods
apply()
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
Returns
boolean
clear()
clear(): void;Forget everything. For a device going away, or a caller starting over.
Returns
void