devicegen

command
v0.24.1 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2026 License: Apache-2.0 Imports: 16 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

Command devicegen generates the device layer's device types from the resolved layer of parity/schema.json (the matter.js model extract): one file per device type in scope under device/, holding the type's id and revision, its [device.Type] with the cluster requirements matter.js's generator derives, a constructor and the typed accessors of its default servers — plus device/types_gen.go, the registry of every generated type, device/types_gen_test.go, which calls every constructor and accessor, device/doc_gen.go, the package doc with the lists of typed cluster packages and device types, docs/reference/device-types.md, the requirement tables of every type (docs.go). The device-type name is schema.DeviceTypeName's; the module keeps no second label table (review 2026-11 W5-api-15).

It is matter.js's support/codegen/src/endpoints translated: matter.js generates packages/node/src/devices and packages/node/src/endpoints from the model (EndpointFile.ts, RequirementGenerator.ts, ClusterRequirements.ts); so does this module. See docs/adr/0018-device-layer-and-node-facade.md.

Usage, from the module root (make generate-matter-schema runs it after clustergen, whose committed definitions it references):

go run ./script/devicegen            # regenerate device/*_gen.go
go run ./script/devicegen -out DIR   # into DIR instead (the reference
                                     # page too)

The committed set is the device types in scope (committed in devicetypes.go): since wave 27-C2 every snapshot device type, 91/91. excluded, empty now, is where a snapshot device type taken out of scope is listed with its reason.

Jump to

Keyboard shortcuts

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