class

Matter::Cluster::Base

Inherits Reference < Object

Base class for all cluster implementations

Constants

GLOBAL_ACCEPTED_COMMAND_LIST = 65529_u32
GLOBAL_ATTRIBUTE_LIST = 65531_u32

Global attribute IDs (mandatory on all clusters)

GLOBAL_CLUSTER_REVISION = 65533_u32
GLOBAL_FEATURE_MAP = 65532_u32
GLOBAL_GENERATED_COMMAND_LIST = 65528_u32

Constructors

new(endpoint_id : DataType::EndpointNumber, cluster_id : DataType::ClusterId)
Source

Instance methods

apply_scene_extension_field_set(field_set : ScenesManagementCluster::ExtensionFieldSet) : Bool
Source
attributes

Get all attribute metadata

Source
cluster_id
Source
cluster_id=(cluster_id : DataType::ClusterId)
Source
commands

Get all command metadata

Source
data_version
Source
data_version=(data_version : UInt32)
Source
endpoint_id
Source
endpoint_id=(endpoint_id : DataType::EndpointNumber)
Source
events

Get all event metadata

Source
get_attribute_metadata(attribute_id : UInt32) : AttributeMetadata | Nil

Get attribute metadata by ID

Source
get_command_metadata(command_id : UInt32) : CommandMetadata | Nil

Get command metadata by ID

Source
invoke_command(command_id : UInt32, fields : Bytes = Bytes.new(0), session_id : UInt64 | Nil = nil, is_case_session : Bool = false, fabric_index : UInt8 | Nil = nil) : InteractionModel::Status | CommandResponse

Invoke a command

Source
name

Get cluster name

Source
on_attribute_changed

Callback for attribute change notifications (used by subscription system) Parameters: endpoint_id, cluster_id, attribute_id

Source
on_attribute_changed=(on_attribute_changed : Proc(UInt16, UInt32, UInt32, Nil) | Nil)

Callback for attribute change notifications (used by subscription system) Parameters: endpoint_id, cluster_id, attribute_id

Source
persistence_key

Returns a unique key for this cluster instance for persistence Format: "endpoint_<id>cluster<id>"

Source
read_attribute(attribute_id : UInt32, fabric_index : UInt8 | Nil = nil) : InteractionModel::Status | Bytes

Read an attribute value The fabric_index parameter is optional and used for fabric-scoped attributes like CurrentFabricIndex in OperationalCredentialsCluster

Source
request_fabric_index
Source
request_fabric_index=(request_fabric_index : UInt8 | Nil)
Source
request_is_case_session=(request_is_case_session : Bool)
Source
request_is_case_session?
Source
request_peer_node_id
Source
request_peer_node_id=(request_peer_node_id : UInt64 | Nil)
Source
request_session_id

Request context (populated by the protocol layer for the current operation). These are intentionally prefixed to avoid colliding with cluster-specific state.

Source
request_session_id=(request_session_id : UInt64 | Nil)

Request context (populated by the protocol layer for the current operation). These are intentionally prefixed to avoid colliding with cluster-specific state.

Source
restore_state(json : String) : Nil

Restore cluster state from JSON. Override in subclasses that need to restore state. The json parameter is the string returned by save_state.

Source
save_state

Save cluster state to JSON for persistence. Override in subclasses that need to persist state (e.g., scenes, groups). Returns nil if no state needs to be persisted.

Source
store_scene_extension_field_set

Scenes Management hooks

ScenesManagementCluster (0x0062) stores "extension field sets" that capture cluster-specific state for scene recall. Clusters can override these hooks to participate; default implementations are no-ops.

The Device base class wires ScenesManagementCluster callbacks by calling these methods on clusters present on the same endpoint.

Source
write_attribute(attribute_id : UInt32, value : Bytes) : InteractionModel::Status

Write an attribute value

Source