class Matter::Cluster::LevelControlCluster

Overview

Level Control Cluster Implementation (0x0008)

Provides level control (dimming) functionality for lights, volume controls, blinds, and other devices with adjustable levels.

Features:

Matter Spec: Application 1.6

Defined in:

matter/cluster/level_control_cluster.cr

Constant Summary

ATTR_CURRENT_FREQUENCY = 4_u32
ATTR_CURRENT_LEVEL = 0_u32

Attributes

ATTR_DEFAULT_MOVE_RATE = 20_u32
ATTR_MAX_FREQUENCY = 6_u32
ATTR_MAX_LEVEL = 3_u32
ATTR_MIN_FREQUENCY = 5_u32
ATTR_MIN_LEVEL = 2_u32
ATTR_OFF_TRANSITION_TIME = 19_u32
ATTR_ON_LEVEL = 17_u32
ATTR_ON_OFF_TRANSITION_TIME = 16_u32
ATTR_ON_TRANSITION_TIME = 18_u32
ATTR_OPTIONS = 15_u32
ATTR_REMAINING_TIME = 1_u32
ATTR_START_UP_CURRENT_LEVEL = 16384_u32
CLUSTER_ID = 8_u32
CLUSTER_REVISION = 65533_u32

Global attributes

CMD_MOVE = 1_u32
CMD_MOVE_TO_CLOSEST_FREQUENCY = 8_u32
CMD_MOVE_TO_LEVEL = 0_u32

Commands

CMD_MOVE_TO_LEVEL_WITH_ON_OFF = 4_u32
CMD_MOVE_WITH_ON_OFF = 5_u32
CMD_STEP = 2_u32
CMD_STEP_WITH_ON_OFF = 6_u32
CMD_STOP = 3_u32
CMD_STOP_WITH_ON_OFF = 7_u32
FEATURE_MAP = 65532_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, current_level : UInt8 = 0_u8, min_level : UInt8 = 0_u8, max_level : UInt8 = 254_u8, on_level : UInt8 | Nil = nil, options : UInt8 = 0_u8, feature_map : Feature = Feature::OnOff | Feature::Lighting) #

[View source]

Class Method Detail

def self.cluster_id #

Level Control Cluster Implementation (0x0008)

Provides level control (dimming) functionality for lights, volume controls, blinds, and other devices with adjustable levels.

Features:

  • OnOff (OO): Dependency with the On/Off cluster
  • Lighting (LT): Lighting control interface (affects level semantics)
  • Frequency (FQ): Frequency control support (provisional)

Matter Spec: Application 1.6


[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 current_frequency : UInt16 #

Frequency feature attributes


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

Frequency feature attributes


[View source]
def current_level : UInt8 #

Base attributes


[View source]
def current_level=(current_level : UInt8) #

Base attributes


[View source]
def default_move_rate : UInt8 | Nil #

[View source]
def default_move_rate=(default_move_rate : UInt8 | Nil) #

[View source]
def feature_map : Feature #

Feature map


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

Feature map


[View source]
def max_frequency : UInt16 #

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

[View source]
def max_level : UInt8 #

[View source]
def max_level=(max_level : UInt8) #

[View source]
def min_frequency : UInt16 #

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

[View source]
def min_level : UInt8 #

[View source]
def min_level=(min_level : UInt8) #

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

Get cluster name


[View source]
def off_transition_time : UInt16 | Nil #

[View source]
def off_transition_time=(off_transition_time : UInt16 | Nil) #

[View source]
def on_level : UInt8 | Nil #

[View source]
def on_level=(on_level : UInt8 | Nil) #

[View source]
def on_level_changed(&block : UInt8, UInt8 -> Nil) #

Set callback for level changes


[View source]
def on_off_transition_time : UInt16 #

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

[View source]
def on_transition_time : UInt16 | Nil #

[View source]
def on_transition_time=(on_transition_time : UInt16 | Nil) #

[View source]
def options : UInt8 #

[View source]
def options=(options : UInt8) #

[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 remaining_time : UInt16 #

Lighting feature attributes


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

Lighting feature attributes


[View source]
def start_up_current_level : UInt8 | Nil #

[View source]
def start_up_current_level=(start_up_current_level : UInt8 | 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]