struct AttributesAttributes for the DeviceEnergyManagementTrait.
-
A list of the attribute IDs of the attributes supported by the cluster instance. Nullable: false.
Declaration
Swift
@TraitAttribute var attributeList: [UInt32]? { get } -
The type of the ESA, which enables an EMS to determine how the ESA consumes, generates, and stores the energy. Nullable: false.
Declaration
Swift
@TraitAttribute var esaType: Matter.DeviceEnergyManagementTrait.ESATypeEnum? { get } -
Indicates whether the ESA is classified as a generator or a load. This allows an energy management system (EMS) to determine whether any power values reported by the ESA need to have their signs (for positive or negative values) inverted to make proper forecasts and adjustments. For example, a home battery storage system that charges its battery and then discharges to the home loads is classified as a generator, and the value of the
ESACanGenerateattribute istrue. The ESA power value is a positive numerical value when indicating that it is discharging to the loads in the home, and a negative numerical value when indicating it is charging its internal battery. Nullable: false.Declaration
Swift
@TraitAttribute var esaCanGenerate: Bool? { get } -
The current state of the ESA. If the ESA is in the
OfflineorFaultstate, it cannot be controlled by an EMS and may not be able to report its forecast information. Nullable: false.Declaration
Swift
@TraitAttribute var esaState: Matter.DeviceEnergyManagementTrait.ESAStateEnum? { get } -
The minimum electrical power, in milliwatts, that the ESA can consume when it’s on. This does not include when the ESA is in power save or standby mode. For a generator ESA that can charge an internal battery, the
AbsMinPoweris a negative number that represents the maximum power to which the ESA can charge its internal battery. For example, for a battery storage inverter that can charge its battery at a maximum power of 2000000mW, theAbsMinPoweris -2000000. Nullable: false.Declaration
Swift
@TraitAttribute var absMinPower: Int64? { get } -
The maximum electrical power, in milliwatts, that the ESA can consume when it’s on. The following condition must be true:
AbsMaxPoweris greater than or equal toAbsMinPower. For a generator ESA that can discharge a battery to loads in the home, theAbsMaxPoweris a positive number that represents the maximum power at which the ESA can discharge its internal battery. For example, for a battery storage inverter that can discharge the battery at a maximum power of 3000000mW, theAbsMaxPoweris 3000000. Nullable: false.Declaration
Swift
@TraitAttribute var absMaxPower: Int64? { get } -
Indicates how the ESA can be adjusted at the current time. For example, a battery storage inverter may need to regulate its internal temperature or the charging rate of the battery may be limited due to cold temperatures. An empty list indicates that no power adjustment is currently available, and multiple entries indicate that various permutations of scenarios may be possible. Refer also to
PowerAdjustStructfor available charging and discharging power adjustments. Nullable: true.Declaration
Swift
@TraitAttribute var powerAdjustmentCapability: Matter.DeviceEnergyManagementTrait.PowerAdjustCapabilityStruct? { get } -
Allows an ESA to share its intended forecast with a client, such as an EMS. A null value indicates that there is no forecast currently available. Nullable: true.
Declaration
Swift
@TraitAttribute var forecast: Matter.DeviceEnergyManagementTrait.ForecastStruct? { get } -
Indicates whether the ESA has opted out of energy management. If the ESA has opted out, it will not be controlled by an EMS. The ESA can opt out of energy management by setting this attribute to
true. Nullable: false.Declaration
Swift
@TraitAttribute var optOutState: Matter.DeviceEnergyManagementTrait.OptOutStateEnum? { get } -
A list of server-generated commands (server to client) which are supported by this cluster server instance. Nullable: false.
Declaration
Swift
@TraitAttribute var generatedCommandList: [UInt32]? { get } -
A list of client-generated commands which are supported by this cluster server instance.
Nullable: false.
Declaration
Swift
@TraitAttribute var acceptedCommandList: [UInt32]? { get } -
Whether the server supports zero or more optional cluster features. A cluster feature is a set of cluster elements that are mandatory or optional for a defined feature of the cluster. If a cluster feature is supported by the cluster instance, then the corresponding bit is set to 1, otherwise the bit is set to 0 (zero). Nullable: false.
Declaration
Swift
@TraitAttribute var featureMap: Matter.DeviceEnergyManagementTrait.Feature? { get } -
The revision of the server cluster specification supported by the cluster instance. Nullable: false.
Declaration
Swift
@TraitAttribute var clusterRevision: UInt16? { get } -
The trait identifier.
Declaration
Swift
static var identifier: String { get } -
Writes this object to the given
TraitEncoder. ThrowsHomeError.encodingFailedif the data could not be encoded.Declaration
Swift
func encode(with encoder: TraitEncoder) throws -
Returns a Boolean value indicating whether two values are equal.
Equality is the inverse of inequality. For any values
aandb,a == bimplies thata != bisfalse.Declaration
Swift
static func == (lhs: Matter.DeviceEnergyManagementTrait.Attributes, rhs: Matter.DeviceEnergyManagementTrait.Attributes) -> BoolParameters
lhsA value to compare.
rhsAnother value to compare.
-
Hashes the essential components of this value by feeding them into the given hasher.
Implement this method to conform to the
Hashableprotocol. The components used for hashing must be the same as the components compared in your type’s==operator implementation. Callhasher.combine(_:)with each of these components.Important
In your implementation of
hash(into:), don’t callfinalize()on thehasherinstance provided, or replace it with a different instance. Doing so may become a compile-time error in the future.Declaration
Swift
func hash(into hasher: inout Hasher)