MatterEx.Device (matter_ex v0.3.1)

Copy Markdown View Source

Macro for defining a Matter device with endpoints and clusters.

Example

defmodule MyApp.Light do
  use MatterEx.Device,
    vendor_name: "My Company",
    product_name: "Smart Light",
    vendor_id: 0xFFF1,
    product_id: 0x8001

  endpoint 1, device_type: 0x0100 do
    cluster MatterEx.Cluster.OnOff
  end
end

This generates a Supervisor that starts all cluster GenServers, including an auto-generated endpoint 0 with Descriptor and BasicInformation clusters.

Summary

Functions

cluster(module)

(macro)

endpoint(id, opts, list)

(macro)