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:
objectA 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 currentCLISPHproperty).optional (bool) – Whether the parameter may be omitted on send.
- Parameters:
- class Command(id, name='', parameters=<factory>, native=False, format=None)[source]¶
Bases:
objectA 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:
- parameters: list[CommandParameter]¶
- classmethod from_json(raw)[source]¶
Build a
Commandfrom a JSON object as found in/rest/profilesnodedefcmds.sends[]/cmds.accepts[].Defensive against partial / null fields under PG3 dynamic profile reload — a parameter without an
editorkey is skipped rather than raisingKeyErroron the whole nodedef.