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.
Features:
- Wired (WIRED): Wired power source
- Battery (BAT): Battery power source
- Rechargeable (RECHG): Rechargeable battery
- Replaceable (REPLC): Replaceable battery
Note: Wired and Battery features are mutually exclusive.
Specification: Matter 1.4 ยง 11.7
Defined in:
matter/cluster/power_source_cluster.crConstant Summary
-
ATTR_ACTIVE_BAT_CHARGE_FAULTS =
30_u32 -
ATTR_ACTIVE_BAT_FAULTS =
18_u32 -
ATTR_ACTIVE_WIRED_FAULTS =
10_u32 -
ATTR_BAT_ANSI_DESIGNATION =
21_u32 -
ATTR_BAT_APPROVED_CHEMISTRY =
23_u32 -
ATTR_BAT_CAPACITY =
24_u32 -
ATTR_BAT_CHARGE_LEVEL =
14_u32 -
ATTR_BAT_CHARGE_STATE =
26_u32 -
Rechargeable Feature Attributes
-
ATTR_BAT_CHARGING_CURRENT =
29_u32 -
ATTR_BAT_COMMON_DESIGNATION =
20_u32 -
ATTR_BAT_FUNCTIONAL_WHILE_CHARGING =
28_u32 -
ATTR_BAT_IEC_DESIGNATION =
22_u32 -
ATTR_BAT_PERCENT_REMAINING =
12_u32 -
ATTR_BAT_PRESENT =
17_u32 -
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_BAT_TIME_REMAINING =
13_u32 -
ATTR_BAT_TIME_TO_FULL_CHARGE =
27_u32 -
ATTR_BAT_VOLTAGE =
11_u32 -
Battery Feature Attributes
-
ATTR_DESCRIPTION =
2_u32 -
ATTR_ORDER =
1_u32 -
ATTR_STATUS =
0_u32 -
Base Attributes
-
ATTR_WIRED_ASSESSED_CURRENT =
6_u32 -
ATTR_WIRED_ASSESSED_INPUT_FREQUENCY =
4_u32 -
ATTR_WIRED_ASSESSED_INPUT_VOLTAGE =
3_u32 -
Wired Feature Attributes
-
ATTR_WIRED_CURRENT_TYPE =
5_u32 -
ATTR_WIRED_MAXIMUM_CURRENT =
8_u32 -
ATTR_WIRED_NOMINAL_VOLTAGE =
7_u32 -
ATTR_WIRED_PRESENT =
9_u32 -
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
- #bat_charge_level=(bat_charge_level : BatChargeLevel | Nil)
-
#bat_charge_state : BatChargeState | Nil
Rechargeable feature attributes
-
#bat_charge_state=(bat_charge_state : BatChargeState | Nil)
Rechargeable feature attributes
- #bat_charging_current : UInt32 | Nil
- #bat_charging_current=(bat_charging_current : UInt32 | Nil)
- #bat_functional_while_charging : Bool | Nil
- #bat_functional_while_charging=(bat_functional_while_charging : Bool | Nil)
- #bat_percent_remaining : UInt8 | Nil
- #bat_percent_remaining=(bat_percent_remaining : UInt8 | Nil)
- #bat_present : Bool | Nil
- #bat_present=(bat_present : Bool | Nil)
- #bat_quantity : UInt8 | Nil
- #bat_quantity=(bat_quantity : UInt8 | Nil)
- #bat_replaceability : BatReplaceability | Nil
- #bat_replaceability=(bat_replaceability : BatReplaceability | Nil)
-
#bat_replacement_description : String | Nil
Replaceable feature attributes
-
#bat_replacement_description=(bat_replacement_description : String | Nil)
Replaceable feature attributes
- #bat_replacement_needed : Bool | Nil
- #bat_replacement_needed=(bat_replacement_needed : Bool | Nil)
- #bat_time_remaining : UInt32 | Nil
- #bat_time_remaining=(bat_time_remaining : UInt32 | Nil)
- #bat_time_to_full_charge : UInt32 | Nil
- #bat_time_to_full_charge=(bat_time_to_full_charge : UInt32 | Nil)
-
#bat_voltage : UInt32 | Nil
Battery feature attributes
-
#bat_voltage=(bat_voltage : UInt32 | Nil)
Battery feature attributes
-
#battery_feature_enabled? : Bool
Check if Battery feature is enabled (for backward compatibility)
-
#commands : Array(CommandMetadata)
Get all command metadata
- #description : String
- #description=(description : String)
-
#feature_map : Feature
Feature map
-
#feature_map=(feature_map : Feature)
Feature map
-
#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
- #order=(order : UInt8)
-
#read_attribute(attribute_id : UInt32, fabric_index : UInt8 | Nil = nil) : Bytes | InteractionModel::Status
Read an attribute value The fabric_index parameter is optional and used for fabric-scoped attributes like CurrentFabricIndex in OperationalCredentialsCluster
-
#replaceable_feature_enabled? : Bool
Check if Replaceable feature is enabled (for backward compatibility)
-
#status : PowerSourceStatus
Base attributes
-
#status=(status : PowerSourceStatus)
Base attributes
-
#update_bat_charge_level(level : BatChargeLevel)
Update battery charge level
-
#update_bat_replacement_needed(needed : Bool)
Update battery replacement needed status
- #wired_assessed_current : UInt32 | Nil
- #wired_assessed_current=(wired_assessed_current : UInt32 | Nil)
- #wired_assessed_input_frequency : UInt16 | Nil
- #wired_assessed_input_frequency=(wired_assessed_input_frequency : UInt16 | Nil)
-
#wired_assessed_input_voltage : UInt32 | Nil
Wired feature attributes
-
#wired_assessed_input_voltage=(wired_assessed_input_voltage : UInt32 | Nil)
Wired feature attributes
- #wired_current_type : WiredCurrentType | Nil
- #wired_current_type=(wired_current_type : WiredCurrentType | Nil)
- #wired_maximum_current : UInt32 | Nil
- #wired_maximum_current=(wired_maximum_current : UInt32 | Nil)
- #wired_nominal_voltage : UInt32 | Nil
- #wired_nominal_voltage=(wired_nominal_voltage : UInt32 | Nil)
- #wired_present : Bool | Nil
- #wired_present=(wired_present : Bool | Nil)
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
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.
Features:
- Wired (WIRED): Wired power source
- Battery (BAT): Battery power source
- Rechargeable (RECHG): Rechargeable battery
- Replaceable (REPLC): Replaceable battery
Note: Wired and Battery features are mutually exclusive.
Specification: Matter 1.4 ยง 11.7
Instance Method Detail
Get all attribute metadata
Replaceable feature attributes
Check if Battery feature is enabled (for backward compatibility)
Get all command metadata
Read an attribute value The fabric_index parameter is optional and used for fabric-scoped attributes like CurrentFabricIndex in OperationalCredentialsCluster
Check if Replaceable feature is enabled (for backward compatibility)
Wired feature attributes