class
Matter::Cluster::PowerSourceCluster
- Matter::Cluster::PowerSourceCluster
- Matter::Cluster::Base
- Reference
- Object
Overview
Power Source Cluster (0x002F)
Provides attributes and events for determining detailed information about power sources present on a node, such as batteries or wired power.
This implementation focuses on Battery and Replaceable features for battery-powered devices.
Specification: Matter 1.4 § 11.7
Defined in:
matter/cluster/power_source_cluster.crConstant Summary
-
ATTR_BAT_CHARGE_LEVEL =
14_u32 -
Battery Feature Attributes
-
ATTR_BAT_QUANTITY =
25_u32 -
ATTR_BAT_REPLACEABILITY =
16_u32 -
ATTR_BAT_REPLACEMENT_DESCRIPTION =
19_u32 -
Replaceable Feature Attributes
-
ATTR_BAT_REPLACEMENT_NEEDED =
15_u32 -
ATTR_DESCRIPTION =
2_u32 -
ATTR_ORDER =
1_u32 -
ATTR_STATUS =
0_u32 -
Base Attributes
-
CLUSTER_ID =
47_u32
Constructors
Class Method Summary
-
.cluster_id
Power Source Cluster (0x002F)
Instance Method Summary
-
#attributes : Array(AttributeMetadata)
Get all attribute metadata
-
#bat_charge_level : BatChargeLevel | Nil
Battery charge level (Battery feature)
-
#bat_charge_level=(bat_charge_level : BatChargeLevel | Nil)
Battery charge level (Battery feature)
-
#bat_quantity : UInt8 | Nil
Number of battery cells/packs (Replaceable feature)
-
#bat_quantity=(bat_quantity : UInt8 | Nil)
Number of battery cells/packs (Replaceable feature)
-
#bat_replaceability : BatReplaceability | Nil
Battery replaceability (Battery feature)
-
#bat_replaceability=(bat_replaceability : BatReplaceability | Nil)
Battery replaceability (Battery feature)
-
#bat_replacement_description : String | Nil
Battery replacement description (Replaceable feature)
-
#bat_replacement_description=(bat_replacement_description : String | Nil)
Battery replacement description (Replaceable feature)
-
#bat_replacement_needed : Bool | Nil
Whether battery needs replacement (Battery feature)
-
#bat_replacement_needed=(bat_replacement_needed : Bool | Nil)
Whether battery needs replacement (Battery feature)
-
#battery_feature_enabled? : Bool
Check if Battery feature is enabled
-
#commands : Array(CommandMetadata)
Get all command metadata
-
#description : String
User-facing description of this source
-
#description=(description : String)
User-facing description of this source
-
#name : String
Get cluster name
- #on_charge_level_changed(&block : BatChargeLevel | Nil, BatChargeLevel -> Nil)
- #on_replacement_needed_changed(&block : Bool | Nil, Bool -> Nil)
-
#order : UInt8
Relative preference for power selection (lower is preferred)
-
#order=(order : UInt8)
Relative preference for power selection (lower is preferred)
-
#read_attribute(attribute_id : UInt32) : Bytes | InteractionModel::Status
Read an attribute value
-
#replaceable_feature_enabled? : Bool
Check if Replaceable feature is enabled
-
#status : PowerSourceStatus
Current power source status
-
#status=(status : PowerSourceStatus)
Current power source status
-
#update_bat_charge_level(level : BatChargeLevel)
Update battery charge level
-
#update_bat_replacement_needed(needed : Bool)
Update battery replacement needed status
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
Class Method Detail
Power Source Cluster (0x002F)
Provides attributes and events for determining detailed information about power sources present on a node, such as batteries or wired power.
This implementation focuses on Battery and Replaceable features for battery-powered devices.
Specification: Matter 1.4 § 11.7
Instance Method Detail
Get all attribute metadata
Battery charge level (Battery feature)
Battery replaceability (Battery feature)
Battery replacement description (Replaceable feature)
Battery replacement description (Replaceable feature)
Whether battery needs replacement (Battery feature)
Get all command metadata
Read an attribute value