pyisyox.schema.cmd module

Command and command-parameter dataclasses for IoX nodedefs.

A Command is an action a node can either send (emit as an event) or accept (receive as an instruction). CommandParameter describes one positional argument the command takes; the parameter’s editor reference resolves to an Editor and provides write-side validation.

Source schema: /rest/profiles?include=nodedefs cmds.{sends,accepts}[].

class CommandParameter(editor_id, param_id='', init=None, optional=False)[source]

Bases: object

A single positional parameter on a command.

Variables:
  • editor_id (str) – Reference to the editor defining valid values for this parameter. Resolves against the parent profile’s editor table.

  • param_id (str) – Optional parameter identifier (often empty in IoX).

  • init (str | None) – Optional property whose current value seeds this parameter (e.g., "CLISPH" — the heat setpoint command’s parameter initialises from the current CLISPH property).

  • optional (bool) – Whether the parameter may be omitted on send.

Parameters:
  • editor_id (str)

  • param_id (str)

  • init (str | None)

  • optional (bool)

editor_id: str
param_id: str
init: str | None
optional: bool
class Command(id, name='', parameters=<factory>, native=False, format=None)[source]

Bases: object

A command a node sends or accepts.

Variables:
  • id (str) – Command identifier (e.g., "DON", "CLISPC", "DISCOVER").

  • name (str) – Human-readable label.

  • parameters (list[pyisyox.schema.cmd.CommandParameter]) – Positional parameters; empty for parameterless commands.

  • native (bool) – Whether the command is a native IoX command ("true") or implemented at a higher layer.

  • format (str | None) – Optional display format string used by the controller’s UI.

Parameters:
id: str
name: str
parameters: list[CommandParameter]
native: bool
format: str | None
classmethod from_json(raw)[source]

Build a Command from a JSON object as found in /rest/profiles nodedef cmds.sends[] / cmds.accepts[].

Defensive against partial / null fields under PG3 dynamic profile reload — a parameter without an editor key is skipped rather than raising KeyError on the whole nodedef.

Parameters:

raw (dict)

Return type:

Command