Skip to content

sim2bot.RoomDeviceInfo

Experimental API

This surface is still being validated and may change before the public beta.

RoomDeviceInfo dataclass

Metadata for a door or window announced by the current scene.

Room-device control is experimental while browser-side actuation is being revised. Discovery is safe to use, but do not build critical workflows around opening behavior yet.

Attributes:

  • id (str) –

    Scene-unique device identity used by set_room_opening().

  • name (str) –

    Human-readable device name.

  • kind (str) –

    Authored type, normally "door" or "window".

  • motion (str) –

    Mechanism type, for example hinged, sliding, or fixed.

  • wall (str) –

    ID of the wall that owns the opening.

  • max_open_deg (float) –

    Maximum authored hinge travel in degrees when applicable.

Source code in sim2bot/client.py
@dataclass
class RoomDeviceInfo:
    """Metadata for a door or window announced by the current scene.

    Room-device control is experimental while browser-side actuation is being
    revised. Discovery is safe to use, but do not build critical workflows around
    opening behavior yet.

    Attributes:
        id: Scene-unique device identity used by ``set_room_opening()``.
        name: Human-readable device name.
        kind: Authored type, normally ``"door"`` or ``"window"``.
        motion: Mechanism type, for example hinged, sliding, or fixed.
        wall: ID of the wall that owns the opening.
        max_open_deg: Maximum authored hinge travel in degrees when applicable.
    """

    id: str
    name: str
    kind: str
    motion: str
    wall: str
    max_open_deg: float

    @classmethod
    def from_json(cls, data: dict) -> "RoomDeviceInfo":
        return cls(
            id=str(data.get("id") or ""),
            name=str(data.get("name") or ""),
            kind=str(data.get("kind") or ""),
            motion=str(data.get("motion") or "fixed"),
            wall=str(data.get("wall") or ""),
            max_open_deg=float(data.get("maxOpenDeg", 0.0)),
        )

Practical examples

Examples use objects discovered from the current scene rather than hard-coded robot metadata.

Inspect mechanism metadata

for device in sim.room_devices():
    print(device.name, device.motion, device.max_open_deg)

Select a device by ID

devices = {device.id: device for device in sim.room_devices()}
selected = devices[opening_id]

Guidance

Important behavior

Discovery metadata is available, but room actuation remains experimental.


See also