class Matter::Cluster::OnOffCluster

Overview

On/Off Cluster Implementation (0x0006) Provides binary on/off control with optional lighting and timing features

Features:

Matter Spec: Application Clusters 1.5

Defined in:

matter/cluster/on_off_cluster.cr

Constant Summary

ACCEPTED_COMMAND_LIST = 65529_u32
ATTR_GLOBAL_SCENE_CONTROL = 16384_u32
ATTR_OFF_WAIT_TIME = 16386_u32
ATTR_ON_OFF = 0_u32

Attribute IDs

ATTR_ON_TIME = 16385_u32
ATTR_START_UP_ON_OFF = 16387_u32
ATTRIBUTE_LIST = 65531_u32
CLUSTER_ID = 6_u32
CLUSTER_REVISION = 65533_u32

Global attributes

CMD_OFF = 0_u32

Command IDs

CMD_OFF_WITH_EFFECT = 64_u32
CMD_ON = 1_u32
CMD_ON_WITH_RECALL_GLOBAL_SCENE = 65_u32
CMD_ON_WITH_TIMED_OFF = 66_u32
CMD_TOGGLE = 2_u32
FEATURE_MAP = 65532_u32
GENERATED_COMMAND_LIST = 65528_u32

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from class Matter::Cluster::Base

attributes : Array(AttributeMetadata) attributes, cluster_id : DataType::ClusterId cluster_id, cluster_id=(cluster_id : DataType::ClusterId) cluster_id=, commands : Array(CommandMetadata) commands, data_version : UInt32 data_version, data_version=(data_version : UInt32) data_version=, endpoint_id : DataType::EndpointNumber endpoint_id, endpoint_id=(endpoint_id : DataType::EndpointNumber) endpoint_id=, events : Array(EventMetadata) events, get_attribute_metadata(attribute_id : UInt32) : AttributeMetadata | Nil get_attribute_metadata, get_command_metadata(command_id : UInt32) : CommandMetadata | Nil get_command_metadata, 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_command, name : String name, on_attribute_changed : Proc(UInt16, UInt32, UInt32, Nil) | Nil on_attribute_changed, on_attribute_changed=(on_attribute_changed : Proc(UInt16, UInt32, UInt32, Nil) | Nil) on_attribute_changed=, read_attribute(attribute_id : UInt32, fabric_index : UInt8 | Nil = nil) : InteractionModel::Status | Bytes read_attribute, write_attribute(attribute_id : UInt32, value : Bytes) : InteractionModel::Status write_attribute

Constructor methods inherited from class Matter::Cluster::Base

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

Constructor Detail

def self.new(endpoint_id : DataType::EndpointNumber, on_off : Bool = false, feature_map : Feature = Feature::None) #

[View source]

Class Method Detail

def self.cluster_id #

On/Off Cluster Implementation (0x0006) Provides binary on/off control with optional lighting and timing features

Features:

  • Lighting (LT): Enables level control interaction and global scene management
  • DeadFrontBehavior (DF): Device exhibits "dead front" when off
  • OffOnly: Device can only be turned off (On/Toggle not supported)

Matter Spec: Application Clusters 1.5


[View source]

Instance Method Detail

def attributes : Array(AttributeMetadata) #
Description copied from class Matter::Cluster::Base

Get all attribute metadata


[View source]
def commands : Array(CommandMetadata) #
Description copied from class Matter::Cluster::Base

Get all command metadata


[View source]
def feature_map : Feature #

[View source]
def feature_map=(feature_map : Feature) #

[View source]
def global_scene_control : Bool #

Lighting feature attributes


[View source]
def global_scene_control=(global_scene_control : Bool) #

Lighting feature attributes


[View source]
def name : String #
Description copied from class Matter::Cluster::Base

Get cluster name


[View source]
def off_wait_time : UInt16 #

[View source]
def off_wait_time=(off_wait_time : UInt16) #

[View source]
def on_off : Bool #

State


[View source]
def on_off=(on_off : Bool) #

State


[View source]
def on_state_changed(&block : Bool -> Nil) #

Set callback for state changes


[View source]
def on_time : UInt16 #

[View source]
def on_time=(on_time : UInt16) #

[View source]
def read_attribute(attribute_id : UInt32, fabric_index : UInt8 | Nil = nil) : InteractionModel::Status | Bytes #
Description copied from class Matter::Cluster::Base

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


[View source]
def start_up_on_off : StartUpOnOff | Nil #

[View source]
def start_up_on_off=(start_up_on_off : StartUpOnOff | Nil) #

[View source]
def write_attribute(attribute_id : UInt32, value : Bytes) : InteractionModel::Status #
Description copied from class Matter::Cluster::Base

Write an attribute value


[View source]