SDK docs menu

class

Scheduled

An action set for an exact simulated time, as Board.do(..., at=), Board.send_serial and Board.scheduled return it.

from hardlabs_sdk import Scheduled

The board works it at that instant, with simulated time standing still, so it lands at the same point of the firmware's run however fast the server is. refresh reads what has happened to it since.

Attributes

idstr
Its id on the board.
kindstr
control or serial.
statusstr
armed (waiting for its trigger), pending, fired, failed or cancelled.
controlstr | None
The control it works.
serialstr | None
The serial port it writes to.
atfloat | None
When it acts, in simulated seconds since the board booted (a trigger's once it matched).
whendict | None
Its trigger.
matched_atfloat | None
When its trigger matched.
fired_atfloat | None
When it acted.
outputstr | None
The control's output.
errorstr | None
Why it failed.
late_byfloat | None
How long after at it acted, when the board had already passed at by the time it was set.
notestr | None
How its trigger is watched, when that matters.
after_pressstr | None
For a button's release, the id of the press it follows.

Scheduled.doneproperty

Whether it is over: fired, failed or cancelled.

action.done -> bool

Scheduled.refreshmethod

Reads its state from the board again.

action.refresh() -> Scheduled

Returns

Scheduled — Itself, updated.

Scheduled.cancelmethod

Cancels it if it hasn't happened yet (and a button's pending release).

action.cancel()

Scheduled.waitmethod

Waits until it has happened.

action.wait(within=30.0) -> Scheduled

Arguments

withinfloatdefault 30.0
Simulated seconds to wait.

Returns

Scheduled — Itself, fired.

Raises

  • AssertionError — It didn't happen within that time, or it failed.
  • RuntimeError — The board is held (Board.hold), so time won't reach it: run it with Board.run_until.