MatterEx.Device (matter_ex v0.4.0)

Copy Markdown View Source

Macro for defining a Matter device with endpoints and clusters.

Example

defmodule MyApp.Light do
  use MatterEx.Device,
    vendor: :test,
    product: :smart_light

  endpoint :light, :dimmable_light
end

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

Summary

Functions

Lists known product aliases that can be used with use MatterEx.Device.

Lists known vendor aliases that can be used with use MatterEx.Device.

Resolves a product ID from either a numeric ID or a known product alias.

Resolves a vendor ID from either a numeric ID or a known vendor alias.

Functions

cluster(name)

(macro)

endpoint(id, device_type)

(macro)

endpoint(id, device_type, list)

(macro)

known_products()

@spec known_products() :: [{atom(), Keyword.t()}]

Lists known product aliases that can be used with use MatterEx.Device.

known_vendors()

@spec known_vendors() :: [{atom(), Keyword.t()}]

Lists known vendor aliases that can be used with use MatterEx.Device.

product_id!(product_id)

@spec product_id!(non_neg_integer() | atom()) :: non_neg_integer()

Resolves a product ID from either a numeric ID or a known product alias.

vendor_id!(vendor_id)

@spec vendor_id!(non_neg_integer() | atom()) :: non_neg_integer()

Resolves a vendor ID from either a numeric ID or a known vendor alias.