class Matter::Cluster::FanControlCluster

Overview

Fan Control Cluster (0x0202)

Provides an interface to control the speed of a fan, including basic fan mode control and percentage-based speed settings.

Features:

Specification: Matter 1.4 § 4.4

Defined in:

matter/cluster/fan_control_cluster.cr

Constant Summary

ATTR_AIRFLOW_DIRECTION = 11_u32

Attributes - AirflowDirection feature

ATTR_FAN_MODE = 0_u32

Attributes - Required

ATTR_FAN_MODE_SEQUENCE = 1_u32
ATTR_PERCENT_CURRENT = 3_u32
ATTR_PERCENT_SETTING = 2_u32
ATTR_ROCK_SETTING = 8_u32
ATTR_ROCK_SUPPORT = 7_u32

Attributes - Rocking feature

ATTR_SPEED_CURRENT = 6_u32
ATTR_SPEED_MAX = 4_u32

Attributes - MultiSpeed feature

ATTR_SPEED_SETTING = 5_u32
ATTR_WIND_SETTING = 10_u32
ATTR_WIND_SUPPORT = 9_u32

Attributes - Wind feature

CLUSTER_ID = 514_u32
CMD_STEP = 0_u32

Commands

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, feature_map : Feature = Feature::None, fan_mode : FanMode = FanMode::Off, fan_mode_sequence : FanModeSequence = FanModeSequence::OffLowMedHigh, percent_setting : UInt8 | Nil = 0_u8, percent_current : UInt8 = 0_u8, speed_max : UInt8 = 100_u8, speed_setting : UInt8 | Nil = 0_u8, speed_current : UInt8 = 0_u8, rock_support : RockSupport = RockSupport::None, rock_setting : RockSupport = RockSupport::None, wind_support : WindSupport = WindSupport::None, wind_setting : WindSupport = WindSupport::None, airflow_direction : AirflowDirectionEnum = AirflowDirectionEnum::Forward) #

[View source]

Class Method Detail

def self.cluster_id #

Fan Control Cluster (0x0202)

Provides an interface to control the speed of a fan, including basic fan mode control and percentage-based speed settings.

Features:

  • MultiSpeed (SPD): Multi-speed fan control with discrete speed levels
  • Auto (AUTO): Automatic mode support
  • Rocking (RCK): Rocking movement support
  • Wind (WND): Wind emulation support
  • Step (STEP): Step command support for incremental speed changes
  • AirflowDirection (DIR): Airflow direction attribute

Specification: Matter 1.4 § 4.4


[View source]

Instance Method Detail

def airflow_direction : AirflowDirectionEnum #

AirflowDirection feature attribute


[View source]
def airflow_direction=(airflow_direction : AirflowDirectionEnum) #

AirflowDirection feature attribute


[View source]
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 fan_mode : FanMode #

Required attributes


[View source]
def fan_mode=(fan_mode : FanMode) #

Required attributes


[View source]
def fan_mode_sequence : FanModeSequence #

[View source]
def fan_mode_sequence=(fan_mode_sequence : FanModeSequence) #

[View source]
def feature_map : Feature #

Feature map


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

Feature map


[View source]
def invoke_command(command_id : UInt32, command_data : Bytes) : Bytes | InteractionModel::Status #
Description copied from class Matter::Cluster::Base

Invoke a command


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

Get cluster name


[View source]
def on_fan_mode_changed(&block : FanMode, FanMode -> Nil) #

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

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

[View source]
def percent_current : UInt8 #

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

[View source]
def percent_setting : UInt8 | Nil #

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

[View source]
def read_attribute(attribute_id : UInt32, fabric_index : UInt8 | Nil = nil) : Bytes | InteractionModel::Status #
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 rock_setting : RockSupport #

[View source]
def rock_setting=(rock_setting : RockSupport) #

[View source]
def rock_support : RockSupport #

Rocking feature attributes


[View source]
def rock_support=(rock_support : RockSupport) #

Rocking feature attributes


[View source]
def speed_current : UInt8 #

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

[View source]
def speed_max : UInt8 #

MultiSpeed feature attributes


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

MultiSpeed feature attributes


[View source]
def speed_setting : UInt8 | Nil #

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

[View source]
def update_percent_current(percent : UInt8) #

Update the current fan speed percentage (read-only attribute updated by implementation)


[View source]
def wind_setting : WindSupport #

[View source]
def wind_setting=(wind_setting : WindSupport) #

[View source]
def wind_support : WindSupport #

Wind feature attributes


[View source]
def wind_support=(wind_support : WindSupport) #

Wind feature attributes


[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]