Skip to content

Floorplans

A floorplan is an image (PNG, SVG, or PDF) bound to an Area. The SDK exposes full CRUD plus image upload (base64-in-JSON) and image download with a 180-second timeout for large PDFs. The full guide lives at guides/floorplans.md.

Quick reference

Method What it does
client.floorplans.list() All floorplans in scope.
client.floorplans.get(uid) Fetch one (unwraps the {floorplans: [...]} envelope).
client.floorplans.create(*, sublocation_uid, image_bytes / image_path, original_filename, display_name=None, **fields) Upload an image and create the row. Image is required.
client.floorplans.update(uid, *, image_bytes=None, image_path=None, **fields) Update fields; replace the image only if image input is passed.
client.floorplans.delete(uid) Delete the row and the stored image.
client.floorplans.download_image(plan_or_uid, *, stream_to=None) Download bytes; 180-second timeout; optional streaming.

Creating

Image input is required and either-or — pass image_bytes + original_filename, OR pass image_path:

plan = client.floorplans.create(
    sublocation_uid=area.uid,
    image_path="warehouse.png",
    display_name="Warehouse 12 — Bay 3",
)

The server requires an image; the SDK enforces that locally with ValueError before any HTTP call.

Downloading

data = client.floorplans.download_image(plan)
with open("warehouse.pdf", "wb") as fh:
    client.floorplans.download_image(plan, stream_to=fh)

Default 30-second read timeout is overridden to 180 seconds for the image GET — production floorplans can be tens of MB of PDF.

Server re-encoding

The server re-encodes PNGs on storage — downloaded bytes don't byte-match the uploaded bytes, but the dimensions and image content are preserved. Distinguish uploads by IHDR dimensions, not byte content.

Model — Floorplan

Field Type Notes
uid str Server-assigned.
sublocation_uid str \| None Parent area.
url str \| None Relative path /uploads/floorplan/image/<uid>/<filename>.
display_name str \| None User-facing label. There is no name field.
image_scale / image_rotation float \| None Placement transform.
image_offset_x / image_offset_y float \| None Placement transform.
width / height int \| None Server-computed pixel dimensions.
size int \| None Stored bytes.

Full field list.

  • Parent: Areas. sublocation_uid is required on create.
  • Sibling: Anchors and Zones place on top of a floorplan in UIs.

See also