Documentation
¶
Overview ¶
Package lightactionv2 compiles experimental high-level actions into explicit frame programs. It does not discover devices, submit work, or perform I/O.
Index ¶
Constants ¶
const Contract = "nb1-light-action/experimental-v2"
const MaxRequestBytes = 65536
Variables ¶
var ErrInvalid = errors.New("invalid experimental light action")
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action struct {
Kind string `json:"kind"`
Colors []string `json:"colors"`
LEDs []int `json:"leds"`
PeriodMS int `json:"period_ms"`
Cycles int `json:"cycles"`
Segments int `json:"segments"`
OnFinish string `json:"on_finish"`
}
Action makes every default explicit. Colors are canonical raw RGB8; a segment is one pair of target fades, not two sequential completed fades.
type Result ¶
type Result struct {
SchemaVersion int `json:"schema_version"`
Contract string `json:"contract"`
ProgramCompileContract string `json:"program_compile_contract"`
RecipeID string `json:"recipe_id"`
Action Action `json:"action"`
Program control.FrameProgram `json:"program"`
NominalDurationMS int64 `json:"nominal_duration_ms"`
TotalFrames int `json:"total_frames"`
PlannedTargetWrites int `json:"planned_target_writes"`
RequiredCapabilities []string `json:"required_capabilities"`
}
func CompileJSON ¶
CompileJSON accepts one bare Orbit action and never submits the result. The explicit frame contract must be understood by the eventual executor.
func CompileRequest ¶
CompileRequest requires the new envelope exactly; a v1 request is not silently upgraded and an unknown action is never converted to Orbit.