plesty.lib.device.doc

Structured, render-agnostic documentation model for a device.

DeviceDocModel is the single source of truth for a device’s user-facing documentation: its configuration parameters (from the parameter system) and its callable operations (from the function system, unifying schema-registered operations and @expose_to_api methods). Renderers — the SDK docs generator, summary(), the server describe endpoint — consume it instead of re-deriving the metadata.

Classes

DeviceDocModel

All doc-relevant metadata of a device, decoupled from rendering.

Module Contents

class plesty.lib.device.doc.DeviceDocModel

All doc-relevant metadata of a device, decoupled from rendering.

Variables:
  • parameters – Configuration parameters grouped by configuration group ({group_name: [ConfigParameter, ...]}).

  • functions – The device’s own operations (schema-registered plus @expose_to_api methods) as unified FuncDoc objects.

  • standard_methods – The common device API shared by every device (connect, write, query, …), as FuncDoc.

parameters: dict[str, list[plesty.lib.device.params.ConfigParameter]]
functions: list[plesty.lib.device.funcs.FuncDoc]
standard_methods: list[plesty.lib.device.funcs.FuncDoc]
to_dict() → dict[str, Any]

Return the whole model as JSON primitives.

This is what leaves the device: the describe reply carries it, so a caller that never imports plesty-lib — a console on another process, a client on another machine — reads the same units, bounds, options and descriptions the device declared, instead of inventing them.

Returns:

A mapping with parameters (grouped, as the model holds them), functions and standard_methods, all JSON primitives.

Return type:

dict[str, Any]