lightactionv2

package
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 19, 2026 License: MIT Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
const Contract = "nb1-light-action/experimental-v2"
View Source
const MaxRequestBytes = 65536

Variables

View Source
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

func CompileJSON(data []byte) (Result, error)

CompileJSON accepts one bare Orbit action and never submits the result. The explicit frame contract must be understood by the eventual executor.

func CompileRequest

func CompileRequest(data []byte) (Result, error)

CompileRequest requires the new envelope exactly; a v1 request is not silently upgraded and an unknown action is never converted to Orbit.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL