Skip to content

@mega-yfue/eufy-sdk / roomIdAt

Function: roomIdAt()

ts
function roomIdAt(outline, cell): number | undefined;

Which room a cell of the ROOM OUTLINE belongs to, or undefined where none does.

That plane is one byte per cell, and the byte is not the room id on its own: its low two bits carry a sub-type and the id is what remains above them. A reader taking the whole byte reports room 4 as room 19 and finds no such room in the list.

A resulting id of 0 reads as undefined. Unmapped space and the gaps between rooms carry zero, and there is no room 0 to look up — reporting it as an id would have a caller searching the room list for something that was never in it.

Parameters

outline

VacuumRoomOutline

cell

MapCell

Returns

number | undefined

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.