Henglos IO
Built-in packages

Code

Runs a short Python script on the board, for logic that doesn't fit a fixed node: reads what earlier actions published, computes, and publishes the result for the next ones.

Runs a short Python script on the board, for logic that doesn't fit a fixed node: reads what earlier actions published, computes, and publishes the result for the next ones.

@henglosio/component-codev1.0.0platform ^1.0.0
NodeKindWhat it does
RunActionRuns Script.

Actions

Run

Runs Script. Its return value goes out as result; a script that raises (or returns something that can't be published) goes out Fallback, with the reason in error.

Settings

SettingTypeDefaultWhat it's for
ScriptPython code—MicroPython, run as the body of a function. ctx.get("name") reads values published before this action; return <value> publishes it as result — a number, bool, text, bytes, or a list / object (as JSON: return {"temp": t, "ok": True}).

Publishes

OutputTypeWhat it is
resultanyWhat the script returned — a number, bool, text, bytes, or a list / object (its fields read as result.<field>, its items by index).
erroranyWhy it went out Fallback (the exception, as text).

On this page