class Matter::Cluster::ColorControlCluster

Overview

Color Control Cluster Implementation (0x0300)

Provides color control functionality for RGB and tunable white lights. Supports multiple color modes: Hue/Saturation, XY, and Color Temperature.

Matter Spec: Application 3.2

Defined in:

matter/cluster/color_control_cluster.cr

Constant Summary

ATTR_COLOR_CAPABILITIES = 16394_u32
ATTR_COLOR_LOOP_ACTIVE = 16386_u32
ATTR_COLOR_LOOP_DIRECTION = 16387_u32
ATTR_COLOR_LOOP_START_ENHANCED_HUE = 16389_u32
ATTR_COLOR_LOOP_STORED_ENHANCED_HUE = 16390_u32
ATTR_COLOR_LOOP_TIME = 16388_u32
ATTR_COLOR_MODE = 8_u32
ATTR_COLOR_TEMP_PHYSICAL_MAX_MIREDS = 16396_u32
ATTR_COLOR_TEMP_PHYSICAL_MIN_MIREDS = 16395_u32
ATTR_COLOR_TEMPERATURE_MIREDS = 7_u32
ATTR_COMPENSATION_TEXT = 6_u32
ATTR_COUPLE_COLOR_TEMP_TO_LEVEL_MIN = 16397_u32
ATTR_CURRENT_HUE = 0_u32

Attributes (using ATTR_ prefix for consistency)

ATTR_CURRENT_SATURATION = 1_u32
ATTR_CURRENT_X = 3_u32
ATTR_CURRENT_Y = 4_u32
ATTR_DRIFT_COMPENSATION = 5_u32
ATTR_ENHANCED_COLOR_MODE = 16385_u32
ATTR_ENHANCED_CURRENT_HUE = 16384_u32
ATTR_NUMBER_OF_PRIMARIES = 16_u32
ATTR_OPTIONS = 15_u32
ATTR_REMAINING_TIME = 2_u32
ATTR_START_UP_COLOR_TEMPERATURE = 16400_u32
CLUSTER_ID = 768_u32
CMD_COLOR_LOOP_SET = 68_u32
CMD_ENHANCED_MOVE_HUE = 65_u32
CMD_ENHANCED_MOVE_TO_HUE = 64_u32
CMD_ENHANCED_MOVE_TO_HUE_AND_SATURATION = 67_u32
CMD_ENHANCED_STEP_HUE = 66_u32
CMD_MOVE_COLOR = 8_u32
CMD_MOVE_COLOR_TEMPERATURE = 75_u32
CMD_MOVE_HUE = 1_u32
CMD_MOVE_SATURATION = 4_u32
CMD_MOVE_TO_COLOR = 7_u32
CMD_MOVE_TO_COLOR_TEMPERATURE = 10_u32
CMD_MOVE_TO_HUE = 0_u32

Commands

CMD_MOVE_TO_HUE_AND_SATURATION = 6_u32
CMD_MOVE_TO_SATURATION = 3_u32
CMD_STEP_COLOR = 9_u32
CMD_STEP_COLOR_TEMPERATURE = 76_u32
CMD_STEP_HUE = 2_u32
CMD_STEP_SATURATION = 5_u32
CMD_STOP_MOVE_STEP = 71_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) : InteractionModel::Status | CommandResponse invoke_command, name : String name, read_attribute(attribute_id : UInt32) : 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_hue : UInt8 = 0_u8, current_saturation : UInt8 = 0_u8, current_x : UInt16 = 0_u16, current_y : UInt16 = 0_u16, color_temperature_mireds : UInt16 = 250_u16, color_temp_physical_min_mireds : UInt16 = 147_u16, color_temp_physical_max_mireds : UInt16 = 500_u16, color_mode : Definitions::ColorControl::ColorMode = Definitions::ColorControl::ColorMode::CurrentHueAndCurrentSaturation, options : UInt8 = 0_u8) #

[View source]

Class Method Detail

def self.cluster_id #

Color Control Cluster Implementation (0x0300)

Provides color control functionality for RGB and tunable white lights. Supports multiple color modes: Hue/Saturation, XY, and Color Temperature.

Matter Spec: Application 3.2


[View source]

Instance Method Detail

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

Get all attribute metadata


[View source]
def color_loop_active : Bool #

Color loop state


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

Color loop state


[View source]
def color_loop_direction : UInt8 #

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

[View source]
def color_loop_start_enhanced_hue : UInt16 #

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

[View source]
def color_loop_stored_enhanced_hue : UInt16 #

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

[View source]
def color_loop_time : UInt16 #

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

[View source]

[View source]
def color_mode=(color_mode : Definitions::ColorControl::ColorMode) #

[View source]
def color_temp_physical_max_mireds : UInt16 #

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

[View source]
def color_temp_physical_min_mireds : UInt16 #

Physical limits


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

Physical limits


[View source]
def color_temperature_kelvin : UInt32 #

Utility methods


[View source]
def color_temperature_mireds : UInt16 #

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

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

Get all command metadata


[View source]
def current_hue : UInt8 #

Attribute storage


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

Attribute storage


[View source]
def current_saturation : UInt8 #

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

[View source]
def current_x : UInt16 #

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

[View source]
def current_y : UInt16 #

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

[View source]

[View source]
def enhanced_color_mode=(enhanced_color_mode : Definitions::ColorControl::EnhancedColorMode) #

[View source]
def enhanced_current_hue : UInt16 #

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

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

Get cluster name


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

Callback setter


[View source]
def options : UInt8 #

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

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

Read an attribute value


[View source]
def remaining_time : UInt16 #

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

[View source]
def set_color_temperature_kelvin(kelvin : UInt32) : InteractionModel::Status #

[View source]