fn idle(timeoutMs?: number)
Hand the screen back to the firmware (s3panel 0.12): the badge,
| Argument | Type | Required | Description |
|---|
| timeoutMs? | number | no | Overrides the instance's timeoutMs for this call |
fn profile(username?: string, fetchMs: number)
Show a swamp-club profile on the panel (firmware s3panel 0.12, on
| Argument | Type | Required | Description |
|---|
| username? | string | no | swamp-club username; omit to refresh the stored one |
| fetchMs | number | yes | Wait for the board's HTTPS fetch (it may first wait up to 30 s for a |
fn listen(timeoutMs?: number)
Listen for unsolicited event lines for timeoutMs. The board pushes
| Argument | Type | Required | Description |
|---|
| timeoutMs? | number | no | How long to listen; defaults to the global timeoutMs |
fn drain()
Drain all buffered unsolicited events from the holder. Unlike
fn text(lines: array, timeoutMs?: number)
Draw lines of text, replacing whatever was on the screen. Pass one
| Argument | Type | Required | Description |
|---|
| lines | array | yes | One string per screen line, drawn top to bottom |
| timeoutMs? | number | no | Overrides the instance's timeoutMs for this call |
fn fill(color: enum, timeoutMs?: number)
Flood the whole screen with one colour. The cheapest way to see,
| Argument | Type | Required | Description |
|---|
| color | enum | yes | A colour the firmware knows by name |
| timeoutMs? | number | no | Overrides the instance's timeoutMs for this call |
fn clear(timeoutMs?: number)
Blank the screen to black, leaving the backlight alone.
| Argument | Type | Required | Description |
|---|
| timeoutMs? | number | no | Overrides the instance's timeoutMs for this call |
fn backlight(on: boolean, timeoutMs?: number)
Turn the backlight on or off. Off leaves the framebuffer intact, so
| Argument | Type | Required | Description |
|---|
| on | boolean | yes | True for lit, false for dark |
| timeoutMs? | number | no | Overrides the instance's timeoutMs for this call |
fn logo(timeoutMs?: number)
Show the Swamp Club logo on screen and enter touch-reactive mode.
| Argument | Type | Required | Description |
|---|
| timeoutMs? | number | no | Overrides the instance's timeoutMs for this call |
fn touch(timeoutMs?: number)
Read the touch controller right now: is a finger on the screen?
| Argument | Type | Required | Description |
|---|
| timeoutMs? | number | no | Overrides the instance's timeoutMs for this call |
fn touchstate(timeoutMs?: number)
Read the latched touch state: how many touches since the last
| Argument | Type | Required | Description |
|---|
| timeoutMs? | number | no | Overrides the instance's timeoutMs for this call |
fn touchclear(timeoutMs?: number)
Reset the touch counter to zero. Returns how many touches were
| Argument | Type | Required | Description |
|---|
| timeoutMs? | number | no | Overrides the instance's timeoutMs for this call |
fn waittouch(timeoutMs: number)
Block until the screen is touched, then return the coordinates.
| Argument | Type | Required | Description |
|---|
| timeoutMs | number | yes | How long to wait for a touch before giving up (default 30s) |
fn simtouch(x: number, y: number, timeoutMs?: number)
Simulate a touch at the given coordinates without physically
| Argument | Type | Required | Description |
|---|
| x | number | yes | X coordinate (0-319) |
| y | number | yes | Y coordinate (0-479) |
| timeoutMs? | number | no | Overrides the instance's timeoutMs for this call |
fn screen()
Push a screen definition to the panel. Sends screen clear, then screen add for each element, then screen show. The firmware renders a mini logo at the top and stacks elements below it.
fn zonewait()
Wait for a touch zone to be tapped on a rendered screen. Returns the zone id that was hit, or times out. `swamp model cancel` ends the wait within a couple of seconds.
fn approve(workflow: string, step: string, prompt?: string, run?: string, resolve: boolean, resume: boolean, swampPath?: string)
Answer a suspended manual_approval step from the panel. Finds the waiting run, shows the workflow, step, prompt and APPROVE / REJECT buttons, waits for a physical tap, then approves (and resumes) or rejects that run in swamp itself. Records the decision and the run it answered as an evidentiary data record.
| Argument | Type | Required | Description |
|---|
| workflow | string | yes | Workflow name (shown on screen) |
| step | string | yes | The manual_approval step name |
| prompt? | string | no | Text to show; defaults to the step's own prompt |
| run? | string | no | Run ID to answer; required only when several runs wait at this step |
| resolve | boolean | yes | Approve/reject the run in swamp after the tap (false: only record) |
| resume | boolean | yes | After approving, start `swamp workflow resume` for the run |
| swampPath? | string | no | swamp binary to call back into; defaults to the running one |