From cf2e8ab9cb9c0c6cafb7771cc94af96f99aecc98 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Thu, 30 May 2024 00:31:18 +0100 Subject: [PATCH 01/32] Updated device-energy-management-cluster.xml and energy-evse-cluster.xml using Alchemy and spec commit: dbf7c6dd7206fa4a4647f8a6218325fbe6c8ec6c Note more DEM PRs are yet to merge. --- .../chip/device-energy-management-cluster.xml | 126 ++++++++++-------- .../data-model/chip/energy-evse-cluster.xml | 112 ++++++++-------- 2 files changed, 128 insertions(+), 110 deletions(-) diff --git a/src/app/zap-templates/zcl/data-model/chip/device-energy-management-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/device-energy-management-cluster.xml index 3f921f4e554409..3bf9ea24d42102 100644 --- a/src/app/zap-templates/zcl/data-model/chip/device-energy-management-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/device-energy-management-cluster.xml @@ -16,8 +16,6 @@ limitations under the License. --> - - Device Energy Management Energy Management @@ -26,15 +24,14 @@ limitations under the License. true true This cluster allows a client to manage the power draw of a device. An example of such a client could be an Energy Management System (EMS) which controls an Energy Smart Appliance (ESA). - - + - +adjustment (within the limits offered by the ESA)."> + +future power consumption vs time."> @@ -43,17 +40,20 @@ limitations under the License. + + + - + +future state vs time."> @@ -62,103 +62,112 @@ limitations under the License. + + + - + - - + + - - + + - - - - - + + - - - - - + + - - ESAType - ESACanGenerate - ESAState - AbsMinPower - AbsMaxPower + ESAType + ESACanGenerate + ESAState + AbsMinPower + AbsMaxPower - PowerAdjustmentCapability + PowerAdjustmentCapability - Forecast - OptOutState + Forecast + OptOutState Allows a client to request an adjustment in the power consumption of an ESA for a specified duration. - - - + + + + Allows a client to cancel an ongoing PowerAdjustmentRequest operation. + Allows a client to adjust the start time of a Forecast sequence that has not yet started operation (i.e. where the current Forecast StartTime is in the future). - - + + + Allows a client to temporarily pause an operation and reduce the ESAs energy demand. - - + + + Allows a client to cancel the PauseRequest command and enable earlier resumption of operation. + Allows a client to modify a Forecast within the limits allowed by the ESA. - - - + + + + Allows a client to ask the ESA to recompute its Forecast based on power and time constraints. - - + + + Allows a client to request cancellation of a previous adjustment request in a StartTimeAdjustRequest, ModifyForecastRequest or RequestConstraintBasedForecast command + PowerAdjustStart + PowerAdjustEnd + Paused + Resumed + + @@ -225,6 +234,13 @@ limitations under the License. + + + + + + + @@ -239,17 +255,18 @@ limitations under the License. + - + - + @@ -261,7 +278,7 @@ limitations under the License. - + @@ -279,17 +296,16 @@ limitations under the License. - + - + - diff --git a/src/app/zap-templates/zcl/data-model/chip/energy-evse-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/energy-evse-cluster.xml index 5c22b8e93be8da..67a86a7e0282a1 100644 --- a/src/app/zap-templates/zcl/data-model/chip/energy-evse-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/energy-evse-cluster.xml @@ -13,7 +13,6 @@ limitations under the License. --> - @@ -32,6 +31,7 @@ limitations under the License. + @@ -75,15 +75,15 @@ limitations under the License. - + - - + + @@ -94,11 +94,13 @@ limitations under the License. true true Electric Vehicle Supply Equipment (EVSE) is equipment used to charge an Electric Vehicle (EV) or Plug-In Hybrid Electric Vehicle. This cluster provides an interface to the functionality of Electric Vehicle Supply Equipment (EVSE) management. - - + - + + + + @@ -113,102 +115,96 @@ limitations under the License. - - - State - SupplyState - FaultState - ChargingEnabledUntil + State + SupplyState + FaultState + ChargingEnabledUntil - - DischargingEnabledUntil - CircuitCapacity - MinimumChargeCurrent - MaximumChargeCurrent + DischargingEnabledUntil + CircuitCapacity + MinimumChargeCurrent + MaximumChargeCurrent - - MaximumDischargeCurrent - + MaximumDischargeCurrent + UserMaximumChargeCurrent - + RandomizationDelayWindow - - - - NextChargeStartTime + NextChargeStartTime - - NextChargeTargetTime + NextChargeTargetTime - - NextChargeRequiredEnergy + NextChargeRequiredEnergy - - NextChargeTargetSoC + NextChargeTargetSoC - - + ApproximateEVEfficiency - - StateOfCharge + StateOfCharge - - BatteryCapacity + BatteryCapacity - - VehicleID - SessionID - SessionDuration - SessionEnergyCharged + VehicleID + SessionID + SessionDuration + SessionEnergyCharged - - SessionEnergyDischarged + SessionEnergyDischarged Allows a client to disable the EVSE from charging and discharging. + - - - + + + Allows a client to enable the EVSE to charge an EV. + - - + + Allows a client to enable the EVSE to discharge an EV. + Allows a client to put the EVSE into a self-diagnostics mode. + - + Allows a client to set the user specified charging targets. + Allows a client to retrieve the user specified charging targets. + Allows a client to clear all stored charging targets. - - + + + The GetTargetsResponse is sent in response to the GetTargets Command. + EVConnected + EVNotDetected @@ -217,19 +213,24 @@ limitations under the License. + EnergyTransferStarted - + + + EnergyTransferStopped + + Fault @@ -237,10 +238,11 @@ limitations under the License. + RFID - + From 1b9021ef531af9eec188dd0eba6b0b6ab16b7e46 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Thu, 30 May 2024 00:32:47 +0100 Subject: [PATCH 02/32] Regen_all checked in. --- .../all-clusters-app.matter | 26 ++-- .../data_model/controller-clusters.matter | 26 ++-- .../devicecontroller/ChipEventStructs.java | 38 +++++- .../chip/devicecontroller/ChipStructs.java | 101 ++++++++------- ...gyEvseClusterEnergyTransferStartedEvent.kt | 23 +++- ...gyEvseClusterEnergyTransferStoppedEvent.kt | 19 ++- ...ceEnergyManagementClusterForecastStruct.kt | 16 +-- ...nergyManagementClusterPowerAdjustStruct.kt | 10 +- ...gyManagementClusterSlotAdjustmentStruct.kt | 15 ++- ...DeviceEnergyManagementClusterSlotStruct.kt | 20 +-- ...EvseClusterChargingTargetScheduleStruct.kt | 46 ++++--- ...gyEvseClusterEnergyTransferStartedEvent.kt | 23 +++- ...gyEvseClusterEnergyTransferStoppedEvent.kt | 19 ++- ...ceEnergyManagementClusterForecastStruct.kt | 16 +-- ...nergyManagementClusterPowerAdjustStruct.kt | 10 +- ...gyManagementClusterSlotAdjustmentStruct.kt | 15 ++- ...DeviceEnergyManagementClusterSlotStruct.kt | 20 +-- ...EvseClusterChargingTargetScheduleStruct.kt | 45 ++++--- .../CHIPAttributeTLVValueDecoder.cpp | 74 ++++++----- .../CHIPEventTLVValueDecoder.cpp | 51 +++++++- .../python/chip/clusters/Objects.py | 39 ++++-- .../MTRAttributeTLVValueDecoder.mm | 11 +- .../CHIP/zap-generated/MTRBaseClusters.h | 7 ++ .../zap-generated/MTRCommandPayloadsObjc.mm | 115 ++++++++++-------- .../zap-generated/MTRDeviceTypeMetadata.mm | 1 + .../zap-generated/MTREventTLVValueDecoder.mm | 18 +++ .../CHIP/zap-generated/MTRStructsObjc.h | 13 +- .../CHIP/zap-generated/MTRStructsObjc.mm | 33 +++-- .../zap-generated/cluster-enums-check.h | 14 +++ .../app-common/zap-generated/cluster-enums.h | 16 ++- .../zap-generated/cluster-objects.cpp | 28 ++++- .../zap-generated/cluster-objects.h | 52 ++++---- .../cluster/ComplexArgumentParser.cpp | 56 +++++---- .../cluster/logging/DataModelLogger.cpp | 32 ++++- .../zap-generated/cluster/Commands.h | 50 +++++--- 35 files changed, 756 insertions(+), 342 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index 804d1eae5fbd32..58cf56f428b82a 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -4069,7 +4069,7 @@ cluster ElectricalEnergyMeasurement = 145 { /** This cluster allows a client to manage the power draw of a device. An example of such a client could be an Energy Management System (EMS) which controls an Energy Smart Appliance (ESA). */ provisional cluster DeviceEnergyManagement = 152 { - revision 3; + revision 4; enum AdjustmentCauseEnum : enum8 { kLocalOptimization = 0; @@ -4130,6 +4130,12 @@ provisional cluster DeviceEnergyManagement = 152 { kOptOut = 3; } + enum PowerAdjustReasonEnum : enum8 { + kNoAdjustment = 0; + kLocalOptimizationAdjustment = 1; + kGridOptimizationAdjustment = 2; + } + bitmap Feature : bitmap32 { kPowerAdjustment = 0x1; kPowerForecastReporting = 0x2; @@ -4153,7 +4159,7 @@ provisional cluster DeviceEnergyManagement = 152 { elapsed_s defaultDuration = 2; elapsed_s elapsedSlotTime = 3; elapsed_s remainingSlotTime = 4; - optional boolean slotIsPauseable = 5; + optional boolean slotIsPausable = 5; optional elapsed_s minPauseDuration = 6; optional elapsed_s maxPauseDuration = 7; optional int16u manufacturerESAState = 8; @@ -4169,13 +4175,13 @@ provisional cluster DeviceEnergyManagement = 152 { } struct ForecastStruct { - int16u forecastId = 0; + int32u forecastId = 0; nullable int16u activeSlotNumber = 1; epoch_s startTime = 2; epoch_s endTime = 3; optional nullable epoch_s earliestStartTime = 4; optional epoch_s latestEndTime = 5; - boolean isPauseable = 6; + boolean isPausable = 6; SlotStruct slots[] = 7; ForecastUpdateReasonEnum forecastUpdateReason = 8; } @@ -4193,11 +4199,12 @@ provisional cluster DeviceEnergyManagement = 152 { power_mw maxPower = 1; elapsed_s minDuration = 2; elapsed_s maxDuration = 3; + PowerAdjustReasonEnum cause = 4; } struct SlotAdjustmentStruct { int8u slotIndex = 0; - power_mw nominalPower = 1; + optional power_mw nominalPower = 1; elapsed_s duration = 2; } @@ -4279,7 +4286,7 @@ provisional cluster DeviceEnergyManagement = 152 { /** Electric Vehicle Supply Equipment (EVSE) is equipment used to charge an Electric Vehicle (EV) or Plug-In Hybrid Electric Vehicle. This cluster provides an interface to the functionality of Electric Vehicle Supply Equipment (EVSE) management. */ cluster EnergyEvse = 153 { - revision 2; + revision 4; enum EnergyTransferStoppedReasonEnum : enum8 { kEVStopped = 0; @@ -4323,6 +4330,7 @@ cluster EnergyEvse = 153 { kDischargingEnabled = 2; kDisabledError = 3; kDisabledDiagnostics = 4; + kEnabled = 5; } bitmap Feature : bitmap32 { @@ -4350,8 +4358,8 @@ cluster EnergyEvse = 153 { } struct ChargingTargetScheduleStruct { - TargetDayOfWeekBitmap dayOfWeekForSequence = 0; - ChargingTargetStruct chargingTargets[] = 1; + optional TargetDayOfWeekBitmap dayOfWeekForSequence = 0; + optional ChargingTargetStruct chargingTargets[] = 1; } info event EVConnected = 0 { @@ -4370,6 +4378,7 @@ cluster EnergyEvse = 153 { int32u sessionID = 0; StateEnum state = 1; amperage_ma maximumCurrent = 2; + optional amperage_ma maximumDischargingCurrent = 3; } info event EnergyTransferStopped = 3 { @@ -4377,6 +4386,7 @@ cluster EnergyEvse = 153 { StateEnum state = 1; EnergyTransferStoppedReasonEnum reason = 2; energy_mwh energyTransferred = 4; + optional energy_mwh energyDischarged = 5; } critical event Fault = 4 { diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index e18d1cbe4a0193..358a027795048d 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -4594,7 +4594,7 @@ provisional cluster Messages = 151 { /** This cluster allows a client to manage the power draw of a device. An example of such a client could be an Energy Management System (EMS) which controls an Energy Smart Appliance (ESA). */ provisional cluster DeviceEnergyManagement = 152 { - revision 3; + revision 4; enum AdjustmentCauseEnum : enum8 { kLocalOptimization = 0; @@ -4655,6 +4655,12 @@ provisional cluster DeviceEnergyManagement = 152 { kOptOut = 3; } + enum PowerAdjustReasonEnum : enum8 { + kNoAdjustment = 0; + kLocalOptimizationAdjustment = 1; + kGridOptimizationAdjustment = 2; + } + bitmap Feature : bitmap32 { kPowerAdjustment = 0x1; kPowerForecastReporting = 0x2; @@ -4678,7 +4684,7 @@ provisional cluster DeviceEnergyManagement = 152 { elapsed_s defaultDuration = 2; elapsed_s elapsedSlotTime = 3; elapsed_s remainingSlotTime = 4; - optional boolean slotIsPauseable = 5; + optional boolean slotIsPausable = 5; optional elapsed_s minPauseDuration = 6; optional elapsed_s maxPauseDuration = 7; optional int16u manufacturerESAState = 8; @@ -4694,13 +4700,13 @@ provisional cluster DeviceEnergyManagement = 152 { } struct ForecastStruct { - int16u forecastId = 0; + int32u forecastId = 0; nullable int16u activeSlotNumber = 1; epoch_s startTime = 2; epoch_s endTime = 3; optional nullable epoch_s earliestStartTime = 4; optional epoch_s latestEndTime = 5; - boolean isPauseable = 6; + boolean isPausable = 6; SlotStruct slots[] = 7; ForecastUpdateReasonEnum forecastUpdateReason = 8; } @@ -4718,11 +4724,12 @@ provisional cluster DeviceEnergyManagement = 152 { power_mw maxPower = 1; elapsed_s minDuration = 2; elapsed_s maxDuration = 3; + PowerAdjustReasonEnum cause = 4; } struct SlotAdjustmentStruct { int8u slotIndex = 0; - power_mw nominalPower = 1; + optional power_mw nominalPower = 1; elapsed_s duration = 2; } @@ -4804,7 +4811,7 @@ provisional cluster DeviceEnergyManagement = 152 { /** Electric Vehicle Supply Equipment (EVSE) is equipment used to charge an Electric Vehicle (EV) or Plug-In Hybrid Electric Vehicle. This cluster provides an interface to the functionality of Electric Vehicle Supply Equipment (EVSE) management. */ cluster EnergyEvse = 153 { - revision 2; + revision 4; enum EnergyTransferStoppedReasonEnum : enum8 { kEVStopped = 0; @@ -4848,6 +4855,7 @@ cluster EnergyEvse = 153 { kDischargingEnabled = 2; kDisabledError = 3; kDisabledDiagnostics = 4; + kEnabled = 5; } bitmap Feature : bitmap32 { @@ -4875,8 +4883,8 @@ cluster EnergyEvse = 153 { } struct ChargingTargetScheduleStruct { - TargetDayOfWeekBitmap dayOfWeekForSequence = 0; - ChargingTargetStruct chargingTargets[] = 1; + optional TargetDayOfWeekBitmap dayOfWeekForSequence = 0; + optional ChargingTargetStruct chargingTargets[] = 1; } info event EVConnected = 0 { @@ -4895,6 +4903,7 @@ cluster EnergyEvse = 153 { int32u sessionID = 0; StateEnum state = 1; amperage_ma maximumCurrent = 2; + optional amperage_ma maximumDischargingCurrent = 3; } info event EnergyTransferStopped = 3 { @@ -4902,6 +4911,7 @@ cluster EnergyEvse = 153 { StateEnum state = 1; EnergyTransferStoppedReasonEnum reason = 2; energy_mwh energyTransferred = 4; + optional energy_mwh energyDischarged = 5; } critical event Fault = 4 { diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipEventStructs.java b/src/controller/java/generated/java/chip/devicecontroller/ChipEventStructs.java index ce1a79c5a4a710..7b2513da455cfa 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipEventStructs.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipEventStructs.java @@ -4323,18 +4323,22 @@ public static class EnergyEvseClusterEnergyTransferStartedEvent { public Long sessionID; public Integer state; public Long maximumCurrent; + public Optional maximumDischargingCurrent; private static final long SESSION_I_D_ID = 0L; private static final long STATE_ID = 1L; private static final long MAXIMUM_CURRENT_ID = 2L; + private static final long MAXIMUM_DISCHARGING_CURRENT_ID = 3L; public EnergyEvseClusterEnergyTransferStartedEvent( Long sessionID, Integer state, - Long maximumCurrent + Long maximumCurrent, + Optional maximumDischargingCurrent ) { this.sessionID = sessionID; this.state = state; this.maximumCurrent = maximumCurrent; + this.maximumDischargingCurrent = maximumDischargingCurrent; } public StructType encodeTlv() { @@ -4342,6 +4346,7 @@ public StructType encodeTlv() { values.add(new StructElement(SESSION_I_D_ID, new UIntType(sessionID))); values.add(new StructElement(STATE_ID, new UIntType(state))); values.add(new StructElement(MAXIMUM_CURRENT_ID, new IntType(maximumCurrent))); + values.add(new StructElement(MAXIMUM_DISCHARGING_CURRENT_ID, maximumDischargingCurrent.map((nonOptionalmaximumDischargingCurrent) -> new IntType(nonOptionalmaximumDischargingCurrent)).orElse(new EmptyType()))); return new StructType(values); } @@ -4353,6 +4358,7 @@ public static EnergyEvseClusterEnergyTransferStartedEvent decodeTlv(BaseTLVType Long sessionID = null; Integer state = null; Long maximumCurrent = null; + Optional maximumDischargingCurrent = Optional.empty(); for (StructElement element: ((StructType)tlvValue).value()) { if (element.contextTagNum() == SESSION_I_D_ID) { if (element.value(BaseTLVType.class).type() == TLVType.UInt) { @@ -4369,12 +4375,18 @@ public static EnergyEvseClusterEnergyTransferStartedEvent decodeTlv(BaseTLVType IntType castingValue = element.value(IntType.class); maximumCurrent = castingValue.value(Long.class); } + } else if (element.contextTagNum() == MAXIMUM_DISCHARGING_CURRENT_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Int) { + IntType castingValue = element.value(IntType.class); + maximumDischargingCurrent = Optional.of(castingValue.value(Long.class)); + } } } return new EnergyEvseClusterEnergyTransferStartedEvent( sessionID, state, - maximumCurrent + maximumCurrent, + maximumDischargingCurrent ); } @@ -4391,6 +4403,9 @@ public String toString() { output.append("\tmaximumCurrent: "); output.append(maximumCurrent); output.append("\n"); + output.append("\tmaximumDischargingCurrent: "); + output.append(maximumDischargingCurrent); + output.append("\n"); output.append("}\n"); return output.toString(); } @@ -4400,21 +4415,25 @@ public static class EnergyEvseClusterEnergyTransferStoppedEvent { public Integer state; public Integer reason; public Long energyTransferred; + public Optional energyDischarged; private static final long SESSION_I_D_ID = 0L; private static final long STATE_ID = 1L; private static final long REASON_ID = 2L; private static final long ENERGY_TRANSFERRED_ID = 4L; + private static final long ENERGY_DISCHARGED_ID = 5L; public EnergyEvseClusterEnergyTransferStoppedEvent( Long sessionID, Integer state, Integer reason, - Long energyTransferred + Long energyTransferred, + Optional energyDischarged ) { this.sessionID = sessionID; this.state = state; this.reason = reason; this.energyTransferred = energyTransferred; + this.energyDischarged = energyDischarged; } public StructType encodeTlv() { @@ -4423,6 +4442,7 @@ public StructType encodeTlv() { values.add(new StructElement(STATE_ID, new UIntType(state))); values.add(new StructElement(REASON_ID, new UIntType(reason))); values.add(new StructElement(ENERGY_TRANSFERRED_ID, new IntType(energyTransferred))); + values.add(new StructElement(ENERGY_DISCHARGED_ID, energyDischarged.map((nonOptionalenergyDischarged) -> new IntType(nonOptionalenergyDischarged)).orElse(new EmptyType()))); return new StructType(values); } @@ -4435,6 +4455,7 @@ public static EnergyEvseClusterEnergyTransferStoppedEvent decodeTlv(BaseTLVType Integer state = null; Integer reason = null; Long energyTransferred = null; + Optional energyDischarged = Optional.empty(); for (StructElement element: ((StructType)tlvValue).value()) { if (element.contextTagNum() == SESSION_I_D_ID) { if (element.value(BaseTLVType.class).type() == TLVType.UInt) { @@ -4456,13 +4477,19 @@ public static EnergyEvseClusterEnergyTransferStoppedEvent decodeTlv(BaseTLVType IntType castingValue = element.value(IntType.class); energyTransferred = castingValue.value(Long.class); } + } else if (element.contextTagNum() == ENERGY_DISCHARGED_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Int) { + IntType castingValue = element.value(IntType.class); + energyDischarged = Optional.of(castingValue.value(Long.class)); + } } } return new EnergyEvseClusterEnergyTransferStoppedEvent( sessionID, state, reason, - energyTransferred + energyTransferred, + energyDischarged ); } @@ -4482,6 +4509,9 @@ public String toString() { output.append("\tenergyTransferred: "); output.append(energyTransferred); output.append("\n"); + output.append("\tenergyDischarged: "); + output.append(energyDischarged); + output.append("\n"); output.append("}\n"); return output.toString(); } diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java b/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java index 7730f05efe734a..ab12472a2ca7ff 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java @@ -7358,7 +7358,7 @@ public static class DeviceEnergyManagementClusterSlotStruct { public Long defaultDuration; public Long elapsedSlotTime; public Long remainingSlotTime; - public Optional slotIsPauseable; + public Optional slotIsPausable; public Optional minPauseDuration; public Optional maxPauseDuration; public Optional manufacturerESAState; @@ -7376,7 +7376,7 @@ public static class DeviceEnergyManagementClusterSlotStruct { private static final long DEFAULT_DURATION_ID = 2L; private static final long ELAPSED_SLOT_TIME_ID = 3L; private static final long REMAINING_SLOT_TIME_ID = 4L; - private static final long SLOT_IS_PAUSEABLE_ID = 5L; + private static final long SLOT_IS_PAUSABLE_ID = 5L; private static final long MIN_PAUSE_DURATION_ID = 6L; private static final long MAX_PAUSE_DURATION_ID = 7L; private static final long MANUFACTURER_E_S_A_STATE_ID = 8L; @@ -7396,7 +7396,7 @@ public DeviceEnergyManagementClusterSlotStruct( Long defaultDuration, Long elapsedSlotTime, Long remainingSlotTime, - Optional slotIsPauseable, + Optional slotIsPausable, Optional minPauseDuration, Optional maxPauseDuration, Optional manufacturerESAState, @@ -7415,7 +7415,7 @@ public DeviceEnergyManagementClusterSlotStruct( this.defaultDuration = defaultDuration; this.elapsedSlotTime = elapsedSlotTime; this.remainingSlotTime = remainingSlotTime; - this.slotIsPauseable = slotIsPauseable; + this.slotIsPausable = slotIsPausable; this.minPauseDuration = minPauseDuration; this.maxPauseDuration = maxPauseDuration; this.manufacturerESAState = manufacturerESAState; @@ -7437,7 +7437,7 @@ public StructType encodeTlv() { values.add(new StructElement(DEFAULT_DURATION_ID, new UIntType(defaultDuration))); values.add(new StructElement(ELAPSED_SLOT_TIME_ID, new UIntType(elapsedSlotTime))); values.add(new StructElement(REMAINING_SLOT_TIME_ID, new UIntType(remainingSlotTime))); - values.add(new StructElement(SLOT_IS_PAUSEABLE_ID, slotIsPauseable.map((nonOptionalslotIsPauseable) -> new BooleanType(nonOptionalslotIsPauseable)).orElse(new EmptyType()))); + values.add(new StructElement(SLOT_IS_PAUSABLE_ID, slotIsPausable.map((nonOptionalslotIsPausable) -> new BooleanType(nonOptionalslotIsPausable)).orElse(new EmptyType()))); values.add(new StructElement(MIN_PAUSE_DURATION_ID, minPauseDuration.map((nonOptionalminPauseDuration) -> new UIntType(nonOptionalminPauseDuration)).orElse(new EmptyType()))); values.add(new StructElement(MAX_PAUSE_DURATION_ID, maxPauseDuration.map((nonOptionalmaxPauseDuration) -> new UIntType(nonOptionalmaxPauseDuration)).orElse(new EmptyType()))); values.add(new StructElement(MANUFACTURER_E_S_A_STATE_ID, manufacturerESAState.map((nonOptionalmanufacturerESAState) -> new UIntType(nonOptionalmanufacturerESAState)).orElse(new EmptyType()))); @@ -7463,7 +7463,7 @@ public static DeviceEnergyManagementClusterSlotStruct decodeTlv(BaseTLVType tlvV Long defaultDuration = null; Long elapsedSlotTime = null; Long remainingSlotTime = null; - Optional slotIsPauseable = Optional.empty(); + Optional slotIsPausable = Optional.empty(); Optional minPauseDuration = Optional.empty(); Optional maxPauseDuration = Optional.empty(); Optional manufacturerESAState = Optional.empty(); @@ -7502,10 +7502,10 @@ public static DeviceEnergyManagementClusterSlotStruct decodeTlv(BaseTLVType tlvV UIntType castingValue = element.value(UIntType.class); remainingSlotTime = castingValue.value(Long.class); } - } else if (element.contextTagNum() == SLOT_IS_PAUSEABLE_ID) { + } else if (element.contextTagNum() == SLOT_IS_PAUSABLE_ID) { if (element.value(BaseTLVType.class).type() == TLVType.Boolean) { BooleanType castingValue = element.value(BooleanType.class); - slotIsPauseable = Optional.of(castingValue.value(Boolean.class)); + slotIsPausable = Optional.of(castingValue.value(Boolean.class)); } } else if (element.contextTagNum() == MIN_PAUSE_DURATION_ID) { if (element.value(BaseTLVType.class).type() == TLVType.UInt) { @@ -7575,7 +7575,7 @@ public static DeviceEnergyManagementClusterSlotStruct decodeTlv(BaseTLVType tlvV defaultDuration, elapsedSlotTime, remainingSlotTime, - slotIsPauseable, + slotIsPausable, minPauseDuration, maxPauseDuration, manufacturerESAState, @@ -7610,8 +7610,8 @@ public String toString() { output.append("\tremainingSlotTime: "); output.append(remainingSlotTime); output.append("\n"); - output.append("\tslotIsPauseable: "); - output.append(slotIsPauseable); + output.append("\tslotIsPausable: "); + output.append(slotIsPausable); output.append("\n"); output.append("\tminPauseDuration: "); output.append(minPauseDuration); @@ -7654,13 +7654,13 @@ public String toString() { } } public static class DeviceEnergyManagementClusterForecastStruct { - public Integer forecastId; + public Long forecastId; public @Nullable Integer activeSlotNumber; public Long startTime; public Long endTime; public @Nullable Optional earliestStartTime; public Optional latestEndTime; - public Boolean isPauseable; + public Boolean isPausable; public ArrayList slots; public Integer forecastUpdateReason; private static final long FORECAST_ID_ID = 0L; @@ -7669,18 +7669,18 @@ public static class DeviceEnergyManagementClusterForecastStruct { private static final long END_TIME_ID = 3L; private static final long EARLIEST_START_TIME_ID = 4L; private static final long LATEST_END_TIME_ID = 5L; - private static final long IS_PAUSEABLE_ID = 6L; + private static final long IS_PAUSABLE_ID = 6L; private static final long SLOTS_ID = 7L; private static final long FORECAST_UPDATE_REASON_ID = 8L; public DeviceEnergyManagementClusterForecastStruct( - Integer forecastId, + Long forecastId, @Nullable Integer activeSlotNumber, Long startTime, Long endTime, @Nullable Optional earliestStartTime, Optional latestEndTime, - Boolean isPauseable, + Boolean isPausable, ArrayList slots, Integer forecastUpdateReason ) { @@ -7690,7 +7690,7 @@ public DeviceEnergyManagementClusterForecastStruct( this.endTime = endTime; this.earliestStartTime = earliestStartTime; this.latestEndTime = latestEndTime; - this.isPauseable = isPauseable; + this.isPausable = isPausable; this.slots = slots; this.forecastUpdateReason = forecastUpdateReason; } @@ -7703,7 +7703,7 @@ public StructType encodeTlv() { values.add(new StructElement(END_TIME_ID, new UIntType(endTime))); values.add(new StructElement(EARLIEST_START_TIME_ID, earliestStartTime != null ? earliestStartTime.map((nonOptionalearliestStartTime) -> new UIntType(nonOptionalearliestStartTime)).orElse(new EmptyType()) : new NullType())); values.add(new StructElement(LATEST_END_TIME_ID, latestEndTime.map((nonOptionallatestEndTime) -> new UIntType(nonOptionallatestEndTime)).orElse(new EmptyType()))); - values.add(new StructElement(IS_PAUSEABLE_ID, new BooleanType(isPauseable))); + values.add(new StructElement(IS_PAUSABLE_ID, new BooleanType(isPausable))); values.add(new StructElement(SLOTS_ID, ArrayType.generateArrayType(slots, (elementslots) -> elementslots.encodeTlv()))); values.add(new StructElement(FORECAST_UPDATE_REASON_ID, new UIntType(forecastUpdateReason))); @@ -7714,20 +7714,20 @@ public static DeviceEnergyManagementClusterForecastStruct decodeTlv(BaseTLVType if (tlvValue == null || tlvValue.type() != TLVType.Struct) { return null; } - Integer forecastId = null; + Long forecastId = null; @Nullable Integer activeSlotNumber = null; Long startTime = null; Long endTime = null; @Nullable Optional earliestStartTime = null; Optional latestEndTime = Optional.empty(); - Boolean isPauseable = null; + Boolean isPausable = null; ArrayList slots = null; Integer forecastUpdateReason = null; for (StructElement element: ((StructType)tlvValue).value()) { if (element.contextTagNum() == FORECAST_ID_ID) { if (element.value(BaseTLVType.class).type() == TLVType.UInt) { UIntType castingValue = element.value(UIntType.class); - forecastId = castingValue.value(Integer.class); + forecastId = castingValue.value(Long.class); } } else if (element.contextTagNum() == ACTIVE_SLOT_NUMBER_ID) { if (element.value(BaseTLVType.class).type() == TLVType.UInt) { @@ -7754,10 +7754,10 @@ public static DeviceEnergyManagementClusterForecastStruct decodeTlv(BaseTLVType UIntType castingValue = element.value(UIntType.class); latestEndTime = Optional.of(castingValue.value(Long.class)); } - } else if (element.contextTagNum() == IS_PAUSEABLE_ID) { + } else if (element.contextTagNum() == IS_PAUSABLE_ID) { if (element.value(BaseTLVType.class).type() == TLVType.Boolean) { BooleanType castingValue = element.value(BooleanType.class); - isPauseable = castingValue.value(Boolean.class); + isPausable = castingValue.value(Boolean.class); } } else if (element.contextTagNum() == SLOTS_ID) { if (element.value(BaseTLVType.class).type() == TLVType.Array) { @@ -7778,7 +7778,7 @@ public static DeviceEnergyManagementClusterForecastStruct decodeTlv(BaseTLVType endTime, earliestStartTime, latestEndTime, - isPauseable, + isPausable, slots, forecastUpdateReason ); @@ -7806,8 +7806,8 @@ public String toString() { output.append("\tlatestEndTime: "); output.append(latestEndTime); output.append("\n"); - output.append("\tisPauseable: "); - output.append(isPauseable); + output.append("\tisPausable: "); + output.append(isPausable); output.append("\n"); output.append("\tslots: "); output.append(slots); @@ -7930,21 +7930,25 @@ public static class DeviceEnergyManagementClusterPowerAdjustStruct { public Long maxPower; public Long minDuration; public Long maxDuration; + public Integer cause; private static final long MIN_POWER_ID = 0L; private static final long MAX_POWER_ID = 1L; private static final long MIN_DURATION_ID = 2L; private static final long MAX_DURATION_ID = 3L; + private static final long CAUSE_ID = 4L; public DeviceEnergyManagementClusterPowerAdjustStruct( Long minPower, Long maxPower, Long minDuration, - Long maxDuration + Long maxDuration, + Integer cause ) { this.minPower = minPower; this.maxPower = maxPower; this.minDuration = minDuration; this.maxDuration = maxDuration; + this.cause = cause; } public StructType encodeTlv() { @@ -7953,6 +7957,7 @@ public StructType encodeTlv() { values.add(new StructElement(MAX_POWER_ID, new IntType(maxPower))); values.add(new StructElement(MIN_DURATION_ID, new UIntType(minDuration))); values.add(new StructElement(MAX_DURATION_ID, new UIntType(maxDuration))); + values.add(new StructElement(CAUSE_ID, new UIntType(cause))); return new StructType(values); } @@ -7965,6 +7970,7 @@ public static DeviceEnergyManagementClusterPowerAdjustStruct decodeTlv(BaseTLVTy Long maxPower = null; Long minDuration = null; Long maxDuration = null; + Integer cause = null; for (StructElement element: ((StructType)tlvValue).value()) { if (element.contextTagNum() == MIN_POWER_ID) { if (element.value(BaseTLVType.class).type() == TLVType.Int) { @@ -7986,13 +7992,19 @@ public static DeviceEnergyManagementClusterPowerAdjustStruct decodeTlv(BaseTLVTy UIntType castingValue = element.value(UIntType.class); maxDuration = castingValue.value(Long.class); } + } else if (element.contextTagNum() == CAUSE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + cause = castingValue.value(Integer.class); + } } } return new DeviceEnergyManagementClusterPowerAdjustStruct( minPower, maxPower, minDuration, - maxDuration + maxDuration, + cause ); } @@ -8012,13 +8024,16 @@ public String toString() { output.append("\tmaxDuration: "); output.append(maxDuration); output.append("\n"); + output.append("\tcause: "); + output.append(cause); + output.append("\n"); output.append("}\n"); return output.toString(); } } public static class DeviceEnergyManagementClusterSlotAdjustmentStruct { public Integer slotIndex; - public Long nominalPower; + public Optional nominalPower; public Long duration; private static final long SLOT_INDEX_ID = 0L; private static final long NOMINAL_POWER_ID = 1L; @@ -8026,7 +8041,7 @@ public static class DeviceEnergyManagementClusterSlotAdjustmentStruct { public DeviceEnergyManagementClusterSlotAdjustmentStruct( Integer slotIndex, - Long nominalPower, + Optional nominalPower, Long duration ) { this.slotIndex = slotIndex; @@ -8037,7 +8052,7 @@ public DeviceEnergyManagementClusterSlotAdjustmentStruct( public StructType encodeTlv() { ArrayList values = new ArrayList<>(); values.add(new StructElement(SLOT_INDEX_ID, new UIntType(slotIndex))); - values.add(new StructElement(NOMINAL_POWER_ID, new IntType(nominalPower))); + values.add(new StructElement(NOMINAL_POWER_ID, nominalPower.map((nonOptionalnominalPower) -> new IntType(nonOptionalnominalPower)).orElse(new EmptyType()))); values.add(new StructElement(DURATION_ID, new UIntType(duration))); return new StructType(values); @@ -8048,7 +8063,7 @@ public static DeviceEnergyManagementClusterSlotAdjustmentStruct decodeTlv(BaseTL return null; } Integer slotIndex = null; - Long nominalPower = null; + Optional nominalPower = Optional.empty(); Long duration = null; for (StructElement element: ((StructType)tlvValue).value()) { if (element.contextTagNum() == SLOT_INDEX_ID) { @@ -8059,7 +8074,7 @@ public static DeviceEnergyManagementClusterSlotAdjustmentStruct decodeTlv(BaseTL } else if (element.contextTagNum() == NOMINAL_POWER_ID) { if (element.value(BaseTLVType.class).type() == TLVType.Int) { IntType castingValue = element.value(IntType.class); - nominalPower = castingValue.value(Long.class); + nominalPower = Optional.of(castingValue.value(Long.class)); } } else if (element.contextTagNum() == DURATION_ID) { if (element.value(BaseTLVType.class).type() == TLVType.UInt) { @@ -8169,14 +8184,14 @@ public String toString() { } } public static class EnergyEvseClusterChargingTargetScheduleStruct { - public Integer dayOfWeekForSequence; - public ArrayList chargingTargets; + public Optional dayOfWeekForSequence; + public Optional> chargingTargets; private static final long DAY_OF_WEEK_FOR_SEQUENCE_ID = 0L; private static final long CHARGING_TARGETS_ID = 1L; public EnergyEvseClusterChargingTargetScheduleStruct( - Integer dayOfWeekForSequence, - ArrayList chargingTargets + Optional dayOfWeekForSequence, + Optional> chargingTargets ) { this.dayOfWeekForSequence = dayOfWeekForSequence; this.chargingTargets = chargingTargets; @@ -8184,8 +8199,8 @@ public EnergyEvseClusterChargingTargetScheduleStruct( public StructType encodeTlv() { ArrayList values = new ArrayList<>(); - values.add(new StructElement(DAY_OF_WEEK_FOR_SEQUENCE_ID, new UIntType(dayOfWeekForSequence))); - values.add(new StructElement(CHARGING_TARGETS_ID, ArrayType.generateArrayType(chargingTargets, (elementchargingTargets) -> elementchargingTargets.encodeTlv()))); + values.add(new StructElement(DAY_OF_WEEK_FOR_SEQUENCE_ID, dayOfWeekForSequence.map((nonOptionaldayOfWeekForSequence) -> new UIntType(nonOptionaldayOfWeekForSequence)).orElse(new EmptyType()))); + values.add(new StructElement(CHARGING_TARGETS_ID, chargingTargets.map((nonOptionalchargingTargets) -> ArrayType.generateArrayType(nonOptionalchargingTargets, (elementnonOptionalchargingTargets) -> elementnonOptionalchargingTargets.encodeTlv())).orElse(new EmptyType()))); return new StructType(values); } @@ -8194,18 +8209,18 @@ public static EnergyEvseClusterChargingTargetScheduleStruct decodeTlv(BaseTLVTyp if (tlvValue == null || tlvValue.type() != TLVType.Struct) { return null; } - Integer dayOfWeekForSequence = null; - ArrayList chargingTargets = null; + Optional dayOfWeekForSequence = Optional.empty(); + Optional> chargingTargets = Optional.empty(); for (StructElement element: ((StructType)tlvValue).value()) { if (element.contextTagNum() == DAY_OF_WEEK_FOR_SEQUENCE_ID) { if (element.value(BaseTLVType.class).type() == TLVType.UInt) { UIntType castingValue = element.value(UIntType.class); - dayOfWeekForSequence = castingValue.value(Integer.class); + dayOfWeekForSequence = Optional.of(castingValue.value(Integer.class)); } } else if (element.contextTagNum() == CHARGING_TARGETS_ID) { if (element.value(BaseTLVType.class).type() == TLVType.Array) { ArrayType castingValue = element.value(ArrayType.class); - chargingTargets = castingValue.map((elementcastingValue) -> ChipStructs.EnergyEvseClusterChargingTargetStruct.decodeTlv(elementcastingValue)); + chargingTargets = Optional.of(castingValue.map((elementcastingValue) -> ChipStructs.EnergyEvseClusterChargingTargetStruct.decodeTlv(elementcastingValue))); } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/EnergyEvseClusterEnergyTransferStartedEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/EnergyEvseClusterEnergyTransferStartedEvent.kt index 7843215518c11d..359feeafbf4c0a 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/EnergyEvseClusterEnergyTransferStartedEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/EnergyEvseClusterEnergyTransferStartedEvent.kt @@ -17,6 +17,7 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* +import java.util.Optional import matter.tlv.ContextSpecificTag import matter.tlv.Tag import matter.tlv.TlvReader @@ -25,13 +26,15 @@ import matter.tlv.TlvWriter class EnergyEvseClusterEnergyTransferStartedEvent( val sessionID: ULong, val state: UInt, - val maximumCurrent: Long + val maximumCurrent: Long, + val maximumDischargingCurrent: Optional ) { override fun toString(): String = buildString { append("EnergyEvseClusterEnergyTransferStartedEvent {\n") append("\tsessionID : $sessionID\n") append("\tstate : $state\n") append("\tmaximumCurrent : $maximumCurrent\n") + append("\tmaximumDischargingCurrent : $maximumDischargingCurrent\n") append("}\n") } @@ -41,6 +44,10 @@ class EnergyEvseClusterEnergyTransferStartedEvent( put(ContextSpecificTag(TAG_SESSION_I_D), sessionID) put(ContextSpecificTag(TAG_STATE), state) put(ContextSpecificTag(TAG_MAXIMUM_CURRENT), maximumCurrent) + if (maximumDischargingCurrent.isPresent) { + val optmaximumDischargingCurrent = maximumDischargingCurrent.get() + put(ContextSpecificTag(TAG_MAXIMUM_DISCHARGING_CURRENT), optmaximumDischargingCurrent) + } endStructure() } } @@ -49,16 +56,28 @@ class EnergyEvseClusterEnergyTransferStartedEvent( private const val TAG_SESSION_I_D = 0 private const val TAG_STATE = 1 private const val TAG_MAXIMUM_CURRENT = 2 + private const val TAG_MAXIMUM_DISCHARGING_CURRENT = 3 fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): EnergyEvseClusterEnergyTransferStartedEvent { tlvReader.enterStructure(tlvTag) val sessionID = tlvReader.getULong(ContextSpecificTag(TAG_SESSION_I_D)) val state = tlvReader.getUInt(ContextSpecificTag(TAG_STATE)) val maximumCurrent = tlvReader.getLong(ContextSpecificTag(TAG_MAXIMUM_CURRENT)) + val maximumDischargingCurrent = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_MAXIMUM_DISCHARGING_CURRENT))) { + Optional.of(tlvReader.getLong(ContextSpecificTag(TAG_MAXIMUM_DISCHARGING_CURRENT))) + } else { + Optional.empty() + } tlvReader.exitContainer() - return EnergyEvseClusterEnergyTransferStartedEvent(sessionID, state, maximumCurrent) + return EnergyEvseClusterEnergyTransferStartedEvent( + sessionID, + state, + maximumCurrent, + maximumDischargingCurrent + ) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/EnergyEvseClusterEnergyTransferStoppedEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/EnergyEvseClusterEnergyTransferStoppedEvent.kt index 642bbc9b5e7a04..e7cac46aa15056 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/EnergyEvseClusterEnergyTransferStoppedEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/EnergyEvseClusterEnergyTransferStoppedEvent.kt @@ -17,6 +17,7 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* +import java.util.Optional import matter.tlv.ContextSpecificTag import matter.tlv.Tag import matter.tlv.TlvReader @@ -26,7 +27,8 @@ class EnergyEvseClusterEnergyTransferStoppedEvent( val sessionID: ULong, val state: UInt, val reason: UInt, - val energyTransferred: Long + val energyTransferred: Long, + val energyDischarged: Optional ) { override fun toString(): String = buildString { append("EnergyEvseClusterEnergyTransferStoppedEvent {\n") @@ -34,6 +36,7 @@ class EnergyEvseClusterEnergyTransferStoppedEvent( append("\tstate : $state\n") append("\treason : $reason\n") append("\tenergyTransferred : $energyTransferred\n") + append("\tenergyDischarged : $energyDischarged\n") append("}\n") } @@ -44,6 +47,10 @@ class EnergyEvseClusterEnergyTransferStoppedEvent( put(ContextSpecificTag(TAG_STATE), state) put(ContextSpecificTag(TAG_REASON), reason) put(ContextSpecificTag(TAG_ENERGY_TRANSFERRED), energyTransferred) + if (energyDischarged.isPresent) { + val optenergyDischarged = energyDischarged.get() + put(ContextSpecificTag(TAG_ENERGY_DISCHARGED), optenergyDischarged) + } endStructure() } } @@ -53,6 +60,7 @@ class EnergyEvseClusterEnergyTransferStoppedEvent( private const val TAG_STATE = 1 private const val TAG_REASON = 2 private const val TAG_ENERGY_TRANSFERRED = 4 + private const val TAG_ENERGY_DISCHARGED = 5 fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): EnergyEvseClusterEnergyTransferStoppedEvent { tlvReader.enterStructure(tlvTag) @@ -60,6 +68,12 @@ class EnergyEvseClusterEnergyTransferStoppedEvent( val state = tlvReader.getUInt(ContextSpecificTag(TAG_STATE)) val reason = tlvReader.getUInt(ContextSpecificTag(TAG_REASON)) val energyTransferred = tlvReader.getLong(ContextSpecificTag(TAG_ENERGY_TRANSFERRED)) + val energyDischarged = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_ENERGY_DISCHARGED))) { + Optional.of(tlvReader.getLong(ContextSpecificTag(TAG_ENERGY_DISCHARGED))) + } else { + Optional.empty() + } tlvReader.exitContainer() @@ -67,7 +81,8 @@ class EnergyEvseClusterEnergyTransferStoppedEvent( sessionID, state, reason, - energyTransferred + energyTransferred, + energyDischarged ) } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DeviceEnergyManagementClusterForecastStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DeviceEnergyManagementClusterForecastStruct.kt index 17e45fa732ea47..35989ede8dc1a8 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DeviceEnergyManagementClusterForecastStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DeviceEnergyManagementClusterForecastStruct.kt @@ -25,13 +25,13 @@ import matter.tlv.TlvReader import matter.tlv.TlvWriter class DeviceEnergyManagementClusterForecastStruct( - val forecastId: UInt, + val forecastId: ULong, val activeSlotNumber: UInt?, val startTime: ULong, val endTime: ULong, val earliestStartTime: Optional?, val latestEndTime: Optional, - val isPauseable: Boolean, + val isPausable: Boolean, val slots: List, val forecastUpdateReason: UInt ) { @@ -43,7 +43,7 @@ class DeviceEnergyManagementClusterForecastStruct( append("\tendTime : $endTime\n") append("\tearliestStartTime : $earliestStartTime\n") append("\tlatestEndTime : $latestEndTime\n") - append("\tisPauseable : $isPauseable\n") + append("\tisPausable : $isPausable\n") append("\tslots : $slots\n") append("\tforecastUpdateReason : $forecastUpdateReason\n") append("}\n") @@ -72,7 +72,7 @@ class DeviceEnergyManagementClusterForecastStruct( val optlatestEndTime = latestEndTime.get() put(ContextSpecificTag(TAG_LATEST_END_TIME), optlatestEndTime) } - put(ContextSpecificTag(TAG_IS_PAUSEABLE), isPauseable) + put(ContextSpecificTag(TAG_IS_PAUSABLE), isPausable) startArray(ContextSpecificTag(TAG_SLOTS)) for (item in slots.iterator()) { item.toTlv(AnonymousTag, this) @@ -90,13 +90,13 @@ class DeviceEnergyManagementClusterForecastStruct( private const val TAG_END_TIME = 3 private const val TAG_EARLIEST_START_TIME = 4 private const val TAG_LATEST_END_TIME = 5 - private const val TAG_IS_PAUSEABLE = 6 + private const val TAG_IS_PAUSABLE = 6 private const val TAG_SLOTS = 7 private const val TAG_FORECAST_UPDATE_REASON = 8 fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): DeviceEnergyManagementClusterForecastStruct { tlvReader.enterStructure(tlvTag) - val forecastId = tlvReader.getUInt(ContextSpecificTag(TAG_FORECAST_ID)) + val forecastId = tlvReader.getULong(ContextSpecificTag(TAG_FORECAST_ID)) val activeSlotNumber = if (!tlvReader.isNull()) { tlvReader.getUInt(ContextSpecificTag(TAG_ACTIVE_SLOT_NUMBER)) @@ -123,7 +123,7 @@ class DeviceEnergyManagementClusterForecastStruct( } else { Optional.empty() } - val isPauseable = tlvReader.getBoolean(ContextSpecificTag(TAG_IS_PAUSEABLE)) + val isPausable = tlvReader.getBoolean(ContextSpecificTag(TAG_IS_PAUSABLE)) val slots = buildList { tlvReader.enterArray(ContextSpecificTag(TAG_SLOTS)) @@ -143,7 +143,7 @@ class DeviceEnergyManagementClusterForecastStruct( endTime, earliestStartTime, latestEndTime, - isPauseable, + isPausable, slots, forecastUpdateReason ) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DeviceEnergyManagementClusterPowerAdjustStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DeviceEnergyManagementClusterPowerAdjustStruct.kt index 7021aa2720949e..d00201e7402bcb 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DeviceEnergyManagementClusterPowerAdjustStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DeviceEnergyManagementClusterPowerAdjustStruct.kt @@ -26,7 +26,8 @@ class DeviceEnergyManagementClusterPowerAdjustStruct( val minPower: Long, val maxPower: Long, val minDuration: ULong, - val maxDuration: ULong + val maxDuration: ULong, + val cause: UInt ) { override fun toString(): String = buildString { append("DeviceEnergyManagementClusterPowerAdjustStruct {\n") @@ -34,6 +35,7 @@ class DeviceEnergyManagementClusterPowerAdjustStruct( append("\tmaxPower : $maxPower\n") append("\tminDuration : $minDuration\n") append("\tmaxDuration : $maxDuration\n") + append("\tcause : $cause\n") append("}\n") } @@ -44,6 +46,7 @@ class DeviceEnergyManagementClusterPowerAdjustStruct( put(ContextSpecificTag(TAG_MAX_POWER), maxPower) put(ContextSpecificTag(TAG_MIN_DURATION), minDuration) put(ContextSpecificTag(TAG_MAX_DURATION), maxDuration) + put(ContextSpecificTag(TAG_CAUSE), cause) endStructure() } } @@ -53,6 +56,7 @@ class DeviceEnergyManagementClusterPowerAdjustStruct( private const val TAG_MAX_POWER = 1 private const val TAG_MIN_DURATION = 2 private const val TAG_MAX_DURATION = 3 + private const val TAG_CAUSE = 4 fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): DeviceEnergyManagementClusterPowerAdjustStruct { tlvReader.enterStructure(tlvTag) @@ -60,6 +64,7 @@ class DeviceEnergyManagementClusterPowerAdjustStruct( val maxPower = tlvReader.getLong(ContextSpecificTag(TAG_MAX_POWER)) val minDuration = tlvReader.getULong(ContextSpecificTag(TAG_MIN_DURATION)) val maxDuration = tlvReader.getULong(ContextSpecificTag(TAG_MAX_DURATION)) + val cause = tlvReader.getUInt(ContextSpecificTag(TAG_CAUSE)) tlvReader.exitContainer() @@ -67,7 +72,8 @@ class DeviceEnergyManagementClusterPowerAdjustStruct( minPower, maxPower, minDuration, - maxDuration + maxDuration, + cause ) } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DeviceEnergyManagementClusterSlotAdjustmentStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DeviceEnergyManagementClusterSlotAdjustmentStruct.kt index 11fcf975e99039..22aa9bdae17234 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DeviceEnergyManagementClusterSlotAdjustmentStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DeviceEnergyManagementClusterSlotAdjustmentStruct.kt @@ -17,6 +17,7 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* +import java.util.Optional import matter.tlv.ContextSpecificTag import matter.tlv.Tag import matter.tlv.TlvReader @@ -24,7 +25,7 @@ import matter.tlv.TlvWriter class DeviceEnergyManagementClusterSlotAdjustmentStruct( val slotIndex: UInt, - val nominalPower: Long, + val nominalPower: Optional, val duration: ULong ) { override fun toString(): String = buildString { @@ -39,7 +40,10 @@ class DeviceEnergyManagementClusterSlotAdjustmentStruct( tlvWriter.apply { startStructure(tlvTag) put(ContextSpecificTag(TAG_SLOT_INDEX), slotIndex) - put(ContextSpecificTag(TAG_NOMINAL_POWER), nominalPower) + if (nominalPower.isPresent) { + val optnominalPower = nominalPower.get() + put(ContextSpecificTag(TAG_NOMINAL_POWER), optnominalPower) + } put(ContextSpecificTag(TAG_DURATION), duration) endStructure() } @@ -56,7 +60,12 @@ class DeviceEnergyManagementClusterSlotAdjustmentStruct( ): DeviceEnergyManagementClusterSlotAdjustmentStruct { tlvReader.enterStructure(tlvTag) val slotIndex = tlvReader.getUInt(ContextSpecificTag(TAG_SLOT_INDEX)) - val nominalPower = tlvReader.getLong(ContextSpecificTag(TAG_NOMINAL_POWER)) + val nominalPower = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_NOMINAL_POWER))) { + Optional.of(tlvReader.getLong(ContextSpecificTag(TAG_NOMINAL_POWER))) + } else { + Optional.empty() + } val duration = tlvReader.getULong(ContextSpecificTag(TAG_DURATION)) tlvReader.exitContainer() diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DeviceEnergyManagementClusterSlotStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DeviceEnergyManagementClusterSlotStruct.kt index 18759432dc2ce4..f6d35be87d59f3 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DeviceEnergyManagementClusterSlotStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DeviceEnergyManagementClusterSlotStruct.kt @@ -30,7 +30,7 @@ class DeviceEnergyManagementClusterSlotStruct( val defaultDuration: ULong, val elapsedSlotTime: ULong, val remainingSlotTime: ULong, - val slotIsPauseable: Optional, + val slotIsPausable: Optional, val minPauseDuration: Optional, val maxPauseDuration: Optional, val manufacturerESAState: Optional, @@ -51,7 +51,7 @@ class DeviceEnergyManagementClusterSlotStruct( append("\tdefaultDuration : $defaultDuration\n") append("\telapsedSlotTime : $elapsedSlotTime\n") append("\tremainingSlotTime : $remainingSlotTime\n") - append("\tslotIsPauseable : $slotIsPauseable\n") + append("\tslotIsPausable : $slotIsPausable\n") append("\tminPauseDuration : $minPauseDuration\n") append("\tmaxPauseDuration : $maxPauseDuration\n") append("\tmanufacturerESAState : $manufacturerESAState\n") @@ -75,9 +75,9 @@ class DeviceEnergyManagementClusterSlotStruct( put(ContextSpecificTag(TAG_DEFAULT_DURATION), defaultDuration) put(ContextSpecificTag(TAG_ELAPSED_SLOT_TIME), elapsedSlotTime) put(ContextSpecificTag(TAG_REMAINING_SLOT_TIME), remainingSlotTime) - if (slotIsPauseable.isPresent) { - val optslotIsPauseable = slotIsPauseable.get() - put(ContextSpecificTag(TAG_SLOT_IS_PAUSEABLE), optslotIsPauseable) + if (slotIsPausable.isPresent) { + val optslotIsPausable = slotIsPausable.get() + put(ContextSpecificTag(TAG_SLOT_IS_PAUSABLE), optslotIsPausable) } if (minPauseDuration.isPresent) { val optminPauseDuration = minPauseDuration.get() @@ -141,7 +141,7 @@ class DeviceEnergyManagementClusterSlotStruct( private const val TAG_DEFAULT_DURATION = 2 private const val TAG_ELAPSED_SLOT_TIME = 3 private const val TAG_REMAINING_SLOT_TIME = 4 - private const val TAG_SLOT_IS_PAUSEABLE = 5 + private const val TAG_SLOT_IS_PAUSABLE = 5 private const val TAG_MIN_PAUSE_DURATION = 6 private const val TAG_MAX_PAUSE_DURATION = 7 private const val TAG_MANUFACTURER_E_S_A_STATE = 8 @@ -162,9 +162,9 @@ class DeviceEnergyManagementClusterSlotStruct( val defaultDuration = tlvReader.getULong(ContextSpecificTag(TAG_DEFAULT_DURATION)) val elapsedSlotTime = tlvReader.getULong(ContextSpecificTag(TAG_ELAPSED_SLOT_TIME)) val remainingSlotTime = tlvReader.getULong(ContextSpecificTag(TAG_REMAINING_SLOT_TIME)) - val slotIsPauseable = - if (tlvReader.isNextTag(ContextSpecificTag(TAG_SLOT_IS_PAUSEABLE))) { - Optional.of(tlvReader.getBoolean(ContextSpecificTag(TAG_SLOT_IS_PAUSEABLE))) + val slotIsPausable = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_SLOT_IS_PAUSABLE))) { + Optional.of(tlvReader.getBoolean(ContextSpecificTag(TAG_SLOT_IS_PAUSABLE))) } else { Optional.empty() } @@ -257,7 +257,7 @@ class DeviceEnergyManagementClusterSlotStruct( defaultDuration, elapsedSlotTime, remainingSlotTime, - slotIsPauseable, + slotIsPausable, minPauseDuration, maxPauseDuration, manufacturerESAState, diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/EnergyEvseClusterChargingTargetScheduleStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/EnergyEvseClusterChargingTargetScheduleStruct.kt index bddc2563640620..2cff1004099c89 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/EnergyEvseClusterChargingTargetScheduleStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/EnergyEvseClusterChargingTargetScheduleStruct.kt @@ -17,6 +17,7 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* +import java.util.Optional import matter.tlv.AnonymousTag import matter.tlv.ContextSpecificTag import matter.tlv.Tag @@ -24,8 +25,8 @@ import matter.tlv.TlvReader import matter.tlv.TlvWriter class EnergyEvseClusterChargingTargetScheduleStruct( - val dayOfWeekForSequence: UInt, - val chargingTargets: List + val dayOfWeekForSequence: Optional, + val chargingTargets: Optional> ) { override fun toString(): String = buildString { append("EnergyEvseClusterChargingTargetScheduleStruct {\n") @@ -37,12 +38,18 @@ class EnergyEvseClusterChargingTargetScheduleStruct( fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { tlvWriter.apply { startStructure(tlvTag) - put(ContextSpecificTag(TAG_DAY_OF_WEEK_FOR_SEQUENCE), dayOfWeekForSequence) - startArray(ContextSpecificTag(TAG_CHARGING_TARGETS)) - for (item in chargingTargets.iterator()) { - item.toTlv(AnonymousTag, this) + if (dayOfWeekForSequence.isPresent) { + val optdayOfWeekForSequence = dayOfWeekForSequence.get() + put(ContextSpecificTag(TAG_DAY_OF_WEEK_FOR_SEQUENCE), optdayOfWeekForSequence) + } + if (chargingTargets.isPresent) { + val optchargingTargets = chargingTargets.get() + startArray(ContextSpecificTag(TAG_CHARGING_TARGETS)) + for (item in optchargingTargets.iterator()) { + item.toTlv(AnonymousTag, this) + } + endArray() } - endArray() endStructure() } } @@ -53,14 +60,25 @@ class EnergyEvseClusterChargingTargetScheduleStruct( fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): EnergyEvseClusterChargingTargetScheduleStruct { tlvReader.enterStructure(tlvTag) - val dayOfWeekForSequence = tlvReader.getUInt(ContextSpecificTag(TAG_DAY_OF_WEEK_FOR_SEQUENCE)) + val dayOfWeekForSequence = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_DAY_OF_WEEK_FOR_SEQUENCE))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_DAY_OF_WEEK_FOR_SEQUENCE))) + } else { + Optional.empty() + } val chargingTargets = - buildList { - tlvReader.enterArray(ContextSpecificTag(TAG_CHARGING_TARGETS)) - while (!tlvReader.isEndOfContainer()) { - add(EnergyEvseClusterChargingTargetStruct.fromTlv(AnonymousTag, tlvReader)) - } - tlvReader.exitContainer() + if (tlvReader.isNextTag(ContextSpecificTag(TAG_CHARGING_TARGETS))) { + Optional.of( + buildList { + tlvReader.enterArray(ContextSpecificTag(TAG_CHARGING_TARGETS)) + while (!tlvReader.isEndOfContainer()) { + add(EnergyEvseClusterChargingTargetStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + ) + } else { + Optional.empty() } tlvReader.exitContainer() diff --git a/src/controller/java/generated/java/matter/controller/cluster/eventstructs/EnergyEvseClusterEnergyTransferStartedEvent.kt b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/EnergyEvseClusterEnergyTransferStartedEvent.kt index 0cd20e3e47ade3..db2b2513c826c4 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/eventstructs/EnergyEvseClusterEnergyTransferStartedEvent.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/EnergyEvseClusterEnergyTransferStartedEvent.kt @@ -16,6 +16,7 @@ */ package matter.controller.cluster.eventstructs +import java.util.Optional import matter.controller.cluster.* import matter.tlv.ContextSpecificTag import matter.tlv.Tag @@ -25,13 +26,15 @@ import matter.tlv.TlvWriter class EnergyEvseClusterEnergyTransferStartedEvent( val sessionID: UInt, val state: UByte, - val maximumCurrent: Long + val maximumCurrent: Long, + val maximumDischargingCurrent: Optional ) { override fun toString(): String = buildString { append("EnergyEvseClusterEnergyTransferStartedEvent {\n") append("\tsessionID : $sessionID\n") append("\tstate : $state\n") append("\tmaximumCurrent : $maximumCurrent\n") + append("\tmaximumDischargingCurrent : $maximumDischargingCurrent\n") append("}\n") } @@ -41,6 +44,10 @@ class EnergyEvseClusterEnergyTransferStartedEvent( put(ContextSpecificTag(TAG_SESSION_I_D), sessionID) put(ContextSpecificTag(TAG_STATE), state) put(ContextSpecificTag(TAG_MAXIMUM_CURRENT), maximumCurrent) + if (maximumDischargingCurrent.isPresent) { + val optmaximumDischargingCurrent = maximumDischargingCurrent.get() + put(ContextSpecificTag(TAG_MAXIMUM_DISCHARGING_CURRENT), optmaximumDischargingCurrent) + } endStructure() } } @@ -49,16 +56,28 @@ class EnergyEvseClusterEnergyTransferStartedEvent( private const val TAG_SESSION_I_D = 0 private const val TAG_STATE = 1 private const val TAG_MAXIMUM_CURRENT = 2 + private const val TAG_MAXIMUM_DISCHARGING_CURRENT = 3 fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): EnergyEvseClusterEnergyTransferStartedEvent { tlvReader.enterStructure(tlvTag) val sessionID = tlvReader.getUInt(ContextSpecificTag(TAG_SESSION_I_D)) val state = tlvReader.getUByte(ContextSpecificTag(TAG_STATE)) val maximumCurrent = tlvReader.getLong(ContextSpecificTag(TAG_MAXIMUM_CURRENT)) + val maximumDischargingCurrent = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_MAXIMUM_DISCHARGING_CURRENT))) { + Optional.of(tlvReader.getLong(ContextSpecificTag(TAG_MAXIMUM_DISCHARGING_CURRENT))) + } else { + Optional.empty() + } tlvReader.exitContainer() - return EnergyEvseClusterEnergyTransferStartedEvent(sessionID, state, maximumCurrent) + return EnergyEvseClusterEnergyTransferStartedEvent( + sessionID, + state, + maximumCurrent, + maximumDischargingCurrent + ) } } } diff --git a/src/controller/java/generated/java/matter/controller/cluster/eventstructs/EnergyEvseClusterEnergyTransferStoppedEvent.kt b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/EnergyEvseClusterEnergyTransferStoppedEvent.kt index 093f687fb16662..f31dd3ffeab267 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/eventstructs/EnergyEvseClusterEnergyTransferStoppedEvent.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/EnergyEvseClusterEnergyTransferStoppedEvent.kt @@ -16,6 +16,7 @@ */ package matter.controller.cluster.eventstructs +import java.util.Optional import matter.controller.cluster.* import matter.tlv.ContextSpecificTag import matter.tlv.Tag @@ -26,7 +27,8 @@ class EnergyEvseClusterEnergyTransferStoppedEvent( val sessionID: UInt, val state: UByte, val reason: UByte, - val energyTransferred: Long + val energyTransferred: Long, + val energyDischarged: Optional ) { override fun toString(): String = buildString { append("EnergyEvseClusterEnergyTransferStoppedEvent {\n") @@ -34,6 +36,7 @@ class EnergyEvseClusterEnergyTransferStoppedEvent( append("\tstate : $state\n") append("\treason : $reason\n") append("\tenergyTransferred : $energyTransferred\n") + append("\tenergyDischarged : $energyDischarged\n") append("}\n") } @@ -44,6 +47,10 @@ class EnergyEvseClusterEnergyTransferStoppedEvent( put(ContextSpecificTag(TAG_STATE), state) put(ContextSpecificTag(TAG_REASON), reason) put(ContextSpecificTag(TAG_ENERGY_TRANSFERRED), energyTransferred) + if (energyDischarged.isPresent) { + val optenergyDischarged = energyDischarged.get() + put(ContextSpecificTag(TAG_ENERGY_DISCHARGED), optenergyDischarged) + } endStructure() } } @@ -53,6 +60,7 @@ class EnergyEvseClusterEnergyTransferStoppedEvent( private const val TAG_STATE = 1 private const val TAG_REASON = 2 private const val TAG_ENERGY_TRANSFERRED = 4 + private const val TAG_ENERGY_DISCHARGED = 5 fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): EnergyEvseClusterEnergyTransferStoppedEvent { tlvReader.enterStructure(tlvTag) @@ -60,6 +68,12 @@ class EnergyEvseClusterEnergyTransferStoppedEvent( val state = tlvReader.getUByte(ContextSpecificTag(TAG_STATE)) val reason = tlvReader.getUByte(ContextSpecificTag(TAG_REASON)) val energyTransferred = tlvReader.getLong(ContextSpecificTag(TAG_ENERGY_TRANSFERRED)) + val energyDischarged = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_ENERGY_DISCHARGED))) { + Optional.of(tlvReader.getLong(ContextSpecificTag(TAG_ENERGY_DISCHARGED))) + } else { + Optional.empty() + } tlvReader.exitContainer() @@ -67,7 +81,8 @@ class EnergyEvseClusterEnergyTransferStoppedEvent( sessionID, state, reason, - energyTransferred + energyTransferred, + energyDischarged ) } } diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/DeviceEnergyManagementClusterForecastStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/DeviceEnergyManagementClusterForecastStruct.kt index a83d26ee3815d0..95b0d89d05b061 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/structs/DeviceEnergyManagementClusterForecastStruct.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/DeviceEnergyManagementClusterForecastStruct.kt @@ -25,13 +25,13 @@ import matter.tlv.TlvReader import matter.tlv.TlvWriter class DeviceEnergyManagementClusterForecastStruct( - val forecastId: UShort, + val forecastId: UInt, val activeSlotNumber: UShort?, val startTime: UInt, val endTime: UInt, val earliestStartTime: Optional?, val latestEndTime: Optional, - val isPauseable: Boolean, + val isPausable: Boolean, val slots: List, val forecastUpdateReason: UByte ) { @@ -43,7 +43,7 @@ class DeviceEnergyManagementClusterForecastStruct( append("\tendTime : $endTime\n") append("\tearliestStartTime : $earliestStartTime\n") append("\tlatestEndTime : $latestEndTime\n") - append("\tisPauseable : $isPauseable\n") + append("\tisPausable : $isPausable\n") append("\tslots : $slots\n") append("\tforecastUpdateReason : $forecastUpdateReason\n") append("}\n") @@ -72,7 +72,7 @@ class DeviceEnergyManagementClusterForecastStruct( val optlatestEndTime = latestEndTime.get() put(ContextSpecificTag(TAG_LATEST_END_TIME), optlatestEndTime) } - put(ContextSpecificTag(TAG_IS_PAUSEABLE), isPauseable) + put(ContextSpecificTag(TAG_IS_PAUSABLE), isPausable) startArray(ContextSpecificTag(TAG_SLOTS)) for (item in slots.iterator()) { item.toTlv(AnonymousTag, this) @@ -90,13 +90,13 @@ class DeviceEnergyManagementClusterForecastStruct( private const val TAG_END_TIME = 3 private const val TAG_EARLIEST_START_TIME = 4 private const val TAG_LATEST_END_TIME = 5 - private const val TAG_IS_PAUSEABLE = 6 + private const val TAG_IS_PAUSABLE = 6 private const val TAG_SLOTS = 7 private const val TAG_FORECAST_UPDATE_REASON = 8 fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): DeviceEnergyManagementClusterForecastStruct { tlvReader.enterStructure(tlvTag) - val forecastId = tlvReader.getUShort(ContextSpecificTag(TAG_FORECAST_ID)) + val forecastId = tlvReader.getUInt(ContextSpecificTag(TAG_FORECAST_ID)) val activeSlotNumber = if (!tlvReader.isNull()) { tlvReader.getUShort(ContextSpecificTag(TAG_ACTIVE_SLOT_NUMBER)) @@ -123,7 +123,7 @@ class DeviceEnergyManagementClusterForecastStruct( } else { Optional.empty() } - val isPauseable = tlvReader.getBoolean(ContextSpecificTag(TAG_IS_PAUSEABLE)) + val isPausable = tlvReader.getBoolean(ContextSpecificTag(TAG_IS_PAUSABLE)) val slots = buildList { tlvReader.enterArray(ContextSpecificTag(TAG_SLOTS)) @@ -143,7 +143,7 @@ class DeviceEnergyManagementClusterForecastStruct( endTime, earliestStartTime, latestEndTime, - isPauseable, + isPausable, slots, forecastUpdateReason ) diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/DeviceEnergyManagementClusterPowerAdjustStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/DeviceEnergyManagementClusterPowerAdjustStruct.kt index c1822bb573e344..27c0e6451cca3a 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/structs/DeviceEnergyManagementClusterPowerAdjustStruct.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/DeviceEnergyManagementClusterPowerAdjustStruct.kt @@ -26,7 +26,8 @@ class DeviceEnergyManagementClusterPowerAdjustStruct( val minPower: Long, val maxPower: Long, val minDuration: UInt, - val maxDuration: UInt + val maxDuration: UInt, + val cause: UByte ) { override fun toString(): String = buildString { append("DeviceEnergyManagementClusterPowerAdjustStruct {\n") @@ -34,6 +35,7 @@ class DeviceEnergyManagementClusterPowerAdjustStruct( append("\tmaxPower : $maxPower\n") append("\tminDuration : $minDuration\n") append("\tmaxDuration : $maxDuration\n") + append("\tcause : $cause\n") append("}\n") } @@ -44,6 +46,7 @@ class DeviceEnergyManagementClusterPowerAdjustStruct( put(ContextSpecificTag(TAG_MAX_POWER), maxPower) put(ContextSpecificTag(TAG_MIN_DURATION), minDuration) put(ContextSpecificTag(TAG_MAX_DURATION), maxDuration) + put(ContextSpecificTag(TAG_CAUSE), cause) endStructure() } } @@ -53,6 +56,7 @@ class DeviceEnergyManagementClusterPowerAdjustStruct( private const val TAG_MAX_POWER = 1 private const val TAG_MIN_DURATION = 2 private const val TAG_MAX_DURATION = 3 + private const val TAG_CAUSE = 4 fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): DeviceEnergyManagementClusterPowerAdjustStruct { tlvReader.enterStructure(tlvTag) @@ -60,6 +64,7 @@ class DeviceEnergyManagementClusterPowerAdjustStruct( val maxPower = tlvReader.getLong(ContextSpecificTag(TAG_MAX_POWER)) val minDuration = tlvReader.getUInt(ContextSpecificTag(TAG_MIN_DURATION)) val maxDuration = tlvReader.getUInt(ContextSpecificTag(TAG_MAX_DURATION)) + val cause = tlvReader.getUByte(ContextSpecificTag(TAG_CAUSE)) tlvReader.exitContainer() @@ -67,7 +72,8 @@ class DeviceEnergyManagementClusterPowerAdjustStruct( minPower, maxPower, minDuration, - maxDuration + maxDuration, + cause ) } } diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/DeviceEnergyManagementClusterSlotAdjustmentStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/DeviceEnergyManagementClusterSlotAdjustmentStruct.kt index e11febdfd6a489..5d4cef6567816d 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/structs/DeviceEnergyManagementClusterSlotAdjustmentStruct.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/DeviceEnergyManagementClusterSlotAdjustmentStruct.kt @@ -16,6 +16,7 @@ */ package matter.controller.cluster.structs +import java.util.Optional import matter.controller.cluster.* import matter.tlv.ContextSpecificTag import matter.tlv.Tag @@ -24,7 +25,7 @@ import matter.tlv.TlvWriter class DeviceEnergyManagementClusterSlotAdjustmentStruct( val slotIndex: UByte, - val nominalPower: Long, + val nominalPower: Optional, val duration: UInt ) { override fun toString(): String = buildString { @@ -39,7 +40,10 @@ class DeviceEnergyManagementClusterSlotAdjustmentStruct( tlvWriter.apply { startStructure(tlvTag) put(ContextSpecificTag(TAG_SLOT_INDEX), slotIndex) - put(ContextSpecificTag(TAG_NOMINAL_POWER), nominalPower) + if (nominalPower.isPresent) { + val optnominalPower = nominalPower.get() + put(ContextSpecificTag(TAG_NOMINAL_POWER), optnominalPower) + } put(ContextSpecificTag(TAG_DURATION), duration) endStructure() } @@ -56,7 +60,12 @@ class DeviceEnergyManagementClusterSlotAdjustmentStruct( ): DeviceEnergyManagementClusterSlotAdjustmentStruct { tlvReader.enterStructure(tlvTag) val slotIndex = tlvReader.getUByte(ContextSpecificTag(TAG_SLOT_INDEX)) - val nominalPower = tlvReader.getLong(ContextSpecificTag(TAG_NOMINAL_POWER)) + val nominalPower = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_NOMINAL_POWER))) { + Optional.of(tlvReader.getLong(ContextSpecificTag(TAG_NOMINAL_POWER))) + } else { + Optional.empty() + } val duration = tlvReader.getUInt(ContextSpecificTag(TAG_DURATION)) tlvReader.exitContainer() diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/DeviceEnergyManagementClusterSlotStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/DeviceEnergyManagementClusterSlotStruct.kt index 992a41573e295e..7759d960c31fde 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/structs/DeviceEnergyManagementClusterSlotStruct.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/DeviceEnergyManagementClusterSlotStruct.kt @@ -30,7 +30,7 @@ class DeviceEnergyManagementClusterSlotStruct( val defaultDuration: UInt, val elapsedSlotTime: UInt, val remainingSlotTime: UInt, - val slotIsPauseable: Optional, + val slotIsPausable: Optional, val minPauseDuration: Optional, val maxPauseDuration: Optional, val manufacturerESAState: Optional, @@ -51,7 +51,7 @@ class DeviceEnergyManagementClusterSlotStruct( append("\tdefaultDuration : $defaultDuration\n") append("\telapsedSlotTime : $elapsedSlotTime\n") append("\tremainingSlotTime : $remainingSlotTime\n") - append("\tslotIsPauseable : $slotIsPauseable\n") + append("\tslotIsPausable : $slotIsPausable\n") append("\tminPauseDuration : $minPauseDuration\n") append("\tmaxPauseDuration : $maxPauseDuration\n") append("\tmanufacturerESAState : $manufacturerESAState\n") @@ -75,9 +75,9 @@ class DeviceEnergyManagementClusterSlotStruct( put(ContextSpecificTag(TAG_DEFAULT_DURATION), defaultDuration) put(ContextSpecificTag(TAG_ELAPSED_SLOT_TIME), elapsedSlotTime) put(ContextSpecificTag(TAG_REMAINING_SLOT_TIME), remainingSlotTime) - if (slotIsPauseable.isPresent) { - val optslotIsPauseable = slotIsPauseable.get() - put(ContextSpecificTag(TAG_SLOT_IS_PAUSEABLE), optslotIsPauseable) + if (slotIsPausable.isPresent) { + val optslotIsPausable = slotIsPausable.get() + put(ContextSpecificTag(TAG_SLOT_IS_PAUSABLE), optslotIsPausable) } if (minPauseDuration.isPresent) { val optminPauseDuration = minPauseDuration.get() @@ -141,7 +141,7 @@ class DeviceEnergyManagementClusterSlotStruct( private const val TAG_DEFAULT_DURATION = 2 private const val TAG_ELAPSED_SLOT_TIME = 3 private const val TAG_REMAINING_SLOT_TIME = 4 - private const val TAG_SLOT_IS_PAUSEABLE = 5 + private const val TAG_SLOT_IS_PAUSABLE = 5 private const val TAG_MIN_PAUSE_DURATION = 6 private const val TAG_MAX_PAUSE_DURATION = 7 private const val TAG_MANUFACTURER_E_S_A_STATE = 8 @@ -162,9 +162,9 @@ class DeviceEnergyManagementClusterSlotStruct( val defaultDuration = tlvReader.getUInt(ContextSpecificTag(TAG_DEFAULT_DURATION)) val elapsedSlotTime = tlvReader.getUInt(ContextSpecificTag(TAG_ELAPSED_SLOT_TIME)) val remainingSlotTime = tlvReader.getUInt(ContextSpecificTag(TAG_REMAINING_SLOT_TIME)) - val slotIsPauseable = - if (tlvReader.isNextTag(ContextSpecificTag(TAG_SLOT_IS_PAUSEABLE))) { - Optional.of(tlvReader.getBoolean(ContextSpecificTag(TAG_SLOT_IS_PAUSEABLE))) + val slotIsPausable = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_SLOT_IS_PAUSABLE))) { + Optional.of(tlvReader.getBoolean(ContextSpecificTag(TAG_SLOT_IS_PAUSABLE))) } else { Optional.empty() } @@ -257,7 +257,7 @@ class DeviceEnergyManagementClusterSlotStruct( defaultDuration, elapsedSlotTime, remainingSlotTime, - slotIsPauseable, + slotIsPausable, minPauseDuration, maxPauseDuration, manufacturerESAState, diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/EnergyEvseClusterChargingTargetScheduleStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/EnergyEvseClusterChargingTargetScheduleStruct.kt index eaa06f527c652f..417b0657103494 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/structs/EnergyEvseClusterChargingTargetScheduleStruct.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/EnergyEvseClusterChargingTargetScheduleStruct.kt @@ -16,6 +16,7 @@ */ package matter.controller.cluster.structs +import java.util.Optional import matter.controller.cluster.* import matter.tlv.AnonymousTag import matter.tlv.ContextSpecificTag @@ -24,8 +25,8 @@ import matter.tlv.TlvReader import matter.tlv.TlvWriter class EnergyEvseClusterChargingTargetScheduleStruct( - val dayOfWeekForSequence: UByte, - val chargingTargets: List + val dayOfWeekForSequence: Optional, + val chargingTargets: Optional> ) { override fun toString(): String = buildString { append("EnergyEvseClusterChargingTargetScheduleStruct {\n") @@ -37,12 +38,18 @@ class EnergyEvseClusterChargingTargetScheduleStruct( fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { tlvWriter.apply { startStructure(tlvTag) - put(ContextSpecificTag(TAG_DAY_OF_WEEK_FOR_SEQUENCE), dayOfWeekForSequence) - startArray(ContextSpecificTag(TAG_CHARGING_TARGETS)) - for (item in chargingTargets.iterator()) { - item.toTlv(AnonymousTag, this) + if (dayOfWeekForSequence.isPresent) { + val optdayOfWeekForSequence = dayOfWeekForSequence.get() + put(ContextSpecificTag(TAG_DAY_OF_WEEK_FOR_SEQUENCE), optdayOfWeekForSequence) + } + if (chargingTargets.isPresent) { + val optchargingTargets = chargingTargets.get() + startArray(ContextSpecificTag(TAG_CHARGING_TARGETS)) + for (item in optchargingTargets.iterator()) { + item.toTlv(AnonymousTag, this) + } + endArray() } - endArray() endStructure() } } @@ -54,14 +61,24 @@ class EnergyEvseClusterChargingTargetScheduleStruct( fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): EnergyEvseClusterChargingTargetScheduleStruct { tlvReader.enterStructure(tlvTag) val dayOfWeekForSequence = - tlvReader.getUByte(ContextSpecificTag(TAG_DAY_OF_WEEK_FOR_SEQUENCE)) + if (tlvReader.isNextTag(ContextSpecificTag(TAG_DAY_OF_WEEK_FOR_SEQUENCE))) { + Optional.of(tlvReader.getUByte(ContextSpecificTag(TAG_DAY_OF_WEEK_FOR_SEQUENCE))) + } else { + Optional.empty() + } val chargingTargets = - buildList { - tlvReader.enterArray(ContextSpecificTag(TAG_CHARGING_TARGETS)) - while (!tlvReader.isEndOfContainer()) { - add(EnergyEvseClusterChargingTargetStruct.fromTlv(AnonymousTag, tlvReader)) - } - tlvReader.exitContainer() + if (tlvReader.isNextTag(ContextSpecificTag(TAG_CHARGING_TARGETS))) { + Optional.of( + buildList { + tlvReader.enterArray(ContextSpecificTag(TAG_CHARGING_TARGETS)) + while (!tlvReader.isEndOfContainer()) { + add(EnergyEvseClusterChargingTargetStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + ) + } else { + Optional.empty() } tlvReader.exitContainer() diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index ff10df38c79f9c..cf25d8d4b2e7b7 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -23476,6 +23476,13 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR chip::JniReferences::GetInstance().CreateBoxedObject( newElement_1_maxDurationClassName.c_str(), newElement_1_maxDurationCtorSignature.c_str(), jninewElement_1_maxDuration, newElement_1_maxDuration); + jobject newElement_1_cause; + std::string newElement_1_causeClassName = "java/lang/Integer"; + std::string newElement_1_causeCtorSignature = "(I)V"; + jint jninewElement_1_cause = static_cast(entry_1.cause); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_1_causeClassName.c_str(), + newElement_1_causeCtorSignature.c_str(), + jninewElement_1_cause, newElement_1_cause); jclass powerAdjustStructStructClass_2; err = chip::JniReferences::GetInstance().GetLocalClassRef( @@ -23490,16 +23497,17 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jmethodID powerAdjustStructStructCtor_2; err = chip::JniReferences::GetInstance().FindMethod( env, powerAdjustStructStructClass_2, "", - "(Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;)V", &powerAdjustStructStructCtor_2); + "(Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Integer;)V", + &powerAdjustStructStructCtor_2); if (err != CHIP_NO_ERROR || powerAdjustStructStructCtor_2 == nullptr) { ChipLogError(Zcl, "Could not find ChipStructs$DeviceEnergyManagementClusterPowerAdjustStruct constructor"); return nullptr; } - newElement_1 = - env->NewObject(powerAdjustStructStructClass_2, powerAdjustStructStructCtor_2, newElement_1_minPower, - newElement_1_maxPower, newElement_1_minDuration, newElement_1_maxDuration); + newElement_1 = env->NewObject(powerAdjustStructStructClass_2, powerAdjustStructStructCtor_2, + newElement_1_minPower, newElement_1_maxPower, newElement_1_minDuration, + newElement_1_maxDuration, newElement_1_cause); chip::JniReferences::GetInstance().AddToList(value, newElement_1); } } @@ -23521,12 +23529,12 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR else { jobject value_forecastId; - std::string value_forecastIdClassName = "java/lang/Integer"; - std::string value_forecastIdCtorSignature = "(I)V"; - jint jnivalue_forecastId = static_cast(cppValue.Value().forecastId); - chip::JniReferences::GetInstance().CreateBoxedObject(value_forecastIdClassName.c_str(), - value_forecastIdCtorSignature.c_str(), - jnivalue_forecastId, value_forecastId); + std::string value_forecastIdClassName = "java/lang/Long"; + std::string value_forecastIdCtorSignature = "(J)V"; + jlong jnivalue_forecastId = static_cast(cppValue.Value().forecastId); + chip::JniReferences::GetInstance().CreateBoxedObject(value_forecastIdClassName.c_str(), + value_forecastIdCtorSignature.c_str(), + jnivalue_forecastId, value_forecastId); jobject value_activeSlotNumber; if (cppValue.Value().activeSlotNumber.IsNull()) { @@ -23595,13 +23603,13 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jnivalue_latestEndTimeInsideOptional, value_latestEndTimeInsideOptional); chip::JniReferences::GetInstance().CreateOptional(value_latestEndTimeInsideOptional, value_latestEndTime); } - jobject value_isPauseable; - std::string value_isPauseableClassName = "java/lang/Boolean"; - std::string value_isPauseableCtorSignature = "(Z)V"; - jboolean jnivalue_isPauseable = static_cast(cppValue.Value().isPauseable); - chip::JniReferences::GetInstance().CreateBoxedObject(value_isPauseableClassName.c_str(), - value_isPauseableCtorSignature.c_str(), - jnivalue_isPauseable, value_isPauseable); + jobject value_isPausable; + std::string value_isPausableClassName = "java/lang/Boolean"; + std::string value_isPausableCtorSignature = "(Z)V"; + jboolean jnivalue_isPausable = static_cast(cppValue.Value().isPausable); + chip::JniReferences::GetInstance().CreateBoxedObject(value_isPausableClassName.c_str(), + value_isPausableCtorSignature.c_str(), + jnivalue_isPausable, value_isPausable); jobject value_slots; chip::JniReferences::GetInstance().CreateArrayList(value_slots); @@ -23645,24 +23653,24 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR chip::JniReferences::GetInstance().CreateBoxedObject( newElement_2_remainingSlotTimeClassName.c_str(), newElement_2_remainingSlotTimeCtorSignature.c_str(), jninewElement_2_remainingSlotTime, newElement_2_remainingSlotTime); - jobject newElement_2_slotIsPauseable; - if (!entry_2.slotIsPauseable.HasValue()) + jobject newElement_2_slotIsPausable; + if (!entry_2.slotIsPausable.HasValue()) { - chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_2_slotIsPauseable); + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_2_slotIsPausable); } else { - jobject newElement_2_slotIsPauseableInsideOptional; - std::string newElement_2_slotIsPauseableInsideOptionalClassName = "java/lang/Boolean"; - std::string newElement_2_slotIsPauseableInsideOptionalCtorSignature = "(Z)V"; - jboolean jninewElement_2_slotIsPauseableInsideOptional = - static_cast(entry_2.slotIsPauseable.Value()); + jobject newElement_2_slotIsPausableInsideOptional; + std::string newElement_2_slotIsPausableInsideOptionalClassName = "java/lang/Boolean"; + std::string newElement_2_slotIsPausableInsideOptionalCtorSignature = "(Z)V"; + jboolean jninewElement_2_slotIsPausableInsideOptional = + static_cast(entry_2.slotIsPausable.Value()); chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_2_slotIsPauseableInsideOptionalClassName.c_str(), - newElement_2_slotIsPauseableInsideOptionalCtorSignature.c_str(), - jninewElement_2_slotIsPauseableInsideOptional, newElement_2_slotIsPauseableInsideOptional); - chip::JniReferences::GetInstance().CreateOptional(newElement_2_slotIsPauseableInsideOptional, - newElement_2_slotIsPauseable); + newElement_2_slotIsPausableInsideOptionalClassName.c_str(), + newElement_2_slotIsPausableInsideOptionalCtorSignature.c_str(), + jninewElement_2_slotIsPausableInsideOptional, newElement_2_slotIsPausableInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(newElement_2_slotIsPausableInsideOptional, + newElement_2_slotIsPausable); } jobject newElement_2_minPauseDuration; if (!entry_2.minPauseDuration.HasValue()) @@ -23976,7 +23984,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_2 = env->NewObject( slotStructStructClass_3, slotStructStructCtor_3, newElement_2_minDuration, newElement_2_maxDuration, newElement_2_defaultDuration, newElement_2_elapsedSlotTime, newElement_2_remainingSlotTime, - newElement_2_slotIsPauseable, newElement_2_minPauseDuration, newElement_2_maxPauseDuration, + newElement_2_slotIsPausable, newElement_2_minPauseDuration, newElement_2_maxPauseDuration, newElement_2_manufacturerESAState, newElement_2_nominalPower, newElement_2_minPower, newElement_2_maxPower, newElement_2_nominalEnergy, newElement_2_costs, newElement_2_minPowerAdjustment, newElement_2_maxPowerAdjustment, newElement_2_minDurationAdjustment, newElement_2_maxDurationAdjustment); @@ -24003,7 +24011,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jmethodID forecastStructStructCtor_1; err = chip::JniReferences::GetInstance().FindMethod( env, forecastStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/Long;Ljava/util/Optional;Ljava/util/" + "(Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/Long;Ljava/util/Optional;Ljava/util/" "Optional;Ljava/lang/Boolean;Ljava/util/ArrayList;Ljava/lang/Integer;)V", &forecastStructStructCtor_1); if (err != CHIP_NO_ERROR || forecastStructStructCtor_1 == nullptr) @@ -24014,7 +24022,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR value = env->NewObject(forecastStructStructClass_1, forecastStructStructCtor_1, value_forecastId, value_activeSlotNumber, value_startTime, value_endTime, value_earliestStartTime, - value_latestEndTime, value_isPauseable, value_slots, value_forecastUpdateReason); + value_latestEndTime, value_isPausable, value_slots, value_forecastUpdateReason); } return value; } diff --git a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp index 7f210566b9aa37..e606cc2b468e3a 100644 --- a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp @@ -5862,6 +5862,26 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & value_maximumCurrentCtorSignature.c_str(), jnivalue_maximumCurrent, value_maximumCurrent); + jobject value_maximumDischargingCurrent; + if (!cppValue.maximumDischargingCurrent.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_maximumDischargingCurrent); + } + else + { + jobject value_maximumDischargingCurrentInsideOptional; + std::string value_maximumDischargingCurrentInsideOptionalClassName = "java/lang/Long"; + std::string value_maximumDischargingCurrentInsideOptionalCtorSignature = "(J)V"; + jlong jnivalue_maximumDischargingCurrentInsideOptional = + static_cast(cppValue.maximumDischargingCurrent.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_maximumDischargingCurrentInsideOptionalClassName.c_str(), + value_maximumDischargingCurrentInsideOptionalCtorSignature.c_str(), + jnivalue_maximumDischargingCurrentInsideOptional, value_maximumDischargingCurrentInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_maximumDischargingCurrentInsideOptional, + value_maximumDischargingCurrent); + } + jclass energyTransferStartedStructClass; err = chip::JniReferences::GetInstance().GetLocalClassRef( env, "chip/devicecontroller/ChipEventStructs$EnergyEvseClusterEnergyTransferStartedEvent", @@ -5873,9 +5893,9 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & } jmethodID energyTransferStartedStructCtor; - err = chip::JniReferences::GetInstance().FindMethod(env, energyTransferStartedStructClass, "", - "(Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Long;)V", - &energyTransferStartedStructCtor); + err = chip::JniReferences::GetInstance().FindMethod( + env, energyTransferStartedStructClass, "", + "(Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Long;Ljava/util/Optional;)V", &energyTransferStartedStructCtor); if (err != CHIP_NO_ERROR || energyTransferStartedStructCtor == nullptr) { ChipLogError(Zcl, "Could not find ChipEventStructs$EnergyEvseClusterEnergyTransferStartedEvent constructor"); @@ -5883,7 +5903,7 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & } jobject value = env->NewObject(energyTransferStartedStructClass, energyTransferStartedStructCtor, value_sessionID, - value_state, value_maximumCurrent); + value_state, value_maximumCurrent, value_maximumDischargingCurrent); return value; } @@ -5923,6 +5943,24 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & value_energyTransferredCtorSignature.c_str(), jnivalue_energyTransferred, value_energyTransferred); + jobject value_energyDischarged; + if (!cppValue.energyDischarged.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_energyDischarged); + } + else + { + jobject value_energyDischargedInsideOptional; + std::string value_energyDischargedInsideOptionalClassName = "java/lang/Long"; + std::string value_energyDischargedInsideOptionalCtorSignature = "(J)V"; + jlong jnivalue_energyDischargedInsideOptional = static_cast(cppValue.energyDischarged.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_energyDischargedInsideOptionalClassName.c_str(), + value_energyDischargedInsideOptionalCtorSignature.c_str(), jnivalue_energyDischargedInsideOptional, + value_energyDischargedInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_energyDischargedInsideOptional, value_energyDischarged); + } + jclass energyTransferStoppedStructClass; err = chip::JniReferences::GetInstance().GetLocalClassRef( env, "chip/devicecontroller/ChipEventStructs$EnergyEvseClusterEnergyTransferStoppedEvent", @@ -5936,7 +5974,8 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & jmethodID energyTransferStoppedStructCtor; err = chip::JniReferences::GetInstance().FindMethod( env, energyTransferStoppedStructClass, "", - "(Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Long;)V", &energyTransferStoppedStructCtor); + "(Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Long;Ljava/util/Optional;)V", + &energyTransferStoppedStructCtor); if (err != CHIP_NO_ERROR || energyTransferStoppedStructCtor == nullptr) { ChipLogError(Zcl, "Could not find ChipEventStructs$EnergyEvseClusterEnergyTransferStoppedEvent constructor"); @@ -5944,7 +5983,7 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & } jobject value = env->NewObject(energyTransferStoppedStructClass, energyTransferStoppedStructCtor, value_sessionID, - value_state, value_reason, value_energyTransferred); + value_state, value_reason, value_energyTransferred, value_energyDischarged); return value; } diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index c2db68c0ecfd4c..ae095a206fa530 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -24252,6 +24252,16 @@ class OptOutStateEnum(MatterIntEnum): # enum value. This specific should never be transmitted. kUnknownEnumValue = 4, + class PowerAdjustReasonEnum(MatterIntEnum): + kNoAdjustment = 0x00 + kLocalOptimizationAdjustment = 0x01 + kGridOptimizationAdjustment = 0x02 + # All received enum values that are not listed above will be mapped + # to kUnknownEnumValue. This is a helper enum value that should only + # be used by code to process how it handles receiving and unknown + # enum value. This specific should never be transmitted. + kUnknownEnumValue = 3, + class Bitmaps: class Feature(IntFlag): kPowerAdjustment = 0x1 @@ -24291,7 +24301,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="defaultDuration", Tag=2, Type=uint), ClusterObjectFieldDescriptor(Label="elapsedSlotTime", Tag=3, Type=uint), ClusterObjectFieldDescriptor(Label="remainingSlotTime", Tag=4, Type=uint), - ClusterObjectFieldDescriptor(Label="slotIsPauseable", Tag=5, Type=typing.Optional[bool]), + ClusterObjectFieldDescriptor(Label="slotIsPausable", Tag=5, Type=typing.Optional[bool]), ClusterObjectFieldDescriptor(Label="minPauseDuration", Tag=6, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="maxPauseDuration", Tag=7, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="manufacturerESAState", Tag=8, Type=typing.Optional[uint]), @@ -24311,7 +24321,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: defaultDuration: 'uint' = 0 elapsedSlotTime: 'uint' = 0 remainingSlotTime: 'uint' = 0 - slotIsPauseable: 'typing.Optional[bool]' = None + slotIsPausable: 'typing.Optional[bool]' = None minPauseDuration: 'typing.Optional[uint]' = None maxPauseDuration: 'typing.Optional[uint]' = None manufacturerESAState: 'typing.Optional[uint]' = None @@ -24337,7 +24347,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="endTime", Tag=3, Type=uint), ClusterObjectFieldDescriptor(Label="earliestStartTime", Tag=4, Type=typing.Union[None, Nullable, uint]), ClusterObjectFieldDescriptor(Label="latestEndTime", Tag=5, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="isPauseable", Tag=6, Type=bool), + ClusterObjectFieldDescriptor(Label="isPausable", Tag=6, Type=bool), ClusterObjectFieldDescriptor(Label="slots", Tag=7, Type=typing.List[DeviceEnergyManagement.Structs.SlotStruct]), ClusterObjectFieldDescriptor(Label="forecastUpdateReason", Tag=8, Type=DeviceEnergyManagement.Enums.ForecastUpdateReasonEnum), ]) @@ -24348,7 +24358,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: endTime: 'uint' = 0 earliestStartTime: 'typing.Union[None, Nullable, uint]' = None latestEndTime: 'typing.Optional[uint]' = None - isPauseable: 'bool' = False + isPausable: 'bool' = False slots: 'typing.List[DeviceEnergyManagement.Structs.SlotStruct]' = field(default_factory=lambda: []) forecastUpdateReason: 'DeviceEnergyManagement.Enums.ForecastUpdateReasonEnum' = 0 @@ -24381,12 +24391,14 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="maxPower", Tag=1, Type=int), ClusterObjectFieldDescriptor(Label="minDuration", Tag=2, Type=uint), ClusterObjectFieldDescriptor(Label="maxDuration", Tag=3, Type=uint), + ClusterObjectFieldDescriptor(Label="cause", Tag=4, Type=DeviceEnergyManagement.Enums.PowerAdjustReasonEnum), ]) minPower: 'int' = 0 maxPower: 'int' = 0 minDuration: 'uint' = 0 maxDuration: 'uint' = 0 + cause: 'DeviceEnergyManagement.Enums.PowerAdjustReasonEnum' = 0 @dataclass class SlotAdjustmentStruct(ClusterObject): @@ -24395,12 +24407,12 @@ def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ ClusterObjectFieldDescriptor(Label="slotIndex", Tag=0, Type=uint), - ClusterObjectFieldDescriptor(Label="nominalPower", Tag=1, Type=int), + ClusterObjectFieldDescriptor(Label="nominalPower", Tag=1, Type=typing.Optional[int]), ClusterObjectFieldDescriptor(Label="duration", Tag=2, Type=uint), ]) slotIndex: 'uint' = 0 - nominalPower: 'int' = 0 + nominalPower: 'typing.Optional[int]' = None duration: 'uint' = 0 class Commands: @@ -24962,11 +24974,12 @@ class SupplyStateEnum(MatterIntEnum): kDischargingEnabled = 0x02 kDisabledError = 0x03 kDisabledDiagnostics = 0x04 + kEnabled = 0x05 # All received enum values that are not listed above will be mapped # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving and unknown # enum value. This specific should never be transmitted. - kUnknownEnumValue = 5, + kUnknownEnumValue = 6, class Bitmaps: class Feature(IntFlag): @@ -25007,12 +25020,12 @@ class ChargingTargetScheduleStruct(ClusterObject): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="dayOfWeekForSequence", Tag=0, Type=uint), - ClusterObjectFieldDescriptor(Label="chargingTargets", Tag=1, Type=typing.List[EnergyEvse.Structs.ChargingTargetStruct]), + ClusterObjectFieldDescriptor(Label="dayOfWeekForSequence", Tag=0, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="chargingTargets", Tag=1, Type=typing.Optional[typing.List[EnergyEvse.Structs.ChargingTargetStruct]]), ]) - dayOfWeekForSequence: 'uint' = 0 - chargingTargets: 'typing.List[EnergyEvse.Structs.ChargingTargetStruct]' = field(default_factory=lambda: []) + dayOfWeekForSequence: 'typing.Optional[uint]' = None + chargingTargets: 'typing.Optional[typing.List[EnergyEvse.Structs.ChargingTargetStruct]]' = None class Commands: @dataclass @@ -25694,11 +25707,13 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="sessionID", Tag=0, Type=uint), ClusterObjectFieldDescriptor(Label="state", Tag=1, Type=EnergyEvse.Enums.StateEnum), ClusterObjectFieldDescriptor(Label="maximumCurrent", Tag=2, Type=int), + ClusterObjectFieldDescriptor(Label="maximumDischargingCurrent", Tag=3, Type=typing.Optional[int]), ]) sessionID: 'uint' = 0 state: 'EnergyEvse.Enums.StateEnum' = 0 maximumCurrent: 'int' = 0 + maximumDischargingCurrent: 'typing.Optional[int]' = None @dataclass class EnergyTransferStopped(ClusterEvent): @@ -25718,12 +25733,14 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="state", Tag=1, Type=EnergyEvse.Enums.StateEnum), ClusterObjectFieldDescriptor(Label="reason", Tag=2, Type=EnergyEvse.Enums.EnergyTransferStoppedReasonEnum), ClusterObjectFieldDescriptor(Label="energyTransferred", Tag=4, Type=int), + ClusterObjectFieldDescriptor(Label="energyDischarged", Tag=5, Type=typing.Optional[int]), ]) sessionID: 'uint' = 0 state: 'EnergyEvse.Enums.StateEnum' = 0 reason: 'EnergyEvse.Enums.EnergyTransferStoppedReasonEnum' = 0 energyTransferred: 'int' = 0 + energyDischarged: 'typing.Optional[int]' = None @dataclass class Fault(ClusterEvent): diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm index f5b2ca3d7dd743..56aa3105af3282 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -8919,6 +8919,7 @@ static id _Nullable DecodeAttributeValueForDeviceEnergyManagementCluster(Attribu newElement_1.maxPower = [NSNumber numberWithLongLong:entry_1.maxPower]; newElement_1.minDuration = [NSNumber numberWithUnsignedInt:entry_1.minDuration]; newElement_1.maxDuration = [NSNumber numberWithUnsignedInt:entry_1.maxDuration]; + newElement_1.cause = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_1.cause)]; [array_1 addObject:newElement_1]; } CHIP_ERROR err = iter_1.GetStatus(); @@ -8943,7 +8944,7 @@ static id _Nullable DecodeAttributeValueForDeviceEnergyManagementCluster(Attribu value = nil; } else { value = [MTRDeviceEnergyManagementClusterForecastStruct new]; - value.forecastId = [NSNumber numberWithUnsignedShort:cppValue.Value().forecastId]; + value.forecastId = [NSNumber numberWithUnsignedInt:cppValue.Value().forecastId]; if (cppValue.Value().activeSlotNumber.IsNull()) { value.activeSlotNumber = nil; } else { @@ -8965,7 +8966,7 @@ static id _Nullable DecodeAttributeValueForDeviceEnergyManagementCluster(Attribu } else { value.latestEndTime = nil; } - value.isPauseable = [NSNumber numberWithBool:cppValue.Value().isPauseable]; + value.isPausable = [NSNumber numberWithBool:cppValue.Value().isPausable]; { // Scope for our temporary variables auto * array_2 = [NSMutableArray new]; auto iter_2 = cppValue.Value().slots.begin(); @@ -8978,10 +8979,10 @@ static id _Nullable DecodeAttributeValueForDeviceEnergyManagementCluster(Attribu newElement_2.defaultDuration = [NSNumber numberWithUnsignedInt:entry_2.defaultDuration]; newElement_2.elapsedSlotTime = [NSNumber numberWithUnsignedInt:entry_2.elapsedSlotTime]; newElement_2.remainingSlotTime = [NSNumber numberWithUnsignedInt:entry_2.remainingSlotTime]; - if (entry_2.slotIsPauseable.HasValue()) { - newElement_2.slotIsPauseable = [NSNumber numberWithBool:entry_2.slotIsPauseable.Value()]; + if (entry_2.slotIsPausable.HasValue()) { + newElement_2.slotIsPausable = [NSNumber numberWithBool:entry_2.slotIsPausable.Value()]; } else { - newElement_2.slotIsPauseable = nil; + newElement_2.slotIsPausable = nil; } if (entry_2.minPauseDuration.HasValue()) { newElement_2.minPauseDuration = [NSNumber numberWithUnsignedInt:entry_2.minPauseDuration.Value()]; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index d5e7efa37f08bd..584bbdd9c55e37 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -18043,6 +18043,12 @@ typedef NS_ENUM(uint8_t, MTRDeviceEnergyManagementOptOutState) { MTRDeviceEnergyManagementOptOutStateOptOut MTR_PROVISIONALLY_AVAILABLE = 0x03, } MTR_PROVISIONALLY_AVAILABLE; +typedef NS_ENUM(uint8_t, MTRDeviceEnergyManagementPowerAdjustReason) { + MTRDeviceEnergyManagementPowerAdjustReasonNoAdjustment MTR_PROVISIONALLY_AVAILABLE = 0x00, + MTRDeviceEnergyManagementPowerAdjustReasonLocalOptimizationAdjustment MTR_PROVISIONALLY_AVAILABLE = 0x01, + MTRDeviceEnergyManagementPowerAdjustReasonGridOptimizationAdjustment MTR_PROVISIONALLY_AVAILABLE = 0x02, +} MTR_PROVISIONALLY_AVAILABLE; + typedef NS_OPTIONS(uint32_t, MTRDeviceEnergyManagementFeature) { MTRDeviceEnergyManagementFeaturePowerAdjustment MTR_PROVISIONALLY_AVAILABLE = 0x1, MTRDeviceEnergyManagementFeaturePowerForecastReporting MTR_PROVISIONALLY_AVAILABLE = 0x2, @@ -18095,6 +18101,7 @@ typedef NS_ENUM(uint8_t, MTREnergyEVSESupplyState) { MTREnergyEVSESupplyStateDischargingEnabled MTR_PROVISIONALLY_AVAILABLE = 0x02, MTREnergyEVSESupplyStateDisabledError MTR_PROVISIONALLY_AVAILABLE = 0x03, MTREnergyEVSESupplyStateDisabledDiagnostics MTR_PROVISIONALLY_AVAILABLE = 0x04, + MTREnergyEVSESupplyStateEnabled MTR_PROVISIONALLY_AVAILABLE = 0x05, } MTR_PROVISIONALLY_AVAILABLE; typedef NS_OPTIONS(uint32_t, MTREnergyEVSEFeature) { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm index af9752c200df41..f6722413101fc3 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm @@ -16171,7 +16171,10 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader } auto element_0 = (MTRDeviceEnergyManagementClusterSlotAdjustmentStruct *) self.slotAdjustments[i_0]; listHolder_0->mList[i_0].slotIndex = element_0.slotIndex.unsignedCharValue; - listHolder_0->mList[i_0].nominalPower = element_0.nominalPower.longLongValue; + if (element_0.nominalPower != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].nominalPower.Emplace(); + definedValue_2 = element_0.nominalPower.longLongValue; + } listHolder_0->mList[i_0].duration = element_0.duration.unsignedIntValue; } encodableStruct.slotAdjustments = ListType_0(listHolder_0->mList, self.slotAdjustments.count); @@ -16493,32 +16496,40 @@ - (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::EnergyEv auto & entry_0 = iter_0.GetValue(); MTREnergyEVSEClusterChargingTargetScheduleStruct * newElement_0; newElement_0 = [MTREnergyEVSEClusterChargingTargetScheduleStruct new]; - newElement_0.dayOfWeekForSequence = [NSNumber numberWithUnsignedChar:entry_0.dayOfWeekForSequence.Raw()]; - { // Scope for our temporary variables - auto * array_2 = [NSMutableArray new]; - auto iter_2 = entry_0.chargingTargets.begin(); - while (iter_2.Next()) { - auto & entry_2 = iter_2.GetValue(); - MTREnergyEVSEClusterChargingTargetStruct * newElement_2; - newElement_2 = [MTREnergyEVSEClusterChargingTargetStruct new]; - newElement_2.targetTimeMinutesPastMidnight = [NSNumber numberWithUnsignedShort:entry_2.targetTimeMinutesPastMidnight]; - if (entry_2.targetSoC.HasValue()) { - newElement_2.targetSoC = [NSNumber numberWithUnsignedChar:entry_2.targetSoC.Value()]; - } else { - newElement_2.targetSoC = nil; + if (entry_0.dayOfWeekForSequence.HasValue()) { + newElement_0.dayOfWeekForSequence = [NSNumber numberWithUnsignedChar:entry_0.dayOfWeekForSequence.Value().Raw()]; + } else { + newElement_0.dayOfWeekForSequence = nil; + } + if (entry_0.chargingTargets.HasValue()) { + { // Scope for our temporary variables + auto * array_3 = [NSMutableArray new]; + auto iter_3 = entry_0.chargingTargets.Value().begin(); + while (iter_3.Next()) { + auto & entry_3 = iter_3.GetValue(); + MTREnergyEVSEClusterChargingTargetStruct * newElement_3; + newElement_3 = [MTREnergyEVSEClusterChargingTargetStruct new]; + newElement_3.targetTimeMinutesPastMidnight = [NSNumber numberWithUnsignedShort:entry_3.targetTimeMinutesPastMidnight]; + if (entry_3.targetSoC.HasValue()) { + newElement_3.targetSoC = [NSNumber numberWithUnsignedChar:entry_3.targetSoC.Value()]; + } else { + newElement_3.targetSoC = nil; + } + if (entry_3.addedEnergy.HasValue()) { + newElement_3.addedEnergy = [NSNumber numberWithLongLong:entry_3.addedEnergy.Value()]; + } else { + newElement_3.addedEnergy = nil; + } + [array_3 addObject:newElement_3]; } - if (entry_2.addedEnergy.HasValue()) { - newElement_2.addedEnergy = [NSNumber numberWithLongLong:entry_2.addedEnergy.Value()]; - } else { - newElement_2.addedEnergy = nil; + CHIP_ERROR err = iter_3.GetStatus(); + if (err != CHIP_NO_ERROR) { + return err; } - [array_2 addObject:newElement_2]; - } - CHIP_ERROR err = iter_2.GetStatus(); - if (err != CHIP_NO_ERROR) { - return err; + newElement_0.chargingTargets = array_3; } - newElement_0.chargingTargets = array_2; + } else { + newElement_0.chargingTargets = nil; } [array_0 addObject:newElement_0]; } @@ -16919,35 +16930,41 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader return CHIP_ERROR_INVALID_ARGUMENT; } auto element_0 = (MTREnergyEVSEClusterChargingTargetScheduleStruct *) self.chargingTargetSchedules[i_0]; - listHolder_0->mList[i_0].dayOfWeekForSequence = static_castmList[i_0].dayOfWeekForSequence)>>(element_0.dayOfWeekForSequence.unsignedCharValue); - { - using ListType_2 = std::remove_reference_tmList[i_0].chargingTargets)>; - using ListMemberType_2 = ListMemberTypeGetter::Type; - if (element_0.chargingTargets.count != 0) { - auto * listHolder_2 = new ListHolder(element_0.chargingTargets.count); - if (listHolder_2 == nullptr || listHolder_2->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_2); - for (size_t i_2 = 0; i_2 < element_0.chargingTargets.count; ++i_2) { - if (![element_0.chargingTargets[i_2] isKindOfClass:[MTREnergyEVSEClusterChargingTargetStruct class]]) { - // Wrong kind of value. + if (element_0.dayOfWeekForSequence != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].dayOfWeekForSequence.Emplace(); + definedValue_2 = static_cast>(element_0.dayOfWeekForSequence.unsignedCharValue); + } + if (element_0.chargingTargets != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].chargingTargets.Emplace(); + { + using ListType_3 = std::remove_reference_t; + using ListMemberType_3 = ListMemberTypeGetter::Type; + if (element_0.chargingTargets.count != 0) { + auto * listHolder_3 = new ListHolder(element_0.chargingTargets.count); + if (listHolder_3 == nullptr || listHolder_3->mList == nullptr) { return CHIP_ERROR_INVALID_ARGUMENT; } - auto element_2 = (MTREnergyEVSEClusterChargingTargetStruct *) element_0.chargingTargets[i_2]; - listHolder_2->mList[i_2].targetTimeMinutesPastMidnight = element_2.targetTimeMinutesPastMidnight.unsignedShortValue; - if (element_2.targetSoC != nil) { - auto & definedValue_4 = listHolder_2->mList[i_2].targetSoC.Emplace(); - definedValue_4 = element_2.targetSoC.unsignedCharValue; - } - if (element_2.addedEnergy != nil) { - auto & definedValue_4 = listHolder_2->mList[i_2].addedEnergy.Emplace(); - definedValue_4 = element_2.addedEnergy.longLongValue; + listFreer.add(listHolder_3); + for (size_t i_3 = 0; i_3 < element_0.chargingTargets.count; ++i_3) { + if (![element_0.chargingTargets[i_3] isKindOfClass:[MTREnergyEVSEClusterChargingTargetStruct class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_3 = (MTREnergyEVSEClusterChargingTargetStruct *) element_0.chargingTargets[i_3]; + listHolder_3->mList[i_3].targetTimeMinutesPastMidnight = element_3.targetTimeMinutesPastMidnight.unsignedShortValue; + if (element_3.targetSoC != nil) { + auto & definedValue_5 = listHolder_3->mList[i_3].targetSoC.Emplace(); + definedValue_5 = element_3.targetSoC.unsignedCharValue; + } + if (element_3.addedEnergy != nil) { + auto & definedValue_5 = listHolder_3->mList[i_3].addedEnergy.Emplace(); + definedValue_5 = element_3.addedEnergy.longLongValue; + } } + definedValue_2 = ListType_3(listHolder_3->mList, element_0.chargingTargets.count); + } else { + definedValue_2 = ListType_3(); } - listHolder_0->mList[i_0].chargingTargets = ListType_2(listHolder_2->mList, element_0.chargingTargets.count); - } else { - listHolder_0->mList[i_0].chargingTargets = ListType_2(); } } } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRDeviceTypeMetadata.mm b/src/darwin/Framework/CHIP/zap-generated/MTRDeviceTypeMetadata.mm index 06042f32f9f1d8..c41c977b3f2a0e 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRDeviceTypeMetadata.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRDeviceTypeMetadata.mm @@ -94,6 +94,7 @@ { 0x00000306, DeviceTypeClass::Simple, "Matter Flow Sensor" }, { 0x00000307, DeviceTypeClass::Simple, "Matter Humidity Sensor" }, { 0x0000050C, DeviceTypeClass::Simple, "Matter EVSE" }, + { 0x0000050D, DeviceTypeClass::Utility, "Matter Device Energy Management" }, { 0x00000510, DeviceTypeClass::Utility, "Matter Electrical Sensor" }, { 0x00000840, DeviceTypeClass::Simple, "Matter Control Bridge" }, { 0x00000850, DeviceTypeClass::Simple, "Matter On/Off Sensor" }, diff --git a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm index 9fc3cd16b8235a..cddf9d148942c1 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm @@ -3144,6 +3144,15 @@ static id _Nullable DecodeEventPayloadForEnergyEVSECluster(EventId aEventId, TLV memberValue = [NSNumber numberWithLongLong:cppValue.maximumCurrent]; value.maximumCurrent = memberValue; } while (0); + do { + NSNumber * _Nullable memberValue; + if (cppValue.maximumDischargingCurrent.HasValue()) { + memberValue = [NSNumber numberWithLongLong:cppValue.maximumDischargingCurrent.Value()]; + } else { + memberValue = nil; + } + value.maximumDischargingCurrent = memberValue; + } while (0); return value; } @@ -3176,6 +3185,15 @@ static id _Nullable DecodeEventPayloadForEnergyEVSECluster(EventId aEventId, TLV memberValue = [NSNumber numberWithLongLong:cppValue.energyTransferred]; value.energyTransferred = memberValue; } while (0); + do { + NSNumber * _Nullable memberValue; + if (cppValue.energyDischarged.HasValue()) { + memberValue = [NSNumber numberWithLongLong:cppValue.energyDischarged.Value()]; + } else { + memberValue = nil; + } + value.energyDischarged = memberValue; + } while (0); return value; } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h index 92bd095b954393..b99a402f2b994d 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h @@ -1292,7 +1292,7 @@ MTR_PROVISIONALLY_AVAILABLE @property (nonatomic, copy) NSNumber * _Nonnull defaultDuration MTR_PROVISIONALLY_AVAILABLE; @property (nonatomic, copy) NSNumber * _Nonnull elapsedSlotTime MTR_PROVISIONALLY_AVAILABLE; @property (nonatomic, copy) NSNumber * _Nonnull remainingSlotTime MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nullable slotIsPauseable MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable slotIsPausable MTR_PROVISIONALLY_AVAILABLE; @property (nonatomic, copy) NSNumber * _Nullable minPauseDuration MTR_PROVISIONALLY_AVAILABLE; @property (nonatomic, copy) NSNumber * _Nullable maxPauseDuration MTR_PROVISIONALLY_AVAILABLE; @property (nonatomic, copy) NSNumber * _Nullable manufacturerESAState MTR_PROVISIONALLY_AVAILABLE; @@ -1315,7 +1315,7 @@ MTR_PROVISIONALLY_AVAILABLE @property (nonatomic, copy) NSNumber * _Nonnull endTime MTR_PROVISIONALLY_AVAILABLE; @property (nonatomic, copy) NSNumber * _Nullable earliestStartTime MTR_PROVISIONALLY_AVAILABLE; @property (nonatomic, copy) NSNumber * _Nullable latestEndTime MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nonnull isPauseable MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull isPausable MTR_PROVISIONALLY_AVAILABLE; @property (nonatomic, copy) NSArray * _Nonnull slots MTR_PROVISIONALLY_AVAILABLE; @property (nonatomic, copy) NSNumber * _Nonnull forecastUpdateReason MTR_PROVISIONALLY_AVAILABLE; @end @@ -1335,12 +1335,13 @@ MTR_PROVISIONALLY_AVAILABLE @property (nonatomic, copy) NSNumber * _Nonnull maxPower MTR_PROVISIONALLY_AVAILABLE; @property (nonatomic, copy) NSNumber * _Nonnull minDuration MTR_PROVISIONALLY_AVAILABLE; @property (nonatomic, copy) NSNumber * _Nonnull maxDuration MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull cause MTR_PROVISIONALLY_AVAILABLE; @end MTR_PROVISIONALLY_AVAILABLE @interface MTRDeviceEnergyManagementClusterSlotAdjustmentStruct : NSObject @property (nonatomic, copy) NSNumber * _Nonnull slotIndex MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nonnull nominalPower MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable nominalPower MTR_PROVISIONALLY_AVAILABLE; @property (nonatomic, copy) NSNumber * _Nonnull duration MTR_PROVISIONALLY_AVAILABLE; @end @@ -1373,8 +1374,8 @@ MTR_PROVISIONALLY_AVAILABLE MTR_PROVISIONALLY_AVAILABLE @interface MTREnergyEVSEClusterChargingTargetScheduleStruct : NSObject -@property (nonatomic, copy) NSNumber * _Nonnull dayOfWeekForSequence MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSArray * _Nonnull chargingTargets MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable dayOfWeekForSequence MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSArray * _Nullable chargingTargets MTR_PROVISIONALLY_AVAILABLE; @end MTR_PROVISIONALLY_AVAILABLE @@ -1396,6 +1397,7 @@ MTR_PROVISIONALLY_AVAILABLE @property (nonatomic, copy) NSNumber * _Nonnull sessionID MTR_PROVISIONALLY_AVAILABLE; @property (nonatomic, copy) NSNumber * _Nonnull state MTR_PROVISIONALLY_AVAILABLE; @property (nonatomic, copy) NSNumber * _Nonnull maximumCurrent MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable maximumDischargingCurrent MTR_PROVISIONALLY_AVAILABLE; @end MTR_PROVISIONALLY_AVAILABLE @@ -1404,6 +1406,7 @@ MTR_PROVISIONALLY_AVAILABLE @property (nonatomic, copy) NSNumber * _Nonnull state MTR_PROVISIONALLY_AVAILABLE; @property (nonatomic, copy) NSNumber * _Nonnull reason MTR_PROVISIONALLY_AVAILABLE; @property (nonatomic, copy) NSNumber * _Nonnull energyTransferred MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable energyDischarged MTR_PROVISIONALLY_AVAILABLE; @end MTR_PROVISIONALLY_AVAILABLE diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm index c9c38c72710756..223b5ccbe701b7 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm @@ -5266,7 +5266,7 @@ - (instancetype)init _remainingSlotTime = @(0); - _slotIsPauseable = nil; + _slotIsPausable = nil; _minPauseDuration = nil; @@ -5304,7 +5304,7 @@ - (id)copyWithZone:(NSZone * _Nullable)zone other.defaultDuration = self.defaultDuration; other.elapsedSlotTime = self.elapsedSlotTime; other.remainingSlotTime = self.remainingSlotTime; - other.slotIsPauseable = self.slotIsPauseable; + other.slotIsPausable = self.slotIsPausable; other.minPauseDuration = self.minPauseDuration; other.maxPauseDuration = self.maxPauseDuration; other.manufacturerESAState = self.manufacturerESAState; @@ -5323,7 +5323,7 @@ - (id)copyWithZone:(NSZone * _Nullable)zone - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: minDuration:%@; maxDuration:%@; defaultDuration:%@; elapsedSlotTime:%@; remainingSlotTime:%@; slotIsPauseable:%@; minPauseDuration:%@; maxPauseDuration:%@; manufacturerESAState:%@; nominalPower:%@; minPower:%@; maxPower:%@; nominalEnergy:%@; costs:%@; minPowerAdjustment:%@; maxPowerAdjustment:%@; minDurationAdjustment:%@; maxDurationAdjustment:%@; >", NSStringFromClass([self class]), _minDuration, _maxDuration, _defaultDuration, _elapsedSlotTime, _remainingSlotTime, _slotIsPauseable, _minPauseDuration, _maxPauseDuration, _manufacturerESAState, _nominalPower, _minPower, _maxPower, _nominalEnergy, _costs, _minPowerAdjustment, _maxPowerAdjustment, _minDurationAdjustment, _maxDurationAdjustment]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: minDuration:%@; maxDuration:%@; defaultDuration:%@; elapsedSlotTime:%@; remainingSlotTime:%@; slotIsPausable:%@; minPauseDuration:%@; maxPauseDuration:%@; manufacturerESAState:%@; nominalPower:%@; minPower:%@; maxPower:%@; nominalEnergy:%@; costs:%@; minPowerAdjustment:%@; maxPowerAdjustment:%@; minDurationAdjustment:%@; maxDurationAdjustment:%@; >", NSStringFromClass([self class]), _minDuration, _maxDuration, _defaultDuration, _elapsedSlotTime, _remainingSlotTime, _slotIsPausable, _minPauseDuration, _maxPauseDuration, _manufacturerESAState, _nominalPower, _minPower, _maxPower, _nominalEnergy, _costs, _minPowerAdjustment, _maxPowerAdjustment, _minDurationAdjustment, _maxDurationAdjustment]; return descriptionString; } @@ -5346,7 +5346,7 @@ - (instancetype)init _latestEndTime = nil; - _isPauseable = @(0); + _isPausable = @(0); _slots = [NSArray array]; @@ -5365,7 +5365,7 @@ - (id)copyWithZone:(NSZone * _Nullable)zone other.endTime = self.endTime; other.earliestStartTime = self.earliestStartTime; other.latestEndTime = self.latestEndTime; - other.isPauseable = self.isPauseable; + other.isPausable = self.isPausable; other.slots = self.slots; other.forecastUpdateReason = self.forecastUpdateReason; @@ -5374,7 +5374,7 @@ - (id)copyWithZone:(NSZone * _Nullable)zone - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: forecastId:%@; activeSlotNumber:%@; startTime:%@; endTime:%@; earliestStartTime:%@; latestEndTime:%@; isPauseable:%@; slots:%@; forecastUpdateReason:%@; >", NSStringFromClass([self class]), _forecastId, _activeSlotNumber, _startTime, _endTime, _earliestStartTime, _latestEndTime, _isPauseable, _slots, _forecastUpdateReason]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: forecastId:%@; activeSlotNumber:%@; startTime:%@; endTime:%@; earliestStartTime:%@; latestEndTime:%@; isPausable:%@; slots:%@; forecastUpdateReason:%@; >", NSStringFromClass([self class]), _forecastId, _activeSlotNumber, _startTime, _endTime, _earliestStartTime, _latestEndTime, _isPausable, _slots, _forecastUpdateReason]; return descriptionString; } @@ -5431,6 +5431,8 @@ - (instancetype)init _minDuration = @(0); _maxDuration = @(0); + + _cause = @(0); } return self; } @@ -5443,13 +5445,14 @@ - (id)copyWithZone:(NSZone * _Nullable)zone other.maxPower = self.maxPower; other.minDuration = self.minDuration; other.maxDuration = self.maxDuration; + other.cause = self.cause; return other; } - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: minPower:%@; maxPower:%@; minDuration:%@; maxDuration:%@; >", NSStringFromClass([self class]), _minPower, _maxPower, _minDuration, _maxDuration]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: minPower:%@; maxPower:%@; minDuration:%@; maxDuration:%@; cause:%@; >", NSStringFromClass([self class]), _minPower, _maxPower, _minDuration, _maxDuration, _cause]; return descriptionString; } @@ -5462,7 +5465,7 @@ - (instancetype)init _slotIndex = @(0); - _nominalPower = @(0); + _nominalPower = nil; _duration = @(0); } @@ -5632,9 +5635,9 @@ - (instancetype)init { if (self = [super init]) { - _dayOfWeekForSequence = @(0); + _dayOfWeekForSequence = nil; - _chargingTargets = [NSArray array]; + _chargingTargets = nil; } return self; } @@ -5733,6 +5736,8 @@ - (instancetype)init _state = @(0); _maximumCurrent = @(0); + + _maximumDischargingCurrent = nil; } return self; } @@ -5744,13 +5749,14 @@ - (id)copyWithZone:(NSZone * _Nullable)zone other.sessionID = self.sessionID; other.state = self.state; other.maximumCurrent = self.maximumCurrent; + other.maximumDischargingCurrent = self.maximumDischargingCurrent; return other; } - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: sessionID:%@; state:%@; maximumCurrent:%@; >", NSStringFromClass([self class]), _sessionID, _state, _maximumCurrent]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: sessionID:%@; state:%@; maximumCurrent:%@; maximumDischargingCurrent:%@; >", NSStringFromClass([self class]), _sessionID, _state, _maximumCurrent, _maximumDischargingCurrent]; return descriptionString; } @@ -5768,6 +5774,8 @@ - (instancetype)init _reason = @(0); _energyTransferred = @(0); + + _energyDischarged = nil; } return self; } @@ -5780,13 +5788,14 @@ - (id)copyWithZone:(NSZone * _Nullable)zone other.state = self.state; other.reason = self.reason; other.energyTransferred = self.energyTransferred; + other.energyDischarged = self.energyDischarged; return other; } - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: sessionID:%@; state:%@; reason:%@; energyTransferred:%@; >", NSStringFromClass([self class]), _sessionID, _state, _reason, _energyTransferred]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: sessionID:%@; state:%@; reason:%@; energyTransferred:%@; energyDischarged:%@; >", NSStringFromClass([self class]), _sessionID, _state, _reason, _energyTransferred, _energyDischarged]; return descriptionString; } diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h index ca25c08c748e0c..c1ca9fffb4a305 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h @@ -1767,6 +1767,19 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(DeviceEnergyManagement: return EnumType::kUnknownEnumValue; } } +static auto __attribute__((unused)) EnsureKnownEnumValue(DeviceEnergyManagement::PowerAdjustReasonEnum val) +{ + using EnumType = DeviceEnergyManagement::PowerAdjustReasonEnum; + switch (val) + { + case EnumType::kNoAdjustment: + case EnumType::kLocalOptimizationAdjustment: + case EnumType::kGridOptimizationAdjustment: + return val; + default: + return EnumType::kUnknownEnumValue; + } +} static auto __attribute__((unused)) EnsureKnownEnumValue(EnergyEvse::EnergyTransferStoppedReasonEnum val) { @@ -1835,6 +1848,7 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(EnergyEvse::SupplyState case EnumType::kDischargingEnabled: case EnumType::kDisabledError: case EnumType::kDisabledDiagnostics: + case EnumType::kEnabled: return val; default: return EnumType::kUnknownEnumValue; diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h index bad7df9b4b8fa8..6b9feff65e1ef2 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h @@ -2571,6 +2571,19 @@ enum class OptOutStateEnum : uint8_t kUnknownEnumValue = 4, }; +// Enum for PowerAdjustReasonEnum +enum class PowerAdjustReasonEnum : uint8_t +{ + kNoAdjustment = 0x00, + kLocalOptimizationAdjustment = 0x01, + kGridOptimizationAdjustment = 0x02, + // All received enum values that are not listed above will be mapped + // to kUnknownEnumValue. This is a helper enum value that should only + // be used by code to process how it handles receiving and unknown + // enum value. This specific should never be transmitted. + kUnknownEnumValue = 3, +}; + // Bitmap for Feature enum class Feature : uint32_t { @@ -2651,11 +2664,12 @@ enum class SupplyStateEnum : uint8_t kDischargingEnabled = 0x02, kDisabledError = 0x03, kDisabledDiagnostics = 0x04, + kEnabled = 0x05, // All received enum values that are not listed above will be mapped // to kUnknownEnumValue. This is a helper enum value that should only // be used by code to process how it handles receiving and unknown // enum value. This specific should never be transmitted. - kUnknownEnumValue = 5, + kUnknownEnumValue = 6, }; // Bitmap for Feature diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp index 3e72137d33179a..30179f2cc66501 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp @@ -15607,7 +15607,7 @@ CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const encoder.Encode(to_underlying(Fields::kDefaultDuration), defaultDuration); encoder.Encode(to_underlying(Fields::kElapsedSlotTime), elapsedSlotTime); encoder.Encode(to_underlying(Fields::kRemainingSlotTime), remainingSlotTime); - encoder.Encode(to_underlying(Fields::kSlotIsPauseable), slotIsPauseable); + encoder.Encode(to_underlying(Fields::kSlotIsPausable), slotIsPausable); encoder.Encode(to_underlying(Fields::kMinPauseDuration), minPauseDuration); encoder.Encode(to_underlying(Fields::kMaxPauseDuration), maxPauseDuration); encoder.Encode(to_underlying(Fields::kManufacturerESAState), manufacturerESAState); @@ -15657,9 +15657,9 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) { err = DataModel::Decode(reader, remainingSlotTime); } - else if (__context_tag == to_underlying(Fields::kSlotIsPauseable)) + else if (__context_tag == to_underlying(Fields::kSlotIsPausable)) { - err = DataModel::Decode(reader, slotIsPauseable); + err = DataModel::Decode(reader, slotIsPausable); } else if (__context_tag == to_underlying(Fields::kMinPauseDuration)) { @@ -15729,7 +15729,7 @@ CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const encoder.Encode(to_underlying(Fields::kEndTime), endTime); encoder.Encode(to_underlying(Fields::kEarliestStartTime), earliestStartTime); encoder.Encode(to_underlying(Fields::kLatestEndTime), latestEndTime); - encoder.Encode(to_underlying(Fields::kIsPauseable), isPauseable); + encoder.Encode(to_underlying(Fields::kIsPausable), isPausable); encoder.Encode(to_underlying(Fields::kSlots), slots); encoder.Encode(to_underlying(Fields::kForecastUpdateReason), forecastUpdateReason); return encoder.Finalize(); @@ -15773,9 +15773,9 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) { err = DataModel::Decode(reader, latestEndTime); } - else if (__context_tag == to_underlying(Fields::kIsPauseable)) + else if (__context_tag == to_underlying(Fields::kIsPausable)) { - err = DataModel::Decode(reader, isPauseable); + err = DataModel::Decode(reader, isPausable); } else if (__context_tag == to_underlying(Fields::kSlots)) { @@ -15859,6 +15859,7 @@ CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const encoder.Encode(to_underlying(Fields::kMaxPower), maxPower); encoder.Encode(to_underlying(Fields::kMinDuration), minDuration); encoder.Encode(to_underlying(Fields::kMaxDuration), maxDuration); + encoder.Encode(to_underlying(Fields::kCause), cause); return encoder.Finalize(); } @@ -15892,6 +15893,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) { err = DataModel::Decode(reader, maxDuration); } + else if (__context_tag == to_underlying(Fields::kCause)) + { + err = DataModel::Decode(reader, cause); + } else { } @@ -16875,6 +16880,8 @@ CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kSessionID), sessionID)); ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kState), state)); ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kMaximumCurrent), maximumCurrent)); + ReturnErrorOnFailure( + DataModel::Encode(aWriter, TLV::ContextTag(Fields::kMaximumDischargingCurrent), maximumDischargingCurrent)); return aWriter.EndContainer(outer); } @@ -16904,6 +16911,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) { err = DataModel::Decode(reader, maximumCurrent); } + else if (__context_tag == to_underlying(Fields::kMaximumDischargingCurrent)) + { + err = DataModel::Decode(reader, maximumDischargingCurrent); + } else { } @@ -16921,6 +16932,7 @@ CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kState), state)); ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kReason), reason)); ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kEnergyTransferred), energyTransferred)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kEnergyDischarged), energyDischarged)); return aWriter.EndContainer(outer); } @@ -16954,6 +16966,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) { err = DataModel::Decode(reader, energyTransferred); } + else if (__context_tag == to_underlying(Fields::kEnergyDischarged)) + { + err = DataModel::Decode(reader, energyDischarged); + } else { } diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index 9dbcdfe8dcad68..b0187052749a98 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h @@ -21869,7 +21869,7 @@ enum class Fields : uint8_t kDefaultDuration = 2, kElapsedSlotTime = 3, kRemainingSlotTime = 4, - kSlotIsPauseable = 5, + kSlotIsPausable = 5, kMinPauseDuration = 6, kMaxPauseDuration = 7, kManufacturerESAState = 8, @@ -21892,7 +21892,7 @@ struct Type uint32_t defaultDuration = static_cast(0); uint32_t elapsedSlotTime = static_cast(0); uint32_t remainingSlotTime = static_cast(0); - Optional slotIsPauseable; + Optional slotIsPausable; Optional minPauseDuration; Optional maxPauseDuration; Optional manufacturerESAState; @@ -21919,7 +21919,7 @@ struct DecodableType uint32_t defaultDuration = static_cast(0); uint32_t elapsedSlotTime = static_cast(0); uint32_t remainingSlotTime = static_cast(0); - Optional slotIsPauseable; + Optional slotIsPausable; Optional minPauseDuration; Optional maxPauseDuration; Optional manufacturerESAState; @@ -21948,7 +21948,7 @@ enum class Fields : uint8_t kEndTime = 3, kEarliestStartTime = 4, kLatestEndTime = 5, - kIsPauseable = 6, + kIsPausable = 6, kSlots = 7, kForecastUpdateReason = 8, }; @@ -21956,13 +21956,13 @@ enum class Fields : uint8_t struct Type { public: - uint16_t forecastId = static_cast(0); + uint32_t forecastId = static_cast(0); DataModel::Nullable activeSlotNumber; uint32_t startTime = static_cast(0); uint32_t endTime = static_cast(0); Optional> earliestStartTime; Optional latestEndTime; - bool isPauseable = static_cast(0); + bool isPausable = static_cast(0); DataModel::List slots; ForecastUpdateReasonEnum forecastUpdateReason = static_cast(0); @@ -21974,13 +21974,13 @@ struct Type struct DecodableType { public: - uint16_t forecastId = static_cast(0); + uint32_t forecastId = static_cast(0); DataModel::Nullable activeSlotNumber; uint32_t startTime = static_cast(0); uint32_t endTime = static_cast(0); Optional> earliestStartTime; Optional latestEndTime; - bool isPauseable = static_cast(0); + bool isPausable = static_cast(0); DataModel::DecodableList slots; ForecastUpdateReasonEnum forecastUpdateReason = static_cast(0); @@ -22026,15 +22026,17 @@ enum class Fields : uint8_t kMaxPower = 1, kMinDuration = 2, kMaxDuration = 3, + kCause = 4, }; struct Type { public: - int64_t minPower = static_cast(0); - int64_t maxPower = static_cast(0); - uint32_t minDuration = static_cast(0); - uint32_t maxDuration = static_cast(0); + int64_t minPower = static_cast(0); + int64_t maxPower = static_cast(0); + uint32_t minDuration = static_cast(0); + uint32_t maxDuration = static_cast(0); + PowerAdjustReasonEnum cause = static_cast(0); CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -22057,9 +22059,9 @@ enum class Fields : uint8_t struct Type { public: - uint8_t slotIndex = static_cast(0); - int64_t nominalPower = static_cast(0); - uint32_t duration = static_cast(0); + uint8_t slotIndex = static_cast(0); + Optional nominalPower; + uint32_t duration = static_cast(0); CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -22722,8 +22724,8 @@ enum class Fields : uint8_t struct Type { public: - chip::BitMask dayOfWeekForSequence = static_cast>(0); - DataModel::List chargingTargets; + Optional> dayOfWeekForSequence; + Optional> chargingTargets; static constexpr bool kIsFabricScoped = false; @@ -22733,8 +22735,8 @@ struct Type struct DecodableType { public: - chip::BitMask dayOfWeekForSequence = static_cast>(0); - DataModel::DecodableList chargingTargets; + Optional> dayOfWeekForSequence; + Optional> chargingTargets; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -23483,9 +23485,10 @@ static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; enum class Fields : uint8_t { - kSessionID = 0, - kState = 1, - kMaximumCurrent = 2, + kSessionID = 0, + kState = 1, + kMaximumCurrent = 2, + kMaximumDischargingCurrent = 3, }; struct Type @@ -23499,6 +23502,7 @@ struct Type uint32_t sessionID = static_cast(0); StateEnum state = static_cast(0); int64_t maximumCurrent = static_cast(0); + Optional maximumDischargingCurrent; CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; }; @@ -23513,6 +23517,7 @@ struct DecodableType uint32_t sessionID = static_cast(0); StateEnum state = static_cast(0); int64_t maximumCurrent = static_cast(0); + Optional maximumDischargingCurrent; CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -23526,6 +23531,7 @@ enum class Fields : uint8_t kState = 1, kReason = 2, kEnergyTransferred = 4, + kEnergyDischarged = 5, }; struct Type @@ -23540,6 +23546,7 @@ struct Type StateEnum state = static_cast(0); EnergyTransferStoppedReasonEnum reason = static_cast(0); int64_t energyTransferred = static_cast(0); + Optional energyDischarged; CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; }; @@ -23555,6 +23562,7 @@ struct DecodableType StateEnum state = static_cast(0); EnergyTransferStoppedReasonEnum reason = static_cast(0); int64_t energyTransferred = static_cast(0); + Optional energyDischarged; CHIP_ERROR Decode(TLV::TLVReader & reader); }; diff --git a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp index 89f34d0cee3714..8cafe818cf0355 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp @@ -3164,12 +3164,12 @@ CHIP_ERROR ComplexArgumentParser::Setup(const char * label, ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.remainingSlotTime, value["remainingSlotTime"])); valueCopy.removeMember("remainingSlotTime"); - if (value.isMember("slotIsPauseable")) + if (value.isMember("slotIsPausable")) { - snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "slotIsPauseable"); - ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.slotIsPauseable, value["slotIsPauseable"])); + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "slotIsPausable"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.slotIsPausable, value["slotIsPausable"])); } - valueCopy.removeMember("slotIsPauseable"); + valueCopy.removeMember("slotIsPausable"); if (value.isMember("minPauseDuration")) { @@ -3270,7 +3270,7 @@ void ComplexArgumentParser::Finalize(chip::app::Clusters::DeviceEnergyManagement ComplexArgumentParser::Finalize(request.defaultDuration); ComplexArgumentParser::Finalize(request.elapsedSlotTime); ComplexArgumentParser::Finalize(request.remainingSlotTime); - ComplexArgumentParser::Finalize(request.slotIsPauseable); + ComplexArgumentParser::Finalize(request.slotIsPausable); ComplexArgumentParser::Finalize(request.minPauseDuration); ComplexArgumentParser::Finalize(request.maxPauseDuration); ComplexArgumentParser::Finalize(request.manufacturerESAState); @@ -3302,7 +3302,7 @@ CHIP_ERROR ComplexArgumentParser::Setup(const char * label, ComplexArgumentParser::EnsureMemberExist("ForecastStruct.startTime", "startTime", value.isMember("startTime"))); ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ForecastStruct.endTime", "endTime", value.isMember("endTime"))); ReturnErrorOnFailure( - ComplexArgumentParser::EnsureMemberExist("ForecastStruct.isPauseable", "isPauseable", value.isMember("isPauseable"))); + ComplexArgumentParser::EnsureMemberExist("ForecastStruct.isPausable", "isPausable", value.isMember("isPausable"))); ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ForecastStruct.slots", "slots", value.isMember("slots"))); ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ForecastStruct.forecastUpdateReason", "forecastUpdateReason", value.isMember("forecastUpdateReason"))); @@ -3338,9 +3338,9 @@ CHIP_ERROR ComplexArgumentParser::Setup(const char * label, } valueCopy.removeMember("latestEndTime"); - snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "isPauseable"); - ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.isPauseable, value["isPauseable"])); - valueCopy.removeMember("isPauseable"); + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "isPausable"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.isPausable, value["isPausable"])); + valueCopy.removeMember("isPausable"); snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "slots"); ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.slots, value["slots"])); @@ -3362,7 +3362,7 @@ void ComplexArgumentParser::Finalize(chip::app::Clusters::DeviceEnergyManagement ComplexArgumentParser::Finalize(request.endTime); ComplexArgumentParser::Finalize(request.earliestStartTime); ComplexArgumentParser::Finalize(request.latestEndTime); - ComplexArgumentParser::Finalize(request.isPauseable); + ComplexArgumentParser::Finalize(request.isPausable); ComplexArgumentParser::Finalize(request.slots); ComplexArgumentParser::Finalize(request.forecastUpdateReason); } @@ -3440,6 +3440,7 @@ CHIP_ERROR ComplexArgumentParser::Setup(const char * label, ComplexArgumentParser::EnsureMemberExist("PowerAdjustStruct.minDuration", "minDuration", value.isMember("minDuration"))); ReturnErrorOnFailure( ComplexArgumentParser::EnsureMemberExist("PowerAdjustStruct.maxDuration", "maxDuration", value.isMember("maxDuration"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("PowerAdjustStruct.cause", "cause", value.isMember("cause"))); char labelWithMember[kMaxLabelLength]; snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "minPower"); @@ -3458,6 +3459,10 @@ CHIP_ERROR ComplexArgumentParser::Setup(const char * label, ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.maxDuration, value["maxDuration"])); valueCopy.removeMember("maxDuration"); + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "cause"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.cause, value["cause"])); + valueCopy.removeMember("cause"); + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); } @@ -3467,6 +3472,7 @@ void ComplexArgumentParser::Finalize(chip::app::Clusters::DeviceEnergyManagement ComplexArgumentParser::Finalize(request.maxPower); ComplexArgumentParser::Finalize(request.minDuration); ComplexArgumentParser::Finalize(request.maxDuration); + ComplexArgumentParser::Finalize(request.cause); } CHIP_ERROR ComplexArgumentParser::Setup(const char * label, @@ -3480,8 +3486,6 @@ CHIP_ERROR ComplexArgumentParser::Setup(const char * label, ReturnErrorOnFailure( ComplexArgumentParser::EnsureMemberExist("SlotAdjustmentStruct.slotIndex", "slotIndex", value.isMember("slotIndex"))); - ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("SlotAdjustmentStruct.nominalPower", "nominalPower", - value.isMember("nominalPower"))); ReturnErrorOnFailure( ComplexArgumentParser::EnsureMemberExist("SlotAdjustmentStruct.duration", "duration", value.isMember("duration"))); @@ -3490,8 +3494,11 @@ CHIP_ERROR ComplexArgumentParser::Setup(const char * label, ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.slotIndex, value["slotIndex"])); valueCopy.removeMember("slotIndex"); - snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "nominalPower"); - ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.nominalPower, value["nominalPower"])); + if (value.isMember("nominalPower")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "nominalPower"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.nominalPower, value["nominalPower"])); + } valueCopy.removeMember("nominalPower"); snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "duration"); @@ -3560,19 +3567,20 @@ CHIP_ERROR ComplexArgumentParser::Setup(const char * label, // Copy to track which members we already processed. Json::Value valueCopy(value); - ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ChargingTargetScheduleStruct.dayOfWeekForSequence", - "dayOfWeekForSequence", value.isMember("dayOfWeekForSequence"))); - ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ChargingTargetScheduleStruct.chargingTargets", "chargingTargets", - value.isMember("chargingTargets"))); - char labelWithMember[kMaxLabelLength]; - snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "dayOfWeekForSequence"); - ReturnErrorOnFailure( - ComplexArgumentParser::Setup(labelWithMember, request.dayOfWeekForSequence, value["dayOfWeekForSequence"])); + if (value.isMember("dayOfWeekForSequence")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "dayOfWeekForSequence"); + ReturnErrorOnFailure( + ComplexArgumentParser::Setup(labelWithMember, request.dayOfWeekForSequence, value["dayOfWeekForSequence"])); + } valueCopy.removeMember("dayOfWeekForSequence"); - snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "chargingTargets"); - ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.chargingTargets, value["chargingTargets"])); + if (value.isMember("chargingTargets")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "chargingTargets"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.chargingTargets, value["chargingTargets"])); + } valueCopy.removeMember("chargingTargets"); return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp index 0d31e0f6074c81..31e09886a2001d 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -2806,10 +2806,10 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, } } { - CHIP_ERROR err = LogValue("SlotIsPauseable", indent + 1, value.slotIsPauseable); + CHIP_ERROR err = LogValue("SlotIsPausable", indent + 1, value.slotIsPausable); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'SlotIsPauseable'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'SlotIsPausable'"); return err; } } @@ -2968,10 +2968,10 @@ DataModelLogger::LogValue(const char * label, size_t indent, } } { - CHIP_ERROR err = LogValue("IsPauseable", indent + 1, value.isPauseable); + CHIP_ERROR err = LogValue("IsPausable", indent + 1, value.isPausable); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'IsPauseable'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'IsPausable'"); return err; } } @@ -3083,6 +3083,14 @@ DataModelLogger::LogValue(const char * label, size_t indent, return err; } } + { + CHIP_ERROR err = LogValue("Cause", indent + 1, value.cause); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Cause'"); + return err; + } + } DataModelLogger::LogString(indent, "}"); return CHIP_NO_ERROR; @@ -6519,6 +6527,14 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return err; } } + { + CHIP_ERROR err = DataModelLogger::LogValue("MaximumDischargingCurrent", indent + 1, value.maximumDischargingCurrent); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'MaximumDischargingCurrent'"); + return err; + } + } DataModelLogger::LogString(indent, "}"); return CHIP_NO_ERROR; @@ -6559,6 +6575,14 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return err; } } + { + CHIP_ERROR err = DataModelLogger::LogValue("EnergyDischarged", indent + 1, value.energyDischarged); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'EnergyDischarged'"); + return err; + } + } DataModelLogger::LogString(indent, "}"); return CHIP_NO_ERROR; diff --git a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h index 59bdd11dcb1cb3..546fa3091812eb 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -81876,7 +81876,11 @@ class DeviceEnergyManagementModifyForecastRequest : public ClusterCommand { MTRDeviceEnergyManagementClusterSlotAdjustmentStruct * newElement_0; newElement_0 = [MTRDeviceEnergyManagementClusterSlotAdjustmentStruct new]; newElement_0.slotIndex = [NSNumber numberWithUnsignedChar:entry_0.slotIndex]; - newElement_0.nominalPower = [NSNumber numberWithLongLong:entry_0.nominalPower]; + if (entry_0.nominalPower.HasValue()) { + newElement_0.nominalPower = [NSNumber numberWithLongLong:entry_0.nominalPower.Value()]; + } else { + newElement_0.nominalPower = nil; + } newElement_0.duration = [NSNumber numberWithUnsignedInt:entry_0.duration]; [array_0 addObject:newElement_0]; } @@ -83545,26 +83549,34 @@ class EnergyEvseSetTargets : public ClusterCommand { for (auto & entry_0 : mRequest.chargingTargetSchedules) { MTREnergyEVSEClusterChargingTargetScheduleStruct * newElement_0; newElement_0 = [MTREnergyEVSEClusterChargingTargetScheduleStruct new]; - newElement_0.dayOfWeekForSequence = [NSNumber numberWithUnsignedChar:entry_0.dayOfWeekForSequence.Raw()]; - { // Scope for our temporary variables - auto * array_2 = [NSMutableArray new]; - for (auto & entry_2 : entry_0.chargingTargets) { - MTREnergyEVSEClusterChargingTargetStruct * newElement_2; - newElement_2 = [MTREnergyEVSEClusterChargingTargetStruct new]; - newElement_2.targetTimeMinutesPastMidnight = [NSNumber numberWithUnsignedShort:entry_2.targetTimeMinutesPastMidnight]; - if (entry_2.targetSoC.HasValue()) { - newElement_2.targetSoC = [NSNumber numberWithUnsignedChar:entry_2.targetSoC.Value()]; - } else { - newElement_2.targetSoC = nil; - } - if (entry_2.addedEnergy.HasValue()) { - newElement_2.addedEnergy = [NSNumber numberWithLongLong:entry_2.addedEnergy.Value()]; - } else { - newElement_2.addedEnergy = nil; + if (entry_0.dayOfWeekForSequence.HasValue()) { + newElement_0.dayOfWeekForSequence = [NSNumber numberWithUnsignedChar:entry_0.dayOfWeekForSequence.Value().Raw()]; + } else { + newElement_0.dayOfWeekForSequence = nil; + } + if (entry_0.chargingTargets.HasValue()) { + { // Scope for our temporary variables + auto * array_3 = [NSMutableArray new]; + for (auto & entry_3 : entry_0.chargingTargets.Value()) { + MTREnergyEVSEClusterChargingTargetStruct * newElement_3; + newElement_3 = [MTREnergyEVSEClusterChargingTargetStruct new]; + newElement_3.targetTimeMinutesPastMidnight = [NSNumber numberWithUnsignedShort:entry_3.targetTimeMinutesPastMidnight]; + if (entry_3.targetSoC.HasValue()) { + newElement_3.targetSoC = [NSNumber numberWithUnsignedChar:entry_3.targetSoC.Value()]; + } else { + newElement_3.targetSoC = nil; + } + if (entry_3.addedEnergy.HasValue()) { + newElement_3.addedEnergy = [NSNumber numberWithLongLong:entry_3.addedEnergy.Value()]; + } else { + newElement_3.addedEnergy = nil; + } + [array_3 addObject:newElement_3]; } - [array_2 addObject:newElement_2]; + newElement_0.chargingTargets = array_3; } - newElement_0.chargingTargets = array_2; + } else { + newElement_0.chargingTargets = nil; } [array_0 addObject:newElement_0]; } From c508af52d7280098b9b0eca13fe7d0c4879ad8fb Mon Sep 17 00:00:00 2001 From: James Harrow Date: Thu, 30 May 2024 00:54:31 +0100 Subject: [PATCH 03/32] Added missing energy-management-app.matter --- .../energy-management-app.matter | 26 +++++++++++++------ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/examples/energy-management-app/energy-management-common/energy-management-app.matter b/examples/energy-management-app/energy-management-common/energy-management-app.matter index 68db2eea271ec3..8b6936cbf083eb 100644 --- a/examples/energy-management-app/energy-management-common/energy-management-app.matter +++ b/examples/energy-management-app/energy-management-common/energy-management-app.matter @@ -1430,7 +1430,7 @@ cluster ElectricalEnergyMeasurement = 145 { /** This cluster allows a client to manage the power draw of a device. An example of such a client could be an Energy Management System (EMS) which controls an Energy Smart Appliance (ESA). */ provisional cluster DeviceEnergyManagement = 152 { - revision 3; + revision 4; enum AdjustmentCauseEnum : enum8 { kLocalOptimization = 0; @@ -1491,6 +1491,12 @@ provisional cluster DeviceEnergyManagement = 152 { kOptOut = 3; } + enum PowerAdjustReasonEnum : enum8 { + kNoAdjustment = 0; + kLocalOptimizationAdjustment = 1; + kGridOptimizationAdjustment = 2; + } + bitmap Feature : bitmap32 { kPowerAdjustment = 0x1; kPowerForecastReporting = 0x2; @@ -1514,7 +1520,7 @@ provisional cluster DeviceEnergyManagement = 152 { elapsed_s defaultDuration = 2; elapsed_s elapsedSlotTime = 3; elapsed_s remainingSlotTime = 4; - optional boolean slotIsPauseable = 5; + optional boolean slotIsPausable = 5; optional elapsed_s minPauseDuration = 6; optional elapsed_s maxPauseDuration = 7; optional int16u manufacturerESAState = 8; @@ -1530,13 +1536,13 @@ provisional cluster DeviceEnergyManagement = 152 { } struct ForecastStruct { - int16u forecastId = 0; + int32u forecastId = 0; nullable int16u activeSlotNumber = 1; epoch_s startTime = 2; epoch_s endTime = 3; optional nullable epoch_s earliestStartTime = 4; optional epoch_s latestEndTime = 5; - boolean isPauseable = 6; + boolean isPausable = 6; SlotStruct slots[] = 7; ForecastUpdateReasonEnum forecastUpdateReason = 8; } @@ -1554,11 +1560,12 @@ provisional cluster DeviceEnergyManagement = 152 { power_mw maxPower = 1; elapsed_s minDuration = 2; elapsed_s maxDuration = 3; + PowerAdjustReasonEnum cause = 4; } struct SlotAdjustmentStruct { int8u slotIndex = 0; - power_mw nominalPower = 1; + optional power_mw nominalPower = 1; elapsed_s duration = 2; } @@ -1640,7 +1647,7 @@ provisional cluster DeviceEnergyManagement = 152 { /** Electric Vehicle Supply Equipment (EVSE) is equipment used to charge an Electric Vehicle (EV) or Plug-In Hybrid Electric Vehicle. This cluster provides an interface to the functionality of Electric Vehicle Supply Equipment (EVSE) management. */ cluster EnergyEvse = 153 { - revision 2; + revision 4; enum EnergyTransferStoppedReasonEnum : enum8 { kEVStopped = 0; @@ -1684,6 +1691,7 @@ cluster EnergyEvse = 153 { kDischargingEnabled = 2; kDisabledError = 3; kDisabledDiagnostics = 4; + kEnabled = 5; } bitmap Feature : bitmap32 { @@ -1711,8 +1719,8 @@ cluster EnergyEvse = 153 { } struct ChargingTargetScheduleStruct { - TargetDayOfWeekBitmap dayOfWeekForSequence = 0; - ChargingTargetStruct chargingTargets[] = 1; + optional TargetDayOfWeekBitmap dayOfWeekForSequence = 0; + optional ChargingTargetStruct chargingTargets[] = 1; } info event EVConnected = 0 { @@ -1731,6 +1739,7 @@ cluster EnergyEvse = 153 { int32u sessionID = 0; StateEnum state = 1; amperage_ma maximumCurrent = 2; + optional amperage_ma maximumDischargingCurrent = 3; } info event EnergyTransferStopped = 3 { @@ -1738,6 +1747,7 @@ cluster EnergyEvse = 153 { StateEnum state = 1; EnergyTransferStoppedReasonEnum reason = 2; energy_mwh energyTransferred = 4; + optional energy_mwh energyDischarged = 5; } critical event Fault = 4 { From 2ed3c011deb8ac1f3ac80c52ff49ca74aebabb04 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Thu, 30 May 2024 21:34:18 +0100 Subject: [PATCH 04/32] Updated with spec PR #9251 merged to master. --- .../chip/device-energy-management-cluster.xml | 58 ++++++++----------- 1 file changed, 23 insertions(+), 35 deletions(-) diff --git a/src/app/zap-templates/zcl/data-model/chip/device-energy-management-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/device-energy-management-cluster.xml index 3bf9ea24d42102..c6c104effed39a 100644 --- a/src/app/zap-templates/zcl/data-model/chip/device-energy-management-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/device-energy-management-cluster.xml @@ -33,46 +33,29 @@ adjustment (within the limits offered by the ESA)."> + + + + + - - - - - - - - - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + @@ -98,7 +81,7 @@ planned operation."> AbsMinPower AbsMaxPower - PowerAdjustmentCapability + PowerAdjustmentCapability Forecast OptOutState @@ -249,13 +232,18 @@ planned operation."> + + + + + + - From f34083f8ff6600adcebfe4455ddcd9607fcb9750 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Thu, 30 May 2024 21:40:19 +0100 Subject: [PATCH 05/32] Updated with spec PR #9266 (change ForecastId -> ForecastID) --- .../zcl/data-model/chip/device-energy-management-cluster.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/zap-templates/zcl/data-model/chip/device-energy-management-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/device-energy-management-cluster.xml index c6c104effed39a..9c46fc1f6887db 100644 --- a/src/app/zap-templates/zcl/data-model/chip/device-energy-management-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/device-energy-management-cluster.xml @@ -114,7 +114,7 @@ planned operation."> Allows a client to modify a Forecast within the limits allowed by the ESA. - + @@ -248,7 +248,7 @@ planned operation."> - + From 824f90b63738cdd8439533c13c6fcc93f4edd3ef Mon Sep 17 00:00:00 2001 From: James Harrow Date: Thu, 30 May 2024 22:11:15 +0100 Subject: [PATCH 06/32] regen_all --- .../all-clusters-app.matter | 26 +- .../energy-management-app.matter | 26 +- .../data_model/controller-clusters.matter | 26 +- .../chip/devicecontroller/ChipClusters.java | 18 +- .../chip/devicecontroller/ChipStructs.java | 280 ++++++++++-------- .../devicecontroller/ClusterIDMapping.java | 2 +- .../devicecontroller/ClusterInfoMapping.java | 10 +- .../chip/devicecontroller/cluster/files.gni | 1 + ...ceEnergyManagementClusterForecastStruct.kt | 12 +- ...nergyManagementClusterPowerAdjustStruct.kt | 10 +- .../clusters/DeviceEnergyManagementCluster.kt | 27 +- .../java/matter/controller/cluster/files.gni | 1 + ...ceEnergyManagementClusterForecastStruct.kt | 12 +- ...nergyManagementClusterPowerAdjustStruct.kt | 10 +- .../CHIPAttributeTLVValueDecoder.cpp | 144 +++++---- .../python/chip/clusters/CHIPClusters.py | 2 +- .../python/chip/clusters/Objects.py | 57 ++-- .../MTRAttributeTLVValueDecoder.mm | 34 ++- .../zap-generated/MTRCommandPayloadsObjc.h | 2 +- .../zap-generated/MTRCommandPayloadsObjc.mm | 8 +- .../zap-generated/MTRDeviceTypeMetadata.mm | 1 - .../CHIP/zap-generated/MTRStructsObjc.h | 25 +- .../CHIP/zap-generated/MTRStructsObjc.mm | 111 ++++--- .../zap-generated/cluster-objects.cpp | 160 ++++++---- .../zap-generated/cluster-objects.h | 98 +++--- .../zap-generated/cluster/Commands.h | 6 +- .../cluster/ComplexArgumentParser.cpp | 143 +++++---- .../cluster/ComplexArgumentParser.h | 16 +- .../cluster/logging/DataModelLogger.cpp | 124 ++++---- .../cluster/logging/DataModelLogger.h | 10 +- .../zap-generated/cluster/Commands.h | 4 +- 31 files changed, 843 insertions(+), 563 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index 58cf56f428b82a..115a7fb4eea677 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -4153,6 +4153,18 @@ provisional cluster DeviceEnergyManagement = 152 { optional int16u currency = 3; } + struct PowerAdjustStruct { + power_mw minPower = 0; + power_mw maxPower = 1; + elapsed_s minDuration = 2; + elapsed_s maxDuration = 3; + } + + struct PowerAdjustCapabilityStruct { + nullable PowerAdjustStruct powerAdjustCapability[] = 0; + PowerAdjustReasonEnum cause = 1; + } + struct SlotStruct { elapsed_s minDuration = 0; elapsed_s maxDuration = 1; @@ -4175,7 +4187,7 @@ provisional cluster DeviceEnergyManagement = 152 { } struct ForecastStruct { - int32u forecastId = 0; + int32u forecastID = 0; nullable int16u activeSlotNumber = 1; epoch_s startTime = 2; epoch_s endTime = 3; @@ -4194,14 +4206,6 @@ provisional cluster DeviceEnergyManagement = 152 { optional int8s loadControl = 4; } - struct PowerAdjustStruct { - power_mw minPower = 0; - power_mw maxPower = 1; - elapsed_s minDuration = 2; - elapsed_s maxDuration = 3; - PowerAdjustReasonEnum cause = 4; - } - struct SlotAdjustmentStruct { int8u slotIndex = 0; optional power_mw nominalPower = 1; @@ -4229,7 +4233,7 @@ provisional cluster DeviceEnergyManagement = 152 { readonly attribute ESAStateEnum ESAState = 2; readonly attribute power_mw absMinPower = 3; readonly attribute power_mw absMaxPower = 4; - readonly attribute optional nullable PowerAdjustStruct powerAdjustmentCapability[] = 5; + readonly attribute optional nullable PowerAdjustCapabilityStruct powerAdjustmentCapability[] = 5; readonly attribute optional nullable ForecastStruct forecast = 6; readonly attribute optional OptOutStateEnum optOutState = 7; readonly attribute command_id generatedCommandList[] = 65528; @@ -4256,7 +4260,7 @@ provisional cluster DeviceEnergyManagement = 152 { } request struct ModifyForecastRequestRequest { - int32u forecastId = 0; + int32u forecastID = 0; SlotAdjustmentStruct slotAdjustments[] = 1; AdjustmentCauseEnum cause = 2; } diff --git a/examples/energy-management-app/energy-management-common/energy-management-app.matter b/examples/energy-management-app/energy-management-common/energy-management-app.matter index 8b6936cbf083eb..9b0c95b0ba786c 100644 --- a/examples/energy-management-app/energy-management-common/energy-management-app.matter +++ b/examples/energy-management-app/energy-management-common/energy-management-app.matter @@ -1514,6 +1514,18 @@ provisional cluster DeviceEnergyManagement = 152 { optional int16u currency = 3; } + struct PowerAdjustStruct { + power_mw minPower = 0; + power_mw maxPower = 1; + elapsed_s minDuration = 2; + elapsed_s maxDuration = 3; + } + + struct PowerAdjustCapabilityStruct { + nullable PowerAdjustStruct powerAdjustCapability[] = 0; + PowerAdjustReasonEnum cause = 1; + } + struct SlotStruct { elapsed_s minDuration = 0; elapsed_s maxDuration = 1; @@ -1536,7 +1548,7 @@ provisional cluster DeviceEnergyManagement = 152 { } struct ForecastStruct { - int32u forecastId = 0; + int32u forecastID = 0; nullable int16u activeSlotNumber = 1; epoch_s startTime = 2; epoch_s endTime = 3; @@ -1555,14 +1567,6 @@ provisional cluster DeviceEnergyManagement = 152 { optional int8s loadControl = 4; } - struct PowerAdjustStruct { - power_mw minPower = 0; - power_mw maxPower = 1; - elapsed_s minDuration = 2; - elapsed_s maxDuration = 3; - PowerAdjustReasonEnum cause = 4; - } - struct SlotAdjustmentStruct { int8u slotIndex = 0; optional power_mw nominalPower = 1; @@ -1590,7 +1594,7 @@ provisional cluster DeviceEnergyManagement = 152 { readonly attribute ESAStateEnum ESAState = 2; readonly attribute power_mw absMinPower = 3; readonly attribute power_mw absMaxPower = 4; - readonly attribute optional nullable PowerAdjustStruct powerAdjustmentCapability[] = 5; + readonly attribute optional nullable PowerAdjustCapabilityStruct powerAdjustmentCapability[] = 5; readonly attribute optional nullable ForecastStruct forecast = 6; readonly attribute optional OptOutStateEnum optOutState = 7; readonly attribute command_id generatedCommandList[] = 65528; @@ -1617,7 +1621,7 @@ provisional cluster DeviceEnergyManagement = 152 { } request struct ModifyForecastRequestRequest { - int32u forecastId = 0; + int32u forecastID = 0; SlotAdjustmentStruct slotAdjustments[] = 1; AdjustmentCauseEnum cause = 2; } diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 358a027795048d..eb9a40da10bae9 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -4678,6 +4678,18 @@ provisional cluster DeviceEnergyManagement = 152 { optional int16u currency = 3; } + struct PowerAdjustStruct { + power_mw minPower = 0; + power_mw maxPower = 1; + elapsed_s minDuration = 2; + elapsed_s maxDuration = 3; + } + + struct PowerAdjustCapabilityStruct { + nullable PowerAdjustStruct powerAdjustCapability[] = 0; + PowerAdjustReasonEnum cause = 1; + } + struct SlotStruct { elapsed_s minDuration = 0; elapsed_s maxDuration = 1; @@ -4700,7 +4712,7 @@ provisional cluster DeviceEnergyManagement = 152 { } struct ForecastStruct { - int32u forecastId = 0; + int32u forecastID = 0; nullable int16u activeSlotNumber = 1; epoch_s startTime = 2; epoch_s endTime = 3; @@ -4719,14 +4731,6 @@ provisional cluster DeviceEnergyManagement = 152 { optional int8s loadControl = 4; } - struct PowerAdjustStruct { - power_mw minPower = 0; - power_mw maxPower = 1; - elapsed_s minDuration = 2; - elapsed_s maxDuration = 3; - PowerAdjustReasonEnum cause = 4; - } - struct SlotAdjustmentStruct { int8u slotIndex = 0; optional power_mw nominalPower = 1; @@ -4754,7 +4758,7 @@ provisional cluster DeviceEnergyManagement = 152 { readonly attribute ESAStateEnum ESAState = 2; readonly attribute power_mw absMinPower = 3; readonly attribute power_mw absMaxPower = 4; - readonly attribute optional nullable PowerAdjustStruct powerAdjustmentCapability[] = 5; + readonly attribute optional nullable PowerAdjustCapabilityStruct powerAdjustmentCapability[] = 5; readonly attribute optional nullable ForecastStruct forecast = 6; readonly attribute optional OptOutStateEnum optOutState = 7; readonly attribute command_id generatedCommandList[] = 65528; @@ -4781,7 +4785,7 @@ provisional cluster DeviceEnergyManagement = 152 { } request struct ModifyForecastRequestRequest { - int32u forecastId = 0; + int32u forecastID = 0; SlotAdjustmentStruct slotAdjustments[] = 1; AdjustmentCauseEnum cause = 2; } diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java index 7a6caeb9532993..44f1418f93f038 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java @@ -31198,17 +31198,17 @@ public void onResponse(StructType invokeStructValue) { }}, commandId, commandArgs, timedInvokeTimeoutMs); } - public void modifyForecastRequest(DefaultClusterCallback callback, Long forecastId, ArrayList slotAdjustments, Integer cause) { - modifyForecastRequest(callback, forecastId, slotAdjustments, cause, 0); + public void modifyForecastRequest(DefaultClusterCallback callback, Long forecastID, ArrayList slotAdjustments, Integer cause) { + modifyForecastRequest(callback, forecastID, slotAdjustments, cause, 0); } - public void modifyForecastRequest(DefaultClusterCallback callback, Long forecastId, ArrayList slotAdjustments, Integer cause, int timedInvokeTimeoutMs) { + public void modifyForecastRequest(DefaultClusterCallback callback, Long forecastID, ArrayList slotAdjustments, Integer cause, int timedInvokeTimeoutMs) { final long commandId = 5L; ArrayList elements = new ArrayList<>(); - final long forecastIdFieldID = 0L; - BaseTLVType forecastIdtlvValue = new UIntType(forecastId); - elements.add(new StructElement(forecastIdFieldID, forecastIdtlvValue)); + final long forecastIDFieldID = 0L; + BaseTLVType forecastIDtlvValue = new UIntType(forecastID); + elements.add(new StructElement(forecastIDFieldID, forecastIDtlvValue)); final long slotAdjustmentsFieldID = 1L; BaseTLVType slotAdjustmentstlvValue = ArrayType.generateArrayType(slotAdjustments, (elementslotAdjustments) -> elementslotAdjustments.encodeTlv()); @@ -31267,7 +31267,7 @@ public void onResponse(StructType invokeStructValue) { } public interface PowerAdjustmentCapabilityAttributeCallback extends BaseAttributeCallback { - void onSuccess(@Nullable List value); + void onSuccess(@Nullable List value); } public interface ForecastAttributeCallback extends BaseAttributeCallback { @@ -31427,7 +31427,7 @@ public void readPowerAdjustmentCapabilityAttribute( readAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - @Nullable List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + @Nullable List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } }, POWER_ADJUSTMENT_CAPABILITY_ATTRIBUTE_ID, true); @@ -31440,7 +31440,7 @@ public void subscribePowerAdjustmentCapabilityAttribute( subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - @Nullable List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + @Nullable List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } }, POWER_ADJUSTMENT_CAPABILITY_ATTRIBUTE_ID, minInterval, maxInterval); diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java b/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java index ab12472a2ca7ff..a24269a9b13dec 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java @@ -7352,6 +7352,158 @@ public String toString() { return output.toString(); } } +public static class DeviceEnergyManagementClusterPowerAdjustStruct { + public Long minPower; + public Long maxPower; + public Long minDuration; + public Long maxDuration; + private static final long MIN_POWER_ID = 0L; + private static final long MAX_POWER_ID = 1L; + private static final long MIN_DURATION_ID = 2L; + private static final long MAX_DURATION_ID = 3L; + + public DeviceEnergyManagementClusterPowerAdjustStruct( + Long minPower, + Long maxPower, + Long minDuration, + Long maxDuration + ) { + this.minPower = minPower; + this.maxPower = maxPower; + this.minDuration = minDuration; + this.maxDuration = maxDuration; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(MIN_POWER_ID, new IntType(minPower))); + values.add(new StructElement(MAX_POWER_ID, new IntType(maxPower))); + values.add(new StructElement(MIN_DURATION_ID, new UIntType(minDuration))); + values.add(new StructElement(MAX_DURATION_ID, new UIntType(maxDuration))); + + return new StructType(values); + } + + public static DeviceEnergyManagementClusterPowerAdjustStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Long minPower = null; + Long maxPower = null; + Long minDuration = null; + Long maxDuration = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == MIN_POWER_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Int) { + IntType castingValue = element.value(IntType.class); + minPower = castingValue.value(Long.class); + } + } else if (element.contextTagNum() == MAX_POWER_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Int) { + IntType castingValue = element.value(IntType.class); + maxPower = castingValue.value(Long.class); + } + } else if (element.contextTagNum() == MIN_DURATION_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + minDuration = castingValue.value(Long.class); + } + } else if (element.contextTagNum() == MAX_DURATION_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + maxDuration = castingValue.value(Long.class); + } + } + } + return new DeviceEnergyManagementClusterPowerAdjustStruct( + minPower, + maxPower, + minDuration, + maxDuration + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("DeviceEnergyManagementClusterPowerAdjustStruct {\n"); + output.append("\tminPower: "); + output.append(minPower); + output.append("\n"); + output.append("\tmaxPower: "); + output.append(maxPower); + output.append("\n"); + output.append("\tminDuration: "); + output.append(minDuration); + output.append("\n"); + output.append("\tmaxDuration: "); + output.append(maxDuration); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class DeviceEnergyManagementClusterPowerAdjustCapabilityStruct { + public @Nullable ArrayList powerAdjustCapability; + public Integer cause; + private static final long POWER_ADJUST_CAPABILITY_ID = 0L; + private static final long CAUSE_ID = 1L; + + public DeviceEnergyManagementClusterPowerAdjustCapabilityStruct( + @Nullable ArrayList powerAdjustCapability, + Integer cause + ) { + this.powerAdjustCapability = powerAdjustCapability; + this.cause = cause; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(POWER_ADJUST_CAPABILITY_ID, powerAdjustCapability != null ? ArrayType.generateArrayType(powerAdjustCapability, (elementpowerAdjustCapability) -> elementpowerAdjustCapability.encodeTlv()) : new NullType())); + values.add(new StructElement(CAUSE_ID, new UIntType(cause))); + + return new StructType(values); + } + + public static DeviceEnergyManagementClusterPowerAdjustCapabilityStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + @Nullable ArrayList powerAdjustCapability = null; + Integer cause = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == POWER_ADJUST_CAPABILITY_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Array) { + ArrayType castingValue = element.value(ArrayType.class); + powerAdjustCapability = castingValue.map((elementcastingValue) -> ChipStructs.DeviceEnergyManagementClusterPowerAdjustStruct.decodeTlv(elementcastingValue)); + } + } else if (element.contextTagNum() == CAUSE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + cause = castingValue.value(Integer.class); + } + } + } + return new DeviceEnergyManagementClusterPowerAdjustCapabilityStruct( + powerAdjustCapability, + cause + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("DeviceEnergyManagementClusterPowerAdjustCapabilityStruct {\n"); + output.append("\tpowerAdjustCapability: "); + output.append(powerAdjustCapability); + output.append("\n"); + output.append("\tcause: "); + output.append(cause); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} public static class DeviceEnergyManagementClusterSlotStruct { public Long minDuration; public Long maxDuration; @@ -7654,7 +7806,7 @@ public String toString() { } } public static class DeviceEnergyManagementClusterForecastStruct { - public Long forecastId; + public Long forecastID; public @Nullable Integer activeSlotNumber; public Long startTime; public Long endTime; @@ -7663,7 +7815,7 @@ public static class DeviceEnergyManagementClusterForecastStruct { public Boolean isPausable; public ArrayList slots; public Integer forecastUpdateReason; - private static final long FORECAST_ID_ID = 0L; + private static final long FORECAST_I_D_ID = 0L; private static final long ACTIVE_SLOT_NUMBER_ID = 1L; private static final long START_TIME_ID = 2L; private static final long END_TIME_ID = 3L; @@ -7674,7 +7826,7 @@ public static class DeviceEnergyManagementClusterForecastStruct { private static final long FORECAST_UPDATE_REASON_ID = 8L; public DeviceEnergyManagementClusterForecastStruct( - Long forecastId, + Long forecastID, @Nullable Integer activeSlotNumber, Long startTime, Long endTime, @@ -7684,7 +7836,7 @@ public DeviceEnergyManagementClusterForecastStruct( ArrayList slots, Integer forecastUpdateReason ) { - this.forecastId = forecastId; + this.forecastID = forecastID; this.activeSlotNumber = activeSlotNumber; this.startTime = startTime; this.endTime = endTime; @@ -7697,7 +7849,7 @@ public DeviceEnergyManagementClusterForecastStruct( public StructType encodeTlv() { ArrayList values = new ArrayList<>(); - values.add(new StructElement(FORECAST_ID_ID, new UIntType(forecastId))); + values.add(new StructElement(FORECAST_I_D_ID, new UIntType(forecastID))); values.add(new StructElement(ACTIVE_SLOT_NUMBER_ID, activeSlotNumber != null ? new UIntType(activeSlotNumber) : new NullType())); values.add(new StructElement(START_TIME_ID, new UIntType(startTime))); values.add(new StructElement(END_TIME_ID, new UIntType(endTime))); @@ -7714,7 +7866,7 @@ public static DeviceEnergyManagementClusterForecastStruct decodeTlv(BaseTLVType if (tlvValue == null || tlvValue.type() != TLVType.Struct) { return null; } - Long forecastId = null; + Long forecastID = null; @Nullable Integer activeSlotNumber = null; Long startTime = null; Long endTime = null; @@ -7724,10 +7876,10 @@ public static DeviceEnergyManagementClusterForecastStruct decodeTlv(BaseTLVType ArrayList slots = null; Integer forecastUpdateReason = null; for (StructElement element: ((StructType)tlvValue).value()) { - if (element.contextTagNum() == FORECAST_ID_ID) { + if (element.contextTagNum() == FORECAST_I_D_ID) { if (element.value(BaseTLVType.class).type() == TLVType.UInt) { UIntType castingValue = element.value(UIntType.class); - forecastId = castingValue.value(Long.class); + forecastID = castingValue.value(Long.class); } } else if (element.contextTagNum() == ACTIVE_SLOT_NUMBER_ID) { if (element.value(BaseTLVType.class).type() == TLVType.UInt) { @@ -7772,7 +7924,7 @@ public static DeviceEnergyManagementClusterForecastStruct decodeTlv(BaseTLVType } } return new DeviceEnergyManagementClusterForecastStruct( - forecastId, + forecastID, activeSlotNumber, startTime, endTime, @@ -7788,8 +7940,8 @@ public static DeviceEnergyManagementClusterForecastStruct decodeTlv(BaseTLVType public String toString() { StringBuilder output = new StringBuilder(); output.append("DeviceEnergyManagementClusterForecastStruct {\n"); - output.append("\tforecastId: "); - output.append(forecastId); + output.append("\tforecastID: "); + output.append(forecastID); output.append("\n"); output.append("\tactiveSlotNumber: "); output.append(activeSlotNumber); @@ -7925,112 +8077,6 @@ public String toString() { return output.toString(); } } -public static class DeviceEnergyManagementClusterPowerAdjustStruct { - public Long minPower; - public Long maxPower; - public Long minDuration; - public Long maxDuration; - public Integer cause; - private static final long MIN_POWER_ID = 0L; - private static final long MAX_POWER_ID = 1L; - private static final long MIN_DURATION_ID = 2L; - private static final long MAX_DURATION_ID = 3L; - private static final long CAUSE_ID = 4L; - - public DeviceEnergyManagementClusterPowerAdjustStruct( - Long minPower, - Long maxPower, - Long minDuration, - Long maxDuration, - Integer cause - ) { - this.minPower = minPower; - this.maxPower = maxPower; - this.minDuration = minDuration; - this.maxDuration = maxDuration; - this.cause = cause; - } - - public StructType encodeTlv() { - ArrayList values = new ArrayList<>(); - values.add(new StructElement(MIN_POWER_ID, new IntType(minPower))); - values.add(new StructElement(MAX_POWER_ID, new IntType(maxPower))); - values.add(new StructElement(MIN_DURATION_ID, new UIntType(minDuration))); - values.add(new StructElement(MAX_DURATION_ID, new UIntType(maxDuration))); - values.add(new StructElement(CAUSE_ID, new UIntType(cause))); - - return new StructType(values); - } - - public static DeviceEnergyManagementClusterPowerAdjustStruct decodeTlv(BaseTLVType tlvValue) { - if (tlvValue == null || tlvValue.type() != TLVType.Struct) { - return null; - } - Long minPower = null; - Long maxPower = null; - Long minDuration = null; - Long maxDuration = null; - Integer cause = null; - for (StructElement element: ((StructType)tlvValue).value()) { - if (element.contextTagNum() == MIN_POWER_ID) { - if (element.value(BaseTLVType.class).type() == TLVType.Int) { - IntType castingValue = element.value(IntType.class); - minPower = castingValue.value(Long.class); - } - } else if (element.contextTagNum() == MAX_POWER_ID) { - if (element.value(BaseTLVType.class).type() == TLVType.Int) { - IntType castingValue = element.value(IntType.class); - maxPower = castingValue.value(Long.class); - } - } else if (element.contextTagNum() == MIN_DURATION_ID) { - if (element.value(BaseTLVType.class).type() == TLVType.UInt) { - UIntType castingValue = element.value(UIntType.class); - minDuration = castingValue.value(Long.class); - } - } else if (element.contextTagNum() == MAX_DURATION_ID) { - if (element.value(BaseTLVType.class).type() == TLVType.UInt) { - UIntType castingValue = element.value(UIntType.class); - maxDuration = castingValue.value(Long.class); - } - } else if (element.contextTagNum() == CAUSE_ID) { - if (element.value(BaseTLVType.class).type() == TLVType.UInt) { - UIntType castingValue = element.value(UIntType.class); - cause = castingValue.value(Integer.class); - } - } - } - return new DeviceEnergyManagementClusterPowerAdjustStruct( - minPower, - maxPower, - minDuration, - maxDuration, - cause - ); - } - - @Override - public String toString() { - StringBuilder output = new StringBuilder(); - output.append("DeviceEnergyManagementClusterPowerAdjustStruct {\n"); - output.append("\tminPower: "); - output.append(minPower); - output.append("\n"); - output.append("\tmaxPower: "); - output.append(maxPower); - output.append("\n"); - output.append("\tminDuration: "); - output.append(minDuration); - output.append("\n"); - output.append("\tmaxDuration: "); - output.append(maxDuration); - output.append("\n"); - output.append("\tcause: "); - output.append(cause); - output.append("\n"); - output.append("}\n"); - return output.toString(); - } -} public static class DeviceEnergyManagementClusterSlotAdjustmentStruct { public Integer slotIndex; public Optional nominalPower; diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java index 506d7386935c47..fc5ef80e3d2f45 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java @@ -9755,7 +9755,7 @@ public static PauseRequestCommandField value(int id) throws NoSuchFieldError { } throw new NoSuchFieldError(); } - }public enum ModifyForecastRequestCommandField {ForecastId(0),SlotAdjustments(1),Cause(2),; + }public enum ModifyForecastRequestCommandField {ForecastID(0),SlotAdjustments(1),Cause(2),; private final int id; ModifyForecastRequestCommandField(int id) { this.id = id; diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java index d7c4134c812d9d..e6fdd4f4163d9a 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java @@ -10882,9 +10882,9 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(@Nullable List valueList) { + public void onSuccess(@Nullable List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -24612,8 +24612,8 @@ public Map> getCommandMap() { Map deviceEnergyManagementmodifyForecastRequestCommandParams = new LinkedHashMap(); - CommandParameterInfo deviceEnergyManagementmodifyForecastRequestforecastIdCommandParameterInfo = new CommandParameterInfo("forecastId", Long.class, Long.class); - deviceEnergyManagementmodifyForecastRequestCommandParams.put("forecastId",deviceEnergyManagementmodifyForecastRequestforecastIdCommandParameterInfo); + CommandParameterInfo deviceEnergyManagementmodifyForecastRequestforecastIDCommandParameterInfo = new CommandParameterInfo("forecastID", Long.class, Long.class); + deviceEnergyManagementmodifyForecastRequestCommandParams.put("forecastID",deviceEnergyManagementmodifyForecastRequestforecastIDCommandParameterInfo); CommandParameterInfo deviceEnergyManagementmodifyForecastRequestcauseCommandParameterInfo = new CommandParameterInfo("cause", Integer.class, Integer.class); @@ -24623,7 +24623,7 @@ public Map> getCommandMap() { ((ChipClusters.DeviceEnergyManagementCluster) cluster) .modifyForecastRequest((DefaultClusterCallback) callback , (Long) - commandArguments.get("forecastId") + commandArguments.get("forecastID") , (ArrayList) commandArguments.get("slotAdjustments") , (Integer) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni b/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni index 34fd21bb27d770..030fd7c6c1761e 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni @@ -47,6 +47,7 @@ structs_sources = [ "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DeviceEnergyManagementClusterConstraintsStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DeviceEnergyManagementClusterCostStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DeviceEnergyManagementClusterForecastStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DeviceEnergyManagementClusterPowerAdjustCapabilityStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DeviceEnergyManagementClusterPowerAdjustStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DeviceEnergyManagementClusterSlotAdjustmentStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DeviceEnergyManagementClusterSlotStruct.kt", diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DeviceEnergyManagementClusterForecastStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DeviceEnergyManagementClusterForecastStruct.kt index 35989ede8dc1a8..ad9120a2327983 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DeviceEnergyManagementClusterForecastStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DeviceEnergyManagementClusterForecastStruct.kt @@ -25,7 +25,7 @@ import matter.tlv.TlvReader import matter.tlv.TlvWriter class DeviceEnergyManagementClusterForecastStruct( - val forecastId: ULong, + val forecastID: ULong, val activeSlotNumber: UInt?, val startTime: ULong, val endTime: ULong, @@ -37,7 +37,7 @@ class DeviceEnergyManagementClusterForecastStruct( ) { override fun toString(): String = buildString { append("DeviceEnergyManagementClusterForecastStruct {\n") - append("\tforecastId : $forecastId\n") + append("\tforecastID : $forecastID\n") append("\tactiveSlotNumber : $activeSlotNumber\n") append("\tstartTime : $startTime\n") append("\tendTime : $endTime\n") @@ -52,7 +52,7 @@ class DeviceEnergyManagementClusterForecastStruct( fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { tlvWriter.apply { startStructure(tlvTag) - put(ContextSpecificTag(TAG_FORECAST_ID), forecastId) + put(ContextSpecificTag(TAG_FORECAST_I_D), forecastID) if (activeSlotNumber != null) { put(ContextSpecificTag(TAG_ACTIVE_SLOT_NUMBER), activeSlotNumber) } else { @@ -84,7 +84,7 @@ class DeviceEnergyManagementClusterForecastStruct( } companion object { - private const val TAG_FORECAST_ID = 0 + private const val TAG_FORECAST_I_D = 0 private const val TAG_ACTIVE_SLOT_NUMBER = 1 private const val TAG_START_TIME = 2 private const val TAG_END_TIME = 3 @@ -96,7 +96,7 @@ class DeviceEnergyManagementClusterForecastStruct( fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): DeviceEnergyManagementClusterForecastStruct { tlvReader.enterStructure(tlvTag) - val forecastId = tlvReader.getULong(ContextSpecificTag(TAG_FORECAST_ID)) + val forecastID = tlvReader.getULong(ContextSpecificTag(TAG_FORECAST_I_D)) val activeSlotNumber = if (!tlvReader.isNull()) { tlvReader.getUInt(ContextSpecificTag(TAG_ACTIVE_SLOT_NUMBER)) @@ -137,7 +137,7 @@ class DeviceEnergyManagementClusterForecastStruct( tlvReader.exitContainer() return DeviceEnergyManagementClusterForecastStruct( - forecastId, + forecastID, activeSlotNumber, startTime, endTime, diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DeviceEnergyManagementClusterPowerAdjustStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DeviceEnergyManagementClusterPowerAdjustStruct.kt index d00201e7402bcb..7021aa2720949e 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DeviceEnergyManagementClusterPowerAdjustStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DeviceEnergyManagementClusterPowerAdjustStruct.kt @@ -26,8 +26,7 @@ class DeviceEnergyManagementClusterPowerAdjustStruct( val minPower: Long, val maxPower: Long, val minDuration: ULong, - val maxDuration: ULong, - val cause: UInt + val maxDuration: ULong ) { override fun toString(): String = buildString { append("DeviceEnergyManagementClusterPowerAdjustStruct {\n") @@ -35,7 +34,6 @@ class DeviceEnergyManagementClusterPowerAdjustStruct( append("\tmaxPower : $maxPower\n") append("\tminDuration : $minDuration\n") append("\tmaxDuration : $maxDuration\n") - append("\tcause : $cause\n") append("}\n") } @@ -46,7 +44,6 @@ class DeviceEnergyManagementClusterPowerAdjustStruct( put(ContextSpecificTag(TAG_MAX_POWER), maxPower) put(ContextSpecificTag(TAG_MIN_DURATION), minDuration) put(ContextSpecificTag(TAG_MAX_DURATION), maxDuration) - put(ContextSpecificTag(TAG_CAUSE), cause) endStructure() } } @@ -56,7 +53,6 @@ class DeviceEnergyManagementClusterPowerAdjustStruct( private const val TAG_MAX_POWER = 1 private const val TAG_MIN_DURATION = 2 private const val TAG_MAX_DURATION = 3 - private const val TAG_CAUSE = 4 fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): DeviceEnergyManagementClusterPowerAdjustStruct { tlvReader.enterStructure(tlvTag) @@ -64,7 +60,6 @@ class DeviceEnergyManagementClusterPowerAdjustStruct( val maxPower = tlvReader.getLong(ContextSpecificTag(TAG_MAX_POWER)) val minDuration = tlvReader.getULong(ContextSpecificTag(TAG_MIN_DURATION)) val maxDuration = tlvReader.getULong(ContextSpecificTag(TAG_MAX_DURATION)) - val cause = tlvReader.getUInt(ContextSpecificTag(TAG_CAUSE)) tlvReader.exitContainer() @@ -72,8 +67,7 @@ class DeviceEnergyManagementClusterPowerAdjustStruct( minPower, maxPower, minDuration, - maxDuration, - cause + maxDuration ) } } diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/DeviceEnergyManagementCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/DeviceEnergyManagementCluster.kt index eb68ec47c75ee1..4e9d0869d70f2c 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/DeviceEnergyManagementCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/DeviceEnergyManagementCluster.kt @@ -47,11 +47,11 @@ class DeviceEnergyManagementCluster( private val endpointId: UShort ) { class PowerAdjustmentCapabilityAttribute( - val value: List? + val value: List? ) sealed class PowerAdjustmentCapabilityAttributeSubscriptionState { - data class Success(val value: List?) : + data class Success(val value: List?) : PowerAdjustmentCapabilityAttributeSubscriptionState() data class Error(val exception: Exception) : @@ -232,7 +232,7 @@ class DeviceEnergyManagementCluster( } suspend fun modifyForecastRequest( - forecastId: UInt, + forecastID: UInt, slotAdjustments: List, cause: UByte, timedInvokeTimeout: Duration? = null @@ -242,8 +242,8 @@ class DeviceEnergyManagementCluster( val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) - val TAG_FORECAST_ID_REQ: Int = 0 - tlvWriter.put(ContextSpecificTag(TAG_FORECAST_ID_REQ), forecastId) + val TAG_FORECAST_I_D_REQ: Int = 0 + tlvWriter.put(ContextSpecificTag(TAG_FORECAST_I_D_REQ), forecastID) val TAG_SLOT_ADJUSTMENTS_REQ: Int = 1 tlvWriter.startArray(ContextSpecificTag(TAG_SLOT_ADJUSTMENTS_REQ)) @@ -750,13 +750,18 @@ class DeviceEnergyManagementCluster( // Decode the TLV data into the appropriate type val tlvReader = TlvReader(attributeData.data) - val decodedValue: List? = + val decodedValue: List? = if (!tlvReader.isNull()) { if (tlvReader.isNextTag(AnonymousTag)) { - buildList { + buildList { tlvReader.enterArray(AnonymousTag) while (!tlvReader.isEndOfContainer()) { - add(DeviceEnergyManagementClusterPowerAdjustStruct.fromTlv(AnonymousTag, tlvReader)) + add( + DeviceEnergyManagementClusterPowerAdjustCapabilityStruct.fromTlv( + AnonymousTag, + tlvReader + ) + ) } tlvReader.exitContainer() } @@ -812,14 +817,14 @@ class DeviceEnergyManagementCluster( // Decode the TLV data into the appropriate type val tlvReader = TlvReader(attributeData.data) - val decodedValue: List? = + val decodedValue: List? = if (!tlvReader.isNull()) { if (tlvReader.isNextTag(AnonymousTag)) { - buildList { + buildList { tlvReader.enterArray(AnonymousTag) while (!tlvReader.isEndOfContainer()) { add( - DeviceEnergyManagementClusterPowerAdjustStruct.fromTlv( + DeviceEnergyManagementClusterPowerAdjustCapabilityStruct.fromTlv( AnonymousTag, tlvReader ) diff --git a/src/controller/java/generated/java/matter/controller/cluster/files.gni b/src/controller/java/generated/java/matter/controller/cluster/files.gni index e58b346b307ab7..e2ad6417670b20 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/files.gni +++ b/src/controller/java/generated/java/matter/controller/cluster/files.gni @@ -47,6 +47,7 @@ matter_structs_sources = [ "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/DeviceEnergyManagementClusterConstraintsStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/DeviceEnergyManagementClusterCostStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/DeviceEnergyManagementClusterForecastStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/DeviceEnergyManagementClusterPowerAdjustCapabilityStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/DeviceEnergyManagementClusterPowerAdjustStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/DeviceEnergyManagementClusterSlotAdjustmentStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/DeviceEnergyManagementClusterSlotStruct.kt", diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/DeviceEnergyManagementClusterForecastStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/DeviceEnergyManagementClusterForecastStruct.kt index 95b0d89d05b061..f78288a7493666 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/structs/DeviceEnergyManagementClusterForecastStruct.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/DeviceEnergyManagementClusterForecastStruct.kt @@ -25,7 +25,7 @@ import matter.tlv.TlvReader import matter.tlv.TlvWriter class DeviceEnergyManagementClusterForecastStruct( - val forecastId: UInt, + val forecastID: UInt, val activeSlotNumber: UShort?, val startTime: UInt, val endTime: UInt, @@ -37,7 +37,7 @@ class DeviceEnergyManagementClusterForecastStruct( ) { override fun toString(): String = buildString { append("DeviceEnergyManagementClusterForecastStruct {\n") - append("\tforecastId : $forecastId\n") + append("\tforecastID : $forecastID\n") append("\tactiveSlotNumber : $activeSlotNumber\n") append("\tstartTime : $startTime\n") append("\tendTime : $endTime\n") @@ -52,7 +52,7 @@ class DeviceEnergyManagementClusterForecastStruct( fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { tlvWriter.apply { startStructure(tlvTag) - put(ContextSpecificTag(TAG_FORECAST_ID), forecastId) + put(ContextSpecificTag(TAG_FORECAST_I_D), forecastID) if (activeSlotNumber != null) { put(ContextSpecificTag(TAG_ACTIVE_SLOT_NUMBER), activeSlotNumber) } else { @@ -84,7 +84,7 @@ class DeviceEnergyManagementClusterForecastStruct( } companion object { - private const val TAG_FORECAST_ID = 0 + private const val TAG_FORECAST_I_D = 0 private const val TAG_ACTIVE_SLOT_NUMBER = 1 private const val TAG_START_TIME = 2 private const val TAG_END_TIME = 3 @@ -96,7 +96,7 @@ class DeviceEnergyManagementClusterForecastStruct( fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): DeviceEnergyManagementClusterForecastStruct { tlvReader.enterStructure(tlvTag) - val forecastId = tlvReader.getUInt(ContextSpecificTag(TAG_FORECAST_ID)) + val forecastID = tlvReader.getUInt(ContextSpecificTag(TAG_FORECAST_I_D)) val activeSlotNumber = if (!tlvReader.isNull()) { tlvReader.getUShort(ContextSpecificTag(TAG_ACTIVE_SLOT_NUMBER)) @@ -137,7 +137,7 @@ class DeviceEnergyManagementClusterForecastStruct( tlvReader.exitContainer() return DeviceEnergyManagementClusterForecastStruct( - forecastId, + forecastID, activeSlotNumber, startTime, endTime, diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/DeviceEnergyManagementClusterPowerAdjustStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/DeviceEnergyManagementClusterPowerAdjustStruct.kt index 27c0e6451cca3a..c1822bb573e344 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/structs/DeviceEnergyManagementClusterPowerAdjustStruct.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/DeviceEnergyManagementClusterPowerAdjustStruct.kt @@ -26,8 +26,7 @@ class DeviceEnergyManagementClusterPowerAdjustStruct( val minPower: Long, val maxPower: Long, val minDuration: UInt, - val maxDuration: UInt, - val cause: UByte + val maxDuration: UInt ) { override fun toString(): String = buildString { append("DeviceEnergyManagementClusterPowerAdjustStruct {\n") @@ -35,7 +34,6 @@ class DeviceEnergyManagementClusterPowerAdjustStruct( append("\tmaxPower : $maxPower\n") append("\tminDuration : $minDuration\n") append("\tmaxDuration : $maxDuration\n") - append("\tcause : $cause\n") append("}\n") } @@ -46,7 +44,6 @@ class DeviceEnergyManagementClusterPowerAdjustStruct( put(ContextSpecificTag(TAG_MAX_POWER), maxPower) put(ContextSpecificTag(TAG_MIN_DURATION), minDuration) put(ContextSpecificTag(TAG_MAX_DURATION), maxDuration) - put(ContextSpecificTag(TAG_CAUSE), cause) endStructure() } } @@ -56,7 +53,6 @@ class DeviceEnergyManagementClusterPowerAdjustStruct( private const val TAG_MAX_POWER = 1 private const val TAG_MIN_DURATION = 2 private const val TAG_MAX_DURATION = 3 - private const val TAG_CAUSE = 4 fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): DeviceEnergyManagementClusterPowerAdjustStruct { tlvReader.enterStructure(tlvTag) @@ -64,7 +60,6 @@ class DeviceEnergyManagementClusterPowerAdjustStruct( val maxPower = tlvReader.getLong(ContextSpecificTag(TAG_MAX_POWER)) val minDuration = tlvReader.getUInt(ContextSpecificTag(TAG_MIN_DURATION)) val maxDuration = tlvReader.getUInt(ContextSpecificTag(TAG_MAX_DURATION)) - val cause = tlvReader.getUByte(ContextSpecificTag(TAG_CAUSE)) tlvReader.exitContainer() @@ -72,8 +67,7 @@ class DeviceEnergyManagementClusterPowerAdjustStruct( minPower, maxPower, minDuration, - maxDuration, - cause + maxDuration ) } } diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index cf25d8d4b2e7b7..fc2fca43beebd9 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -23448,34 +23448,78 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR { auto & entry_1 = iter_value_1.GetValue(); jobject newElement_1; - jobject newElement_1_minPower; - std::string newElement_1_minPowerClassName = "java/lang/Long"; - std::string newElement_1_minPowerCtorSignature = "(J)V"; - jlong jninewElement_1_minPower = static_cast(entry_1.minPower); - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_1_minPowerClassName.c_str(), - newElement_1_minPowerCtorSignature.c_str(), - jninewElement_1_minPower, newElement_1_minPower); - jobject newElement_1_maxPower; - std::string newElement_1_maxPowerClassName = "java/lang/Long"; - std::string newElement_1_maxPowerCtorSignature = "(J)V"; - jlong jninewElement_1_maxPower = static_cast(entry_1.maxPower); - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_1_maxPowerClassName.c_str(), - newElement_1_maxPowerCtorSignature.c_str(), - jninewElement_1_maxPower, newElement_1_maxPower); - jobject newElement_1_minDuration; - std::string newElement_1_minDurationClassName = "java/lang/Long"; - std::string newElement_1_minDurationCtorSignature = "(J)V"; - jlong jninewElement_1_minDuration = static_cast(entry_1.minDuration); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_1_minDurationClassName.c_str(), newElement_1_minDurationCtorSignature.c_str(), - jninewElement_1_minDuration, newElement_1_minDuration); - jobject newElement_1_maxDuration; - std::string newElement_1_maxDurationClassName = "java/lang/Long"; - std::string newElement_1_maxDurationCtorSignature = "(J)V"; - jlong jninewElement_1_maxDuration = static_cast(entry_1.maxDuration); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_1_maxDurationClassName.c_str(), newElement_1_maxDurationCtorSignature.c_str(), - jninewElement_1_maxDuration, newElement_1_maxDuration); + jobject newElement_1_powerAdjustCapability; + if (entry_1.powerAdjustCapability.IsNull()) + { + newElement_1_powerAdjustCapability = nullptr; + } + else + { + chip::JniReferences::GetInstance().CreateArrayList(newElement_1_powerAdjustCapability); + + auto iter_newElement_1_powerAdjustCapability_4 = entry_1.powerAdjustCapability.Value().begin(); + while (iter_newElement_1_powerAdjustCapability_4.Next()) + { + auto & entry_4 = iter_newElement_1_powerAdjustCapability_4.GetValue(); + jobject newElement_4; + jobject newElement_4_minPower; + std::string newElement_4_minPowerClassName = "java/lang/Long"; + std::string newElement_4_minPowerCtorSignature = "(J)V"; + jlong jninewElement_4_minPower = static_cast(entry_4.minPower); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_4_minPowerClassName.c_str(), newElement_4_minPowerCtorSignature.c_str(), + jninewElement_4_minPower, newElement_4_minPower); + jobject newElement_4_maxPower; + std::string newElement_4_maxPowerClassName = "java/lang/Long"; + std::string newElement_4_maxPowerCtorSignature = "(J)V"; + jlong jninewElement_4_maxPower = static_cast(entry_4.maxPower); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_4_maxPowerClassName.c_str(), newElement_4_maxPowerCtorSignature.c_str(), + jninewElement_4_maxPower, newElement_4_maxPower); + jobject newElement_4_minDuration; + std::string newElement_4_minDurationClassName = "java/lang/Long"; + std::string newElement_4_minDurationCtorSignature = "(J)V"; + jlong jninewElement_4_minDuration = static_cast(entry_4.minDuration); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_4_minDurationClassName.c_str(), newElement_4_minDurationCtorSignature.c_str(), + jninewElement_4_minDuration, newElement_4_minDuration); + jobject newElement_4_maxDuration; + std::string newElement_4_maxDurationClassName = "java/lang/Long"; + std::string newElement_4_maxDurationCtorSignature = "(J)V"; + jlong jninewElement_4_maxDuration = static_cast(entry_4.maxDuration); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_4_maxDurationClassName.c_str(), newElement_4_maxDurationCtorSignature.c_str(), + jninewElement_4_maxDuration, newElement_4_maxDuration); + + jclass powerAdjustStructStructClass_5; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$DeviceEnergyManagementClusterPowerAdjustStruct", + powerAdjustStructStructClass_5); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, + "Could not find class ChipStructs$DeviceEnergyManagementClusterPowerAdjustStruct"); + return nullptr; + } + + jmethodID powerAdjustStructStructCtor_5; + err = chip::JniReferences::GetInstance().FindMethod( + env, powerAdjustStructStructClass_5, "", + "(Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;)V", + &powerAdjustStructStructCtor_5); + if (err != CHIP_NO_ERROR || powerAdjustStructStructCtor_5 == nullptr) + { + ChipLogError( + Zcl, "Could not find ChipStructs$DeviceEnergyManagementClusterPowerAdjustStruct constructor"); + return nullptr; + } + + newElement_4 = + env->NewObject(powerAdjustStructStructClass_5, powerAdjustStructStructCtor_5, newElement_4_minPower, + newElement_4_maxPower, newElement_4_minDuration, newElement_4_maxDuration); + chip::JniReferences::GetInstance().AddToList(newElement_1_powerAdjustCapability, newElement_4); + } + } jobject newElement_1_cause; std::string newElement_1_causeClassName = "java/lang/Integer"; std::string newElement_1_causeCtorSignature = "(I)V"; @@ -23484,30 +23528,30 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_1_causeCtorSignature.c_str(), jninewElement_1_cause, newElement_1_cause); - jclass powerAdjustStructStructClass_2; + jclass powerAdjustCapabilityStructStructClass_2; err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DeviceEnergyManagementClusterPowerAdjustStruct", - powerAdjustStructStructClass_2); + env, "chip/devicecontroller/ChipStructs$DeviceEnergyManagementClusterPowerAdjustCapabilityStruct", + powerAdjustCapabilityStructStructClass_2); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$DeviceEnergyManagementClusterPowerAdjustStruct"); + ChipLogError(Zcl, + "Could not find class ChipStructs$DeviceEnergyManagementClusterPowerAdjustCapabilityStruct"); return nullptr; } - jmethodID powerAdjustStructStructCtor_2; - err = chip::JniReferences::GetInstance().FindMethod( - env, powerAdjustStructStructClass_2, "", - "(Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Integer;)V", - &powerAdjustStructStructCtor_2); - if (err != CHIP_NO_ERROR || powerAdjustStructStructCtor_2 == nullptr) + jmethodID powerAdjustCapabilityStructStructCtor_2; + err = chip::JniReferences::GetInstance().FindMethod(env, powerAdjustCapabilityStructStructClass_2, "", + "(Ljava/util/ArrayList;Ljava/lang/Integer;)V", + &powerAdjustCapabilityStructStructCtor_2); + if (err != CHIP_NO_ERROR || powerAdjustCapabilityStructStructCtor_2 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$DeviceEnergyManagementClusterPowerAdjustStruct constructor"); + ChipLogError( + Zcl, "Could not find ChipStructs$DeviceEnergyManagementClusterPowerAdjustCapabilityStruct constructor"); return nullptr; } - newElement_1 = env->NewObject(powerAdjustStructStructClass_2, powerAdjustStructStructCtor_2, - newElement_1_minPower, newElement_1_maxPower, newElement_1_minDuration, - newElement_1_maxDuration, newElement_1_cause); + newElement_1 = env->NewObject(powerAdjustCapabilityStructStructClass_2, powerAdjustCapabilityStructStructCtor_2, + newElement_1_powerAdjustCapability, newElement_1_cause); chip::JniReferences::GetInstance().AddToList(value, newElement_1); } } @@ -23528,13 +23572,13 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } else { - jobject value_forecastId; - std::string value_forecastIdClassName = "java/lang/Long"; - std::string value_forecastIdCtorSignature = "(J)V"; - jlong jnivalue_forecastId = static_cast(cppValue.Value().forecastId); - chip::JniReferences::GetInstance().CreateBoxedObject(value_forecastIdClassName.c_str(), - value_forecastIdCtorSignature.c_str(), - jnivalue_forecastId, value_forecastId); + jobject value_forecastID; + std::string value_forecastIDClassName = "java/lang/Long"; + std::string value_forecastIDCtorSignature = "(J)V"; + jlong jnivalue_forecastID = static_cast(cppValue.Value().forecastID); + chip::JniReferences::GetInstance().CreateBoxedObject(value_forecastIDClassName.c_str(), + value_forecastIDCtorSignature.c_str(), + jnivalue_forecastID, value_forecastID); jobject value_activeSlotNumber; if (cppValue.Value().activeSlotNumber.IsNull()) { @@ -24020,7 +24064,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } - value = env->NewObject(forecastStructStructClass_1, forecastStructStructCtor_1, value_forecastId, + value = env->NewObject(forecastStructStructClass_1, forecastStructStructCtor_1, value_forecastID, value_activeSlotNumber, value_startTime, value_endTime, value_earliestStartTime, value_latestEndTime, value_isPausable, value_slots, value_forecastUpdateReason); } diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index 6acd5596b06d50..728fc0c2134211 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -6829,7 +6829,7 @@ class ChipClusters: "commandId": 0x00000005, "commandName": "ModifyForecastRequest", "args": { - "forecastId": "int", + "forecastID": "int", "slotAdjustments": "SlotAdjustmentStruct", "cause": "int", }, diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index ae095a206fa530..b089dfc4d106b1 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -24290,6 +24290,36 @@ def descriptor(cls) -> ClusterObjectDescriptor: decimalPoints: 'uint' = 0 currency: 'typing.Optional[uint]' = None + @dataclass + class PowerAdjustStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="minPower", Tag=0, Type=int), + ClusterObjectFieldDescriptor(Label="maxPower", Tag=1, Type=int), + ClusterObjectFieldDescriptor(Label="minDuration", Tag=2, Type=uint), + ClusterObjectFieldDescriptor(Label="maxDuration", Tag=3, Type=uint), + ]) + + minPower: 'int' = 0 + maxPower: 'int' = 0 + minDuration: 'uint' = 0 + maxDuration: 'uint' = 0 + + @dataclass + class PowerAdjustCapabilityStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="powerAdjustCapability", Tag=0, Type=typing.Union[Nullable, typing.List[DeviceEnergyManagement.Structs.PowerAdjustStruct]]), + ClusterObjectFieldDescriptor(Label="cause", Tag=1, Type=DeviceEnergyManagement.Enums.PowerAdjustReasonEnum), + ]) + + powerAdjustCapability: 'typing.Union[Nullable, typing.List[DeviceEnergyManagement.Structs.PowerAdjustStruct]]' = NullValue + cause: 'DeviceEnergyManagement.Enums.PowerAdjustReasonEnum' = 0 + @dataclass class SlotStruct(ClusterObject): @ChipUtility.classproperty @@ -24341,7 +24371,7 @@ class ForecastStruct(ClusterObject): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="forecastId", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="forecastID", Tag=0, Type=uint), ClusterObjectFieldDescriptor(Label="activeSlotNumber", Tag=1, Type=typing.Union[Nullable, uint]), ClusterObjectFieldDescriptor(Label="startTime", Tag=2, Type=uint), ClusterObjectFieldDescriptor(Label="endTime", Tag=3, Type=uint), @@ -24352,7 +24382,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="forecastUpdateReason", Tag=8, Type=DeviceEnergyManagement.Enums.ForecastUpdateReasonEnum), ]) - forecastId: 'uint' = 0 + forecastID: 'uint' = 0 activeSlotNumber: 'typing.Union[Nullable, uint]' = NullValue startTime: 'uint' = 0 endTime: 'uint' = 0 @@ -24381,25 +24411,6 @@ def descriptor(cls) -> ClusterObjectDescriptor: maximumEnergy: 'typing.Optional[int]' = None loadControl: 'typing.Optional[int]' = None - @dataclass - class PowerAdjustStruct(ClusterObject): - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields=[ - ClusterObjectFieldDescriptor(Label="minPower", Tag=0, Type=int), - ClusterObjectFieldDescriptor(Label="maxPower", Tag=1, Type=int), - ClusterObjectFieldDescriptor(Label="minDuration", Tag=2, Type=uint), - ClusterObjectFieldDescriptor(Label="maxDuration", Tag=3, Type=uint), - ClusterObjectFieldDescriptor(Label="cause", Tag=4, Type=DeviceEnergyManagement.Enums.PowerAdjustReasonEnum), - ]) - - minPower: 'int' = 0 - maxPower: 'int' = 0 - minDuration: 'uint' = 0 - maxDuration: 'uint' = 0 - cause: 'DeviceEnergyManagement.Enums.PowerAdjustReasonEnum' = 0 - @dataclass class SlotAdjustmentStruct(ClusterObject): @ChipUtility.classproperty @@ -24509,12 +24520,12 @@ class ModifyForecastRequest(ClusterCommand): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="forecastId", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="forecastID", Tag=0, Type=uint), ClusterObjectFieldDescriptor(Label="slotAdjustments", Tag=1, Type=typing.List[DeviceEnergyManagement.Structs.SlotAdjustmentStruct]), ClusterObjectFieldDescriptor(Label="cause", Tag=2, Type=DeviceEnergyManagement.Enums.AdjustmentCauseEnum), ]) - forecastId: 'uint' = 0 + forecastID: 'uint' = 0 slotAdjustments: 'typing.List[DeviceEnergyManagement.Structs.SlotAdjustmentStruct]' = field(default_factory=lambda: []) cause: 'DeviceEnergyManagement.Enums.AdjustmentCauseEnum' = 0 diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm index 56aa3105af3282..f871b5a0f79251 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -8913,12 +8913,32 @@ static id _Nullable DecodeAttributeValueForDeviceEnergyManagementCluster(Attribu auto iter_1 = cppValue.Value().begin(); while (iter_1.Next()) { auto & entry_1 = iter_1.GetValue(); - MTRDeviceEnergyManagementClusterPowerAdjustStruct * newElement_1; - newElement_1 = [MTRDeviceEnergyManagementClusterPowerAdjustStruct new]; - newElement_1.minPower = [NSNumber numberWithLongLong:entry_1.minPower]; - newElement_1.maxPower = [NSNumber numberWithLongLong:entry_1.maxPower]; - newElement_1.minDuration = [NSNumber numberWithUnsignedInt:entry_1.minDuration]; - newElement_1.maxDuration = [NSNumber numberWithUnsignedInt:entry_1.maxDuration]; + MTRDeviceEnergyManagementClusterPowerAdjustCapabilityStruct * newElement_1; + newElement_1 = [MTRDeviceEnergyManagementClusterPowerAdjustCapabilityStruct new]; + if (entry_1.powerAdjustCapability.IsNull()) { + newElement_1.powerAdjustCapability = nil; + } else { + { // Scope for our temporary variables + auto * array_4 = [NSMutableArray new]; + auto iter_4 = entry_1.powerAdjustCapability.Value().begin(); + while (iter_4.Next()) { + auto & entry_4 = iter_4.GetValue(); + MTRDeviceEnergyManagementClusterPowerAdjustStruct * newElement_4; + newElement_4 = [MTRDeviceEnergyManagementClusterPowerAdjustStruct new]; + newElement_4.minPower = [NSNumber numberWithLongLong:entry_4.minPower]; + newElement_4.maxPower = [NSNumber numberWithLongLong:entry_4.maxPower]; + newElement_4.minDuration = [NSNumber numberWithUnsignedInt:entry_4.minDuration]; + newElement_4.maxDuration = [NSNumber numberWithUnsignedInt:entry_4.maxDuration]; + [array_4 addObject:newElement_4]; + } + CHIP_ERROR err = iter_4.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + newElement_1.powerAdjustCapability = array_4; + } + } newElement_1.cause = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_1.cause)]; [array_1 addObject:newElement_1]; } @@ -8944,7 +8964,7 @@ static id _Nullable DecodeAttributeValueForDeviceEnergyManagementCluster(Attribu value = nil; } else { value = [MTRDeviceEnergyManagementClusterForecastStruct new]; - value.forecastId = [NSNumber numberWithUnsignedInt:cppValue.Value().forecastId]; + value.forecastID = [NSNumber numberWithUnsignedInt:cppValue.Value().forecastID]; if (cppValue.Value().activeSlotNumber.IsNull()) { value.activeSlotNumber = nil; } else { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h index cfd06dee343cc0..94325294e8c763 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h @@ -5739,7 +5739,7 @@ MTR_PROVISIONALLY_AVAILABLE MTR_PROVISIONALLY_AVAILABLE @interface MTRDeviceEnergyManagementClusterModifyForecastRequestParams : NSObject -@property (nonatomic, copy) NSNumber * _Nonnull forecastId MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull forecastID MTR_PROVISIONALLY_AVAILABLE; @property (nonatomic, copy) NSArray * _Nonnull slotAdjustments MTR_PROVISIONALLY_AVAILABLE; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm index f6722413101fc3..4f3f20613973ed 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm @@ -16113,7 +16113,7 @@ - (instancetype)init { if (self = [super init]) { - _forecastId = @(0); + _forecastID = @(0); _slotAdjustments = [NSArray array]; @@ -16128,7 +16128,7 @@ - (id)copyWithZone:(NSZone * _Nullable)zone; { auto other = [[MTRDeviceEnergyManagementClusterModifyForecastRequestParams alloc] init]; - other.forecastId = self.forecastId; + other.forecastID = self.forecastID; other.slotAdjustments = self.slotAdjustments; other.cause = self.cause; other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; @@ -16139,7 +16139,7 @@ - (id)copyWithZone:(NSZone * _Nullable)zone; - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: forecastId:%@; slotAdjustments:%@; cause:%@; >", NSStringFromClass([self class]), _forecastId, _slotAdjustments, _cause]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: forecastID:%@; slotAdjustments:%@; cause:%@; >", NSStringFromClass([self class]), _forecastID, _slotAdjustments, _cause]; return descriptionString; } @@ -16152,7 +16152,7 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader chip::app::Clusters::DeviceEnergyManagement::Commands::ModifyForecastRequest::Type encodableStruct; ListFreer listFreer; { - encodableStruct.forecastId = self.forecastId.unsignedIntValue; + encodableStruct.forecastID = self.forecastID.unsignedIntValue; } { { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRDeviceTypeMetadata.mm b/src/darwin/Framework/CHIP/zap-generated/MTRDeviceTypeMetadata.mm index c41c977b3f2a0e..06042f32f9f1d8 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRDeviceTypeMetadata.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRDeviceTypeMetadata.mm @@ -94,7 +94,6 @@ { 0x00000306, DeviceTypeClass::Simple, "Matter Flow Sensor" }, { 0x00000307, DeviceTypeClass::Simple, "Matter Humidity Sensor" }, { 0x0000050C, DeviceTypeClass::Simple, "Matter EVSE" }, - { 0x0000050D, DeviceTypeClass::Utility, "Matter Device Energy Management" }, { 0x00000510, DeviceTypeClass::Utility, "Matter Electrical Sensor" }, { 0x00000840, DeviceTypeClass::Simple, "Matter Control Bridge" }, { 0x00000850, DeviceTypeClass::Simple, "Matter On/Off Sensor" }, diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h index b99a402f2b994d..e7e79cc4b35a68 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h @@ -1285,6 +1285,20 @@ MTR_PROVISIONALLY_AVAILABLE @property (nonatomic, copy) NSNumber * _Nullable currency MTR_PROVISIONALLY_AVAILABLE; @end +MTR_PROVISIONALLY_AVAILABLE +@interface MTRDeviceEnergyManagementClusterPowerAdjustStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull minPower MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull maxPower MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull minDuration MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull maxDuration MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRDeviceEnergyManagementClusterPowerAdjustCapabilityStruct : NSObject +@property (nonatomic, copy) NSArray * _Nullable powerAdjustCapability MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull cause MTR_PROVISIONALLY_AVAILABLE; +@end + MTR_PROVISIONALLY_AVAILABLE @interface MTRDeviceEnergyManagementClusterSlotStruct : NSObject @property (nonatomic, copy) NSNumber * _Nonnull minDuration MTR_PROVISIONALLY_AVAILABLE; @@ -1309,7 +1323,7 @@ MTR_PROVISIONALLY_AVAILABLE MTR_PROVISIONALLY_AVAILABLE @interface MTRDeviceEnergyManagementClusterForecastStruct : NSObject -@property (nonatomic, copy) NSNumber * _Nonnull forecastId MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull forecastID MTR_PROVISIONALLY_AVAILABLE; @property (nonatomic, copy) NSNumber * _Nullable activeSlotNumber MTR_PROVISIONALLY_AVAILABLE; @property (nonatomic, copy) NSNumber * _Nonnull startTime MTR_PROVISIONALLY_AVAILABLE; @property (nonatomic, copy) NSNumber * _Nonnull endTime MTR_PROVISIONALLY_AVAILABLE; @@ -1329,15 +1343,6 @@ MTR_PROVISIONALLY_AVAILABLE @property (nonatomic, copy) NSNumber * _Nullable loadControl MTR_PROVISIONALLY_AVAILABLE; @end -MTR_PROVISIONALLY_AVAILABLE -@interface MTRDeviceEnergyManagementClusterPowerAdjustStruct : NSObject -@property (nonatomic, copy) NSNumber * _Nonnull minPower MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nonnull maxPower MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nonnull minDuration MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nonnull maxDuration MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nonnull cause MTR_PROVISIONALLY_AVAILABLE; -@end - MTR_PROVISIONALLY_AVAILABLE @interface MTRDeviceEnergyManagementClusterSlotAdjustmentStruct : NSObject @property (nonatomic, copy) NSNumber * _Nonnull slotIndex MTR_PROVISIONALLY_AVAILABLE; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm index 223b5ccbe701b7..7a6caadf1a51a3 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm @@ -5251,6 +5251,72 @@ - (NSString *)description @end +@implementation MTRDeviceEnergyManagementClusterPowerAdjustStruct +- (instancetype)init +{ + if (self = [super init]) { + + _minPower = @(0); + + _maxPower = @(0); + + _minDuration = @(0); + + _maxDuration = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRDeviceEnergyManagementClusterPowerAdjustStruct alloc] init]; + + other.minPower = self.minPower; + other.maxPower = self.maxPower; + other.minDuration = self.minDuration; + other.maxDuration = self.maxDuration; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: minPower:%@; maxPower:%@; minDuration:%@; maxDuration:%@; >", NSStringFromClass([self class]), _minPower, _maxPower, _minDuration, _maxDuration]; + return descriptionString; +} + +@end + +@implementation MTRDeviceEnergyManagementClusterPowerAdjustCapabilityStruct +- (instancetype)init +{ + if (self = [super init]) { + + _powerAdjustCapability = nil; + + _cause = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRDeviceEnergyManagementClusterPowerAdjustCapabilityStruct alloc] init]; + + other.powerAdjustCapability = self.powerAdjustCapability; + other.cause = self.cause; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: powerAdjustCapability:%@; cause:%@; >", NSStringFromClass([self class]), _powerAdjustCapability, _cause]; + return descriptionString; +} + +@end + @implementation MTRDeviceEnergyManagementClusterSlotStruct - (instancetype)init { @@ -5334,7 +5400,7 @@ - (instancetype)init { if (self = [super init]) { - _forecastId = @(0); + _forecastID = @(0); _activeSlotNumber = nil; @@ -5359,7 +5425,7 @@ - (id)copyWithZone:(NSZone * _Nullable)zone { auto other = [[MTRDeviceEnergyManagementClusterForecastStruct alloc] init]; - other.forecastId = self.forecastId; + other.forecastID = self.forecastID; other.activeSlotNumber = self.activeSlotNumber; other.startTime = self.startTime; other.endTime = self.endTime; @@ -5374,7 +5440,7 @@ - (id)copyWithZone:(NSZone * _Nullable)zone - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: forecastId:%@; activeSlotNumber:%@; startTime:%@; endTime:%@; earliestStartTime:%@; latestEndTime:%@; isPausable:%@; slots:%@; forecastUpdateReason:%@; >", NSStringFromClass([self class]), _forecastId, _activeSlotNumber, _startTime, _endTime, _earliestStartTime, _latestEndTime, _isPausable, _slots, _forecastUpdateReason]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: forecastID:%@; activeSlotNumber:%@; startTime:%@; endTime:%@; earliestStartTime:%@; latestEndTime:%@; isPausable:%@; slots:%@; forecastUpdateReason:%@; >", NSStringFromClass([self class]), _forecastID, _activeSlotNumber, _startTime, _endTime, _earliestStartTime, _latestEndTime, _isPausable, _slots, _forecastUpdateReason]; return descriptionString; } @@ -5419,45 +5485,6 @@ - (NSString *)description @end -@implementation MTRDeviceEnergyManagementClusterPowerAdjustStruct -- (instancetype)init -{ - if (self = [super init]) { - - _minPower = @(0); - - _maxPower = @(0); - - _minDuration = @(0); - - _maxDuration = @(0); - - _cause = @(0); - } - return self; -} - -- (id)copyWithZone:(NSZone * _Nullable)zone -{ - auto other = [[MTRDeviceEnergyManagementClusterPowerAdjustStruct alloc] init]; - - other.minPower = self.minPower; - other.maxPower = self.maxPower; - other.minDuration = self.minDuration; - other.maxDuration = self.maxDuration; - other.cause = self.cause; - - return other; -} - -- (NSString *)description -{ - NSString * descriptionString = [NSString stringWithFormat:@"<%@: minPower:%@; maxPower:%@; minDuration:%@; maxDuration:%@; cause:%@; >", NSStringFromClass([self class]), _minPower, _maxPower, _minDuration, _maxDuration, _cause]; - return descriptionString; -} - -@end - @implementation MTRDeviceEnergyManagementClusterSlotAdjustmentStruct - (instancetype)init { diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp index 30179f2cc66501..f6e8c0fc245aaf 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp @@ -15598,6 +15598,98 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } // namespace CostStruct +namespace PowerAdjustStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kMinPower), minPower); + encoder.Encode(to_underlying(Fields::kMaxPower), maxPower); + encoder.Encode(to_underlying(Fields::kMinDuration), minDuration); + encoder.Encode(to_underlying(Fields::kMaxDuration), maxDuration); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kMinPower)) + { + err = DataModel::Decode(reader, minPower); + } + else if (__context_tag == to_underlying(Fields::kMaxPower)) + { + err = DataModel::Decode(reader, maxPower); + } + else if (__context_tag == to_underlying(Fields::kMinDuration)) + { + err = DataModel::Decode(reader, minDuration); + } + else if (__context_tag == to_underlying(Fields::kMaxDuration)) + { + err = DataModel::Decode(reader, maxDuration); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} + +} // namespace PowerAdjustStruct + +namespace PowerAdjustCapabilityStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kPowerAdjustCapability), powerAdjustCapability); + encoder.Encode(to_underlying(Fields::kCause), cause); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kPowerAdjustCapability)) + { + err = DataModel::Decode(reader, powerAdjustCapability); + } + else if (__context_tag == to_underlying(Fields::kCause)) + { + err = DataModel::Decode(reader, cause); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} + +} // namespace PowerAdjustCapabilityStruct + namespace SlotStruct { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { @@ -15723,7 +15815,7 @@ namespace ForecastStruct { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - encoder.Encode(to_underlying(Fields::kForecastId), forecastId); + encoder.Encode(to_underlying(Fields::kForecastID), forecastID); encoder.Encode(to_underlying(Fields::kActiveSlotNumber), activeSlotNumber); encoder.Encode(to_underlying(Fields::kStartTime), startTime); encoder.Encode(to_underlying(Fields::kEndTime), endTime); @@ -15749,9 +15841,9 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; const uint8_t __context_tag = std::get(__element); - if (__context_tag == to_underlying(Fields::kForecastId)) + if (__context_tag == to_underlying(Fields::kForecastID)) { - err = DataModel::Decode(reader, forecastId); + err = DataModel::Decode(reader, forecastID); } else if (__context_tag == to_underlying(Fields::kActiveSlotNumber)) { @@ -15851,62 +15943,6 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } // namespace ConstraintsStruct -namespace PowerAdjustStruct { -CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const -{ - DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - encoder.Encode(to_underlying(Fields::kMinPower), minPower); - encoder.Encode(to_underlying(Fields::kMaxPower), maxPower); - encoder.Encode(to_underlying(Fields::kMinDuration), minDuration); - encoder.Encode(to_underlying(Fields::kMaxDuration), maxDuration); - encoder.Encode(to_underlying(Fields::kCause), cause); - return encoder.Finalize(); -} - -CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) -{ - detail::StructDecodeIterator __iterator(reader); - while (true) - { - auto __element = __iterator.Next(); - if (std::holds_alternative(__element)) - { - return std::get(__element); - } - - CHIP_ERROR err = CHIP_NO_ERROR; - const uint8_t __context_tag = std::get(__element); - - if (__context_tag == to_underlying(Fields::kMinPower)) - { - err = DataModel::Decode(reader, minPower); - } - else if (__context_tag == to_underlying(Fields::kMaxPower)) - { - err = DataModel::Decode(reader, maxPower); - } - else if (__context_tag == to_underlying(Fields::kMinDuration)) - { - err = DataModel::Decode(reader, minDuration); - } - else if (__context_tag == to_underlying(Fields::kMaxDuration)) - { - err = DataModel::Decode(reader, maxDuration); - } - else if (__context_tag == to_underlying(Fields::kCause)) - { - err = DataModel::Decode(reader, cause); - } - else - { - } - - ReturnErrorOnFailure(err); - } -} - -} // namespace PowerAdjustStruct - namespace SlotAdjustmentStruct { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { @@ -16121,7 +16157,7 @@ namespace ModifyForecastRequest { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - encoder.Encode(to_underlying(Fields::kForecastId), forecastId); + encoder.Encode(to_underlying(Fields::kForecastID), forecastID); encoder.Encode(to_underlying(Fields::kSlotAdjustments), slotAdjustments); encoder.Encode(to_underlying(Fields::kCause), cause); return encoder.Finalize(); @@ -16141,9 +16177,9 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; const uint8_t __context_tag = std::get(__element); - if (__context_tag == to_underlying(Fields::kForecastId)) + if (__context_tag == to_underlying(Fields::kForecastID)) { - err = DataModel::Decode(reader, forecastId); + err = DataModel::Decode(reader, forecastID); } else if (__context_tag == to_underlying(Fields::kSlotAdjustments)) { diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index b0187052749a98..8d5c5447c37978 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h @@ -21861,6 +21861,63 @@ struct Type using DecodableType = Type; } // namespace CostStruct +namespace PowerAdjustStruct { +enum class Fields : uint8_t +{ + kMinPower = 0, + kMaxPower = 1, + kMinDuration = 2, + kMaxDuration = 3, +}; + +struct Type +{ +public: + int64_t minPower = static_cast(0); + int64_t maxPower = static_cast(0); + uint32_t minDuration = static_cast(0); + uint32_t maxDuration = static_cast(0); + + CHIP_ERROR Decode(TLV::TLVReader & reader); + + static constexpr bool kIsFabricScoped = false; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +using DecodableType = Type; + +} // namespace PowerAdjustStruct +namespace PowerAdjustCapabilityStruct { +enum class Fields : uint8_t +{ + kPowerAdjustCapability = 0, + kCause = 1, +}; + +struct Type +{ +public: + DataModel::Nullable> powerAdjustCapability; + PowerAdjustReasonEnum cause = static_cast(0); + + static constexpr bool kIsFabricScoped = false; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +struct DecodableType +{ +public: + DataModel::Nullable> powerAdjustCapability; + PowerAdjustReasonEnum cause = static_cast(0); + + CHIP_ERROR Decode(TLV::TLVReader & reader); + + static constexpr bool kIsFabricScoped = false; +}; + +} // namespace PowerAdjustCapabilityStruct namespace SlotStruct { enum class Fields : uint8_t { @@ -21942,7 +21999,7 @@ struct DecodableType namespace ForecastStruct { enum class Fields : uint8_t { - kForecastId = 0, + kForecastID = 0, kActiveSlotNumber = 1, kStartTime = 2, kEndTime = 3, @@ -21956,7 +22013,7 @@ enum class Fields : uint8_t struct Type { public: - uint32_t forecastId = static_cast(0); + uint32_t forecastID = static_cast(0); DataModel::Nullable activeSlotNumber; uint32_t startTime = static_cast(0); uint32_t endTime = static_cast(0); @@ -21974,7 +22031,7 @@ struct Type struct DecodableType { public: - uint32_t forecastId = static_cast(0); + uint32_t forecastID = static_cast(0); DataModel::Nullable activeSlotNumber; uint32_t startTime = static_cast(0); uint32_t endTime = static_cast(0); @@ -22019,35 +22076,6 @@ struct Type using DecodableType = Type; } // namespace ConstraintsStruct -namespace PowerAdjustStruct { -enum class Fields : uint8_t -{ - kMinPower = 0, - kMaxPower = 1, - kMinDuration = 2, - kMaxDuration = 3, - kCause = 4, -}; - -struct Type -{ -public: - int64_t minPower = static_cast(0); - int64_t maxPower = static_cast(0); - uint32_t minDuration = static_cast(0); - uint32_t maxDuration = static_cast(0); - PowerAdjustReasonEnum cause = static_cast(0); - - CHIP_ERROR Decode(TLV::TLVReader & reader); - - static constexpr bool kIsFabricScoped = false; - - CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; -}; - -using DecodableType = Type; - -} // namespace PowerAdjustStruct namespace SlotAdjustmentStruct { enum class Fields : uint8_t { @@ -22288,7 +22316,7 @@ struct DecodableType namespace ModifyForecastRequest { enum class Fields : uint8_t { - kForecastId = 0, + kForecastID = 0, kSlotAdjustments = 1, kCause = 2, }; @@ -22300,7 +22328,7 @@ struct Type static constexpr CommandId GetCommandId() { return Commands::ModifyForecastRequest::Id; } static constexpr ClusterId GetClusterId() { return Clusters::DeviceEnergyManagement::Id; } - uint32_t forecastId = static_cast(0); + uint32_t forecastID = static_cast(0); DataModel::List slotAdjustments; AdjustmentCauseEnum cause = static_cast(0); @@ -22317,7 +22345,7 @@ struct DecodableType static constexpr CommandId GetCommandId() { return Commands::ModifyForecastRequest::Id; } static constexpr ClusterId GetClusterId() { return Clusters::DeviceEnergyManagement::Id; } - uint32_t forecastId = static_cast(0); + uint32_t forecastID = static_cast(0); DataModel::DecodableList slotAdjustments; AdjustmentCauseEnum cause = static_cast(0); CHIP_ERROR Decode(TLV::TLVReader & reader); diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index 012407529d1369..74bd7ed55525de 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -7149,7 +7149,7 @@ class DeviceEnergyManagementModifyForecastRequest : public ClusterCommand DeviceEnergyManagementModifyForecastRequest(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("modify-forecast-request", credsIssuerConfig), mComplex_SlotAdjustments(&mRequest.slotAdjustments) { - AddArgument("ForecastId", 0, UINT32_MAX, &mRequest.forecastId); + AddArgument("ForecastID", 0, UINT32_MAX, &mRequest.forecastID); AddArgument("SlotAdjustments", &mComplex_SlotAdjustments); AddArgument("Cause", 0, UINT8_MAX, &mRequest.cause); ClusterCommand::AddArguments(); @@ -20655,8 +20655,8 @@ void registerClusterDeviceEnergyManagement(Commands & commands, CredentialIssuer WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique>(Id, "abs-max-power", INT64_MIN, INT64_MAX, Attributes::AbsMaxPower::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>>>( + make_unique>>>( Id, "power-adjustment-capability", Attributes::PowerAdjustmentCapability::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique> + chip::app::Clusters::DeviceEnergyManagement::Structs::PowerAdjustCapabilityStruct::DecodableType>> value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("PowerAdjustmentCapability", 1, value); diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h index ca39e2ae069060..dab4bb33f7d2ab 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h @@ -236,6 +236,13 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::DeviceEnergyManagement::Structs::CostStruct::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::DeviceEnergyManagement::Structs::PowerAdjustStruct::DecodableType & value); + +static CHIP_ERROR +LogValue(const char * label, size_t indent, + const chip::app::Clusters::DeviceEnergyManagement::Structs::PowerAdjustCapabilityStruct::DecodableType & value); + static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::DeviceEnergyManagement::Structs::SlotStruct::DecodableType & value); @@ -245,9 +252,6 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::DeviceEnergyManagement::Structs::ConstraintsStruct::DecodableType & value); -static CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::DeviceEnergyManagement::Structs::PowerAdjustStruct::DecodableType & value); - static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::DeviceEnergyManagement::Structs::SlotAdjustmentStruct::DecodableType & value); diff --git a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h index 546fa3091812eb..ea5ad1848a844f 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -81844,7 +81844,7 @@ class DeviceEnergyManagementModifyForecastRequest : public ClusterCommand { , mComplex_SlotAdjustments(&mRequest.slotAdjustments) { #if MTR_ENABLE_PROVISIONAL - AddArgument("ForecastId", 0, UINT32_MAX, &mRequest.forecastId); + AddArgument("ForecastID", 0, UINT32_MAX, &mRequest.forecastID); #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL AddArgument("SlotAdjustments", &mComplex_SlotAdjustments); @@ -81867,7 +81867,7 @@ class DeviceEnergyManagementModifyForecastRequest : public ClusterCommand { __auto_type * params = [[MTRDeviceEnergyManagementClusterModifyForecastRequestParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; #if MTR_ENABLE_PROVISIONAL - params.forecastId = [NSNumber numberWithUnsignedInt:mRequest.forecastId]; + params.forecastID = [NSNumber numberWithUnsignedInt:mRequest.forecastID]; #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL { // Scope for our temporary variables From 6ca83b459b2a5e6ca6362ede265ad3d9cd59f9c9 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Mon, 3 Jun 2024 08:07:04 +0100 Subject: [PATCH 07/32] Removed extra entryType="PowerAdjustStruct" which causes incorrect generation of a top-level list in the PowerAdjustmentCapability attribute. --- .../zcl/data-model/chip/device-energy-management-cluster.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/zap-templates/zcl/data-model/chip/device-energy-management-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/device-energy-management-cluster.xml index 9c46fc1f6887db..b087f3c162ab8d 100644 --- a/src/app/zap-templates/zcl/data-model/chip/device-energy-management-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/device-energy-management-cluster.xml @@ -81,7 +81,7 @@ planned operation."> AbsMinPower AbsMaxPower - PowerAdjustmentCapability + PowerAdjustmentCapability Forecast OptOutState From c9c27a588fd896880d9b59be329c869b6bb001ef Mon Sep 17 00:00:00 2001 From: James Harrow Date: Mon, 3 Jun 2024 08:09:02 +0100 Subject: [PATCH 08/32] Removed extra min="-4611686018427387904" max="4611686018427387903" which causes ZAP to complain about more than 2 byte length. --- .../zap-templates/zcl/data-model/chip/energy-evse-cluster.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/zap-templates/zcl/data-model/chip/energy-evse-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/energy-evse-cluster.xml index 67a86a7e0282a1..067bd58d32fca0 100644 --- a/src/app/zap-templates/zcl/data-model/chip/energy-evse-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/energy-evse-cluster.xml @@ -127,7 +127,7 @@ limitations under the License. MaximumChargeCurrent MaximumDischargeCurrent - + UserMaximumChargeCurrent From 59c5802b489d9046fbd00e33a5f0d934da224022 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Mon, 3 Jun 2024 09:05:28 +0100 Subject: [PATCH 09/32] Updated after regen_all --- .../all-clusters-app.matter | 2 +- .../energy-management-app.matter | 2 +- .../data_model/controller-clusters.matter | 2 +- .../chip/devicecontroller/ChipClusters.java | 6 +- .../devicecontroller/ClusterInfoMapping.java | 6 +- .../devicecontroller/ClusterReadMapping.java | 11 - .../clusters/DeviceEnergyManagementCluster.kt | 37 +--- .../CHIPAttributeTLVValueDecoder.cpp | 193 ++++++++---------- .../python/chip/clusters/Objects.py | 8 +- .../MTRAttributeTLVValueDecoder.mm | 63 +++--- .../CHIP/zap-generated/MTRBaseClusters.h | 6 +- .../CHIP/zap-generated/MTRBaseClusters.mm | 6 +- .../zap-generated/cluster-objects.h | 12 +- .../zap-generated/cluster/Commands.h | 4 +- .../cluster/logging/DataModelLogger.cpp | 4 +- .../zap-generated/cluster/Commands.h | 4 +- 16 files changed, 154 insertions(+), 212 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index 115a7fb4eea677..61811abd9bfae8 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -4233,7 +4233,7 @@ provisional cluster DeviceEnergyManagement = 152 { readonly attribute ESAStateEnum ESAState = 2; readonly attribute power_mw absMinPower = 3; readonly attribute power_mw absMaxPower = 4; - readonly attribute optional nullable PowerAdjustCapabilityStruct powerAdjustmentCapability[] = 5; + readonly attribute optional nullable PowerAdjustCapabilityStruct powerAdjustmentCapability = 5; readonly attribute optional nullable ForecastStruct forecast = 6; readonly attribute optional OptOutStateEnum optOutState = 7; readonly attribute command_id generatedCommandList[] = 65528; diff --git a/examples/energy-management-app/energy-management-common/energy-management-app.matter b/examples/energy-management-app/energy-management-common/energy-management-app.matter index 9b0c95b0ba786c..37e3273057f101 100644 --- a/examples/energy-management-app/energy-management-common/energy-management-app.matter +++ b/examples/energy-management-app/energy-management-common/energy-management-app.matter @@ -1594,7 +1594,7 @@ provisional cluster DeviceEnergyManagement = 152 { readonly attribute ESAStateEnum ESAState = 2; readonly attribute power_mw absMinPower = 3; readonly attribute power_mw absMaxPower = 4; - readonly attribute optional nullable PowerAdjustCapabilityStruct powerAdjustmentCapability[] = 5; + readonly attribute optional nullable PowerAdjustCapabilityStruct powerAdjustmentCapability = 5; readonly attribute optional nullable ForecastStruct forecast = 6; readonly attribute optional OptOutStateEnum optOutState = 7; readonly attribute command_id generatedCommandList[] = 65528; diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index eb9a40da10bae9..b0a6c60a33dab2 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -4758,7 +4758,7 @@ provisional cluster DeviceEnergyManagement = 152 { readonly attribute ESAStateEnum ESAState = 2; readonly attribute power_mw absMinPower = 3; readonly attribute power_mw absMaxPower = 4; - readonly attribute optional nullable PowerAdjustCapabilityStruct powerAdjustmentCapability[] = 5; + readonly attribute optional nullable PowerAdjustCapabilityStruct powerAdjustmentCapability = 5; readonly attribute optional nullable ForecastStruct forecast = 6; readonly attribute optional OptOutStateEnum optOutState = 7; readonly attribute command_id generatedCommandList[] = 65528; diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java index 44f1418f93f038..4aef27e1a52562 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java @@ -31267,7 +31267,7 @@ public void onResponse(StructType invokeStructValue) { } public interface PowerAdjustmentCapabilityAttributeCallback extends BaseAttributeCallback { - void onSuccess(@Nullable List value); + void onSuccess(@Nullable ChipStructs.DeviceEnergyManagementClusterPowerAdjustCapabilityStruct value); } public interface ForecastAttributeCallback extends BaseAttributeCallback { @@ -31427,7 +31427,7 @@ public void readPowerAdjustmentCapabilityAttribute( readAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - @Nullable List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + @Nullable ChipStructs.DeviceEnergyManagementClusterPowerAdjustCapabilityStruct value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } }, POWER_ADJUSTMENT_CAPABILITY_ATTRIBUTE_ID, true); @@ -31440,7 +31440,7 @@ public void subscribePowerAdjustmentCapabilityAttribute( subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - @Nullable List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + @Nullable ChipStructs.DeviceEnergyManagementClusterPowerAdjustCapabilityStruct value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } }, POWER_ADJUSTMENT_CAPABILITY_ATTRIBUTE_ID, minInterval, maxInterval); diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java index e6fdd4f4163d9a..1a711b69773459 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java @@ -10882,10 +10882,10 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(@Nullable List valueList) { + public void onSuccess(@Nullable ChipStructs.DeviceEnergyManagementClusterPowerAdjustCapabilityStruct value) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); - responseValues.put(commandResponseInfo, valueList); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "ChipStructs.DeviceEnergyManagementClusterPowerAdjustCapabilityStruct"); + responseValues.put(commandResponseInfo, value); callback.onSuccess(responseValues); } diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java index e75473bc0869b8..22208b3a9bf0cd 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java @@ -9619,17 +9619,6 @@ private static Map readDeviceEnergyManagementInteractio readDeviceEnergyManagementAbsMaxPowerCommandParams ); result.put("readAbsMaxPowerAttribute", readDeviceEnergyManagementAbsMaxPowerAttributeInteractionInfo); - Map readDeviceEnergyManagementPowerAdjustmentCapabilityCommandParams = new LinkedHashMap(); - InteractionInfo readDeviceEnergyManagementPowerAdjustmentCapabilityAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.DeviceEnergyManagementCluster) cluster).readPowerAdjustmentCapabilityAttribute( - (ChipClusters.DeviceEnergyManagementCluster.PowerAdjustmentCapabilityAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedDeviceEnergyManagementClusterPowerAdjustmentCapabilityAttributeCallback(), - readDeviceEnergyManagementPowerAdjustmentCapabilityCommandParams - ); - result.put("readPowerAdjustmentCapabilityAttribute", readDeviceEnergyManagementPowerAdjustmentCapabilityAttributeInteractionInfo); Map readDeviceEnergyManagementOptOutStateCommandParams = new LinkedHashMap(); InteractionInfo readDeviceEnergyManagementOptOutStateAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/DeviceEnergyManagementCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/DeviceEnergyManagementCluster.kt index 4e9d0869d70f2c..6549ec01a70fed 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/DeviceEnergyManagementCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/DeviceEnergyManagementCluster.kt @@ -47,11 +47,11 @@ class DeviceEnergyManagementCluster( private val endpointId: UShort ) { class PowerAdjustmentCapabilityAttribute( - val value: List? + val value: DeviceEnergyManagementClusterPowerAdjustCapabilityStruct? ) sealed class PowerAdjustmentCapabilityAttributeSubscriptionState { - data class Success(val value: List?) : + data class Success(val value: DeviceEnergyManagementClusterPowerAdjustCapabilityStruct?) : PowerAdjustmentCapabilityAttributeSubscriptionState() data class Error(val exception: Exception) : @@ -750,21 +750,10 @@ class DeviceEnergyManagementCluster( // Decode the TLV data into the appropriate type val tlvReader = TlvReader(attributeData.data) - val decodedValue: List? = + val decodedValue: DeviceEnergyManagementClusterPowerAdjustCapabilityStruct? = if (!tlvReader.isNull()) { if (tlvReader.isNextTag(AnonymousTag)) { - buildList { - tlvReader.enterArray(AnonymousTag) - while (!tlvReader.isEndOfContainer()) { - add( - DeviceEnergyManagementClusterPowerAdjustCapabilityStruct.fromTlv( - AnonymousTag, - tlvReader - ) - ) - } - tlvReader.exitContainer() - } + DeviceEnergyManagementClusterPowerAdjustCapabilityStruct.fromTlv(AnonymousTag, tlvReader) } else { null } @@ -817,21 +806,13 @@ class DeviceEnergyManagementCluster( // Decode the TLV data into the appropriate type val tlvReader = TlvReader(attributeData.data) - val decodedValue: List? = + val decodedValue: DeviceEnergyManagementClusterPowerAdjustCapabilityStruct? = if (!tlvReader.isNull()) { if (tlvReader.isNextTag(AnonymousTag)) { - buildList { - tlvReader.enterArray(AnonymousTag) - while (!tlvReader.isEndOfContainer()) { - add( - DeviceEnergyManagementClusterPowerAdjustCapabilityStruct.fromTlv( - AnonymousTag, - tlvReader - ) - ) - } - tlvReader.exitContainer() - } + DeviceEnergyManagementClusterPowerAdjustCapabilityStruct.fromTlv( + AnonymousTag, + tlvReader + ) } else { null } diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index fc2fca43beebd9..22ce3a09298d03 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -23441,119 +23441,106 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } else { - chip::JniReferences::GetInstance().CreateArrayList(value); - - auto iter_value_1 = cppValue.Value().begin(); - while (iter_value_1.Next()) + jobject value_powerAdjustCapability; + if (cppValue.Value().powerAdjustCapability.IsNull()) { - auto & entry_1 = iter_value_1.GetValue(); - jobject newElement_1; - jobject newElement_1_powerAdjustCapability; - if (entry_1.powerAdjustCapability.IsNull()) - { - newElement_1_powerAdjustCapability = nullptr; - } - else + value_powerAdjustCapability = nullptr; + } + else + { + chip::JniReferences::GetInstance().CreateArrayList(value_powerAdjustCapability); + + auto iter_value_powerAdjustCapability_3 = cppValue.Value().powerAdjustCapability.Value().begin(); + while (iter_value_powerAdjustCapability_3.Next()) { - chip::JniReferences::GetInstance().CreateArrayList(newElement_1_powerAdjustCapability); + auto & entry_3 = iter_value_powerAdjustCapability_3.GetValue(); + jobject newElement_3; + jobject newElement_3_minPower; + std::string newElement_3_minPowerClassName = "java/lang/Long"; + std::string newElement_3_minPowerCtorSignature = "(J)V"; + jlong jninewElement_3_minPower = static_cast(entry_3.minPower); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_3_minPowerClassName.c_str(), newElement_3_minPowerCtorSignature.c_str(), + jninewElement_3_minPower, newElement_3_minPower); + jobject newElement_3_maxPower; + std::string newElement_3_maxPowerClassName = "java/lang/Long"; + std::string newElement_3_maxPowerCtorSignature = "(J)V"; + jlong jninewElement_3_maxPower = static_cast(entry_3.maxPower); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_3_maxPowerClassName.c_str(), newElement_3_maxPowerCtorSignature.c_str(), + jninewElement_3_maxPower, newElement_3_maxPower); + jobject newElement_3_minDuration; + std::string newElement_3_minDurationClassName = "java/lang/Long"; + std::string newElement_3_minDurationCtorSignature = "(J)V"; + jlong jninewElement_3_minDuration = static_cast(entry_3.minDuration); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_3_minDurationClassName.c_str(), newElement_3_minDurationCtorSignature.c_str(), + jninewElement_3_minDuration, newElement_3_minDuration); + jobject newElement_3_maxDuration; + std::string newElement_3_maxDurationClassName = "java/lang/Long"; + std::string newElement_3_maxDurationCtorSignature = "(J)V"; + jlong jninewElement_3_maxDuration = static_cast(entry_3.maxDuration); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_3_maxDurationClassName.c_str(), newElement_3_maxDurationCtorSignature.c_str(), + jninewElement_3_maxDuration, newElement_3_maxDuration); - auto iter_newElement_1_powerAdjustCapability_4 = entry_1.powerAdjustCapability.Value().begin(); - while (iter_newElement_1_powerAdjustCapability_4.Next()) + jclass powerAdjustStructStructClass_4; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$DeviceEnergyManagementClusterPowerAdjustStruct", + powerAdjustStructStructClass_4); + if (err != CHIP_NO_ERROR) { - auto & entry_4 = iter_newElement_1_powerAdjustCapability_4.GetValue(); - jobject newElement_4; - jobject newElement_4_minPower; - std::string newElement_4_minPowerClassName = "java/lang/Long"; - std::string newElement_4_minPowerCtorSignature = "(J)V"; - jlong jninewElement_4_minPower = static_cast(entry_4.minPower); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_4_minPowerClassName.c_str(), newElement_4_minPowerCtorSignature.c_str(), - jninewElement_4_minPower, newElement_4_minPower); - jobject newElement_4_maxPower; - std::string newElement_4_maxPowerClassName = "java/lang/Long"; - std::string newElement_4_maxPowerCtorSignature = "(J)V"; - jlong jninewElement_4_maxPower = static_cast(entry_4.maxPower); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_4_maxPowerClassName.c_str(), newElement_4_maxPowerCtorSignature.c_str(), - jninewElement_4_maxPower, newElement_4_maxPower); - jobject newElement_4_minDuration; - std::string newElement_4_minDurationClassName = "java/lang/Long"; - std::string newElement_4_minDurationCtorSignature = "(J)V"; - jlong jninewElement_4_minDuration = static_cast(entry_4.minDuration); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_4_minDurationClassName.c_str(), newElement_4_minDurationCtorSignature.c_str(), - jninewElement_4_minDuration, newElement_4_minDuration); - jobject newElement_4_maxDuration; - std::string newElement_4_maxDurationClassName = "java/lang/Long"; - std::string newElement_4_maxDurationCtorSignature = "(J)V"; - jlong jninewElement_4_maxDuration = static_cast(entry_4.maxDuration); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_4_maxDurationClassName.c_str(), newElement_4_maxDurationCtorSignature.c_str(), - jninewElement_4_maxDuration, newElement_4_maxDuration); - - jclass powerAdjustStructStructClass_5; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DeviceEnergyManagementClusterPowerAdjustStruct", - powerAdjustStructStructClass_5); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, - "Could not find class ChipStructs$DeviceEnergyManagementClusterPowerAdjustStruct"); - return nullptr; - } - - jmethodID powerAdjustStructStructCtor_5; - err = chip::JniReferences::GetInstance().FindMethod( - env, powerAdjustStructStructClass_5, "", - "(Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;)V", - &powerAdjustStructStructCtor_5); - if (err != CHIP_NO_ERROR || powerAdjustStructStructCtor_5 == nullptr) - { - ChipLogError( - Zcl, "Could not find ChipStructs$DeviceEnergyManagementClusterPowerAdjustStruct constructor"); - return nullptr; - } + ChipLogError(Zcl, "Could not find class ChipStructs$DeviceEnergyManagementClusterPowerAdjustStruct"); + return nullptr; + } - newElement_4 = - env->NewObject(powerAdjustStructStructClass_5, powerAdjustStructStructCtor_5, newElement_4_minPower, - newElement_4_maxPower, newElement_4_minDuration, newElement_4_maxDuration); - chip::JniReferences::GetInstance().AddToList(newElement_1_powerAdjustCapability, newElement_4); + jmethodID powerAdjustStructStructCtor_4; + err = chip::JniReferences::GetInstance().FindMethod( + env, powerAdjustStructStructClass_4, "", + "(Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;)V", &powerAdjustStructStructCtor_4); + if (err != CHIP_NO_ERROR || powerAdjustStructStructCtor_4 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$DeviceEnergyManagementClusterPowerAdjustStruct constructor"); + return nullptr; } - } - jobject newElement_1_cause; - std::string newElement_1_causeClassName = "java/lang/Integer"; - std::string newElement_1_causeCtorSignature = "(I)V"; - jint jninewElement_1_cause = static_cast(entry_1.cause); - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_1_causeClassName.c_str(), - newElement_1_causeCtorSignature.c_str(), - jninewElement_1_cause, newElement_1_cause); - - jclass powerAdjustCapabilityStructStructClass_2; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DeviceEnergyManagementClusterPowerAdjustCapabilityStruct", - powerAdjustCapabilityStructStructClass_2); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, - "Could not find class ChipStructs$DeviceEnergyManagementClusterPowerAdjustCapabilityStruct"); - return nullptr; - } - jmethodID powerAdjustCapabilityStructStructCtor_2; - err = chip::JniReferences::GetInstance().FindMethod(env, powerAdjustCapabilityStructStructClass_2, "", - "(Ljava/util/ArrayList;Ljava/lang/Integer;)V", - &powerAdjustCapabilityStructStructCtor_2); - if (err != CHIP_NO_ERROR || powerAdjustCapabilityStructStructCtor_2 == nullptr) - { - ChipLogError( - Zcl, "Could not find ChipStructs$DeviceEnergyManagementClusterPowerAdjustCapabilityStruct constructor"); - return nullptr; + newElement_3 = + env->NewObject(powerAdjustStructStructClass_4, powerAdjustStructStructCtor_4, newElement_3_minPower, + newElement_3_maxPower, newElement_3_minDuration, newElement_3_maxDuration); + chip::JniReferences::GetInstance().AddToList(value_powerAdjustCapability, newElement_3); } + } + jobject value_cause; + std::string value_causeClassName = "java/lang/Integer"; + std::string value_causeCtorSignature = "(I)V"; + jint jnivalue_cause = static_cast(cppValue.Value().cause); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_causeClassName.c_str(), value_causeCtorSignature.c_str(), jnivalue_cause, value_cause); - newElement_1 = env->NewObject(powerAdjustCapabilityStructStructClass_2, powerAdjustCapabilityStructStructCtor_2, - newElement_1_powerAdjustCapability, newElement_1_cause); - chip::JniReferences::GetInstance().AddToList(value, newElement_1); + jclass powerAdjustCapabilityStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$DeviceEnergyManagementClusterPowerAdjustCapabilityStruct", + powerAdjustCapabilityStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$DeviceEnergyManagementClusterPowerAdjustCapabilityStruct"); + return nullptr; + } + + jmethodID powerAdjustCapabilityStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, powerAdjustCapabilityStructStructClass_1, "", + "(Ljava/util/ArrayList;Ljava/lang/Integer;)V", + &powerAdjustCapabilityStructStructCtor_1); + if (err != CHIP_NO_ERROR || powerAdjustCapabilityStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$DeviceEnergyManagementClusterPowerAdjustCapabilityStruct constructor"); + return nullptr; } + + value = env->NewObject(powerAdjustCapabilityStructStructClass_1, powerAdjustCapabilityStructStructCtor_1, + value_powerAdjustCapability, value_cause); } return value; } diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index b089dfc4d106b1..fe7d28590e6b62 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -24138,7 +24138,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="ESAState", Tag=0x00000002, Type=DeviceEnergyManagement.Enums.ESAStateEnum), ClusterObjectFieldDescriptor(Label="absMinPower", Tag=0x00000003, Type=int), ClusterObjectFieldDescriptor(Label="absMaxPower", Tag=0x00000004, Type=int), - ClusterObjectFieldDescriptor(Label="powerAdjustmentCapability", Tag=0x00000005, Type=typing.Union[None, Nullable, typing.List[DeviceEnergyManagement.Structs.PowerAdjustStruct]]), + ClusterObjectFieldDescriptor(Label="powerAdjustmentCapability", Tag=0x00000005, Type=typing.Union[None, Nullable, DeviceEnergyManagement.Structs.PowerAdjustCapabilityStruct]), ClusterObjectFieldDescriptor(Label="forecast", Tag=0x00000006, Type=typing.Union[None, Nullable, DeviceEnergyManagement.Structs.ForecastStruct]), ClusterObjectFieldDescriptor(Label="optOutState", Tag=0x00000007, Type=typing.Optional[DeviceEnergyManagement.Enums.OptOutStateEnum]), ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), @@ -24154,7 +24154,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: ESAState: 'DeviceEnergyManagement.Enums.ESAStateEnum' = None absMinPower: 'int' = None absMaxPower: 'int' = None - powerAdjustmentCapability: 'typing.Union[None, Nullable, typing.List[DeviceEnergyManagement.Structs.PowerAdjustStruct]]' = None + powerAdjustmentCapability: 'typing.Union[None, Nullable, DeviceEnergyManagement.Structs.PowerAdjustCapabilityStruct]' = None forecast: 'typing.Union[None, Nullable, DeviceEnergyManagement.Structs.ForecastStruct]' = None optOutState: 'typing.Optional[DeviceEnergyManagement.Enums.OptOutStateEnum]' = None generatedCommandList: 'typing.List[uint]' = None @@ -24653,9 +24653,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, typing.List[DeviceEnergyManagement.Structs.PowerAdjustStruct]]) + return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, DeviceEnergyManagement.Structs.PowerAdjustCapabilityStruct]) - value: 'typing.Union[None, Nullable, typing.List[DeviceEnergyManagement.Structs.PowerAdjustStruct]]' = None + value: 'typing.Union[None, Nullable, DeviceEnergyManagement.Structs.PowerAdjustCapabilityStruct]' = None @dataclass class Forecast(ClusterAttributeDescriptor): diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm index f871b5a0f79251..e6075088abdd68 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -8904,51 +8904,36 @@ static id _Nullable DecodeAttributeValueForDeviceEnergyManagementCluster(Attribu if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nullable value; + MTRDeviceEnergyManagementClusterPowerAdjustCapabilityStruct * _Nullable value; if (cppValue.IsNull()) { value = nil; } else { - { // Scope for our temporary variables - auto * array_1 = [NSMutableArray new]; - auto iter_1 = cppValue.Value().begin(); - while (iter_1.Next()) { - auto & entry_1 = iter_1.GetValue(); - MTRDeviceEnergyManagementClusterPowerAdjustCapabilityStruct * newElement_1; - newElement_1 = [MTRDeviceEnergyManagementClusterPowerAdjustCapabilityStruct new]; - if (entry_1.powerAdjustCapability.IsNull()) { - newElement_1.powerAdjustCapability = nil; - } else { - { // Scope for our temporary variables - auto * array_4 = [NSMutableArray new]; - auto iter_4 = entry_1.powerAdjustCapability.Value().begin(); - while (iter_4.Next()) { - auto & entry_4 = iter_4.GetValue(); - MTRDeviceEnergyManagementClusterPowerAdjustStruct * newElement_4; - newElement_4 = [MTRDeviceEnergyManagementClusterPowerAdjustStruct new]; - newElement_4.minPower = [NSNumber numberWithLongLong:entry_4.minPower]; - newElement_4.maxPower = [NSNumber numberWithLongLong:entry_4.maxPower]; - newElement_4.minDuration = [NSNumber numberWithUnsignedInt:entry_4.minDuration]; - newElement_4.maxDuration = [NSNumber numberWithUnsignedInt:entry_4.maxDuration]; - [array_4 addObject:newElement_4]; - } - CHIP_ERROR err = iter_4.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - newElement_1.powerAdjustCapability = array_4; - } + value = [MTRDeviceEnergyManagementClusterPowerAdjustCapabilityStruct new]; + if (cppValue.Value().powerAdjustCapability.IsNull()) { + value.powerAdjustCapability = nil; + } else { + { // Scope for our temporary variables + auto * array_3 = [NSMutableArray new]; + auto iter_3 = cppValue.Value().powerAdjustCapability.Value().begin(); + while (iter_3.Next()) { + auto & entry_3 = iter_3.GetValue(); + MTRDeviceEnergyManagementClusterPowerAdjustStruct * newElement_3; + newElement_3 = [MTRDeviceEnergyManagementClusterPowerAdjustStruct new]; + newElement_3.minPower = [NSNumber numberWithLongLong:entry_3.minPower]; + newElement_3.maxPower = [NSNumber numberWithLongLong:entry_3.maxPower]; + newElement_3.minDuration = [NSNumber numberWithUnsignedInt:entry_3.minDuration]; + newElement_3.maxDuration = [NSNumber numberWithUnsignedInt:entry_3.maxDuration]; + [array_3 addObject:newElement_3]; } - newElement_1.cause = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_1.cause)]; - [array_1 addObject:newElement_1]; - } - CHIP_ERROR err = iter_1.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; + CHIP_ERROR err = iter_3.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value.powerAdjustCapability = array_3; } - value = array_1; } + value.cause = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.Value().cause)]; } return value; } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index 584bbdd9c55e37..f93f69511d15b2 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -7827,11 +7827,11 @@ MTR_PROVISIONALLY_AVAILABLE reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; + (void)readAttributeAbsMaxPowerWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; -- (void)readAttributePowerAdjustmentCapabilityWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)readAttributePowerAdjustmentCapabilityWithCompletion:(void (^)(MTRDeviceEnergyManagementClusterPowerAdjustCapabilityStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; - (void)subscribeAttributePowerAdjustmentCapabilityWithParams:(MTRSubscribeParams *)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; -+ (void)readAttributePowerAdjustmentCapabilityWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + reportHandler:(void (^)(MTRDeviceEnergyManagementClusterPowerAdjustCapabilityStruct * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributePowerAdjustmentCapabilityWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTRDeviceEnergyManagementClusterPowerAdjustCapabilityStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; - (void)readAttributeForecastWithCompletion:(void (^)(MTRDeviceEnergyManagementClusterForecastStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; - (void)subscribeAttributeForecastWithParams:(MTRSubscribeParams *)params diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index 8155fed2e794f1..176307000a7286 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -52502,7 +52502,7 @@ + (void)readAttributeAbsMaxPowerWithClusterStateCache:(MTRClusterStateCacheConta completion:completion]; } -- (void)readAttributePowerAdjustmentCapabilityWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +- (void)readAttributePowerAdjustmentCapabilityWithCompletion:(void (^)(MTRDeviceEnergyManagementClusterPowerAdjustCapabilityStruct * _Nullable value, NSError * _Nullable error))completion { using TypeInfo = DeviceEnergyManagement::Attributes::PowerAdjustmentCapability::TypeInfo; [self.device _readKnownAttributeWithEndpointID:self.endpointID @@ -52515,7 +52515,7 @@ - (void)readAttributePowerAdjustmentCapabilityWithCompletion:(void (^)(NSArray * - (void)subscribeAttributePowerAdjustmentCapabilityWithParams:(MTRSubscribeParams * _Nonnull)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler + reportHandler:(void (^)(MTRDeviceEnergyManagementClusterPowerAdjustCapabilityStruct * _Nullable value, NSError * _Nullable error))reportHandler { using TypeInfo = DeviceEnergyManagement::Attributes::PowerAdjustmentCapability::TypeInfo; [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID @@ -52527,7 +52527,7 @@ - (void)subscribeAttributePowerAdjustmentCapabilityWithParams:(MTRSubscribeParam subscriptionEstablished:subscriptionEstablished]; } -+ (void)readAttributePowerAdjustmentCapabilityWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion ++ (void)readAttributePowerAdjustmentCapabilityWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTRDeviceEnergyManagementClusterPowerAdjustCapabilityStruct * _Nullable value, NSError * _Nullable error))completion { using TypeInfo = DeviceEnergyManagement::Attributes::PowerAdjustmentCapability::TypeInfo; [clusterStateCacheContainer diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index 8d5c5447c37978..9b697a3dba9b9a 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h @@ -22481,12 +22481,12 @@ struct TypeInfo namespace PowerAdjustmentCapability { struct TypeInfo { - using Type = chip::app::DataModel::Nullable< - chip::app::DataModel::List>; - using DecodableType = chip::app::DataModel::Nullable>; - using DecodableArgType = const chip::app::DataModel::Nullable> &; + using Type = + chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable< + chip::app::Clusters::DeviceEnergyManagement::Structs::PowerAdjustCapabilityStruct::DecodableType>; + using DecodableArgType = const chip::app::DataModel::Nullable< + chip::app::Clusters::DeviceEnergyManagement::Structs::PowerAdjustCapabilityStruct::DecodableType> &; static constexpr ClusterId GetClusterId() { return Clusters::DeviceEnergyManagement::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::PowerAdjustmentCapability::Id; } diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index 74bd7ed55525de..25652d1244a2fc 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -20655,8 +20655,8 @@ void registerClusterDeviceEnergyManagement(Commands & commands, CredentialIssuer WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique>(Id, "abs-max-power", INT64_MIN, INT64_MAX, Attributes::AbsMaxPower::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>>>( + make_unique>>( Id, "power-adjustment-capability", Attributes::PowerAdjustmentCapability::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique> + chip::app::DataModel::Nullable< + chip::app::Clusters::DeviceEnergyManagement::Structs::PowerAdjustCapabilityStruct::DecodableType> value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("PowerAdjustmentCapability", 1, value); diff --git a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h index ea5ad1848a844f..85eb8c76bbf0af 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -82498,7 +82498,7 @@ class ReadDeviceEnergyManagementPowerAdjustmentCapability : public ReadAttribute dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); __auto_type * cluster = [[MTRBaseClusterDeviceEnergyManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; - [cluster readAttributePowerAdjustmentCapabilityWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + [cluster readAttributePowerAdjustmentCapabilityWithCompletion:^(MTRDeviceEnergyManagementClusterPowerAdjustCapabilityStruct * _Nullable value, NSError * _Nullable error) { NSLog(@"DeviceEnergyManagement.PowerAdjustmentCapability response %@", [value description]); if (error == nil) { RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); @@ -82543,7 +82543,7 @@ class SubscribeAttributeDeviceEnergyManagementPowerAdjustmentCapability : public } [cluster subscribeAttributePowerAdjustmentCapabilityWithParams:params subscriptionEstablished:^() { mSubscriptionEstablished = YES; } - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + reportHandler:^(MTRDeviceEnergyManagementClusterPowerAdjustCapabilityStruct * _Nullable value, NSError * _Nullable error) { NSLog(@"DeviceEnergyManagement.PowerAdjustmentCapability response %@", [value description]); if (error == nil) { RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); From 26d3030e8646b9a3ebc8ca4980a3d01df7bd4ff9 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Mon, 3 Jun 2024 23:01:56 +0100 Subject: [PATCH 10/32] Reverted max="86400" in RANDOMIZATION_DELAY_WINDOW which upsets some builds --- .../zap-templates/zcl/data-model/chip/energy-evse-cluster.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/zap-templates/zcl/data-model/chip/energy-evse-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/energy-evse-cluster.xml index 067bd58d32fca0..8a34a0cc32f1bb 100644 --- a/src/app/zap-templates/zcl/data-model/chip/energy-evse-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/energy-evse-cluster.xml @@ -131,7 +131,7 @@ limitations under the License. UserMaximumChargeCurrent - + RandomizationDelayWindow From 6ce2430022c1e6ceb11f8615174375851a4f0e56 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Mon, 3 Jun 2024 23:21:20 +0100 Subject: [PATCH 11/32] Added missing autogen'd code for DEM changes. --- ...ementClusterPowerAdjustCapabilityStruct.kt | 83 +++++++++++++++++++ ...ementClusterPowerAdjustCapabilityStruct.kt | 83 +++++++++++++++++++ 2 files changed, 166 insertions(+) create mode 100644 src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DeviceEnergyManagementClusterPowerAdjustCapabilityStruct.kt create mode 100644 src/controller/java/generated/java/matter/controller/cluster/structs/DeviceEnergyManagementClusterPowerAdjustCapabilityStruct.kt diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DeviceEnergyManagementClusterPowerAdjustCapabilityStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DeviceEnergyManagementClusterPowerAdjustCapabilityStruct.kt new file mode 100644 index 00000000000000..e2172a7b33b94e --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DeviceEnergyManagementClusterPowerAdjustCapabilityStruct.kt @@ -0,0 +1,83 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package chip.devicecontroller.cluster.structs + +import chip.devicecontroller.cluster.* +import matter.tlv.AnonymousTag +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class DeviceEnergyManagementClusterPowerAdjustCapabilityStruct( + val powerAdjustCapability: List?, + val cause: UInt +) { + override fun toString(): String = buildString { + append("DeviceEnergyManagementClusterPowerAdjustCapabilityStruct {\n") + append("\tpowerAdjustCapability : $powerAdjustCapability\n") + append("\tcause : $cause\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + if (powerAdjustCapability != null) { + startArray(ContextSpecificTag(TAG_POWER_ADJUST_CAPABILITY)) + for (item in powerAdjustCapability.iterator()) { + item.toTlv(AnonymousTag, this) + } + endArray() + } else { + putNull(ContextSpecificTag(TAG_POWER_ADJUST_CAPABILITY)) + } + put(ContextSpecificTag(TAG_CAUSE), cause) + endStructure() + } + } + + companion object { + private const val TAG_POWER_ADJUST_CAPABILITY = 0 + private const val TAG_CAUSE = 1 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader + ): DeviceEnergyManagementClusterPowerAdjustCapabilityStruct { + tlvReader.enterStructure(tlvTag) + val powerAdjustCapability = + if (!tlvReader.isNull()) { + buildList { + tlvReader.enterArray(ContextSpecificTag(TAG_POWER_ADJUST_CAPABILITY)) + while (!tlvReader.isEndOfContainer()) { + add(DeviceEnergyManagementClusterPowerAdjustStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_POWER_ADJUST_CAPABILITY)) + null + } + val cause = tlvReader.getUInt(ContextSpecificTag(TAG_CAUSE)) + + tlvReader.exitContainer() + + return DeviceEnergyManagementClusterPowerAdjustCapabilityStruct(powerAdjustCapability, cause) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/DeviceEnergyManagementClusterPowerAdjustCapabilityStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/DeviceEnergyManagementClusterPowerAdjustCapabilityStruct.kt new file mode 100644 index 00000000000000..eda6c168281800 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/DeviceEnergyManagementClusterPowerAdjustCapabilityStruct.kt @@ -0,0 +1,83 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package matter.controller.cluster.structs + +import matter.controller.cluster.* +import matter.tlv.AnonymousTag +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class DeviceEnergyManagementClusterPowerAdjustCapabilityStruct( + val powerAdjustCapability: List?, + val cause: UByte +) { + override fun toString(): String = buildString { + append("DeviceEnergyManagementClusterPowerAdjustCapabilityStruct {\n") + append("\tpowerAdjustCapability : $powerAdjustCapability\n") + append("\tcause : $cause\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + if (powerAdjustCapability != null) { + startArray(ContextSpecificTag(TAG_POWER_ADJUST_CAPABILITY)) + for (item in powerAdjustCapability.iterator()) { + item.toTlv(AnonymousTag, this) + } + endArray() + } else { + putNull(ContextSpecificTag(TAG_POWER_ADJUST_CAPABILITY)) + } + put(ContextSpecificTag(TAG_CAUSE), cause) + endStructure() + } + } + + companion object { + private const val TAG_POWER_ADJUST_CAPABILITY = 0 + private const val TAG_CAUSE = 1 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader + ): DeviceEnergyManagementClusterPowerAdjustCapabilityStruct { + tlvReader.enterStructure(tlvTag) + val powerAdjustCapability = + if (!tlvReader.isNull()) { + buildList { + tlvReader.enterArray(ContextSpecificTag(TAG_POWER_ADJUST_CAPABILITY)) + while (!tlvReader.isEndOfContainer()) { + add(DeviceEnergyManagementClusterPowerAdjustStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_POWER_ADJUST_CAPABILITY)) + null + } + val cause = tlvReader.getUByte(ContextSpecificTag(TAG_CAUSE)) + + tlvReader.exitContainer() + + return DeviceEnergyManagementClusterPowerAdjustCapabilityStruct(powerAdjustCapability, cause) + } + } +} From 2380b986430a0307339f8afd263659c146b1d728 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Mon, 3 Jun 2024 23:47:32 +0100 Subject: [PATCH 12/32] Fix up compilation errors caused by change to forecastID and powerAdjustementCapability list moving one level below. --- .../device-energy-management-server.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp b/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp index da1fd23d151987..afd98011a3448a 100644 --- a/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp +++ b/src/app/clusters/device-energy-management-server/device-energy-management-server.cpp @@ -319,15 +319,16 @@ void Instance::HandlePowerAdjustRequest(HandlerContext & ctx, const Commands::Po } powerAdjustmentCapability = mDelegate.GetPowerAdjustmentCapability(); - if (powerAdjustmentCapability.IsNull()) + if ((powerAdjustmentCapability.IsNull()) || (powerAdjustmentCapability.Value().powerAdjustCapability.IsNull())) { ChipLogError(Zcl, "DEM: powerAdjustmentCapability IsNull"); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::ConstraintError); return; } - /* PowerAdjustmentCapability is a list - so iterate through checking if the command is within one of the offers */ - for (auto pas : powerAdjustmentCapability.Value()) + /* PowerAdjustmentCapability is a list within a powerAdjustmentCapability structure + so iterate through checking if the command is within one of the offers */ + for (auto pas : powerAdjustmentCapability.Value().powerAdjustCapability.Value()) { if ((power >= pas.minPower) && (durationSec >= pas.minDuration) && (power <= pas.maxPower) && (durationSec <= pas.maxDuration)) @@ -530,10 +531,10 @@ void Instance::HandlePauseRequest(HandlerContext & ctx, const Commands::PauseReq return; } - /* We expect that there should be a slotIsPauseable entry (but it is optional) */ - if (!forecast.Value().slots[activeSlotNumber].slotIsPauseable.HasValue()) + /* We expect that there should be a slotIsPausable entry (but it is optional) */ + if (!forecast.Value().slots[activeSlotNumber].slotIsPausable.HasValue()) { - ChipLogError(Zcl, "DEM: activeSlotNumber %d does not include slotIsPauseable.", activeSlotNumber); + ChipLogError(Zcl, "DEM: activeSlotNumber %d does not include slotIsPausable.", activeSlotNumber); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::Failure); return; } @@ -552,7 +553,7 @@ void Instance::HandlePauseRequest(HandlerContext & ctx, const Commands::PauseReq return; } - if (!forecast.Value().slots[activeSlotNumber].slotIsPauseable.Value()) + if (!forecast.Value().slots[activeSlotNumber].slotIsPausable.Value()) { ChipLogError(Zcl, "DEM: activeSlotNumber %d is NOT pauseable.", activeSlotNumber); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Status::ConstraintError); @@ -609,7 +610,7 @@ void Instance::HandleModifyForecastRequest(HandlerContext & ctx, const Commands: Status status; DataModel::Nullable forecast; - uint32_t forecastId = commandData.forecastId; + uint32_t forecastID = commandData.forecastID; DataModel::DecodableList slotAdjustments = commandData.slotAdjustments; AdjustmentCauseEnum adjustmentCause = commandData.cause; @@ -629,7 +630,7 @@ void Instance::HandleModifyForecastRequest(HandlerContext & ctx, const Commands: return; } - status = mDelegate.ModifyForecastRequest(forecastId, slotAdjustments, adjustmentCause); + status = mDelegate.ModifyForecastRequest(forecastID, slotAdjustments, adjustmentCause); ctx.mCommandHandler.AddStatus(ctx.mRequestPath, status); if (status != Status::Success) { From 482a6af504d80705ee26fa3d8d94be174d03c1b4 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Tue, 18 Jun 2024 16:58:55 +0100 Subject: [PATCH 13/32] Added Water Heater Management cluster XML --- .github/workflows/tests.yaml | 1 + scripts/rules.matterlint | 1 + src/app/zap-templates/zcl/data-model/all.xml | 1 + .../chip/water-heater-management-cluster.xml | 81 +++++++++++++++++++ .../zcl/zcl-with-test-extensions.json | 2 + src/app/zap-templates/zcl/zcl.json | 2 + src/app/zap_cluster_list.json | 2 + 7 files changed, 90 insertions(+) create mode 100644 src/app/zap-templates/zcl/data-model/chip/water-heater-management-cluster.xml diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index e2dbd5f707334a..40d394b9489d12 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -189,6 +189,7 @@ jobs: src/app/zap-templates/zcl/data-model/chip/unit-localization-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/wake-on-lan-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/washer-controls-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/water-heater-management-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/wifi-network-diagnostics-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/wifi-network-management-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/window-covering.xml \ diff --git a/scripts/rules.matterlint b/scripts/rules.matterlint index 76e9d8df313d63..7a2b93e8ba19c8 100644 --- a/scripts/rules.matterlint +++ b/scripts/rules.matterlint @@ -97,6 +97,7 @@ load "../src/app/zap-templates/zcl/data-model/chip/unit-localization-cluster.xml load "../src/app/zap-templates/zcl/data-model/chip/user-label-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/wake-on-lan-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/washer-controls-cluster.xml"; +load "../src/app/zap-templates/zcl/data-model/chip/water-heater-management-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/wifi-network-diagnostics-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/wifi-network-management-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/window-covering.xml"; diff --git a/src/app/zap-templates/zcl/data-model/all.xml b/src/app/zap-templates/zcl/data-model/all.xml index e523acb886541d..4b15d43a54bf65 100644 --- a/src/app/zap-templates/zcl/data-model/all.xml +++ b/src/app/zap-templates/zcl/data-model/all.xml @@ -105,6 +105,7 @@ + diff --git a/src/app/zap-templates/zcl/data-model/chip/water-heater-management-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/water-heater-management-cluster.xml new file mode 100644 index 00000000000000..958ac28da523a2 --- /dev/null +++ b/src/app/zap-templates/zcl/data-model/chip/water-heater-management-cluster.xml @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Energy Management + Water Heater Management + 0x0094 + WATER_HEATER_MANAGEMENT_CLUSTER + This cluster is used to allow clients to control the operation of a hot water heating appliance so that it can be used with energy management. + true + true + + HeaterTypes + HeatDemand + TankVolume + EstimatedHeatRequired + TankPercentage + BoostState + + Allows a client to request that the water heater is put into a Boost state. + + + + + + + + + + + Allows a client to cancel an ongoing Boost operation. + + + + + diff --git a/src/app/zap-templates/zcl/zcl-with-test-extensions.json b/src/app/zap-templates/zcl/zcl-with-test-extensions.json index 0c1e2c2b5a715f..11c89aa3f9db99 100644 --- a/src/app/zap-templates/zcl/zcl-with-test-extensions.json +++ b/src/app/zap-templates/zcl/zcl-with-test-extensions.json @@ -126,6 +126,7 @@ "valve-configuration-and-control-cluster.xml", "wake-on-lan-cluster.xml", "washer-controls-cluster.xml", + "water-heater-management-cluster.xml", "wifi-network-diagnostics-cluster.xml", "wifi-network-management-cluster.xml", "window-covering.xml", @@ -637,6 +638,7 @@ "Power Topology": ["FeatureMap"], "Valve Configuration and Control": ["RemainingDuration"], "Boolean State Configuration": ["CurrentSensitivityLevel"], + "Water Heater Management": ["FeatureMap"], "Wi-Fi Network Management": ["SSID"] }, "defaultReportingPolicy": "mandatory", diff --git a/src/app/zap-templates/zcl/zcl.json b/src/app/zap-templates/zcl/zcl.json index 0d99e3f865463c..8e16b26072364b 100644 --- a/src/app/zap-templates/zcl/zcl.json +++ b/src/app/zap-templates/zcl/zcl.json @@ -124,6 +124,7 @@ "valve-configuration-and-control-cluster.xml", "wake-on-lan-cluster.xml", "washer-controls-cluster.xml", + "water-heater-management-cluster.xml", "wifi-network-diagnostics-cluster.xml", "wifi-network-management-cluster.xml", "window-covering.xml", @@ -635,6 +636,7 @@ "Power Topology": ["FeatureMap"], "Valve Configuration and Control": ["RemainingDuration"], "Boolean State Configuration": ["CurrentSensitivityLevel"], + "Water Heater Management": ["FeatureMap"], "Wi-Fi Network Management": ["SSID"] }, "defaultReportingPolicy": "mandatory", diff --git a/src/app/zap_cluster_list.json b/src/app/zap_cluster_list.json index 4c7757224b1a7d..4591255df5cae4 100644 --- a/src/app/zap_cluster_list.json +++ b/src/app/zap_cluster_list.json @@ -129,6 +129,7 @@ "WAKE_ON_LAN_CLUSTER": [], "LAUNDRY_WASHER_CONTROLS_CLUSTER": [], "LAUNDRY_DRYER_CONTROLS_CLUSTER": [], + "WATER_HEATER_MANAGEMENT_CLUSTER": [], "WIFI_NETWORK_DIAGNOSTICS_CLUSTER": [], "WINDOW_COVERING_CLUSTER": [], "ZLL_COMMISSIONING_CLUSTER": [] @@ -311,6 +312,7 @@ "WIFI_NETWORK_DIAGNOSTICS_CLUSTER": ["wifi-network-diagnostics-server"], "WIFI_NETWORK_MANAGEMENT_CLUSTER": ["wifi-network-management-server"], "WINDOW_COVERING_CLUSTER": ["window-covering-server"], + "WATER_HEATER_MANAGEMENT_CLUSTER": [], "ZLL_COMMISSIONING_CLUSTER": [] } } From f53bfeba4259ff701161b2eacac1851715d2d13f Mon Sep 17 00:00:00 2001 From: James Harrow Date: Tue, 18 Jun 2024 17:01:52 +0100 Subject: [PATCH 14/32] Added Water Heater Management to controller-clusters.zap --- .../data_model/controller-clusters.zap | 249 ++++++++++-------- 1 file changed, 138 insertions(+), 111 deletions(-) diff --git a/src/controller/data_model/controller-clusters.zap b/src/controller/data_model/controller-clusters.zap index b47470d022b108..a9759583747532 100644 --- a/src/controller/data_model/controller-clusters.zap +++ b/src/controller/data_model/controller-clusters.zap @@ -1,6 +1,6 @@ { "fileFormat": 2, - "featureLevel": 100, + "featureLevel": 103, "creator": "zap", "keyValuePairs": [ { @@ -29,6 +29,7 @@ "pathRelativity": "relativeToZap", "path": "../../app/zap-templates/app-templates.json", "type": "gen-templates-json", + "category": "matter", "version": "chip-v1" } ], @@ -1180,106 +1181,6 @@ } ] }, - { - "name": "Thread Border Router Management", - "code": 1106, - "mfgCode": null, - "define": "THREAD_BORDER_ROUTER_MANAGEMENT_CLUSTER", - "side": "client", - "enabled": 1, - "commands": [ - { - "name": "GetActiveDatasetRequest", - "code": 0, - "mfgCode": null, - "source": "client", - "isIncoming": 0, - "isEnabled": 1 - }, - { - "name": "GetPendingDatasetRequest", - "code": 1, - "mfgCode": null, - "source": "client", - "isIncoming": 0, - "isEnabled": 1 - }, - { - "name": "DatasetResponse", - "code": 2, - "mfgCode": null, - "source": "server", - "isIncoming": 0, - "isEnabled": 1 - }, - { - "name": "SetActiveDatasetRequest", - "code": 3, - "mfgCode": null, - "source": "client", - "isIncoming": 0, - "isEnabled": 1 - }, - { - "name": "SetPendingDatasetRequest", - "code": 4, - "mfgCode": null, - "source": "client", - "isIncoming": 0, - "isEnabled": 1 - }, - { - "name": "TopologyRequest", - "code": 5, - "mfgCode": null, - "source": "client", - "isIncoming": 0, - "isEnabled": 1 - }, - { - "name": "TopologyResponse", - "code": 6, - "mfgCode": null, - "source": "server", - "isIncoming": 0, - "isEnabled": 1 - } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "2", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, { "name": "Thread Network Diagnostics", "code": 53, @@ -2028,7 +1929,6 @@ "define": "OPERATIONAL_STATE_OVEN_CLUSTER", "side": "client", "enabled": 1, - "apiMaturity": "provisional", "attributes": [ { "name": "FeatureMap", @@ -2071,7 +1971,6 @@ "define": "OVEN_MODE_CLUSTER", "side": "client", "enabled": 1, - "apiMaturity": "provisional", "commands": [ { "name": "ChangeToMode", @@ -2132,7 +2031,6 @@ "define": "LAUNDRY_DRYER_CONTROLS_CLUSTER", "side": "client", "enabled": 1, - "apiMaturity": "provisional", "attributes": [ { "name": "FeatureMap", @@ -2793,7 +2691,6 @@ "define": "MICROWAVE_OVEN_MODE_CLUSTER", "side": "client", "enabled": 1, - "apiMaturity": "provisional", "attributes": [ { "name": "FeatureMap", @@ -2836,7 +2733,6 @@ "define": "MICROWAVE_OVEN_CONTROL_CLUSTER", "side": "client", "enabled": 1, - "apiMaturity": "provisional", "commands": [ { "name": "SetCookingParameters", @@ -3216,7 +3112,6 @@ "define": "ELECTRICAL_POWER_MEASUREMENT_CLUSTER", "side": "client", "enabled": 1, - "apiMaturity": "provisional", "attributes": [ { "name": "FeatureMap", @@ -3259,7 +3154,6 @@ "define": "ELECTRICAL_ENERGY_MEASUREMENT_CLUSTER", "side": "client", "enabled": 1, - "apiMaturity": "provisional", "attributes": [ { "name": "FeatureMap", @@ -3295,6 +3189,66 @@ } ] }, + { + "name": "Water Heater Management", + "code": 148, + "mfgCode": null, + "define": "WATER_HEATER_MANAGEMENT_CLUSTER", + "side": "client", + "enabled": 1, + "commands": [ + { + "name": "Boost", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "CancelBoost", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, { "name": "Device Energy Management", "code": 152, @@ -3345,7 +3299,6 @@ "define": "ENERGY_EVSE_CLUSTER", "side": "client", "enabled": 1, - "apiMaturity": "provisional", "commands": [ { "name": "Disable", @@ -3406,7 +3359,6 @@ "define": "POWER_TOPOLOGY_CLUSTER", "side": "client", "enabled": 1, - "apiMaturity": "provisional", "attributes": [ { "name": "FeatureMap", @@ -3449,7 +3401,6 @@ "define": "ENERGY_EVSE_MODE_CLUSTER", "side": "client", "enabled": 1, - "apiMaturity": "provisional", "commands": [ { "name": "ChangeToMode", @@ -4856,6 +4807,82 @@ } ] }, + { + "name": "Thread Border Router Management", + "code": 1106, + "mfgCode": null, + "define": "THREAD_BORDER_ROUTER_MANAGEMENT", + "side": "client", + "enabled": 1, + "commands": [ + { + "name": "GetActiveDatasetRequest", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "GetPendingDatasetRequest", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "SetActiveDatasetRequest", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "SetPendingDatasetRequest", + "code": 5, + "mfgCode": null, + "source": "client", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, { "name": "Wake on LAN", "code": 1283, From 7e510b14080f9ca195c4a4a67d47c6da581ca1de Mon Sep 17 00:00:00 2001 From: James Harrow Date: Tue, 18 Jun 2024 17:05:23 +0100 Subject: [PATCH 15/32] Added Water Heater Management to zap_cluster_list.json --- src/app/zap_cluster_list.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/zap_cluster_list.json b/src/app/zap_cluster_list.json index 4591255df5cae4..5972895bfbd41a 100644 --- a/src/app/zap_cluster_list.json +++ b/src/app/zap_cluster_list.json @@ -312,7 +312,7 @@ "WIFI_NETWORK_DIAGNOSTICS_CLUSTER": ["wifi-network-diagnostics-server"], "WIFI_NETWORK_MANAGEMENT_CLUSTER": ["wifi-network-management-server"], "WINDOW_COVERING_CLUSTER": ["window-covering-server"], - "WATER_HEATER_MANAGEMENT_CLUSTER": [], + "WATER_HEATER_MANAGEMENT_CLUSTER": ["water-heater-management-server"], "ZLL_COMMISSIONING_CLUSTER": [] } } From 749636eee92d44fbf476eb4cb42f364a83112dd5 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Tue, 18 Jun 2024 17:06:35 +0100 Subject: [PATCH 16/32] Added Water Heater Management cluster to all-clusters-app.zap --- .../all-clusters-common/all-clusters-app.zap | 188 ++++++++++++++++-- 1 file changed, 175 insertions(+), 13 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap index 8660f24af8b504..ceced1409f5834 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap @@ -1,6 +1,6 @@ { "fileFormat": 2, - "featureLevel": 102, + "featureLevel": 103, "creator": "zap", "keyValuePairs": [ { @@ -29,6 +29,7 @@ "pathRelativity": "relativeToZap", "path": "../../../src/app/zap-templates/app-templates.json", "type": "gen-templates-json", + "category": "matter", "version": "chip-v1" } ], @@ -8226,7 +8227,6 @@ "define": "OPERATIONAL_STATE_OVEN_CLUSTER", "side": "server", "enabled": 1, - "apiMaturity": "provisional", "commands": [ { "name": "Pause", @@ -8487,7 +8487,6 @@ "define": "OVEN_MODE_CLUSTER", "side": "server", "enabled": 1, - "apiMaturity": "provisional", "commands": [ { "name": "ChangeToMode", @@ -8644,7 +8643,6 @@ "define": "LAUNDRY_DRYER_CONTROLS_CLUSTER", "side": "server", "enabled": 1, - "apiMaturity": "provisional", "attributes": [ { "name": "SupportedDrynessLevels", @@ -10898,7 +10896,6 @@ "define": "MICROWAVE_OVEN_MODE_CLUSTER", "side": "server", "enabled": 1, - "apiMaturity": "provisional", "attributes": [ { "name": "SupportedModes", @@ -12202,7 +12199,6 @@ "define": "BOOLEAN_STATE_CONFIGURATION_CLUSTER", "side": "server", "enabled": 1, - "apiMaturity": "provisional", "commands": [ { "name": "SuppressAlarm", @@ -12471,7 +12467,6 @@ "define": "VALVE_CONFIGURATION_AND_CONTROL_CLUSTER", "side": "server", "enabled": 1, - "apiMaturity": "provisional", "commands": [ { "name": "Open", @@ -12788,7 +12783,6 @@ "define": "ELECTRICAL_POWER_MEASUREMENT_CLUSTER", "side": "server", "enabled": 1, - "apiMaturity": "provisional", "attributes": [ { "name": "PowerMode", @@ -13208,7 +13202,6 @@ "define": "ELECTRICAL_ENERGY_MEASUREMENT_CLUSTER", "side": "server", "enabled": 1, - "apiMaturity": "provisional", "attributes": [ { "name": "Accuracy", @@ -13420,6 +13413,178 @@ } ] }, + { + "name": "Water Heater Management", + "code": 148, + "mfgCode": null, + "define": "WATER_HEATER_MANAGEMENT_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "Boost", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "CancelBoost", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "HeaterTypes", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "WaterHeaterTypeBitmap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "HeatDemand", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "WaterHeaterDemandBitmap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BoostState", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "BoostStateEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, { "name": "Device Energy Management", "code": 152, @@ -13580,7 +13745,7 @@ "code": 5, "mfgCode": null, "side": "server", - "type": "array", + "type": "PowerAdjustCapabilityStruct", "included": 1, "storageOption": "External", "singleton": 0, @@ -13758,7 +13923,6 @@ "define": "ENERGY_EVSE_CLUSTER", "side": "server", "enabled": 1, - "apiMaturity": "provisional", "commands": [ { "name": "GetTargetsResponse", @@ -14434,7 +14598,6 @@ "define": "POWER_TOPOLOGY_CLUSTER", "side": "server", "enabled": 1, - "apiMaturity": "provisional", "attributes": [ { "name": "AvailableEndpoints", @@ -14573,7 +14736,6 @@ "define": "ENERGY_EVSE_MODE_CLUSTER", "side": "server", "enabled": 1, - "apiMaturity": "provisional", "commands": [ { "name": "ChangeToMode", From 6c7c3085d7da730001d6c75da9b9fd13cf8215ea Mon Sep 17 00:00:00 2001 From: James Harrow Date: Tue, 18 Jun 2024 17:54:16 +0100 Subject: [PATCH 17/32] Tried to add apiMaturity="provisional" to silence deprecation warnings when running zap_regen_all.py. Also used Alchemy --featureXML. --- .../chip/water-heater-management-cluster.xml | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/app/zap-templates/zcl/data-model/chip/water-heater-management-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/water-heater-management-cluster.xml index 958ac28da523a2..0c5a9a1efea2fa 100644 --- a/src/app/zap-templates/zcl/data-model/chip/water-heater-management-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/water-heater-management-cluster.xml @@ -16,13 +16,7 @@ limitations under the License. --> - - - - - - - + @@ -31,7 +25,7 @@ limitations under the License. - + @@ -40,19 +34,27 @@ limitations under the License. - + - + Energy Management Water Heater Management 0x0094 WATER_HEATER_MANAGEMENT_CLUSTER This cluster is used to allow clients to control the operation of a hot water heating appliance so that it can be used with energy management. true + + + + + + + + true HeaterTypes @@ -61,7 +63,7 @@ limitations under the License. EstimatedHeatRequired TankPercentage BoostState - + Allows a client to request that the water heater is put into a Boost state. @@ -72,7 +74,7 @@ limitations under the License. - + Allows a client to cancel an ongoing Boost operation. From f5c4f62e59093f963a1cc43cbf13622532a9b2f5 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Tue, 18 Jun 2024 17:55:34 +0100 Subject: [PATCH 18/32] Added all-clusters-app.matter and controller-clusters.matter after regen_all --- .../all-clusters-app.matter | 73 +++++++++++++++++++ .../data_model/controller-clusters.matter | 58 +++++++++++++++ 2 files changed, 131 insertions(+) diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index b5d847383c760e..79ee652f1d214d 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -4068,6 +4068,64 @@ cluster ElectricalEnergyMeasurement = 145 { readonly attribute int16u clusterRevision = 65533; } +/** This cluster is used to allow clients to control the operation of a hot water heating appliance so that it can be used with energy management. */ +provisional cluster WaterHeaterManagement = 148 { + revision 1; + + enum BoostStateEnum : enum8 { + kInactive = 0; + kActive = 1; + } + + bitmap Feature : bitmap32 { + kEnergyManagement = 0x1; + kTankPercent = 0x2; + } + + bitmap WaterHeaterDemandBitmap : bitmap8 { + kImmersionElement1 = 0x1; + kImmersionElement2 = 0x2; + kHeatPump = 0x4; + kBoiler = 0x8; + kOther = 0x10; + } + + bitmap WaterHeaterTypeBitmap : bitmap8 { + kImmersionElement1 = 0x1; + kImmersionElement2 = 0x2; + kHeatPump = 0x4; + kBoiler = 0x8; + kOther = 0x10; + } + + readonly attribute WaterHeaterTypeBitmap heaterTypes = 0; + readonly attribute WaterHeaterDemandBitmap heatDemand = 1; + readonly attribute optional int16u tankVolume = 2; + readonly attribute optional energy_mwh estimatedHeatRequired = 3; + readonly attribute optional percent tankPercentage = 4; + readonly attribute BoostStateEnum boostState = 5; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct BoostRequest { + elapsed_s duration = 0; + optional boolean oneShot = 1; + optional boolean emergencyBoost = 2; + optional temperature temporarySetpoint = 3; + optional percent targetPercentage = 4; + optional percent targetReheat = 5; + } + + /** Allows a client to request that the water heater is put into a Boost state. */ + command access(invoke: manage) Boost(BoostRequest): DefaultSuccess = 0; + /** Allows a client to cancel an ongoing Boost operation. */ + command access(invoke: manage) CancelBoost(): DefaultSuccess = 1; +} + /** This cluster allows a client to manage the power draw of a device. An example of such a client could be an Energy Management System (EMS) which controls an Energy Smart Appliance (ESA). */ provisional cluster DeviceEnergyManagement = 152 { revision 4; @@ -8339,6 +8397,21 @@ endpoint 1 { ram attribute clusterRevision default = 1; } + server cluster WaterHeaterManagement { + ram attribute heaterTypes default = 0x00; + ram attribute heatDemand default = 0x00; + ram attribute boostState default = 0; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + callback attribute featureMap; + ram attribute clusterRevision default = 1; + + handle command Boost; + handle command CancelBoost; + } + server cluster DeviceEnergyManagement { emits event PowerAdjustStart; emits event PowerAdjustEnd; diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 831f69e0e5dc7a..c856a1c88abd1c 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -4304,6 +4304,64 @@ cluster ElectricalEnergyMeasurement = 145 { readonly attribute int16u clusterRevision = 65533; } +/** This cluster is used to allow clients to control the operation of a hot water heating appliance so that it can be used with energy management. */ +provisional cluster WaterHeaterManagement = 148 { + revision 1; + + enum BoostStateEnum : enum8 { + kInactive = 0; + kActive = 1; + } + + bitmap Feature : bitmap32 { + kEnergyManagement = 0x1; + kTankPercent = 0x2; + } + + bitmap WaterHeaterDemandBitmap : bitmap8 { + kImmersionElement1 = 0x1; + kImmersionElement2 = 0x2; + kHeatPump = 0x4; + kBoiler = 0x8; + kOther = 0x10; + } + + bitmap WaterHeaterTypeBitmap : bitmap8 { + kImmersionElement1 = 0x1; + kImmersionElement2 = 0x2; + kHeatPump = 0x4; + kBoiler = 0x8; + kOther = 0x10; + } + + readonly attribute WaterHeaterTypeBitmap heaterTypes = 0; + readonly attribute WaterHeaterDemandBitmap heatDemand = 1; + readonly attribute optional int16u tankVolume = 2; + readonly attribute optional energy_mwh estimatedHeatRequired = 3; + readonly attribute optional percent tankPercentage = 4; + readonly attribute BoostStateEnum boostState = 5; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct BoostRequest { + elapsed_s duration = 0; + optional boolean oneShot = 1; + optional boolean emergencyBoost = 2; + optional temperature temporarySetpoint = 3; + optional percent targetPercentage = 4; + optional percent targetReheat = 5; + } + + /** Allows a client to request that the water heater is put into a Boost state. */ + command access(invoke: manage) Boost(BoostRequest): DefaultSuccess = 0; + /** Allows a client to cancel an ongoing Boost operation. */ + command access(invoke: manage) CancelBoost(): DefaultSuccess = 1; +} + /** This cluster provides an interface to the functionality of Smart Energy Demand Response and Load Control. */ provisional cluster DemandResponseLoadControl = 150 { revision 4; From 81f70091582d8670f5b6bf27fcaf54db43669d8d Mon Sep 17 00:00:00 2001 From: James Harrow Date: Tue, 18 Jun 2024 17:56:38 +0100 Subject: [PATCH 19/32] Added output from regen_all.py --- docs/zap_clusters.md | 1 + .../app-templates/endpoint_config.h | 89 +- .../chip/devicecontroller/ChipClusters.java | 411 ++++++ .../devicecontroller/ClusterIDMapping.java | 128 ++ .../devicecontroller/ClusterInfoMapping.java | 147 ++ .../devicecontroller/ClusterReadMapping.java | 137 ++ .../devicecontroller/ClusterWriteMapping.java | 2 + .../java/matter/controller/cluster/files.gni | 1 + .../CHIPAttributeTLVValueDecoder.cpp | 238 ++++ .../CHIPEventTLVValueDecoder.cpp | 10 + .../python/chip/clusters/CHIPClusters.py | 100 ++ .../python/chip/clusters/Objects.py | 298 ++++ .../MTRAttributeSpecifiedCheck.mm | 48 + .../MTRAttributeTLVValueDecoder.mm | 81 ++ .../CHIP/zap-generated/MTRBaseClusters.h | 138 ++ .../CHIP/zap-generated/MTRBaseClusters.mm | 489 +++++++ .../CHIP/zap-generated/MTRClusterConstants.h | 19 + .../CHIP/zap-generated/MTRClusterNames.mm | 61 + .../CHIP/zap-generated/MTRClusters.h | 53 + .../CHIP/zap-generated/MTRClusters.mm | 122 ++ .../zap-generated/MTRCommandPayloadsObjc.h | 68 + .../zap-generated/MTRCommandPayloadsObjc.mm | 197 +++ .../MTRCommandPayloads_Internal.h | 12 + .../zap-generated/MTRCommandTimedCheck.mm | 12 + .../zap-generated/MTREventTLVValueDecoder.mm | 15 + .../zap-generated/attributes/Accessors.cpp | 342 +++++ .../zap-generated/attributes/Accessors.h | 61 + .../app-common/zap-generated/callback.h | 55 + .../zap-generated/cluster-enums-check.h | 13 + .../app-common/zap-generated/cluster-enums.h | 42 + .../zap-generated/cluster-objects.cpp | 129 ++ .../zap-generated/cluster-objects.h | 233 +++ .../app-common/zap-generated/ids/Attributes.h | 54 + .../app-common/zap-generated/ids/Clusters.h | 3 + .../app-common/zap-generated/ids/Commands.h | 14 + .../zap-generated/cluster/Commands.h | 183 +++ .../cluster/logging/DataModelLogger.cpp | 66 + .../zap-generated/cluster/Commands.h | 1269 +++++++++++++++++ 38 files changed, 5298 insertions(+), 43 deletions(-) diff --git a/docs/zap_clusters.md b/docs/zap_clusters.md index 9033fff4101de9..7e6df18cd884c5 100644 --- a/docs/zap_clusters.md +++ b/docs/zap_clusters.md @@ -79,6 +79,7 @@ Generally regenerate using one of: | 129 | 0x81 | ValveConfigurationAndControl | | 144 | 0x90 | ElectricalPowerMeasurement | | 145 | 0x91 | ElectricalEnergyMeasurement | +| 148 | 0x94 | WaterHeaterManagement | | 150 | 0x96 | DemandResponseLoadControl | | 151 | 0x97 | Messages | | 152 | 0x98 | DeviceEnergyManagement | diff --git a/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/endpoint_config.h b/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/endpoint_config.h index 8289394bce6d89..69486db49cfb77 100644 --- a/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/endpoint_config.h +++ b/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/endpoint_config.h @@ -261,7 +261,7 @@ #define GENERATED_DEFAULTS_COUNT (30) // This is an array of EmberAfAttributeMinMaxValue structures. -#define GENERATED_MIN_MAX_DEFAULT_COUNT 48 +#define GENERATED_MIN_MAX_DEFAULT_COUNT 49 #define GENERATED_MIN_MAX_DEFAULTS \ { \ \ @@ -289,6 +289,9 @@ /* Endpoint: 1, Cluster: Valve Configuration and Control (server) */ \ { (uint16_t) 0x64, (uint16_t) 0x1, (uint16_t) 0x64 }, /* DefaultOpenLevel */ \ \ + /* Endpoint: 1, Cluster: Energy EVSE (server) */ \ + { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0xFFFE }, /* ApproximateEVEfficiency */ \ + \ /* Endpoint: 1, Cluster: Window Covering (server) */ \ { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0xF }, /* Mode */ \ \ @@ -1235,8 +1238,8 @@ ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* NextChargeRequiredEnergy */ \ { ZAP_EMPTY_DEFAULT(), 0x00000026, 1, ZAP_TYPE(PERCENT), \ ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* NextChargeTargetSoC */ \ - { ZAP_EMPTY_DEFAULT(), 0x00000027, 2, ZAP_TYPE(INT16U), \ - ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE) | \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(8), 0x00000027, 2, ZAP_TYPE(INT16U), \ + ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE) | \ ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* ApproximateEVEfficiency */ \ { ZAP_EMPTY_DEFAULT(), 0x00000040, 4, ZAP_TYPE(INT32U), \ ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* SessionID */ \ @@ -1312,7 +1315,7 @@ ZAP_ATTRIBUTE_MASK(TOKENIZE) }, /* InstalledOpenLimitTilt */ \ { ZAP_SIMPLE_DEFAULT(0xFFFF), 0x00000013, 2, ZAP_TYPE(INT16U), \ ZAP_ATTRIBUTE_MASK(TOKENIZE) }, /* InstalledClosedLimitTilt */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(8), 0x00000017, 1, ZAP_TYPE(BITMAP8), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(9), 0x00000017, 1, ZAP_TYPE(BITMAP8), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(TOKENIZE) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* Mode */ \ { ZAP_SIMPLE_DEFAULT(0x00), 0x0000001A, 2, ZAP_TYPE(BITMAP16), 0 }, /* SafetyStatus */ \ { ZAP_SIMPLE_DEFAULT(0x17), 0x0000FFFC, 4, ZAP_TYPE(BITMAP32), 0 }, /* FeatureMap */ \ @@ -1350,9 +1353,9 @@ { ZAP_EMPTY_DEFAULT(), 0x00000016, 3, ZAP_TYPE(INT24U), ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* Power */ \ { ZAP_SIMPLE_DEFAULT(0x00000000), 0x00000017, 4, ZAP_TYPE(INT32U), \ ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* LifetimeEnergyConsumed */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(9), 0x00000020, 1, ZAP_TYPE(ENUM8), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(10), 0x00000020, 1, ZAP_TYPE(ENUM8), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* OperationMode */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(10), 0x00000021, 1, ZAP_TYPE(ENUM8), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(11), 0x00000021, 1, ZAP_TYPE(ENUM8), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* ControlMode */ \ { ZAP_SIMPLE_DEFAULT(0x1F), 0x0000FFFC, 4, ZAP_TYPE(BITMAP32), 0 }, /* FeatureMap */ \ { ZAP_SIMPLE_DEFAULT(4), 0x0000FFFD, 2, ZAP_TYPE(INT16U), 0 }, /* ClusterRevision */ \ @@ -1363,23 +1366,23 @@ { ZAP_SIMPLE_DEFAULT(0x0BB8), 0x00000004, 2, ZAP_TYPE(TEMPERATURE), 0 }, /* AbsMaxHeatSetpointLimit */ \ { ZAP_SIMPLE_DEFAULT(0x0640), 0x00000005, 2, ZAP_TYPE(TEMPERATURE), 0 }, /* AbsMinCoolSetpointLimit */ \ { ZAP_SIMPLE_DEFAULT(0x0C80), 0x00000006, 2, ZAP_TYPE(TEMPERATURE), 0 }, /* AbsMaxCoolSetpointLimit */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(11), 0x00000011, 2, ZAP_TYPE(INT16S), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(12), 0x00000011, 2, ZAP_TYPE(INT16S), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* OccupiedCoolingSetpoint */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(12), 0x00000012, 2, ZAP_TYPE(INT16S), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(13), 0x00000012, 2, ZAP_TYPE(INT16S), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* OccupiedHeatingSetpoint */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(13), 0x00000015, 2, ZAP_TYPE(INT16S), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(14), 0x00000015, 2, ZAP_TYPE(INT16S), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* MinHeatSetpointLimit */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(14), 0x00000016, 2, ZAP_TYPE(INT16S), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(15), 0x00000016, 2, ZAP_TYPE(INT16S), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* MaxHeatSetpointLimit */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(15), 0x00000017, 2, ZAP_TYPE(INT16S), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(16), 0x00000017, 2, ZAP_TYPE(INT16S), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* MinCoolSetpointLimit */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(16), 0x00000018, 2, ZAP_TYPE(INT16S), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(17), 0x00000018, 2, ZAP_TYPE(INT16S), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* MaxCoolSetpointLimit */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(17), 0x00000019, 1, ZAP_TYPE(INT8S), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(18), 0x00000019, 1, ZAP_TYPE(INT8S), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* MinSetpointDeadBand */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(18), 0x0000001B, 1, ZAP_TYPE(ENUM8), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(19), 0x0000001B, 1, ZAP_TYPE(ENUM8), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* ControlSequenceOfOperation */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(19), 0x0000001C, 1, ZAP_TYPE(ENUM8), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(20), 0x0000001C, 1, ZAP_TYPE(ENUM8), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* SystemMode */ \ { ZAP_EMPTY_DEFAULT(), 0x00000048, 0, ZAP_TYPE(ARRAY), ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) }, /* PresetTypes */ \ { ZAP_EMPTY_DEFAULT(), 0x00000049, 0, ZAP_TYPE(ARRAY), ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) }, /* ScheduleTypes */ \ @@ -1405,14 +1408,14 @@ { ZAP_SIMPLE_DEFAULT(6), 0x0000FFFD, 2, ZAP_TYPE(INT16U), 0 }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Fan Control (server) */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(20), 0x00000000, 1, ZAP_TYPE(ENUM8), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(21), 0x00000000, 1, ZAP_TYPE(ENUM8), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* FanMode */ \ { ZAP_SIMPLE_DEFAULT(0x02), 0x00000001, 1, ZAP_TYPE(ENUM8), 0 }, /* FanModeSequence */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(21), 0x00000002, 1, ZAP_TYPE(PERCENT), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(22), 0x00000002, 1, ZAP_TYPE(PERCENT), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* PercentSetting */ \ { ZAP_SIMPLE_DEFAULT(0x00), 0x00000003, 1, ZAP_TYPE(PERCENT), 0 }, /* PercentCurrent */ \ { ZAP_SIMPLE_DEFAULT(100), 0x00000004, 1, ZAP_TYPE(INT8U), 0 }, /* SpeedMax */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(22), 0x00000005, 1, ZAP_TYPE(INT8U), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(23), 0x00000005, 1, ZAP_TYPE(INT8U), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* SpeedSetting */ \ { ZAP_SIMPLE_DEFAULT(0x00), 0x00000006, 1, ZAP_TYPE(INT8U), 0 }, /* SpeedCurrent */ \ { ZAP_SIMPLE_DEFAULT(0x03), 0x00000007, 1, ZAP_TYPE(BITMAP8), 0 }, /* RockSupport */ \ @@ -1424,11 +1427,11 @@ { ZAP_SIMPLE_DEFAULT(4), 0x0000FFFD, 2, ZAP_TYPE(INT16U), 0 }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Thermostat User Interface Configuration (server) */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(23), 0x00000000, 1, ZAP_TYPE(ENUM8), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(24), 0x00000000, 1, ZAP_TYPE(ENUM8), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* TemperatureDisplayMode */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(24), 0x00000001, 1, ZAP_TYPE(ENUM8), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(25), 0x00000001, 1, ZAP_TYPE(ENUM8), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* KeypadLockout */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(25), 0x00000002, 1, ZAP_TYPE(ENUM8), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(26), 0x00000002, 1, ZAP_TYPE(ENUM8), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* ScheduleProgrammingVisibility */ \ { ZAP_SIMPLE_DEFAULT(0), 0x0000FFFC, 4, ZAP_TYPE(BITMAP32), 0 }, /* FeatureMap */ \ { ZAP_SIMPLE_DEFAULT(2), 0x0000FFFD, 2, ZAP_TYPE(INT16U), 0 }, /* ClusterRevision */ \ @@ -1464,25 +1467,25 @@ { ZAP_EMPTY_DEFAULT(), 0x00000028, 2, ZAP_TYPE(INT16U), 0 }, /* Primary6X */ \ { ZAP_EMPTY_DEFAULT(), 0x00000029, 2, ZAP_TYPE(INT16U), 0 }, /* Primary6Y */ \ { ZAP_EMPTY_DEFAULT(), 0x0000002A, 1, ZAP_TYPE(INT8U), ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* Primary6Intensity */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(26), 0x00000030, 2, ZAP_TYPE(INT16U), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(27), 0x00000030, 2, ZAP_TYPE(INT16U), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* WhitePointX */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(27), 0x00000031, 2, ZAP_TYPE(INT16U), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(28), 0x00000031, 2, ZAP_TYPE(INT16U), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* WhitePointY */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(28), 0x00000032, 2, ZAP_TYPE(INT16U), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(29), 0x00000032, 2, ZAP_TYPE(INT16U), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* ColorPointRX */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(29), 0x00000033, 2, ZAP_TYPE(INT16U), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(30), 0x00000033, 2, ZAP_TYPE(INT16U), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* ColorPointRY */ \ { ZAP_EMPTY_DEFAULT(), 0x00000034, 1, ZAP_TYPE(INT8U), \ ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* ColorPointRIntensity */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(30), 0x00000036, 2, ZAP_TYPE(INT16U), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(31), 0x00000036, 2, ZAP_TYPE(INT16U), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* ColorPointGX */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(31), 0x00000037, 2, ZAP_TYPE(INT16U), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(32), 0x00000037, 2, ZAP_TYPE(INT16U), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* ColorPointGY */ \ { ZAP_EMPTY_DEFAULT(), 0x00000038, 1, ZAP_TYPE(INT8U), \ ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* ColorPointGIntensity */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(32), 0x0000003A, 2, ZAP_TYPE(INT16U), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(33), 0x0000003A, 2, ZAP_TYPE(INT16U), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* ColorPointBX */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(33), 0x0000003B, 2, ZAP_TYPE(INT16U), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(34), 0x0000003B, 2, ZAP_TYPE(INT16U), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* ColorPointBY */ \ { ZAP_EMPTY_DEFAULT(), 0x0000003C, 1, ZAP_TYPE(INT8U), \ ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* ColorPointBIntensity */ \ @@ -1498,7 +1501,7 @@ { ZAP_SIMPLE_DEFAULT(0x0000), 0x0000400B, 2, ZAP_TYPE(INT16U), 0 }, /* ColorTempPhysicalMinMireds */ \ { ZAP_SIMPLE_DEFAULT(0xFEFF), 0x0000400C, 2, ZAP_TYPE(INT16U), 0 }, /* ColorTempPhysicalMaxMireds */ \ { ZAP_EMPTY_DEFAULT(), 0x0000400D, 2, ZAP_TYPE(INT16U), 0 }, /* CoupleColorTempToLevelMinMireds */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(34), 0x00004010, 2, ZAP_TYPE(INT16U), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(35), 0x00004010, 2, ZAP_TYPE(INT16U), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(TOKENIZE) | ZAP_ATTRIBUTE_MASK(WRITABLE) | \ ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* StartUpColorTemperatureMireds */ \ { ZAP_SIMPLE_DEFAULT(0x1F), 0x0000FFFC, 4, ZAP_TYPE(BITMAP32), 0 }, /* FeatureMap */ \ @@ -1508,13 +1511,13 @@ { ZAP_SIMPLE_DEFAULT(0x01), 0x00000000, 1, ZAP_TYPE(INT8U), 0 }, /* PhysicalMinLevel */ \ { ZAP_SIMPLE_DEFAULT(0xFE), 0x00000001, 1, ZAP_TYPE(INT8U), 0 }, /* PhysicalMaxLevel */ \ { ZAP_SIMPLE_DEFAULT(0x00), 0x00000002, 1, ZAP_TYPE(BITMAP8), 0 }, /* BallastStatus */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(35), 0x00000010, 1, ZAP_TYPE(INT8U), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(36), 0x00000010, 1, ZAP_TYPE(INT8U), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* MinLevel */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(36), 0x00000011, 1, ZAP_TYPE(INT8U), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(37), 0x00000011, 1, ZAP_TYPE(INT8U), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* MaxLevel */ \ { ZAP_EMPTY_DEFAULT(), 0x00000014, 1, ZAP_TYPE(INT8U), \ ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* IntrinsicBallastFactor */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(37), 0x00000015, 1, ZAP_TYPE(INT8U), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(38), 0x00000015, 1, ZAP_TYPE(INT8U), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) | \ ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* BallastFactorAdjustment */ \ { ZAP_EMPTY_DEFAULT(), 0x00000020, 1, ZAP_TYPE(INT8U), 0 }, /* LampQuantity */ \ @@ -1524,7 +1527,7 @@ ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* LampRatedHours */ \ { ZAP_SIMPLE_DEFAULT(0x000000), 0x00000033, 3, ZAP_TYPE(INT24U), \ ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* LampBurnHours */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(38), 0x00000034, 1, ZAP_TYPE(BITMAP8), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(39), 0x00000034, 1, ZAP_TYPE(BITMAP8), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* LampAlarmMode */ \ { ZAP_SIMPLE_DEFAULT(0xFFFFFF), 0x00000035, 3, ZAP_TYPE(INT24U), \ ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* LampBurnHoursTripPoint */ \ @@ -1871,13 +1874,13 @@ { ZAP_EMPTY_DEFAULT(), 0x00000024, 1, ZAP_TYPE(ENUM8), ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* enum_attr */ \ { ZAP_EMPTY_DEFAULT(), 0x00000025, 0, ZAP_TYPE(STRUCT), \ ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* struct_attr */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(39), 0x00000026, 1, ZAP_TYPE(INT8U), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(40), 0x00000026, 1, ZAP_TYPE(INT8U), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* range_restricted_int8u */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(40), 0x00000027, 1, ZAP_TYPE(INT8S), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(41), 0x00000027, 1, ZAP_TYPE(INT8S), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* range_restricted_int8s */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(41), 0x00000028, 2, ZAP_TYPE(INT16U), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(42), 0x00000028, 2, ZAP_TYPE(INT16U), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* range_restricted_int16u */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(42), 0x00000029, 2, ZAP_TYPE(INT16S), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(43), 0x00000029, 2, ZAP_TYPE(INT16S), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* range_restricted_int16s */ \ { ZAP_EMPTY_DEFAULT(), 0x0000002A, 0, ZAP_TYPE(ARRAY), \ ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* list_long_octet_string */ \ @@ -1948,16 +1951,16 @@ { ZAP_EMPTY_DEFAULT(), 0x00004025, 0, ZAP_TYPE(STRUCT), \ ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE) | \ ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* nullable_struct */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(43), 0x00004026, 1, ZAP_TYPE(INT8U), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(44), 0x00004026, 1, ZAP_TYPE(INT8U), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) | \ ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* nullable_range_restricted_int8u */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(44), 0x00004027, 1, ZAP_TYPE(INT8S), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(45), 0x00004027, 1, ZAP_TYPE(INT8S), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) | \ ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* nullable_range_restricted_int8s */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(45), 0x00004028, 2, ZAP_TYPE(INT16U), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(46), 0x00004028, 2, ZAP_TYPE(INT16U), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) | \ ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* nullable_range_restricted_int16u */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(46), 0x00004029, 2, ZAP_TYPE(INT16S), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(47), 0x00004029, 2, ZAP_TYPE(INT16S), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) | \ ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* nullable_range_restricted_int16s */ \ { ZAP_EMPTY_DEFAULT(), 0x0000402A, 1, ZAP_TYPE(INT8U), \ @@ -1982,7 +1985,7 @@ { ZAP_SIMPLE_DEFAULT(1), 0x00004000, 1, ZAP_TYPE(BOOLEAN), 0 }, /* GlobalSceneControl */ \ { ZAP_SIMPLE_DEFAULT(0), 0x00004001, 2, ZAP_TYPE(INT16U), ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* OnTime */ \ { ZAP_SIMPLE_DEFAULT(0), 0x00004002, 2, ZAP_TYPE(INT16U), ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* OffWaitTime */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(47), 0x00004003, 1, ZAP_TYPE(ENUM8), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(48), 0x00004003, 1, ZAP_TYPE(ENUM8), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* StartUpOnOff */ \ { ZAP_SIMPLE_DEFAULT(0x0001), 0x0000FFFC, 4, ZAP_TYPE(BITMAP32), 0 }, /* FeatureMap */ \ { ZAP_SIMPLE_DEFAULT(6), 0x0000FFFD, 2, ZAP_TYPE(INT16U), 0 }, /* ClusterRevision */ \ diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java index 40725b1dfba8fe..83819337e0ca8d 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java @@ -30204,6 +30204,417 @@ public void onSuccess(byte[] tlv) { } } + public static class WaterHeaterManagementCluster extends BaseChipCluster { + public static final long CLUSTER_ID = 148L; + + private static final long HEATER_TYPES_ATTRIBUTE_ID = 0L; + private static final long HEAT_DEMAND_ATTRIBUTE_ID = 1L; + private static final long TANK_VOLUME_ATTRIBUTE_ID = 2L; + private static final long ESTIMATED_HEAT_REQUIRED_ATTRIBUTE_ID = 3L; + private static final long TANK_PERCENTAGE_ATTRIBUTE_ID = 4L; + private static final long BOOST_STATE_ATTRIBUTE_ID = 5L; + private static final long GENERATED_COMMAND_LIST_ATTRIBUTE_ID = 65528L; + private static final long ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID = 65529L; + private static final long EVENT_LIST_ATTRIBUTE_ID = 65530L; + private static final long ATTRIBUTE_LIST_ATTRIBUTE_ID = 65531L; + private static final long FEATURE_MAP_ATTRIBUTE_ID = 65532L; + private static final long CLUSTER_REVISION_ATTRIBUTE_ID = 65533L; + + public WaterHeaterManagementCluster(long devicePtr, int endpointId) { + super(devicePtr, endpointId, CLUSTER_ID); + } + + @Override + @Deprecated + public long initWithDevice(long devicePtr, int endpointId) { + return 0L; + } + + public void boost(DefaultClusterCallback callback, Long duration, Optional oneShot, Optional emergencyBoost, Optional temporarySetpoint, Optional targetPercentage, Optional targetReheat) { + boost(callback, duration, oneShot, emergencyBoost, temporarySetpoint, targetPercentage, targetReheat, 0); + } + + public void boost(DefaultClusterCallback callback, Long duration, Optional oneShot, Optional emergencyBoost, Optional temporarySetpoint, Optional targetPercentage, Optional targetReheat, int timedInvokeTimeoutMs) { + final long commandId = 0L; + + ArrayList elements = new ArrayList<>(); + final long durationFieldID = 0L; + BaseTLVType durationtlvValue = new UIntType(duration); + elements.add(new StructElement(durationFieldID, durationtlvValue)); + + final long oneShotFieldID = 1L; + BaseTLVType oneShottlvValue = oneShot.map((nonOptionaloneShot) -> new BooleanType(nonOptionaloneShot)).orElse(new EmptyType()); + elements.add(new StructElement(oneShotFieldID, oneShottlvValue)); + + final long emergencyBoostFieldID = 2L; + BaseTLVType emergencyBoosttlvValue = emergencyBoost.map((nonOptionalemergencyBoost) -> new BooleanType(nonOptionalemergencyBoost)).orElse(new EmptyType()); + elements.add(new StructElement(emergencyBoostFieldID, emergencyBoosttlvValue)); + + final long temporarySetpointFieldID = 3L; + BaseTLVType temporarySetpointtlvValue = temporarySetpoint.map((nonOptionaltemporarySetpoint) -> new IntType(nonOptionaltemporarySetpoint)).orElse(new EmptyType()); + elements.add(new StructElement(temporarySetpointFieldID, temporarySetpointtlvValue)); + + final long targetPercentageFieldID = 4L; + BaseTLVType targetPercentagetlvValue = targetPercentage.map((nonOptionaltargetPercentage) -> new UIntType(nonOptionaltargetPercentage)).orElse(new EmptyType()); + elements.add(new StructElement(targetPercentageFieldID, targetPercentagetlvValue)); + + final long targetReheatFieldID = 5L; + BaseTLVType targetReheattlvValue = targetReheat.map((nonOptionaltargetReheat) -> new UIntType(nonOptionaltargetReheat)).orElse(new EmptyType()); + elements.add(new StructElement(targetReheatFieldID, targetReheattlvValue)); + + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + + public void cancelBoost(DefaultClusterCallback callback) { + cancelBoost(callback, 0); + } + + public void cancelBoost(DefaultClusterCallback callback, int timedInvokeTimeoutMs) { + final long commandId = 1L; + + ArrayList elements = new ArrayList<>(); + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + + public interface GeneratedCommandListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface AcceptedCommandListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface EventListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface AttributeListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public void readHeaterTypesAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, HEATER_TYPES_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, HEATER_TYPES_ATTRIBUTE_ID, true); + } + + public void subscribeHeaterTypesAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, HEATER_TYPES_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, HEATER_TYPES_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readHeatDemandAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, HEAT_DEMAND_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, HEAT_DEMAND_ATTRIBUTE_ID, true); + } + + public void subscribeHeatDemandAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, HEAT_DEMAND_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, HEAT_DEMAND_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readTankVolumeAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, TANK_VOLUME_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, TANK_VOLUME_ATTRIBUTE_ID, true); + } + + public void subscribeTankVolumeAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, TANK_VOLUME_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, TANK_VOLUME_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readEstimatedHeatRequiredAttribute( + LongAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ESTIMATED_HEAT_REQUIRED_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ESTIMATED_HEAT_REQUIRED_ATTRIBUTE_ID, true); + } + + public void subscribeEstimatedHeatRequiredAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ESTIMATED_HEAT_REQUIRED_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ESTIMATED_HEAT_REQUIRED_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readTankPercentageAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, TANK_PERCENTAGE_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, TANK_PERCENTAGE_ATTRIBUTE_ID, true); + } + + public void subscribeTankPercentageAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, TANK_PERCENTAGE_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, TANK_PERCENTAGE_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readBoostStateAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, BOOST_STATE_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, BOOST_STATE_ATTRIBUTE_ID, true); + } + + public void subscribeBoostStateAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, BOOST_STATE_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, BOOST_STATE_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readGeneratedCommandListAttribute( + GeneratedCommandListAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, GENERATED_COMMAND_LIST_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, GENERATED_COMMAND_LIST_ATTRIBUTE_ID, true); + } + + public void subscribeGeneratedCommandListAttribute( + GeneratedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, GENERATED_COMMAND_LIST_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, GENERATED_COMMAND_LIST_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readAcceptedCommandListAttribute( + AcceptedCommandListAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID, true); + } + + public void subscribeAcceptedCommandListAttribute( + AcceptedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readEventListAttribute( + EventListAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, EVENT_LIST_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, EVENT_LIST_ATTRIBUTE_ID, true); + } + + public void subscribeEventListAttribute( + EventListAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, EVENT_LIST_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, EVENT_LIST_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readAttributeListAttribute( + AttributeListAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ATTRIBUTE_LIST_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ATTRIBUTE_LIST_ATTRIBUTE_ID, true); + } + + public void subscribeAttributeListAttribute( + AttributeListAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ATTRIBUTE_LIST_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ATTRIBUTE_LIST_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readFeatureMapAttribute( + LongAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, FEATURE_MAP_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, FEATURE_MAP_ATTRIBUTE_ID, true); + } + + public void subscribeFeatureMapAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, FEATURE_MAP_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, FEATURE_MAP_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readClusterRevisionAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CLUSTER_REVISION_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, CLUSTER_REVISION_ATTRIBUTE_ID, true); + } + + public void subscribeClusterRevisionAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CLUSTER_REVISION_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, CLUSTER_REVISION_ATTRIBUTE_ID, minInterval, maxInterval); + } + } + public static class DemandResponseLoadControlCluster extends BaseChipCluster { public static final long CLUSTER_ID = 150L; diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java index df03516f3e4063..c176affae0025e 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java @@ -229,6 +229,9 @@ public static BaseCluster getCluster(long clusterId) { if (clusterId == ElectricalEnergyMeasurement.ID) { return new ElectricalEnergyMeasurement(); } + if (clusterId == WaterHeaterManagement.ID) { + return new WaterHeaterManagement(); + } if (clusterId == DemandResponseLoadControl.ID) { return new DemandResponseLoadControl(); } @@ -9297,6 +9300,131 @@ public long getCommandID(String name) throws IllegalArgumentException { return Command.valueOf(name).getID(); } } + public static class WaterHeaterManagement implements BaseCluster { + public static final long ID = 148L; + public long getID() { + return ID; + } + + public enum Attribute { + HeaterTypes(0L), + HeatDemand(1L), + TankVolume(2L), + EstimatedHeatRequired(3L), + TankPercentage(4L), + BoostState(5L), + GeneratedCommandList(65528L), + AcceptedCommandList(65529L), + EventList(65530L), + AttributeList(65531L), + FeatureMap(65532L), + ClusterRevision(65533L),; + private final long id; + Attribute(long id) { + this.id = id; + } + + public long getID() { + return id; + } + + public static Attribute value(long id) throws NoSuchFieldError { + for (Attribute attribute : Attribute.values()) { + if (attribute.getID() == id) { + return attribute; + } + } + throw new NoSuchFieldError(); + } + } + + public enum Event {; + private final long id; + Event(long id) { + this.id = id; + } + + public long getID() { + return id; + } + + public static Event value(long id) throws NoSuchFieldError { + for (Event event : Event.values()) { + if (event.getID() == id) { + return event; + } + } + throw new NoSuchFieldError(); + } + } + + public enum Command { + Boost(0L), + CancelBoost(1L),; + private final long id; + Command(long id) { + this.id = id; + } + + public long getID() { + return id; + } + + public static Command value(long id) throws NoSuchFieldError { + for (Command command : Command.values()) { + if (command.getID() == id) { + return command; + } + } + throw new NoSuchFieldError(); + } + }public enum BoostCommandField {Duration(0),OneShot(1),EmergencyBoost(2),TemporarySetpoint(3),TargetPercentage(4),TargetReheat(5),; + private final int id; + BoostCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static BoostCommandField value(int id) throws NoSuchFieldError { + for (BoostCommandField field : BoostCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }@Override + public String getAttributeName(long id) throws NoSuchFieldError { + return Attribute.value(id).toString(); + } + + @Override + public String getEventName(long id) throws NoSuchFieldError { + return Event.value(id).toString(); + } + + @Override + public String getCommandName(long id) throws NoSuchFieldError { + return Command.value(id).toString(); + } + + @Override + public long getAttributeID(String name) throws IllegalArgumentException { + return Attribute.valueOf(name).getID(); + } + + @Override + public long getEventID(String name) throws IllegalArgumentException { + return Event.valueOf(name).getID(); + } + + @Override + public long getCommandID(String name) throws IllegalArgumentException { + return Command.valueOf(name).getID(); + } + } public static class DemandResponseLoadControl implements BaseCluster { public static final long ID = 150L; public long getID() { diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java index 219baca838f58b..4f0e3d40dd0965 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java @@ -10601,6 +10601,90 @@ public void onError(Exception ex) { } } + public static class DelegatedWaterHeaterManagementClusterGeneratedCommandListAttributeCallback implements ChipClusters.WaterHeaterManagementCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedWaterHeaterManagementClusterAcceptedCommandListAttributeCallback implements ChipClusters.WaterHeaterManagementCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedWaterHeaterManagementClusterEventListAttributeCallback implements ChipClusters.WaterHeaterManagementCluster.EventListAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedWaterHeaterManagementClusterAttributeListAttributeCallback implements ChipClusters.WaterHeaterManagementCluster.AttributeListAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + public static class DelegatedDemandResponseLoadControlClusterLoadControlProgramsAttributeCallback implements ChipClusters.DemandResponseLoadControlCluster.LoadControlProgramsAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override @@ -21447,6 +21531,10 @@ public Map initializeClusterMap() { (ptr, endpointId) -> new ChipClusters.ElectricalEnergyMeasurementCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("electricalEnergyMeasurement", electricalEnergyMeasurementClusterInfo); + ClusterInfo waterHeaterManagementClusterInfo = new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.WaterHeaterManagementCluster(ptr, endpointId), new HashMap<>()); + clusterMap.put("waterHeaterManagement", waterHeaterManagementClusterInfo); + ClusterInfo demandResponseLoadControlClusterInfo = new ClusterInfo( (ptr, endpointId) -> new ChipClusters.DemandResponseLoadControlCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("demandResponseLoadControl", demandResponseLoadControlClusterInfo); @@ -21734,6 +21822,7 @@ public void combineCommand(Map destination, Map> getCommandMap() { commandMap.put("electricalEnergyMeasurement", electricalEnergyMeasurementClusterInteractionInfoMap); + Map waterHeaterManagementClusterInteractionInfoMap = new LinkedHashMap<>(); + + Map waterHeaterManagementboostCommandParams = new LinkedHashMap(); + + CommandParameterInfo waterHeaterManagementboostdurationCommandParameterInfo = new CommandParameterInfo("duration", Long.class, Long.class); + waterHeaterManagementboostCommandParams.put("duration",waterHeaterManagementboostdurationCommandParameterInfo); + + CommandParameterInfo waterHeaterManagementboostoneShotCommandParameterInfo = new CommandParameterInfo("oneShot", Optional.class, Boolean.class); + waterHeaterManagementboostCommandParams.put("oneShot",waterHeaterManagementboostoneShotCommandParameterInfo); + + CommandParameterInfo waterHeaterManagementboostemergencyBoostCommandParameterInfo = new CommandParameterInfo("emergencyBoost", Optional.class, Boolean.class); + waterHeaterManagementboostCommandParams.put("emergencyBoost",waterHeaterManagementboostemergencyBoostCommandParameterInfo); + + CommandParameterInfo waterHeaterManagementboosttemporarySetpointCommandParameterInfo = new CommandParameterInfo("temporarySetpoint", Optional.class, Integer.class); + waterHeaterManagementboostCommandParams.put("temporarySetpoint",waterHeaterManagementboosttemporarySetpointCommandParameterInfo); + + CommandParameterInfo waterHeaterManagementboosttargetPercentageCommandParameterInfo = new CommandParameterInfo("targetPercentage", Optional.class, Integer.class); + waterHeaterManagementboostCommandParams.put("targetPercentage",waterHeaterManagementboosttargetPercentageCommandParameterInfo); + + CommandParameterInfo waterHeaterManagementboosttargetReheatCommandParameterInfo = new CommandParameterInfo("targetReheat", Optional.class, Integer.class); + waterHeaterManagementboostCommandParams.put("targetReheat",waterHeaterManagementboosttargetReheatCommandParameterInfo); + InteractionInfo waterHeaterManagementboostInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WaterHeaterManagementCluster) cluster) + .boost((DefaultClusterCallback) callback + , (Long) + commandArguments.get("duration") + , (Optional) + commandArguments.get("oneShot") + , (Optional) + commandArguments.get("emergencyBoost") + , (Optional) + commandArguments.get("temporarySetpoint") + , (Optional) + commandArguments.get("targetPercentage") + , (Optional) + commandArguments.get("targetReheat") + ); + }, + () -> new DelegatedDefaultClusterCallback(), + waterHeaterManagementboostCommandParams + ); + waterHeaterManagementClusterInteractionInfoMap.put("boost", waterHeaterManagementboostInteractionInfo); + + Map waterHeaterManagementcancelBoostCommandParams = new LinkedHashMap(); + InteractionInfo waterHeaterManagementcancelBoostInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WaterHeaterManagementCluster) cluster) + .cancelBoost((DefaultClusterCallback) callback + ); + }, + () -> new DelegatedDefaultClusterCallback(), + waterHeaterManagementcancelBoostCommandParams + ); + waterHeaterManagementClusterInteractionInfoMap.put("cancelBoost", waterHeaterManagementcancelBoostInteractionInfo); + + commandMap.put("waterHeaterManagement", waterHeaterManagementClusterInteractionInfoMap); + Map demandResponseLoadControlClusterInteractionInfoMap = new LinkedHashMap<>(); Map demandResponseLoadControlregisterLoadControlProgramRequestCommandParams = new LinkedHashMap(); diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java index 23261b74f09dbf..af00a920454c9c 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java @@ -9313,6 +9313,142 @@ private static Map readElectricalEnergyMeasurementInter return result; } + private static Map readWaterHeaterManagementInteractionInfo() { + Map result = new LinkedHashMap<>();Map readWaterHeaterManagementHeaterTypesCommandParams = new LinkedHashMap(); + InteractionInfo readWaterHeaterManagementHeaterTypesAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WaterHeaterManagementCluster) cluster).readHeaterTypesAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readWaterHeaterManagementHeaterTypesCommandParams + ); + result.put("readHeaterTypesAttribute", readWaterHeaterManagementHeaterTypesAttributeInteractionInfo); + Map readWaterHeaterManagementHeatDemandCommandParams = new LinkedHashMap(); + InteractionInfo readWaterHeaterManagementHeatDemandAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WaterHeaterManagementCluster) cluster).readHeatDemandAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readWaterHeaterManagementHeatDemandCommandParams + ); + result.put("readHeatDemandAttribute", readWaterHeaterManagementHeatDemandAttributeInteractionInfo); + Map readWaterHeaterManagementTankVolumeCommandParams = new LinkedHashMap(); + InteractionInfo readWaterHeaterManagementTankVolumeAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WaterHeaterManagementCluster) cluster).readTankVolumeAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readWaterHeaterManagementTankVolumeCommandParams + ); + result.put("readTankVolumeAttribute", readWaterHeaterManagementTankVolumeAttributeInteractionInfo); + Map readWaterHeaterManagementEstimatedHeatRequiredCommandParams = new LinkedHashMap(); + InteractionInfo readWaterHeaterManagementEstimatedHeatRequiredAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WaterHeaterManagementCluster) cluster).readEstimatedHeatRequiredAttribute( + (ChipClusters.LongAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readWaterHeaterManagementEstimatedHeatRequiredCommandParams + ); + result.put("readEstimatedHeatRequiredAttribute", readWaterHeaterManagementEstimatedHeatRequiredAttributeInteractionInfo); + Map readWaterHeaterManagementTankPercentageCommandParams = new LinkedHashMap(); + InteractionInfo readWaterHeaterManagementTankPercentageAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WaterHeaterManagementCluster) cluster).readTankPercentageAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readWaterHeaterManagementTankPercentageCommandParams + ); + result.put("readTankPercentageAttribute", readWaterHeaterManagementTankPercentageAttributeInteractionInfo); + Map readWaterHeaterManagementBoostStateCommandParams = new LinkedHashMap(); + InteractionInfo readWaterHeaterManagementBoostStateAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WaterHeaterManagementCluster) cluster).readBoostStateAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readWaterHeaterManagementBoostStateCommandParams + ); + result.put("readBoostStateAttribute", readWaterHeaterManagementBoostStateAttributeInteractionInfo); + Map readWaterHeaterManagementGeneratedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readWaterHeaterManagementGeneratedCommandListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WaterHeaterManagementCluster) cluster).readGeneratedCommandListAttribute( + (ChipClusters.WaterHeaterManagementCluster.GeneratedCommandListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedWaterHeaterManagementClusterGeneratedCommandListAttributeCallback(), + readWaterHeaterManagementGeneratedCommandListCommandParams + ); + result.put("readGeneratedCommandListAttribute", readWaterHeaterManagementGeneratedCommandListAttributeInteractionInfo); + Map readWaterHeaterManagementAcceptedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readWaterHeaterManagementAcceptedCommandListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WaterHeaterManagementCluster) cluster).readAcceptedCommandListAttribute( + (ChipClusters.WaterHeaterManagementCluster.AcceptedCommandListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedWaterHeaterManagementClusterAcceptedCommandListAttributeCallback(), + readWaterHeaterManagementAcceptedCommandListCommandParams + ); + result.put("readAcceptedCommandListAttribute", readWaterHeaterManagementAcceptedCommandListAttributeInteractionInfo); + Map readWaterHeaterManagementEventListCommandParams = new LinkedHashMap(); + InteractionInfo readWaterHeaterManagementEventListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WaterHeaterManagementCluster) cluster).readEventListAttribute( + (ChipClusters.WaterHeaterManagementCluster.EventListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedWaterHeaterManagementClusterEventListAttributeCallback(), + readWaterHeaterManagementEventListCommandParams + ); + result.put("readEventListAttribute", readWaterHeaterManagementEventListAttributeInteractionInfo); + Map readWaterHeaterManagementAttributeListCommandParams = new LinkedHashMap(); + InteractionInfo readWaterHeaterManagementAttributeListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WaterHeaterManagementCluster) cluster).readAttributeListAttribute( + (ChipClusters.WaterHeaterManagementCluster.AttributeListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedWaterHeaterManagementClusterAttributeListAttributeCallback(), + readWaterHeaterManagementAttributeListCommandParams + ); + result.put("readAttributeListAttribute", readWaterHeaterManagementAttributeListAttributeInteractionInfo); + Map readWaterHeaterManagementFeatureMapCommandParams = new LinkedHashMap(); + InteractionInfo readWaterHeaterManagementFeatureMapAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WaterHeaterManagementCluster) cluster).readFeatureMapAttribute( + (ChipClusters.LongAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readWaterHeaterManagementFeatureMapCommandParams + ); + result.put("readFeatureMapAttribute", readWaterHeaterManagementFeatureMapAttributeInteractionInfo); + Map readWaterHeaterManagementClusterRevisionCommandParams = new LinkedHashMap(); + InteractionInfo readWaterHeaterManagementClusterRevisionAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WaterHeaterManagementCluster) cluster).readClusterRevisionAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readWaterHeaterManagementClusterRevisionCommandParams + ); + result.put("readClusterRevisionAttribute", readWaterHeaterManagementClusterRevisionAttributeInteractionInfo); + + return result; + } private static Map readDemandResponseLoadControlInteractionInfo() { Map result = new LinkedHashMap<>();Map readDemandResponseLoadControlLoadControlProgramsCommandParams = new LinkedHashMap(); InteractionInfo readDemandResponseLoadControlLoadControlProgramsAttributeInteractionInfo = new InteractionInfo( @@ -20853,6 +20989,7 @@ public Map> getReadAttributeMap() { put("valveConfigurationAndControl", readValveConfigurationAndControlInteractionInfo()); put("electricalPowerMeasurement", readElectricalPowerMeasurementInteractionInfo()); put("electricalEnergyMeasurement", readElectricalEnergyMeasurementInteractionInfo()); + put("waterHeaterManagement", readWaterHeaterManagementInteractionInfo()); put("demandResponseLoadControl", readDemandResponseLoadControlInteractionInfo()); put("messages", readMessagesInteractionInfo()); put("deviceEnergyManagement", readDeviceEnergyManagementInteractionInfo()); diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java index 948e665b63da72..09f728a2ec85cb 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java @@ -1194,6 +1194,8 @@ public Map> getWriteAttributeMap() { writeAttributeMap.put("electricalPowerMeasurement", writeElectricalPowerMeasurementInteractionInfo); Map writeElectricalEnergyMeasurementInteractionInfo = new LinkedHashMap<>(); writeAttributeMap.put("electricalEnergyMeasurement", writeElectricalEnergyMeasurementInteractionInfo); + Map writeWaterHeaterManagementInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("waterHeaterManagement", writeWaterHeaterManagementInteractionInfo); Map writeDemandResponseLoadControlInteractionInfo = new LinkedHashMap<>(); Map writeDemandResponseLoadControlDefaultRandomStartCommandParams = new LinkedHashMap(); CommandParameterInfo demandResponseLoadControldefaultRandomStartCommandParameterInfo = diff --git a/src/controller/java/generated/java/matter/controller/cluster/files.gni b/src/controller/java/generated/java/matter/controller/cluster/files.gni index ff3afa7d53e5fd..0c1f6599aa7288 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/files.gni +++ b/src/controller/java/generated/java/matter/controller/cluster/files.gni @@ -345,6 +345,7 @@ matter_clusters_sources = [ "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/UserLabelCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/ValveConfigurationAndControlCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/WakeOnLanCluster.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/WaterHeaterManagementCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/WiFiNetworkDiagnosticsCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/WiFiNetworkManagementCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/WindowCoveringCluster.kt", diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index 6f9ee58cafcadb..93b67284a3f117 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -21596,6 +21596,244 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } break; } + case app::Clusters::WaterHeaterManagement::Id: { + using namespace app::Clusters::WaterHeaterManagement; + switch (aPath.mAttributeId) + { + case Attributes::HeaterTypes::Id: { + using TypeInfo = Attributes::HeaterTypes::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + jint jnivalue = static_cast(cppValue.Raw()); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, + value); + return value; + } + case Attributes::HeatDemand::Id: { + using TypeInfo = Attributes::HeatDemand::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + jint jnivalue = static_cast(cppValue.Raw()); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, + value); + return value; + } + case Attributes::TankVolume::Id: { + using TypeInfo = Attributes::TankVolume::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + jint jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, + value); + return value; + } + case Attributes::EstimatedHeatRequired::Id: { + using TypeInfo = Attributes::EstimatedHeatRequired::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + jlong jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::TankPercentage::Id: { + using TypeInfo = Attributes::TankPercentage::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + jint jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, + value); + return value; + } + case Attributes::BoostState::Id: { + using TypeInfo = Attributes::BoostState::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + jint jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, + value); + return value; + } + case Attributes::GeneratedCommandList::Id: { + using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AcceptedCommandList::Id: { + using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::EventList::Id: { + using TypeInfo = Attributes::EventList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AttributeList::Id: { + using TypeInfo = Attributes::AttributeList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::FeatureMap::Id: { + using TypeInfo = Attributes::FeatureMap::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + jlong jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::ClusterRevision::Id: { + using TypeInfo = Attributes::ClusterRevision::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + jint jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, + value); + return value; + } + default: + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + break; + } + break; + } case app::Clusters::DemandResponseLoadControl::Id: { using namespace app::Clusters::DemandResponseLoadControl; switch (aPath.mAttributeId) diff --git a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp index 55338612e969a5..0a57067d38df82 100644 --- a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp @@ -4896,6 +4896,16 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & } break; } + case app::Clusters::WaterHeaterManagement::Id: { + using namespace app::Clusters::WaterHeaterManagement; + switch (aPath.mEventId) + { + default: + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + break; + } + break; + } case app::Clusters::DemandResponseLoadControl::Id: { using namespace app::Clusters::DemandResponseLoadControl; switch (aPath.mEventId) diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index c89a767203ce71..6a457263c32e62 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -6579,6 +6579,104 @@ class ChipClusters: }, }, } + _WATER_HEATER_MANAGEMENT_CLUSTER_INFO = { + "clusterName": "WaterHeaterManagement", + "clusterId": 0x00000094, + "commands": { + 0x00000000: { + "commandId": 0x00000000, + "commandName": "Boost", + "args": { + "duration": "int", + "oneShot": "bool", + "emergencyBoost": "bool", + "temporarySetpoint": "int", + "targetPercentage": "int", + "targetReheat": "int", + }, + }, + 0x00000001: { + "commandId": 0x00000001, + "commandName": "CancelBoost", + "args": { + }, + }, + }, + "attributes": { + 0x00000000: { + "attributeName": "HeaterTypes", + "attributeId": 0x00000000, + "type": "int", + "reportable": True, + }, + 0x00000001: { + "attributeName": "HeatDemand", + "attributeId": 0x00000001, + "type": "int", + "reportable": True, + }, + 0x00000002: { + "attributeName": "TankVolume", + "attributeId": 0x00000002, + "type": "int", + "reportable": True, + }, + 0x00000003: { + "attributeName": "EstimatedHeatRequired", + "attributeId": 0x00000003, + "type": "int", + "reportable": True, + }, + 0x00000004: { + "attributeName": "TankPercentage", + "attributeId": 0x00000004, + "type": "int", + "reportable": True, + }, + 0x00000005: { + "attributeName": "BoostState", + "attributeId": 0x00000005, + "type": "int", + "reportable": True, + }, + 0x0000FFF8: { + "attributeName": "GeneratedCommandList", + "attributeId": 0x0000FFF8, + "type": "int", + "reportable": True, + }, + 0x0000FFF9: { + "attributeName": "AcceptedCommandList", + "attributeId": 0x0000FFF9, + "type": "int", + "reportable": True, + }, + 0x0000FFFA: { + "attributeName": "EventList", + "attributeId": 0x0000FFFA, + "type": "int", + "reportable": True, + }, + 0x0000FFFB: { + "attributeName": "AttributeList", + "attributeId": 0x0000FFFB, + "type": "int", + "reportable": True, + }, + 0x0000FFFC: { + "attributeName": "FeatureMap", + "attributeId": 0x0000FFFC, + "type": "int", + "reportable": True, + }, + 0x0000FFFD: { + "attributeName": "ClusterRevision", + "attributeId": 0x0000FFFD, + "type": "int", + "reportable": True, + }, + }, + } _DEMAND_RESPONSE_LOAD_CONTROL_CLUSTER_INFO = { "clusterName": "DemandResponseLoadControl", "clusterId": 0x00000096, @@ -14846,6 +14944,7 @@ class ChipClusters: 0x00000081: _VALVE_CONFIGURATION_AND_CONTROL_CLUSTER_INFO, 0x00000090: _ELECTRICAL_POWER_MEASUREMENT_CLUSTER_INFO, 0x00000091: _ELECTRICAL_ENERGY_MEASUREMENT_CLUSTER_INFO, + 0x00000094: _WATER_HEATER_MANAGEMENT_CLUSTER_INFO, 0x00000096: _DEMAND_RESPONSE_LOAD_CONTROL_CLUSTER_INFO, 0x00000097: _MESSAGES_CLUSTER_INFO, 0x00000098: _DEVICE_ENERGY_MANAGEMENT_CLUSTER_INFO, @@ -14970,6 +15069,7 @@ class ChipClusters: "ValveConfigurationAndControl": _VALVE_CONFIGURATION_AND_CONTROL_CLUSTER_INFO, "ElectricalPowerMeasurement": _ELECTRICAL_POWER_MEASUREMENT_CLUSTER_INFO, "ElectricalEnergyMeasurement": _ELECTRICAL_ENERGY_MEASUREMENT_CLUSTER_INFO, + "WaterHeaterManagement": _WATER_HEATER_MANAGEMENT_CLUSTER_INFO, "DemandResponseLoadControl": _DEMAND_RESPONSE_LOAD_CONTROL_CLUSTER_INFO, "Messages": _MESSAGES_CLUSTER_INFO, "DeviceEnergyManagement": _DEVICE_ENERGY_MANAGEMENT_CLUSTER_INFO, diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index d38d935f1ed00b..355f8ef0c64e86 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -23177,6 +23177,304 @@ def descriptor(cls) -> ClusterObjectDescriptor: energyExported: 'typing.Optional[ElectricalEnergyMeasurement.Structs.EnergyMeasurementStruct]' = None +@dataclass +class WaterHeaterManagement(Cluster): + id: typing.ClassVar[int] = 0x00000094 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="heaterTypes", Tag=0x00000000, Type=uint), + ClusterObjectFieldDescriptor(Label="heatDemand", Tag=0x00000001, Type=uint), + ClusterObjectFieldDescriptor(Label="tankVolume", Tag=0x00000002, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="estimatedHeatRequired", Tag=0x00000003, Type=typing.Optional[int]), + ClusterObjectFieldDescriptor(Label="tankPercentage", Tag=0x00000004, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="boostState", Tag=0x00000005, Type=WaterHeaterManagement.Enums.BoostStateEnum), + ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="eventList", Tag=0x0000FFFA, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="attributeList", Tag=0x0000FFFB, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="featureMap", Tag=0x0000FFFC, Type=uint), + ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint), + ]) + + heaterTypes: 'uint' = None + heatDemand: 'uint' = None + tankVolume: 'typing.Optional[uint]' = None + estimatedHeatRequired: 'typing.Optional[int]' = None + tankPercentage: 'typing.Optional[uint]' = None + boostState: 'WaterHeaterManagement.Enums.BoostStateEnum' = None + generatedCommandList: 'typing.List[uint]' = None + acceptedCommandList: 'typing.List[uint]' = None + eventList: 'typing.List[uint]' = None + attributeList: 'typing.List[uint]' = None + featureMap: 'uint' = None + clusterRevision: 'uint' = None + + class Enums: + class BoostStateEnum(MatterIntEnum): + kInactive = 0x00 + kActive = 0x01 + # All received enum values that are not listed above will be mapped + # to kUnknownEnumValue. This is a helper enum value that should only + # be used by code to process how it handles receiving and unknown + # enum value. This specific should never be transmitted. + kUnknownEnumValue = 2, + + class Bitmaps: + class Feature(IntFlag): + kEnergyManagement = 0x1 + kTankPercent = 0x2 + + class WaterHeaterDemandBitmap(IntFlag): + kImmersionElement1 = 0x1 + kImmersionElement2 = 0x2 + kHeatPump = 0x4 + kBoiler = 0x8 + kOther = 0x10 + + class WaterHeaterTypeBitmap(IntFlag): + kImmersionElement1 = 0x1 + kImmersionElement2 = 0x2 + kHeatPump = 0x4 + kBoiler = 0x8 + kOther = 0x10 + + class Commands: + @dataclass + class Boost(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000094 + command_id: typing.ClassVar[int] = 0x00000000 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="duration", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="oneShot", Tag=1, Type=typing.Optional[bool]), + ClusterObjectFieldDescriptor(Label="emergencyBoost", Tag=2, Type=typing.Optional[bool]), + ClusterObjectFieldDescriptor(Label="temporarySetpoint", Tag=3, Type=typing.Optional[int]), + ClusterObjectFieldDescriptor(Label="targetPercentage", Tag=4, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="targetReheat", Tag=5, Type=typing.Optional[uint]), + ]) + + duration: 'uint' = 0 + oneShot: 'typing.Optional[bool]' = None + emergencyBoost: 'typing.Optional[bool]' = None + temporarySetpoint: 'typing.Optional[int]' = None + targetPercentage: 'typing.Optional[uint]' = None + targetReheat: 'typing.Optional[uint]' = None + + @dataclass + class CancelBoost(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000094 + command_id: typing.ClassVar[int] = 0x00000001 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ]) + + class Attributes: + @dataclass + class HeaterTypes(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000094 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000000 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: 'uint' = 0 + + @dataclass + class HeatDemand(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000094 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000001 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: 'uint' = 0 + + @dataclass + class TankVolume(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000094 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000002 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + + value: 'typing.Optional[uint]' = None + + @dataclass + class EstimatedHeatRequired(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000094 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000003 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) + + value: 'typing.Optional[int]' = None + + @dataclass + class TankPercentage(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000094 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000004 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + + value: 'typing.Optional[uint]' = None + + @dataclass + class BoostState(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000094 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000005 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=WaterHeaterManagement.Enums.BoostStateEnum) + + value: 'WaterHeaterManagement.Enums.BoostStateEnum' = 0 + + @dataclass + class GeneratedCommandList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000094 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFF8 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class AcceptedCommandList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000094 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFF9 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class EventList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000094 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFA + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class AttributeList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000094 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFB + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class FeatureMap(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000094 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFC + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: 'uint' = 0 + + @dataclass + class ClusterRevision(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000094 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFD + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: 'uint' = 0 + + @dataclass class DemandResponseLoadControl(Cluster): id: typing.ClassVar[int] = 0x00000096 diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm index 603647682805f6..84519d6af6da33 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm @@ -3053,6 +3053,51 @@ static BOOL AttributeIsSpecifiedInElectricalEnergyMeasurementCluster(AttributeId } } } +static BOOL AttributeIsSpecifiedInWaterHeaterManagementCluster(AttributeId aAttributeId) +{ + using namespace Clusters::WaterHeaterManagement; + switch (aAttributeId) { + case Attributes::HeaterTypes::Id: { + return YES; + } + case Attributes::HeatDemand::Id: { + return YES; + } + case Attributes::TankVolume::Id: { + return YES; + } + case Attributes::EstimatedHeatRequired::Id: { + return YES; + } + case Attributes::TankPercentage::Id: { + return YES; + } + case Attributes::BoostState::Id: { + return YES; + } + case Attributes::GeneratedCommandList::Id: { + return YES; + } + case Attributes::AcceptedCommandList::Id: { + return YES; + } + case Attributes::EventList::Id: { + return YES; + } + case Attributes::AttributeList::Id: { + return YES; + } + case Attributes::FeatureMap::Id: { + return YES; + } + case Attributes::ClusterRevision::Id: { + return YES; + } + default: { + return NO; + } + } +} static BOOL AttributeIsSpecifiedInDemandResponseLoadControlCluster(AttributeId aAttributeId) { using namespace Clusters::DemandResponseLoadControl; @@ -6813,6 +6858,9 @@ BOOL MTRAttributeIsSpecified(ClusterId aClusterId, AttributeId aAttributeId) case Clusters::ElectricalEnergyMeasurement::Id: { return AttributeIsSpecifiedInElectricalEnergyMeasurementCluster(aAttributeId); } + case Clusters::WaterHeaterManagement::Id: { + return AttributeIsSpecifiedInWaterHeaterManagementCluster(aAttributeId); + } case Clusters::DemandResponseLoadControl::Id: { return AttributeIsSpecifiedInDemandResponseLoadControlCluster(aAttributeId); } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm index fdc2820cc0d584..e7fa2ab164b882 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -8349,6 +8349,84 @@ static id _Nullable DecodeAttributeValueForElectricalEnergyMeasurementCluster(At *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } +static id _Nullable DecodeAttributeValueForWaterHeaterManagementCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::WaterHeaterManagement; + switch (aAttributeId) { + case Attributes::HeaterTypes::Id: { + using TypeInfo = Attributes::HeaterTypes::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; + return value; + } + case Attributes::HeatDemand::Id: { + using TypeInfo = Attributes::HeatDemand::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; + return value; + } + case Attributes::TankVolume::Id: { + using TypeInfo = Attributes::TankVolume::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; + return value; + } + case Attributes::EstimatedHeatRequired::Id: { + using TypeInfo = Attributes::EstimatedHeatRequired::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithLongLong:cppValue]; + return value; + } + case Attributes::TankPercentage::Id: { + using TypeInfo = Attributes::TankPercentage::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; + return value; + } + case Attributes::BoostState::Id: { + using TypeInfo = Attributes::BoostState::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + return value; + } + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} static id _Nullable DecodeAttributeValueForDemandResponseLoadControlCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { using namespace Clusters::DemandResponseLoadControl; @@ -19675,6 +19753,9 @@ id _Nullable MTRDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::T case Clusters::ElectricalEnergyMeasurement::Id: { return DecodeAttributeValueForElectricalEnergyMeasurementCluster(aPath.mAttributeId, aReader, aError); } + case Clusters::WaterHeaterManagement::Id: { + return DecodeAttributeValueForWaterHeaterManagementCluster(aPath.mAttributeId, aReader, aError); + } case Clusters::DemandResponseLoadControl::Id: { return DecodeAttributeValueForDemandResponseLoadControlCluster(aPath.mAttributeId, aReader, aError); } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index 1edc13fcb88685..1c0478c31b41a0 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -7502,6 +7502,118 @@ MTR_AVAILABLE(ios(17.6), macos(14.6), watchos(10.6), tvos(17.6)) @end +/** + * Cluster Water Heater Management + * + * This cluster is used to allow clients to control the operation of a hot water heating appliance so that it can be used with energy management. + */ +MTR_PROVISIONALLY_AVAILABLE +@interface MTRBaseClusterWaterHeaterManagement : MTRGenericBaseCluster + +/** + * Command Boost + * + * Allows a client to request that the water heater is put into a Boost state. + */ +- (void)boostWithParams:(MTRWaterHeaterManagementClusterBoostParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +/** + * Command CancelBoost + * + * Allows a client to cancel an ongoing Boost operation. + */ +- (void)cancelBoostWithParams:(MTRWaterHeaterManagementClusterCancelBoostParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)cancelBoostWithCompletion:(MTRStatusCompletion)completion + MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeHeaterTypesWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeHeaterTypesWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeHeaterTypesWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeHeatDemandWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeHeatDemandWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeHeatDemandWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeTankVolumeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeTankVolumeWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeTankVolumeWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeEstimatedHeatRequiredWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeEstimatedHeatRequiredWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeEstimatedHeatRequiredWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeTankPercentageWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeTankPercentageWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeTankPercentageWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeBoostStateWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeBoostStateWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeBoostStateWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeAcceptedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeAcceptedCommandListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeEventListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeEventListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeEventListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeAttributeListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeFeatureMapWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeClusterRevisionWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +@interface MTRBaseClusterWaterHeaterManagement (Availability) + +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ +- (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device + endpointID:(NSNumber *)endpointID + queue:(dispatch_queue_t)queue MTR_PROVISIONALLY_AVAILABLE; + +@end + /** * Cluster Demand Response Load Control * @@ -18092,6 +18204,32 @@ typedef NS_OPTIONS(uint32_t, MTRElectricalEnergyMeasurementFeature) { MTRElectricalEnergyMeasurementFeaturePeriodicEnergy MTR_AVAILABLE(ios(17.6), macos(14.6), watchos(10.6), tvos(17.6)) = 0x8, } MTR_AVAILABLE(ios(17.6), macos(14.6), watchos(10.6), tvos(17.6)); +typedef NS_ENUM(uint8_t, MTRWaterHeaterManagementBoostState) { + MTRWaterHeaterManagementBoostStateInactive MTR_PROVISIONALLY_AVAILABLE = 0x00, + MTRWaterHeaterManagementBoostStateActive MTR_PROVISIONALLY_AVAILABLE = 0x01, +} MTR_PROVISIONALLY_AVAILABLE; + +typedef NS_OPTIONS(uint32_t, MTRWaterHeaterManagementFeature) { + MTRWaterHeaterManagementFeatureEnergyManagement MTR_PROVISIONALLY_AVAILABLE = 0x1, + MTRWaterHeaterManagementFeatureTankPercent MTR_PROVISIONALLY_AVAILABLE = 0x2, +} MTR_PROVISIONALLY_AVAILABLE; + +typedef NS_OPTIONS(uint8_t, MTRWaterHeaterManagementWaterHeaterDemandBitmap) { + MTRWaterHeaterManagementWaterHeaterDemandBitmapImmersionElement1 MTR_PROVISIONALLY_AVAILABLE = 0x1, + MTRWaterHeaterManagementWaterHeaterDemandBitmapImmersionElement2 MTR_PROVISIONALLY_AVAILABLE = 0x2, + MTRWaterHeaterManagementWaterHeaterDemandBitmapHeatPump MTR_PROVISIONALLY_AVAILABLE = 0x4, + MTRWaterHeaterManagementWaterHeaterDemandBitmapBoiler MTR_PROVISIONALLY_AVAILABLE = 0x8, + MTRWaterHeaterManagementWaterHeaterDemandBitmapOther MTR_PROVISIONALLY_AVAILABLE = 0x10, +} MTR_PROVISIONALLY_AVAILABLE; + +typedef NS_OPTIONS(uint8_t, MTRWaterHeaterManagementWaterHeaterTypeBitmap) { + MTRWaterHeaterManagementWaterHeaterTypeBitmapImmersionElement1 MTR_PROVISIONALLY_AVAILABLE = 0x1, + MTRWaterHeaterManagementWaterHeaterTypeBitmapImmersionElement2 MTR_PROVISIONALLY_AVAILABLE = 0x2, + MTRWaterHeaterManagementWaterHeaterTypeBitmapHeatPump MTR_PROVISIONALLY_AVAILABLE = 0x4, + MTRWaterHeaterManagementWaterHeaterTypeBitmapBoiler MTR_PROVISIONALLY_AVAILABLE = 0x8, + MTRWaterHeaterManagementWaterHeaterTypeBitmapOther MTR_PROVISIONALLY_AVAILABLE = 0x10, +} MTR_PROVISIONALLY_AVAILABLE; + typedef NS_ENUM(uint8_t, MTRDemandResponseLoadControlCriticalityLevel) { MTRDemandResponseLoadControlCriticalityLevelUnknown MTR_PROVISIONALLY_AVAILABLE = 0x00, MTRDemandResponseLoadControlCriticalityLevelGreen MTR_PROVISIONALLY_AVAILABLE = 0x01, diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index f5ad47a7917dd0..59fe98bea0d0b2 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -51085,6 +51085,495 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC @end +@implementation MTRBaseClusterWaterHeaterManagement + +- (void)boostWithParams:(MTRWaterHeaterManagementClusterBoostParams *)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRWaterHeaterManagementClusterBoostParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = WaterHeaterManagement::Commands::Boost::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} +- (void)cancelBoostWithCompletion:(MTRStatusCompletion)completion +{ + [self cancelBoostWithParams:nil completion:completion]; +} +- (void)cancelBoostWithParams:(MTRWaterHeaterManagementClusterCancelBoostParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRWaterHeaterManagementClusterCancelBoostParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = WaterHeaterManagement::Commands::CancelBoost::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} + +- (void)readAttributeHeaterTypesWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WaterHeaterManagement::Attributes::HeaterTypes::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeHeaterTypesWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = WaterHeaterManagement::Attributes::HeaterTypes::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeHeaterTypesWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WaterHeaterManagement::Attributes::HeaterTypes::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeHeatDemandWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WaterHeaterManagement::Attributes::HeatDemand::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeHeatDemandWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = WaterHeaterManagement::Attributes::HeatDemand::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeHeatDemandWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WaterHeaterManagement::Attributes::HeatDemand::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeTankVolumeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WaterHeaterManagement::Attributes::TankVolume::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeTankVolumeWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = WaterHeaterManagement::Attributes::TankVolume::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeTankVolumeWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WaterHeaterManagement::Attributes::TankVolume::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeEstimatedHeatRequiredWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WaterHeaterManagement::Attributes::EstimatedHeatRequired::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeEstimatedHeatRequiredWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = WaterHeaterManagement::Attributes::EstimatedHeatRequired::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeEstimatedHeatRequiredWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WaterHeaterManagement::Attributes::EstimatedHeatRequired::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeTankPercentageWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WaterHeaterManagement::Attributes::TankPercentage::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeTankPercentageWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = WaterHeaterManagement::Attributes::TankPercentage::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeTankPercentageWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WaterHeaterManagement::Attributes::TankPercentage::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeBoostStateWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WaterHeaterManagement::Attributes::BoostState::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeBoostStateWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = WaterHeaterManagement::Attributes::BoostState::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeBoostStateWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WaterHeaterManagement::Attributes::BoostState::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WaterHeaterManagement::Attributes::GeneratedCommandList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = WaterHeaterManagement::Attributes::GeneratedCommandList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WaterHeaterManagement::Attributes::GeneratedCommandList::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeAcceptedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WaterHeaterManagement::Attributes::AcceptedCommandList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeAcceptedCommandListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = WaterHeaterManagement::Attributes::AcceptedCommandList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WaterHeaterManagement::Attributes::AcceptedCommandList::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeEventListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WaterHeaterManagement::Attributes::EventList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeEventListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = WaterHeaterManagement::Attributes::EventList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeEventListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WaterHeaterManagement::Attributes::EventList::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WaterHeaterManagement::Attributes::AttributeList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeAttributeListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = WaterHeaterManagement::Attributes::AttributeList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WaterHeaterManagement::Attributes::AttributeList::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WaterHeaterManagement::Attributes::FeatureMap::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeFeatureMapWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = WaterHeaterManagement::Attributes::FeatureMap::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WaterHeaterManagement::Attributes::FeatureMap::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WaterHeaterManagement::Attributes::ClusterRevision::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeClusterRevisionWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = WaterHeaterManagement::Attributes::ClusterRevision::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WaterHeaterManagement::Attributes::ClusterRevision::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +@end + @implementation MTRBaseClusterDemandResponseLoadControl - (void)registerLoadControlProgramRequestWithParams:(MTRDemandResponseLoadControlClusterRegisterLoadControlProgramRequestParams *)params completion:(MTRStatusCompletion)completion diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h index da9c24e4c35beb..7ad0a907bcd3cf 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h @@ -151,6 +151,7 @@ typedef NS_ENUM(uint32_t, MTRClusterIDType) { MTRClusterIDTypeValveConfigurationAndControlID MTR_AVAILABLE(ios(17.6), macos(14.6), watchos(10.6), tvos(17.6)) = 0x00000081, MTRClusterIDTypeElectricalPowerMeasurementID MTR_AVAILABLE(ios(17.6), macos(14.6), watchos(10.6), tvos(17.6)) = 0x00000090, MTRClusterIDTypeElectricalEnergyMeasurementID MTR_AVAILABLE(ios(17.6), macos(14.6), watchos(10.6), tvos(17.6)) = 0x00000091, + MTRClusterIDTypeWaterHeaterManagementID MTR_PROVISIONALLY_AVAILABLE = 0x00000094, MTRClusterIDTypeDemandResponseLoadControlID MTR_PROVISIONALLY_AVAILABLE = 0x00000096, MTRClusterIDTypeMessagesID MTR_PROVISIONALLY_AVAILABLE = 0x00000097, MTRClusterIDTypeDeviceEnergyManagementID MTR_PROVISIONALLY_AVAILABLE = 0x00000098, @@ -2623,6 +2624,20 @@ typedef NS_ENUM(uint32_t, MTRAttributeIDType) { MTRAttributeIDTypeClusterElectricalEnergyMeasurementAttributeFeatureMapID MTR_AVAILABLE(ios(17.6), macos(14.6), watchos(10.6), tvos(17.6)) = MTRAttributeIDTypeGlobalAttributeFeatureMapID, MTRAttributeIDTypeClusterElectricalEnergyMeasurementAttributeClusterRevisionID MTR_AVAILABLE(ios(17.6), macos(14.6), watchos(10.6), tvos(17.6)) = MTRAttributeIDTypeGlobalAttributeClusterRevisionID, + // Cluster WaterHeaterManagement attributes + MTRAttributeIDTypeClusterWaterHeaterManagementAttributeHeaterTypesID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, + MTRAttributeIDTypeClusterWaterHeaterManagementAttributeHeatDemandID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, + MTRAttributeIDTypeClusterWaterHeaterManagementAttributeTankVolumeID MTR_PROVISIONALLY_AVAILABLE = 0x00000002, + MTRAttributeIDTypeClusterWaterHeaterManagementAttributeEstimatedHeatRequiredID MTR_PROVISIONALLY_AVAILABLE = 0x00000003, + MTRAttributeIDTypeClusterWaterHeaterManagementAttributeTankPercentageID MTR_PROVISIONALLY_AVAILABLE = 0x00000004, + MTRAttributeIDTypeClusterWaterHeaterManagementAttributeBoostStateID MTR_PROVISIONALLY_AVAILABLE = 0x00000005, + MTRAttributeIDTypeClusterWaterHeaterManagementAttributeGeneratedCommandListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeGeneratedCommandListID, + MTRAttributeIDTypeClusterWaterHeaterManagementAttributeAcceptedCommandListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeAcceptedCommandListID, + MTRAttributeIDTypeClusterWaterHeaterManagementAttributeEventListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeEventListID, + MTRAttributeIDTypeClusterWaterHeaterManagementAttributeAttributeListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeAttributeListID, + MTRAttributeIDTypeClusterWaterHeaterManagementAttributeFeatureMapID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeFeatureMapID, + MTRAttributeIDTypeClusterWaterHeaterManagementAttributeClusterRevisionID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeClusterRevisionID, + // Cluster DemandResponseLoadControl attributes MTRAttributeIDTypeClusterDemandResponseLoadControlAttributeLoadControlProgramsID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, MTRAttributeIDTypeClusterDemandResponseLoadControlAttributeNumberOfLoadControlProgramsID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, @@ -6309,6 +6324,10 @@ typedef NS_ENUM(uint32_t, MTRCommandIDType) { MTRCommandIDTypeClusterValveConfigurationAndControlCommandOpenID MTR_AVAILABLE(ios(17.6), macos(14.6), watchos(10.6), tvos(17.6)) = 0x00000000, MTRCommandIDTypeClusterValveConfigurationAndControlCommandCloseID MTR_AVAILABLE(ios(17.6), macos(14.6), watchos(10.6), tvos(17.6)) = 0x00000001, + // Cluster WaterHeaterManagement commands + MTRCommandIDTypeClusterWaterHeaterManagementCommandBoostID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, + MTRCommandIDTypeClusterWaterHeaterManagementCommandCancelBoostID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, + // Cluster DemandResponseLoadControl commands MTRCommandIDTypeClusterDemandResponseLoadControlCommandRegisterLoadControlProgramRequestID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, MTRCommandIDTypeClusterDemandResponseLoadControlCommandUnregisterLoadControlProgramRequestID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm index 5ca3b9058c217a..008f375281c646 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm @@ -219,6 +219,9 @@ case MTRClusterIDTypeElectricalEnergyMeasurementID: result = @"ElectricalEnergyMeasurement"; break; + case MTRClusterIDTypeWaterHeaterManagementID: + result = @"WaterHeaterManagement"; + break; case MTRClusterIDTypeDemandResponseLoadControlID: result = @"DemandResponseLoadControl"; break; @@ -4307,6 +4310,64 @@ break; } + case MTRClusterIDTypeWaterHeaterManagementID: + + switch (attributeID) { + + // Cluster WaterHeaterManagement attributes + case MTRAttributeIDTypeClusterWaterHeaterManagementAttributeHeaterTypesID: + result = @"HeaterTypes"; + break; + + case MTRAttributeIDTypeClusterWaterHeaterManagementAttributeHeatDemandID: + result = @"HeatDemand"; + break; + + case MTRAttributeIDTypeClusterWaterHeaterManagementAttributeTankVolumeID: + result = @"TankVolume"; + break; + + case MTRAttributeIDTypeClusterWaterHeaterManagementAttributeEstimatedHeatRequiredID: + result = @"EstimatedHeatRequired"; + break; + + case MTRAttributeIDTypeClusterWaterHeaterManagementAttributeTankPercentageID: + result = @"TankPercentage"; + break; + + case MTRAttributeIDTypeClusterWaterHeaterManagementAttributeBoostStateID: + result = @"BoostState"; + break; + + case MTRAttributeIDTypeClusterWaterHeaterManagementAttributeGeneratedCommandListID: + result = @"GeneratedCommandList"; + break; + + case MTRAttributeIDTypeClusterWaterHeaterManagementAttributeAcceptedCommandListID: + result = @"AcceptedCommandList"; + break; + + case MTRAttributeIDTypeClusterWaterHeaterManagementAttributeEventListID: + result = @"EventList"; + break; + + case MTRAttributeIDTypeClusterWaterHeaterManagementAttributeAttributeListID: + result = @"AttributeList"; + break; + + case MTRAttributeIDTypeClusterWaterHeaterManagementAttributeFeatureMapID: + result = @"FeatureMap"; + break; + + case MTRAttributeIDTypeClusterWaterHeaterManagementAttributeClusterRevisionID: + result = @"ClusterRevision"; + break; + + default: + result = [NSString stringWithFormat:@"", attributeID]; + break; + } + case MTRClusterIDTypeDemandResponseLoadControlID: switch (attributeID) { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h index e2a0873cee6392..80d4ce9dfe1f53 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h @@ -3550,6 +3550,59 @@ MTR_AVAILABLE(ios(17.6), macos(14.6), watchos(10.6), tvos(17.6)) @end +/** + * Cluster Water Heater Management + * This cluster is used to allow clients to control the operation of a hot water heating appliance so that it can be used with energy management. + */ +MTR_PROVISIONALLY_AVAILABLE +@interface MTRClusterWaterHeaterManagement : MTRGenericCluster + +- (void)boostWithParams:(MTRWaterHeaterManagementClusterBoostParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)cancelBoostWithParams:(MTRWaterHeaterManagementClusterCancelBoostParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)cancelBoostWithExpectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion + MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeHeaterTypesWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeHeatDemandWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeTankVolumeWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeEstimatedHeatRequiredWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeTankPercentageWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeBoostStateWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeEventListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +@interface MTRClusterWaterHeaterManagement (Availability) + +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ +- (instancetype _Nullable)initWithDevice:(MTRDevice *)device + endpointID:(NSNumber *)endpointID + queue:(dispatch_queue_t)queue MTR_PROVISIONALLY_AVAILABLE; + +@end + /** * Cluster Demand Response Load Control * This cluster provides an interface to the functionality of Smart Energy Demand Response and Load Control. diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm index 953df0cde7fa90..f989be31ce46e8 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm @@ -9285,6 +9285,128 @@ @implementation MTRClusterElectricalEnergyMeasurement @end +@implementation MTRClusterWaterHeaterManagement + +- (void)boostWithParams:(MTRWaterHeaterManagementClusterBoostParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRWaterHeaterManagementClusterBoostParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = WaterHeaterManagement::Commands::Boost::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} + +- (void)cancelBoostWithExpectedValues:(NSArray *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + [self cancelBoostWithParams:nil expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs completion:completion]; +} +- (void)cancelBoostWithParams:(MTRWaterHeaterManagementClusterCancelBoostParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRWaterHeaterManagementClusterCancelBoostParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = WaterHeaterManagement::Commands::CancelBoost::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} + +- (NSDictionary * _Nullable)readAttributeHeaterTypesWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeWaterHeaterManagementID) attributeID:@(MTRAttributeIDTypeClusterWaterHeaterManagementAttributeHeaterTypesID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeHeatDemandWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeWaterHeaterManagementID) attributeID:@(MTRAttributeIDTypeClusterWaterHeaterManagementAttributeHeatDemandID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeTankVolumeWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeWaterHeaterManagementID) attributeID:@(MTRAttributeIDTypeClusterWaterHeaterManagementAttributeTankVolumeID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeEstimatedHeatRequiredWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeWaterHeaterManagementID) attributeID:@(MTRAttributeIDTypeClusterWaterHeaterManagementAttributeEstimatedHeatRequiredID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeTankPercentageWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeWaterHeaterManagementID) attributeID:@(MTRAttributeIDTypeClusterWaterHeaterManagementAttributeTankPercentageID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeBoostStateWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeWaterHeaterManagementID) attributeID:@(MTRAttributeIDTypeClusterWaterHeaterManagementAttributeBoostStateID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeWaterHeaterManagementID) attributeID:@(MTRAttributeIDTypeClusterWaterHeaterManagementAttributeGeneratedCommandListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeWaterHeaterManagementID) attributeID:@(MTRAttributeIDTypeClusterWaterHeaterManagementAttributeAcceptedCommandListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeEventListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeWaterHeaterManagementID) attributeID:@(MTRAttributeIDTypeClusterWaterHeaterManagementAttributeEventListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeWaterHeaterManagementID) attributeID:@(MTRAttributeIDTypeClusterWaterHeaterManagementAttributeAttributeListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeWaterHeaterManagementID) attributeID:@(MTRAttributeIDTypeClusterWaterHeaterManagementAttributeFeatureMapID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeWaterHeaterManagementID) attributeID:@(MTRAttributeIDTypeClusterWaterHeaterManagementAttributeClusterRevisionID) params:params]; +} + +@end + @implementation MTRClusterDemandResponseLoadControl - (void)registerLoadControlProgramRequestWithParams:(MTRDemandResponseLoadControlClusterRegisterLoadControlProgramRequestParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h index 6ec4cfb8ee8778..cd1688f1d69228 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h @@ -5360,6 +5360,74 @@ MTR_AVAILABLE(ios(17.6), macos(14.6), watchos(10.6), tvos(17.6)) @property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; @end +MTR_PROVISIONALLY_AVAILABLE +@interface MTRWaterHeaterManagementClusterBoostParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull duration MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nullable oneShot MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nullable emergencyBoost MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nullable temporarySetpoint MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nullable targetPercentage MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nullable targetReheat MTR_PROVISIONALLY_AVAILABLE; +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRWaterHeaterManagementClusterCancelBoostParams : NSObject +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + MTR_PROVISIONALLY_AVAILABLE @interface MTRDemandResponseLoadControlClusterRegisterLoadControlProgramRequestParams : NSObject diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm index 19eca8de9234b0..facfe84e413676 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm @@ -14934,6 +14934,203 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader } @end +@implementation MTRWaterHeaterManagementClusterBoostParams +- (instancetype)init +{ + if (self = [super init]) { + + _duration = @(0); + + _oneShot = nil; + + _emergencyBoost = nil; + + _temporarySetpoint = nil; + + _targetPercentage = nil; + + _targetReheat = nil; + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRWaterHeaterManagementClusterBoostParams alloc] init]; + + other.duration = self.duration; + other.oneShot = self.oneShot; + other.emergencyBoost = self.emergencyBoost; + other.temporarySetpoint = self.temporarySetpoint; + other.targetPercentage = self.targetPercentage; + other.targetReheat = self.targetReheat; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: duration:%@; oneShot:%@; emergencyBoost:%@; temporarySetpoint:%@; targetPercentage:%@; targetReheat:%@; >", NSStringFromClass([self class]), _duration, _oneShot, _emergencyBoost, _temporarySetpoint, _targetPercentage, _targetReheat]; + return descriptionString; +} + +@end + +@implementation MTRWaterHeaterManagementClusterBoostParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::WaterHeaterManagement::Commands::Boost::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.duration = self.duration.unsignedIntValue; + } + { + if (self.oneShot != nil) { + auto & definedValue_0 = encodableStruct.oneShot.Emplace(); + definedValue_0 = self.oneShot.boolValue; + } + } + { + if (self.emergencyBoost != nil) { + auto & definedValue_0 = encodableStruct.emergencyBoost.Emplace(); + definedValue_0 = self.emergencyBoost.boolValue; + } + } + { + if (self.temporarySetpoint != nil) { + auto & definedValue_0 = encodableStruct.temporarySetpoint.Emplace(); + definedValue_0 = self.temporarySetpoint.shortValue; + } + } + { + if (self.targetPercentage != nil) { + auto & definedValue_0 = encodableStruct.targetPercentage.Emplace(); + definedValue_0 = self.targetPercentage.unsignedCharValue; + } + } + { + if (self.targetReheat != nil) { + auto & definedValue_0 = encodableStruct.targetReheat.Emplace(); + definedValue_0 = self.targetReheat.unsignedCharValue; + } + } + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + +@implementation MTRWaterHeaterManagementClusterCancelBoostParams +- (instancetype)init +{ + if (self = [super init]) { + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRWaterHeaterManagementClusterCancelBoostParams alloc] init]; + + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + return descriptionString; +} + +@end + +@implementation MTRWaterHeaterManagementClusterCancelBoostParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::WaterHeaterManagement::Commands::CancelBoost::Type encodableStruct; + ListFreer listFreer; + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + @implementation MTRDemandResponseLoadControlClusterRegisterLoadControlProgramRequestParams - (instancetype)init { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h index 36938c35dd5637..7a460f1afac0a5 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h @@ -1000,6 +1000,18 @@ NS_ASSUME_NONNULL_BEGIN @end +@interface MTRWaterHeaterManagementClusterBoostParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRWaterHeaterManagementClusterCancelBoostParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + @interface MTRDemandResponseLoadControlClusterRegisterLoadControlProgramRequestParams (InternalMethods) - (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandTimedCheck.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandTimedCheck.mm index f49e574232b544..3f5d4fc65e2d31 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandTimedCheck.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandTimedCheck.mm @@ -608,6 +608,15 @@ static BOOL CommandNeedsTimedInvokeInElectricalEnergyMeasurementCluster(Attribut } } } +static BOOL CommandNeedsTimedInvokeInWaterHeaterManagementCluster(AttributeId aAttributeId) +{ + using namespace Clusters::WaterHeaterManagement; + switch (aAttributeId) { + default: { + return NO; + } + } +} static BOOL CommandNeedsTimedInvokeInDemandResponseLoadControlCluster(AttributeId aAttributeId) { using namespace Clusters::DemandResponseLoadControl; @@ -1356,6 +1365,9 @@ BOOL MTRCommandNeedsTimedInvoke(NSNumber * _Nonnull aClusterID, NSNumber * _Nonn case Clusters::ElectricalEnergyMeasurement::Id: { return CommandNeedsTimedInvokeInElectricalEnergyMeasurementCluster(commandID); } + case Clusters::WaterHeaterManagement::Id: { + return CommandNeedsTimedInvokeInWaterHeaterManagementCluster(commandID); + } case Clusters::DemandResponseLoadControl::Id: { return CommandNeedsTimedInvokeInDemandResponseLoadControlCluster(commandID); } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm index f4ca2dca65a58e..4692733ecf5c91 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm @@ -2719,6 +2719,18 @@ static id _Nullable DecodeEventPayloadForElectricalEnergyMeasurementCluster(Even *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; return nil; } +static id _Nullable DecodeEventPayloadForWaterHeaterManagementCluster(EventId aEventId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::WaterHeaterManagement; + switch (aEventId) { + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + return nil; +} static id _Nullable DecodeEventPayloadForDemandResponseLoadControlCluster(EventId aEventId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { using namespace Clusters::DemandResponseLoadControl; @@ -4808,6 +4820,9 @@ id _Nullable MTRDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVRead case Clusters::ElectricalEnergyMeasurement::Id: { return DecodeEventPayloadForElectricalEnergyMeasurementCluster(aPath.mEventId, aReader, aError); } + case Clusters::WaterHeaterManagement::Id: { + return DecodeEventPayloadForWaterHeaterManagementCluster(aPath.mEventId, aReader, aError); + } case Clusters::DemandResponseLoadControl::Id: { return DecodeEventPayloadForDemandResponseLoadControlCluster(aPath.mEventId, aReader, aError); } diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp index 9a952b67e21b17..6f2533dbf2cf11 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp @@ -15001,6 +15001,348 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu } // namespace Attributes } // namespace ElectricalEnergyMeasurement +namespace WaterHeaterManagement { +namespace Attributes { + +namespace HeaterTypes { + +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, + chip::BitMask * value) +{ + using Traits = NumericAttributeTraits>; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::WaterHeaterManagement::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, + chip::BitMask value, + MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits>; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::WaterHeaterManagement::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE, + markDirty); +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, + chip::BitMask value) +{ + using Traits = NumericAttributeTraits>; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::WaterHeaterManagement::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); +} + +} // namespace HeaterTypes + +namespace HeatDemand { + +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, + chip::BitMask * value) +{ + using Traits = NumericAttributeTraits>; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::WaterHeaterManagement::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, + chip::BitMask value, + MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits>; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::WaterHeaterManagement::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE, + markDirty); +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, + chip::BitMask value) +{ + using Traits = NumericAttributeTraits>; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::WaterHeaterManagement::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); +} + +} // namespace HeatDemand + +namespace TankVolume { + +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::WaterHeaterManagement::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::WaterHeaterManagement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::WaterHeaterManagement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); +} + +} // namespace TankVolume + +namespace EstimatedHeatRequired { + +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int64_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::WaterHeaterManagement::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int64_t value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::WaterHeaterManagement::Id, Id, writable, ZCL_ENERGY_MWH_ATTRIBUTE_TYPE, + markDirty); +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int64_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::WaterHeaterManagement::Id, Id, writable, ZCL_ENERGY_MWH_ATTRIBUTE_TYPE); +} + +} // namespace EstimatedHeatRequired + +namespace TankPercentage { + +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, chip::Percent * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::WaterHeaterManagement::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::Percent value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::WaterHeaterManagement::Id, Id, writable, ZCL_PERCENT_ATTRIBUTE_TYPE, + markDirty); +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::Percent value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::WaterHeaterManagement::Id, Id, writable, ZCL_PERCENT_ATTRIBUTE_TYPE); +} + +} // namespace TankPercentage + +namespace BoostState { + +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, + chip::app::Clusters::WaterHeaterManagement::BoostStateEnum * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::WaterHeaterManagement::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::app::Clusters::WaterHeaterManagement::BoostStateEnum value, + MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::WaterHeaterManagement::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE, markDirty); +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::app::Clusters::WaterHeaterManagement::BoostStateEnum value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::WaterHeaterManagement::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); +} + +} // namespace BoostState + +namespace ClusterRevision { + +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::WaterHeaterManagement::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::WaterHeaterManagement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::WaterHeaterManagement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); +} + +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace WaterHeaterManagement + namespace DemandResponseLoadControl { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h index feec1e6f04bcb8..869a58cd5fb35b 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h @@ -2467,6 +2467,67 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu } // namespace Attributes } // namespace ElectricalEnergyMeasurement +namespace WaterHeaterManagement { +namespace Attributes { + +namespace HeaterTypes { +Protocols::InteractionModel::Status +Get(chip::EndpointId endpoint, + chip::BitMask * value); // WaterHeaterTypeBitmap +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, + chip::BitMask value); +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, + chip::BitMask value, + MarkAttributeDirty markDirty); +} // namespace HeaterTypes + +namespace HeatDemand { +Protocols::InteractionModel::Status +Get(chip::EndpointId endpoint, + chip::BitMask * value); // WaterHeaterDemandBitmap +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, + chip::BitMask value); +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, + chip::BitMask value, + MarkAttributeDirty markDirty); +} // namespace HeatDemand + +namespace TankVolume { +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value); // int16u +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value); +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); +} // namespace TankVolume + +namespace EstimatedHeatRequired { +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int64_t * value); // energy_mwh +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int64_t value); +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int64_t value, MarkAttributeDirty markDirty); +} // namespace EstimatedHeatRequired + +namespace TankPercentage { +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, chip::Percent * value); // percent +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::Percent value); +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::Percent value, MarkAttributeDirty markDirty); +} // namespace TankPercentage + +namespace BoostState { +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, + chip::app::Clusters::WaterHeaterManagement::BoostStateEnum * value); // BoostStateEnum +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, + chip::app::Clusters::WaterHeaterManagement::BoostStateEnum value); +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::app::Clusters::WaterHeaterManagement::BoostStateEnum value, + MarkAttributeDirty markDirty); +} // namespace BoostState + +namespace ClusterRevision { +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value); // int16u +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value); +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace WaterHeaterManagement + namespace DemandResponseLoadControl { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/callback.h b/zzz_generated/app-common/app-common/zap-generated/callback.h index 0f6a34fec9a9cc..70aa32f0298163 100644 --- a/zzz_generated/app-common/app-common/zap-generated/callback.h +++ b/zzz_generated/app-common/app-common/zap-generated/callback.h @@ -368,6 +368,11 @@ void emberAfElectricalPowerMeasurementClusterInitCallback(chip::EndpointId endpo */ void emberAfElectricalEnergyMeasurementClusterInitCallback(chip::EndpointId endpoint); +/** + * @param endpoint Endpoint that is being initialized + */ +void emberAfWaterHeaterManagementClusterInitCallback(chip::EndpointId endpoint); + /** * @param endpoint Endpoint that is being initialized */ @@ -3225,6 +3230,44 @@ chip::Protocols::InteractionModel::Status MatterElectricalEnergyMeasurementClust */ void emberAfElectricalEnergyMeasurementClusterServerTickCallback(chip::EndpointId endpoint); +// +// Water Heater Management Cluster +// + +/** + * @param endpoint Endpoint that is being initialized + */ +void emberAfWaterHeaterManagementClusterServerInitCallback(chip::EndpointId endpoint); + +/** + * @param endpoint Endpoint that is being shutdown + */ +void MatterWaterHeaterManagementClusterServerShutdownCallback(chip::EndpointId endpoint); + +/** + * @param endpoint Endpoint that is being initialized + */ +void emberAfWaterHeaterManagementClusterClientInitCallback(chip::EndpointId endpoint); + +/** + * @param attributePath Concrete attribute path that changed + */ +void MatterWaterHeaterManagementClusterServerAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath); + +/** + * @param attributePath Concrete attribute path to be changed + * @param attributeType Attribute type + * @param size Attribute size + * @param value Attribute value + */ +chip::Protocols::InteractionModel::Status MatterWaterHeaterManagementClusterServerPreAttributeChangedCallback( + const chip::app::ConcreteAttributePath & attributePath, EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); + +/** + * @param endpoint Endpoint that is being served + */ +void emberAfWaterHeaterManagementClusterServerTickCallback(chip::EndpointId endpoint); + // // Demand Response Load Control Cluster // @@ -5836,6 +5879,18 @@ bool emberAfValveConfigurationAndControlClusterOpenCallback( bool emberAfValveConfigurationAndControlClusterCloseCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, const chip::app::Clusters::ValveConfigurationAndControl::Commands::Close::DecodableType & commandData); +/** + * @brief Water Heater Management Cluster Boost Command callback (from client) + */ +bool emberAfWaterHeaterManagementClusterBoostCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::WaterHeaterManagement::Commands::Boost::DecodableType & commandData); +/** + * @brief Water Heater Management Cluster CancelBoost Command callback (from client) + */ +bool emberAfWaterHeaterManagementClusterCancelBoostCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::WaterHeaterManagement::Commands::CancelBoost::DecodableType & commandData); /** * @brief Demand Response Load Control Cluster RegisterLoadControlProgramRequest Command callback (from client) */ diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h index c1ca9fffb4a305..4acfcb4febb6e0 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h @@ -1560,6 +1560,19 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(ElectricalPowerMeasurem } } +static auto __attribute__((unused)) EnsureKnownEnumValue(WaterHeaterManagement::BoostStateEnum val) +{ + using EnumType = WaterHeaterManagement::BoostStateEnum; + switch (val) + { + case EnumType::kInactive: + case EnumType::kActive: + return val; + default: + return EnumType::kUnknownEnumValue; + } +} + static auto __attribute__((unused)) EnsureKnownEnumValue(DemandResponseLoadControl::CriticalityLevelEnum val) { using EnumType = DemandResponseLoadControl::CriticalityLevelEnum; diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h index b313314412c5ec..51a6547998f9d2 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h @@ -2287,6 +2287,48 @@ enum class Feature : uint32_t }; } // namespace ElectricalEnergyMeasurement +namespace WaterHeaterManagement { + +// Enum for BoostStateEnum +enum class BoostStateEnum : uint8_t +{ + kInactive = 0x00, + kActive = 0x01, + // All received enum values that are not listed above will be mapped + // to kUnknownEnumValue. This is a helper enum value that should only + // be used by code to process how it handles receiving and unknown + // enum value. This specific should never be transmitted. + kUnknownEnumValue = 2, +}; + +// Bitmap for Feature +enum class Feature : uint32_t +{ + kEnergyManagement = 0x1, + kTankPercent = 0x2, +}; + +// Bitmap for WaterHeaterDemandBitmap +enum class WaterHeaterDemandBitmap : uint8_t +{ + kImmersionElement1 = 0x1, + kImmersionElement2 = 0x2, + kHeatPump = 0x4, + kBoiler = 0x8, + kOther = 0x10, +}; + +// Bitmap for WaterHeaterTypeBitmap +enum class WaterHeaterTypeBitmap : uint8_t +{ + kImmersionElement1 = 0x1, + kImmersionElement2 = 0x2, + kHeatPump = 0x4, + kBoiler = 0x8, + kOther = 0x10, +}; +} // namespace WaterHeaterManagement + namespace DemandResponseLoadControl { // Enum for CriticalityLevelEnum diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp index a51104184b45e5..8c99d4bbff0f1b 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp @@ -14502,6 +14502,128 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } // namespace Events } // namespace ElectricalEnergyMeasurement +namespace WaterHeaterManagement { + +namespace Commands { +namespace Boost { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kDuration), duration); + encoder.Encode(to_underlying(Fields::kOneShot), oneShot); + encoder.Encode(to_underlying(Fields::kEmergencyBoost), emergencyBoost); + encoder.Encode(to_underlying(Fields::kTemporarySetpoint), temporarySetpoint); + encoder.Encode(to_underlying(Fields::kTargetPercentage), targetPercentage); + encoder.Encode(to_underlying(Fields::kTargetReheat), targetReheat); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kDuration)) + { + err = DataModel::Decode(reader, duration); + } + else if (__context_tag == to_underlying(Fields::kOneShot)) + { + err = DataModel::Decode(reader, oneShot); + } + else if (__context_tag == to_underlying(Fields::kEmergencyBoost)) + { + err = DataModel::Decode(reader, emergencyBoost); + } + else if (__context_tag == to_underlying(Fields::kTemporarySetpoint)) + { + err = DataModel::Decode(reader, temporarySetpoint); + } + else if (__context_tag == to_underlying(Fields::kTargetPercentage)) + { + err = DataModel::Decode(reader, targetPercentage); + } + else if (__context_tag == to_underlying(Fields::kTargetReheat)) + { + err = DataModel::Decode(reader, targetReheat); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace Boost. +namespace CancelBoost { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + } +} +} // namespace CancelBoost. +} // namespace Commands + +namespace Attributes { +CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) +{ + switch (path.mAttributeId) + { + case Attributes::HeaterTypes::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, heaterTypes); + case Attributes::HeatDemand::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, heatDemand); + case Attributes::TankVolume::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, tankVolume); + case Attributes::EstimatedHeatRequired::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, estimatedHeatRequired); + case Attributes::TankPercentage::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, tankPercentage); + case Attributes::BoostState::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, boostState); + case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, generatedCommandList); + case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, acceptedCommandList); + case Attributes::EventList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, eventList); + case Attributes::AttributeList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, attributeList); + case Attributes::FeatureMap::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, featureMap); + case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, clusterRevision); + default: + return CHIP_NO_ERROR; + } +} +} // namespace Attributes + +namespace Events {} // namespace Events + +} // namespace WaterHeaterManagement namespace DemandResponseLoadControl { namespace Structs { @@ -30852,6 +30974,13 @@ bool CommandIsFabricScoped(ClusterId aCluster, CommandId aCommand) return false; } } + case Clusters::WaterHeaterManagement::Id: { + switch (aCommand) + { + default: + return false; + } + } case Clusters::DemandResponseLoadControl::Id: { switch (aCommand) { diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index d4b69ea58a0d5a..cebd2309cf1db7 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h @@ -20817,6 +20817,239 @@ struct DecodableType } // namespace PeriodicEnergyMeasured } // namespace Events } // namespace ElectricalEnergyMeasurement +namespace WaterHeaterManagement { + +namespace Commands { +// Forward-declarations so we can reference these later. + +namespace Boost { +struct Type; +struct DecodableType; +} // namespace Boost + +namespace CancelBoost { +struct Type; +struct DecodableType; +} // namespace CancelBoost + +} // namespace Commands + +namespace Commands { +namespace Boost { +enum class Fields : uint8_t +{ + kDuration = 0, + kOneShot = 1, + kEmergencyBoost = 2, + kTemporarySetpoint = 3, + kTargetPercentage = 4, + kTargetReheat = 5, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::Boost::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::WaterHeaterManagement::Id; } + + uint32_t duration = static_cast(0); + Optional oneShot; + Optional emergencyBoost; + Optional temporarySetpoint; + Optional targetPercentage; + Optional targetReheat; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::Boost::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::WaterHeaterManagement::Id; } + + uint32_t duration = static_cast(0); + Optional oneShot; + Optional emergencyBoost; + Optional temporarySetpoint; + Optional targetPercentage; + Optional targetReheat; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace Boost +namespace CancelBoost { +enum class Fields : uint8_t +{ +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::CancelBoost::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::WaterHeaterManagement::Id; } + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::CancelBoost::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::WaterHeaterManagement::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace CancelBoost +} // namespace Commands + +namespace Attributes { + +namespace HeaterTypes { +struct TypeInfo +{ + using Type = chip::BitMask; + using DecodableType = chip::BitMask; + using DecodableArgType = chip::BitMask; + + static constexpr ClusterId GetClusterId() { return Clusters::WaterHeaterManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::HeaterTypes::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace HeaterTypes +namespace HeatDemand { +struct TypeInfo +{ + using Type = chip::BitMask; + using DecodableType = chip::BitMask; + using DecodableArgType = chip::BitMask; + + static constexpr ClusterId GetClusterId() { return Clusters::WaterHeaterManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::HeatDemand::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace HeatDemand +namespace TankVolume { +struct TypeInfo +{ + using Type = uint16_t; + using DecodableType = uint16_t; + using DecodableArgType = uint16_t; + + static constexpr ClusterId GetClusterId() { return Clusters::WaterHeaterManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::TankVolume::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace TankVolume +namespace EstimatedHeatRequired { +struct TypeInfo +{ + using Type = int64_t; + using DecodableType = int64_t; + using DecodableArgType = int64_t; + + static constexpr ClusterId GetClusterId() { return Clusters::WaterHeaterManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::EstimatedHeatRequired::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace EstimatedHeatRequired +namespace TankPercentage { +struct TypeInfo +{ + using Type = chip::Percent; + using DecodableType = chip::Percent; + using DecodableArgType = chip::Percent; + + static constexpr ClusterId GetClusterId() { return Clusters::WaterHeaterManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::TankPercentage::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace TankPercentage +namespace BoostState { +struct TypeInfo +{ + using Type = chip::app::Clusters::WaterHeaterManagement::BoostStateEnum; + using DecodableType = chip::app::Clusters::WaterHeaterManagement::BoostStateEnum; + using DecodableArgType = chip::app::Clusters::WaterHeaterManagement::BoostStateEnum; + + static constexpr ClusterId GetClusterId() { return Clusters::WaterHeaterManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::BoostState::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace BoostState +namespace GeneratedCommandList { +struct TypeInfo : public Clusters::Globals::Attributes::GeneratedCommandList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::WaterHeaterManagement::Id; } +}; +} // namespace GeneratedCommandList +namespace AcceptedCommandList { +struct TypeInfo : public Clusters::Globals::Attributes::AcceptedCommandList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::WaterHeaterManagement::Id; } +}; +} // namespace AcceptedCommandList +namespace EventList { +struct TypeInfo : public Clusters::Globals::Attributes::EventList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::WaterHeaterManagement::Id; } +}; +} // namespace EventList +namespace AttributeList { +struct TypeInfo : public Clusters::Globals::Attributes::AttributeList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::WaterHeaterManagement::Id; } +}; +} // namespace AttributeList +namespace FeatureMap { +struct TypeInfo : public Clusters::Globals::Attributes::FeatureMap::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::WaterHeaterManagement::Id; } +}; +} // namespace FeatureMap +namespace ClusterRevision { +struct TypeInfo : public Clusters::Globals::Attributes::ClusterRevision::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::WaterHeaterManagement::Id; } +}; +} // namespace ClusterRevision + +struct TypeInfo +{ + struct DecodableType + { + static constexpr ClusterId GetClusterId() { return Clusters::WaterHeaterManagement::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); + + Attributes::HeaterTypes::TypeInfo::DecodableType heaterTypes = + static_cast>(0); + Attributes::HeatDemand::TypeInfo::DecodableType heatDemand = + static_cast>(0); + Attributes::TankVolume::TypeInfo::DecodableType tankVolume = static_cast(0); + Attributes::EstimatedHeatRequired::TypeInfo::DecodableType estimatedHeatRequired = static_cast(0); + Attributes::TankPercentage::TypeInfo::DecodableType tankPercentage = static_cast(0); + Attributes::BoostState::TypeInfo::DecodableType boostState = + static_cast(0); + Attributes::GeneratedCommandList::TypeInfo::DecodableType generatedCommandList; + Attributes::AcceptedCommandList::TypeInfo::DecodableType acceptedCommandList; + Attributes::EventList::TypeInfo::DecodableType eventList; + Attributes::AttributeList::TypeInfo::DecodableType attributeList; + Attributes::FeatureMap::TypeInfo::DecodableType featureMap = static_cast(0); + Attributes::ClusterRevision::TypeInfo::DecodableType clusterRevision = static_cast(0); + }; +}; +} // namespace Attributes +} // namespace WaterHeaterManagement namespace DemandResponseLoadControl { namespace Structs { namespace HeatingSourceControlStruct { diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h index ad8b2c79bbecd7..6ed284feb4354f 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h @@ -3801,6 +3801,60 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; } // namespace Attributes } // namespace ElectricalEnergyMeasurement +namespace WaterHeaterManagement { +namespace Attributes { + +namespace HeaterTypes { +static constexpr AttributeId Id = 0x00000000; +} // namespace HeaterTypes + +namespace HeatDemand { +static constexpr AttributeId Id = 0x00000001; +} // namespace HeatDemand + +namespace TankVolume { +static constexpr AttributeId Id = 0x00000002; +} // namespace TankVolume + +namespace EstimatedHeatRequired { +static constexpr AttributeId Id = 0x00000003; +} // namespace EstimatedHeatRequired + +namespace TankPercentage { +static constexpr AttributeId Id = 0x00000004; +} // namespace TankPercentage + +namespace BoostState { +static constexpr AttributeId Id = 0x00000005; +} // namespace BoostState + +namespace GeneratedCommandList { +static constexpr AttributeId Id = Globals::Attributes::GeneratedCommandList::Id; +} // namespace GeneratedCommandList + +namespace AcceptedCommandList { +static constexpr AttributeId Id = Globals::Attributes::AcceptedCommandList::Id; +} // namespace AcceptedCommandList + +namespace EventList { +static constexpr AttributeId Id = Globals::Attributes::EventList::Id; +} // namespace EventList + +namespace AttributeList { +static constexpr AttributeId Id = Globals::Attributes::AttributeList::Id; +} // namespace AttributeList + +namespace FeatureMap { +static constexpr AttributeId Id = Globals::Attributes::FeatureMap::Id; +} // namespace FeatureMap + +namespace ClusterRevision { +static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace WaterHeaterManagement + namespace DemandResponseLoadControl { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h b/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h index 030893e204de34..5a6cba638e6b26 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h @@ -226,6 +226,9 @@ static constexpr ClusterId Id = 0x00000090; namespace ElectricalEnergyMeasurement { static constexpr ClusterId Id = 0x00000091; } // namespace ElectricalEnergyMeasurement +namespace WaterHeaterManagement { +static constexpr ClusterId Id = 0x00000094; +} // namespace WaterHeaterManagement namespace DemandResponseLoadControl { static constexpr ClusterId Id = 0x00000096; } // namespace DemandResponseLoadControl diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h index 98bfd4eaceb968..49f05dd449dff6 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h @@ -929,6 +929,20 @@ static constexpr CommandId Id = 0x00000001; } // namespace Commands } // namespace ValveConfigurationAndControl +namespace WaterHeaterManagement { +namespace Commands { + +namespace Boost { +static constexpr CommandId Id = 0x00000000; +} // namespace Boost + +namespace CancelBoost { +static constexpr CommandId Id = 0x00000001; +} // namespace CancelBoost + +} // namespace Commands +} // namespace WaterHeaterManagement + namespace DemandResponseLoadControl { namespace Commands { diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index a160e9db747c7a..6f76578df7e601 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -102,6 +102,7 @@ | ValveConfigurationAndControl | 0x0081 | | ElectricalPowerMeasurement | 0x0090 | | ElectricalEnergyMeasurement | 0x0091 | +| WaterHeaterManagement | 0x0094 | | DemandResponseLoadControl | 0x0096 | | Messages | 0x0097 | | DeviceEnergyManagement | 0x0098 | @@ -6571,6 +6572,109 @@ class ValveConfigurationAndControlClose : public ClusterCommand | * PeriodicEnergyMeasured | 0x0001 | \*----------------------------------------------------------------------------*/ +/*----------------------------------------------------------------------------*\ +| Cluster WaterHeaterManagement | 0x0094 | +|------------------------------------------------------------------------------| +| Commands: | | +| * Boost | 0x00 | +| * CancelBoost | 0x01 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * HeaterTypes | 0x0000 | +| * HeatDemand | 0x0001 | +| * TankVolume | 0x0002 | +| * EstimatedHeatRequired | 0x0003 | +| * TankPercentage | 0x0004 | +| * BoostState | 0x0005 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * EventList | 0xFFFA | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +\*----------------------------------------------------------------------------*/ + +/* + * Command Boost + */ +class WaterHeaterManagementBoost : public ClusterCommand +{ +public: + WaterHeaterManagementBoost(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("boost", credsIssuerConfig) + { + AddArgument("Duration", 0, UINT32_MAX, &mRequest.duration); + AddArgument("OneShot", 0, 1, &mRequest.oneShot); + AddArgument("EmergencyBoost", 0, 1, &mRequest.emergencyBoost); + AddArgument("TemporarySetpoint", INT16_MIN, INT16_MAX, &mRequest.temporarySetpoint); + AddArgument("TargetPercentage", 0, UINT8_MAX, &mRequest.targetPercentage); + AddArgument("TargetReheat", 0, UINT8_MAX, &mRequest.targetReheat); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WaterHeaterManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::WaterHeaterManagement::Commands::Boost::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WaterHeaterManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::WaterHeaterManagement::Commands::Boost::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::WaterHeaterManagement::Commands::Boost::Type mRequest; +}; + +/* + * Command CancelBoost + */ +class WaterHeaterManagementCancelBoost : public ClusterCommand +{ +public: + WaterHeaterManagementCancelBoost(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("cancel-boost", credsIssuerConfig) + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WaterHeaterManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::WaterHeaterManagement::Commands::CancelBoost::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WaterHeaterManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::WaterHeaterManagement::Commands::CancelBoost::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::WaterHeaterManagement::Commands::CancelBoost::Type mRequest; +}; + /*----------------------------------------------------------------------------*\ | Cluster DemandResponseLoadControl | 0x0096 | |------------------------------------------------------------------------------| @@ -20760,6 +20864,84 @@ void registerClusterElectricalEnergyMeasurement(Commands & commands, CredentialI commands.RegisterCluster(clusterName, clusterCommands); } +void registerClusterWaterHeaterManagement(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) +{ + using namespace chip::app::Clusters::WaterHeaterManagement; + + const char * clusterName = "WaterHeaterManagement"; + + commands_list clusterCommands = { + // + // Commands + // + make_unique(Id, credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + // + // Attributes + // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "heater-types", Attributes::HeaterTypes::Id, credsIssuerConfig), // + make_unique(Id, "heat-demand", Attributes::HeatDemand::Id, credsIssuerConfig), // + make_unique(Id, "tank-volume", Attributes::TankVolume::Id, credsIssuerConfig), // + make_unique(Id, "estimated-heat-required", Attributes::EstimatedHeatRequired::Id, credsIssuerConfig), // + make_unique(Id, "tank-percentage", Attributes::TankPercentage::Id, credsIssuerConfig), // + make_unique(Id, "boost-state", Attributes::BoostState::Id, credsIssuerConfig), // + make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "event-list", Attributes::EventList::Id, credsIssuerConfig), // + make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // + make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // + make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // + make_unique>(Id, credsIssuerConfig), // + make_unique>>( + Id, "heater-types", 0, UINT8_MAX, Attributes::HeaterTypes::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "heat-demand", 0, UINT8_MAX, Attributes::HeatDemand::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "tank-volume", 0, UINT16_MAX, Attributes::TankVolume::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "estimated-heat-required", INT64_MIN, INT64_MAX, + Attributes::EstimatedHeatRequired::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique>(Id, "tank-percentage", 0, UINT8_MAX, Attributes::TankPercentage::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>( + Id, "boost-state", 0, UINT8_MAX, Attributes::BoostState::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "generated-command-list", Attributes::GeneratedCommandList::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique>>( + Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "event-list", Attributes::EventList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "attribute-list", Attributes::AttributeList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "feature-map", 0, UINT32_MAX, Attributes::FeatureMap::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "cluster-revision", 0, UINT16_MAX, Attributes::ClusterRevision::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "heater-types", Attributes::HeaterTypes::Id, credsIssuerConfig), // + make_unique(Id, "heat-demand", Attributes::HeatDemand::Id, credsIssuerConfig), // + make_unique(Id, "tank-volume", Attributes::TankVolume::Id, credsIssuerConfig), // + make_unique(Id, "estimated-heat-required", Attributes::EstimatedHeatRequired::Id, credsIssuerConfig), // + make_unique(Id, "tank-percentage", Attributes::TankPercentage::Id, credsIssuerConfig), // + make_unique(Id, "boost-state", Attributes::BoostState::Id, credsIssuerConfig), // + make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "event-list", Attributes::EventList::Id, credsIssuerConfig), // + make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // + make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // + make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // + // + // Events + // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + }; + + commands.RegisterCluster(clusterName, clusterCommands); +} void registerClusterDemandResponseLoadControl(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) { using namespace chip::app::Clusters::DemandResponseLoadControl; @@ -27412,6 +27594,7 @@ void registerClusters(Commands & commands, CredentialIssuerCommands * credsIssue registerClusterValveConfigurationAndControl(commands, credsIssuerConfig); registerClusterElectricalPowerMeasurement(commands, credsIssuerConfig); registerClusterElectricalEnergyMeasurement(commands, credsIssuerConfig); + registerClusterWaterHeaterManagement(commands, credsIssuerConfig); registerClusterDemandResponseLoadControl(commands, credsIssuerConfig); registerClusterMessages(commands, credsIssuerConfig); registerClusterDeviceEnergyManagement(commands, credsIssuerConfig); diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp index 16206779dd4334..e85e8f3f753748 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -12765,6 +12765,72 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } + case WaterHeaterManagement::Id: { + switch (path.mAttributeId) + { + case WaterHeaterManagement::Attributes::HeaterTypes::Id: { + chip::BitMask value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("HeaterTypes", 1, value); + } + case WaterHeaterManagement::Attributes::HeatDemand::Id: { + chip::BitMask value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("HeatDemand", 1, value); + } + case WaterHeaterManagement::Attributes::TankVolume::Id: { + uint16_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("TankVolume", 1, value); + } + case WaterHeaterManagement::Attributes::EstimatedHeatRequired::Id: { + int64_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("EstimatedHeatRequired", 1, value); + } + case WaterHeaterManagement::Attributes::TankPercentage::Id: { + chip::Percent value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("TankPercentage", 1, value); + } + case WaterHeaterManagement::Attributes::BoostState::Id: { + chip::app::Clusters::WaterHeaterManagement::BoostStateEnum value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("BoostState", 1, value); + } + case WaterHeaterManagement::Attributes::GeneratedCommandList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + } + case WaterHeaterManagement::Attributes::AcceptedCommandList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + } + case WaterHeaterManagement::Attributes::EventList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("EventList", 1, value); + } + case WaterHeaterManagement::Attributes::AttributeList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("AttributeList", 1, value); + } + case WaterHeaterManagement::Attributes::FeatureMap::Id: { + uint32_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("FeatureMap", 1, value); + } + case WaterHeaterManagement::Attributes::ClusterRevision::Id: { + uint16_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("ClusterRevision", 1, value); + } + } + break; + } case DemandResponseLoadControl::Id: { switch (path.mAttributeId) { diff --git a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h index f3def661260145..7e0eb5112f9476 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -104,6 +104,7 @@ | ValveConfigurationAndControl | 0x0081 | | ElectricalPowerMeasurement | 0x0090 | | ElectricalEnergyMeasurement | 0x0091 | +| WaterHeaterManagement | 0x0094 | | DemandResponseLoadControl | 0x0096 | | Messages | 0x0097 | | DeviceEnergyManagement | 0x0098 | @@ -78948,6 +78949,1202 @@ class SubscribeAttributeElectricalEnergyMeasurementClusterRevision : public Subs } }; +#if MTR_ENABLE_PROVISIONAL +/*----------------------------------------------------------------------------*\ +| Cluster WaterHeaterManagement | 0x0094 | +|------------------------------------------------------------------------------| +| Commands: | | +| * Boost | 0x00 | +| * CancelBoost | 0x01 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * HeaterTypes | 0x0000 | +| * HeatDemand | 0x0001 | +| * TankVolume | 0x0002 | +| * EstimatedHeatRequired | 0x0003 | +| * TankPercentage | 0x0004 | +| * BoostState | 0x0005 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * EventList | 0xFFFA | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +\*----------------------------------------------------------------------------*/ + +#if MTR_ENABLE_PROVISIONAL +/* + * Command Boost + */ +class WaterHeaterManagementBoost : public ClusterCommand { +public: + WaterHeaterManagementBoost() + : ClusterCommand("boost") + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("Duration", 0, UINT32_MAX, &mRequest.duration); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("OneShot", 0, 1, &mRequest.oneShot); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("EmergencyBoost", 0, 1, &mRequest.emergencyBoost); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("TemporarySetpoint", INT16_MIN, INT16_MAX, &mRequest.temporarySetpoint); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("TargetPercentage", 0, UINT8_MAX, &mRequest.targetPercentage); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("TargetReheat", 0, UINT8_MAX, &mRequest.targetReheat); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WaterHeaterManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::WaterHeaterManagement::Commands::Boost::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterWaterHeaterManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWaterHeaterManagementClusterBoostParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + params.duration = [NSNumber numberWithUnsignedInt:mRequest.duration]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + if (mRequest.oneShot.HasValue()) { + params.oneShot = [NSNumber numberWithBool:mRequest.oneShot.Value()]; + } else { + params.oneShot = nil; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + if (mRequest.emergencyBoost.HasValue()) { + params.emergencyBoost = [NSNumber numberWithBool:mRequest.emergencyBoost.Value()]; + } else { + params.emergencyBoost = nil; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + if (mRequest.temporarySetpoint.HasValue()) { + params.temporarySetpoint = [NSNumber numberWithShort:mRequest.temporarySetpoint.Value()]; + } else { + params.temporarySetpoint = nil; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + if (mRequest.targetPercentage.HasValue()) { + params.targetPercentage = [NSNumber numberWithUnsignedChar:mRequest.targetPercentage.Value()]; + } else { + params.targetPercentage = nil; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + if (mRequest.targetReheat.HasValue()) { + params.targetReheat = [NSNumber numberWithUnsignedChar:mRequest.targetReheat.Value()]; + } else { + params.targetReheat = nil; + } +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster boostWithParams:params completion: + ^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::WaterHeaterManagement::Commands::Boost::Type mRequest; +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command CancelBoost + */ +class WaterHeaterManagementCancelBoost : public ClusterCommand { +public: + WaterHeaterManagementCancelBoost() + : ClusterCommand("cancel-boost") + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WaterHeaterManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::WaterHeaterManagement::Commands::CancelBoost::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterWaterHeaterManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWaterHeaterManagementClusterCancelBoostParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster cancelBoostWithParams:params completion: + ^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: +}; + +#endif // MTR_ENABLE_PROVISIONAL + +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute HeaterTypes + */ +class ReadWaterHeaterManagementHeaterTypes : public ReadAttribute { +public: + ReadWaterHeaterManagementHeaterTypes() + : ReadAttribute("heater-types") + { + } + + ~ReadWaterHeaterManagementHeaterTypes() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WaterHeaterManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::WaterHeaterManagement::Attributes::HeaterTypes::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterWaterHeaterManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeHeaterTypesWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"WaterHeaterManagement.HeaterTypes response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("WaterHeaterManagement HeaterTypes read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeWaterHeaterManagementHeaterTypes : public SubscribeAttribute { +public: + SubscribeAttributeWaterHeaterManagementHeaterTypes() + : SubscribeAttribute("heater-types") + { + } + + ~SubscribeAttributeWaterHeaterManagementHeaterTypes() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WaterHeaterManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::WaterHeaterManagement::Attributes::HeaterTypes::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterWaterHeaterManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeHeaterTypesWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"WaterHeaterManagement.HeaterTypes response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute HeatDemand + */ +class ReadWaterHeaterManagementHeatDemand : public ReadAttribute { +public: + ReadWaterHeaterManagementHeatDemand() + : ReadAttribute("heat-demand") + { + } + + ~ReadWaterHeaterManagementHeatDemand() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WaterHeaterManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::WaterHeaterManagement::Attributes::HeatDemand::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterWaterHeaterManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeHeatDemandWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"WaterHeaterManagement.HeatDemand response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("WaterHeaterManagement HeatDemand read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeWaterHeaterManagementHeatDemand : public SubscribeAttribute { +public: + SubscribeAttributeWaterHeaterManagementHeatDemand() + : SubscribeAttribute("heat-demand") + { + } + + ~SubscribeAttributeWaterHeaterManagementHeatDemand() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WaterHeaterManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::WaterHeaterManagement::Attributes::HeatDemand::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterWaterHeaterManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeHeatDemandWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"WaterHeaterManagement.HeatDemand response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute TankVolume + */ +class ReadWaterHeaterManagementTankVolume : public ReadAttribute { +public: + ReadWaterHeaterManagementTankVolume() + : ReadAttribute("tank-volume") + { + } + + ~ReadWaterHeaterManagementTankVolume() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WaterHeaterManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::WaterHeaterManagement::Attributes::TankVolume::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterWaterHeaterManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeTankVolumeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"WaterHeaterManagement.TankVolume response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("WaterHeaterManagement TankVolume read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeWaterHeaterManagementTankVolume : public SubscribeAttribute { +public: + SubscribeAttributeWaterHeaterManagementTankVolume() + : SubscribeAttribute("tank-volume") + { + } + + ~SubscribeAttributeWaterHeaterManagementTankVolume() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WaterHeaterManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::WaterHeaterManagement::Attributes::TankVolume::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterWaterHeaterManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeTankVolumeWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"WaterHeaterManagement.TankVolume response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute EstimatedHeatRequired + */ +class ReadWaterHeaterManagementEstimatedHeatRequired : public ReadAttribute { +public: + ReadWaterHeaterManagementEstimatedHeatRequired() + : ReadAttribute("estimated-heat-required") + { + } + + ~ReadWaterHeaterManagementEstimatedHeatRequired() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WaterHeaterManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::WaterHeaterManagement::Attributes::EstimatedHeatRequired::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterWaterHeaterManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeEstimatedHeatRequiredWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"WaterHeaterManagement.EstimatedHeatRequired response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("WaterHeaterManagement EstimatedHeatRequired read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeWaterHeaterManagementEstimatedHeatRequired : public SubscribeAttribute { +public: + SubscribeAttributeWaterHeaterManagementEstimatedHeatRequired() + : SubscribeAttribute("estimated-heat-required") + { + } + + ~SubscribeAttributeWaterHeaterManagementEstimatedHeatRequired() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WaterHeaterManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::WaterHeaterManagement::Attributes::EstimatedHeatRequired::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterWaterHeaterManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeEstimatedHeatRequiredWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"WaterHeaterManagement.EstimatedHeatRequired response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute TankPercentage + */ +class ReadWaterHeaterManagementTankPercentage : public ReadAttribute { +public: + ReadWaterHeaterManagementTankPercentage() + : ReadAttribute("tank-percentage") + { + } + + ~ReadWaterHeaterManagementTankPercentage() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WaterHeaterManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::WaterHeaterManagement::Attributes::TankPercentage::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterWaterHeaterManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeTankPercentageWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"WaterHeaterManagement.TankPercentage response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("WaterHeaterManagement TankPercentage read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeWaterHeaterManagementTankPercentage : public SubscribeAttribute { +public: + SubscribeAttributeWaterHeaterManagementTankPercentage() + : SubscribeAttribute("tank-percentage") + { + } + + ~SubscribeAttributeWaterHeaterManagementTankPercentage() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WaterHeaterManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::WaterHeaterManagement::Attributes::TankPercentage::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterWaterHeaterManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeTankPercentageWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"WaterHeaterManagement.TankPercentage response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute BoostState + */ +class ReadWaterHeaterManagementBoostState : public ReadAttribute { +public: + ReadWaterHeaterManagementBoostState() + : ReadAttribute("boost-state") + { + } + + ~ReadWaterHeaterManagementBoostState() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WaterHeaterManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::WaterHeaterManagement::Attributes::BoostState::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterWaterHeaterManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeBoostStateWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"WaterHeaterManagement.BoostState response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("WaterHeaterManagement BoostState read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeWaterHeaterManagementBoostState : public SubscribeAttribute { +public: + SubscribeAttributeWaterHeaterManagementBoostState() + : SubscribeAttribute("boost-state") + { + } + + ~SubscribeAttributeWaterHeaterManagementBoostState() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WaterHeaterManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::WaterHeaterManagement::Attributes::BoostState::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterWaterHeaterManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeBoostStateWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"WaterHeaterManagement.BoostState response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute GeneratedCommandList + */ +class ReadWaterHeaterManagementGeneratedCommandList : public ReadAttribute { +public: + ReadWaterHeaterManagementGeneratedCommandList() + : ReadAttribute("generated-command-list") + { + } + + ~ReadWaterHeaterManagementGeneratedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WaterHeaterManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::WaterHeaterManagement::Attributes::GeneratedCommandList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterWaterHeaterManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"WaterHeaterManagement.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("WaterHeaterManagement GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeWaterHeaterManagementGeneratedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeWaterHeaterManagementGeneratedCommandList() + : SubscribeAttribute("generated-command-list") + { + } + + ~SubscribeAttributeWaterHeaterManagementGeneratedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WaterHeaterManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::WaterHeaterManagement::Attributes::GeneratedCommandList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterWaterHeaterManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeGeneratedCommandListWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"WaterHeaterManagement.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute AcceptedCommandList + */ +class ReadWaterHeaterManagementAcceptedCommandList : public ReadAttribute { +public: + ReadWaterHeaterManagementAcceptedCommandList() + : ReadAttribute("accepted-command-list") + { + } + + ~ReadWaterHeaterManagementAcceptedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WaterHeaterManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::WaterHeaterManagement::Attributes::AcceptedCommandList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterWaterHeaterManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"WaterHeaterManagement.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("WaterHeaterManagement AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeWaterHeaterManagementAcceptedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeWaterHeaterManagementAcceptedCommandList() + : SubscribeAttribute("accepted-command-list") + { + } + + ~SubscribeAttributeWaterHeaterManagementAcceptedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WaterHeaterManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::WaterHeaterManagement::Attributes::AcceptedCommandList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterWaterHeaterManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeAcceptedCommandListWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"WaterHeaterManagement.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute EventList + */ +class ReadWaterHeaterManagementEventList : public ReadAttribute { +public: + ReadWaterHeaterManagementEventList() + : ReadAttribute("event-list") + { + } + + ~ReadWaterHeaterManagementEventList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WaterHeaterManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::WaterHeaterManagement::Attributes::EventList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterWaterHeaterManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"WaterHeaterManagement.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("WaterHeaterManagement EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeWaterHeaterManagementEventList : public SubscribeAttribute { +public: + SubscribeAttributeWaterHeaterManagementEventList() + : SubscribeAttribute("event-list") + { + } + + ~SubscribeAttributeWaterHeaterManagementEventList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WaterHeaterManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::WaterHeaterManagement::Attributes::EventList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterWaterHeaterManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeEventListWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"WaterHeaterManagement.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute AttributeList + */ +class ReadWaterHeaterManagementAttributeList : public ReadAttribute { +public: + ReadWaterHeaterManagementAttributeList() + : ReadAttribute("attribute-list") + { + } + + ~ReadWaterHeaterManagementAttributeList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WaterHeaterManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::WaterHeaterManagement::Attributes::AttributeList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterWaterHeaterManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"WaterHeaterManagement.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("WaterHeaterManagement AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeWaterHeaterManagementAttributeList : public SubscribeAttribute { +public: + SubscribeAttributeWaterHeaterManagementAttributeList() + : SubscribeAttribute("attribute-list") + { + } + + ~SubscribeAttributeWaterHeaterManagementAttributeList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WaterHeaterManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::WaterHeaterManagement::Attributes::AttributeList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterWaterHeaterManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeAttributeListWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"WaterHeaterManagement.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute FeatureMap + */ +class ReadWaterHeaterManagementFeatureMap : public ReadAttribute { +public: + ReadWaterHeaterManagementFeatureMap() + : ReadAttribute("feature-map") + { + } + + ~ReadWaterHeaterManagementFeatureMap() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WaterHeaterManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::WaterHeaterManagement::Attributes::FeatureMap::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterWaterHeaterManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"WaterHeaterManagement.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("WaterHeaterManagement FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeWaterHeaterManagementFeatureMap : public SubscribeAttribute { +public: + SubscribeAttributeWaterHeaterManagementFeatureMap() + : SubscribeAttribute("feature-map") + { + } + + ~SubscribeAttributeWaterHeaterManagementFeatureMap() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WaterHeaterManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::WaterHeaterManagement::Attributes::FeatureMap::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterWaterHeaterManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeFeatureMapWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"WaterHeaterManagement.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute ClusterRevision + */ +class ReadWaterHeaterManagementClusterRevision : public ReadAttribute { +public: + ReadWaterHeaterManagementClusterRevision() + : ReadAttribute("cluster-revision") + { + } + + ~ReadWaterHeaterManagementClusterRevision() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WaterHeaterManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::WaterHeaterManagement::Attributes::ClusterRevision::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterWaterHeaterManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"WaterHeaterManagement.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("WaterHeaterManagement ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeWaterHeaterManagementClusterRevision : public SubscribeAttribute { +public: + SubscribeAttributeWaterHeaterManagementClusterRevision() + : SubscribeAttribute("cluster-revision") + { + } + + ~SubscribeAttributeWaterHeaterManagementClusterRevision() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WaterHeaterManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::WaterHeaterManagement::Attributes::ClusterRevision::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterWaterHeaterManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeClusterRevisionWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"WaterHeaterManagement.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL /*----------------------------------------------------------------------------*\ | Cluster DemandResponseLoadControl | 0x0096 | @@ -188375,6 +189572,77 @@ void registerClusterElectricalEnergyMeasurement(Commands & commands) commands.RegisterCluster(clusterName, clusterCommands); } +void registerClusterWaterHeaterManagement(Commands & commands) +{ +#if MTR_ENABLE_PROVISIONAL + using namespace chip::app::Clusters::WaterHeaterManagement; + + const char * clusterName = "WaterHeaterManagement"; + + commands_list clusterCommands = { + make_unique(Id), // +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL + make_unique(Id), // + make_unique(Id), // + make_unique(Id), // +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL + }; + + commands.RegisterCluster(clusterName, clusterCommands); +#endif // MTR_ENABLE_PROVISIONAL +} void registerClusterDemandResponseLoadControl(Commands & commands) { #if MTR_ENABLE_PROVISIONAL @@ -192320,6 +193588,7 @@ void registerClusters(Commands & commands) registerClusterValveConfigurationAndControl(commands); registerClusterElectricalPowerMeasurement(commands); registerClusterElectricalEnergyMeasurement(commands); + registerClusterWaterHeaterManagement(commands); registerClusterDemandResponseLoadControl(commands); registerClusterMessages(commands); registerClusterDeviceEnergyManagement(commands); From df7ad2be0072054d209c6da9d272c1af6362bfb7 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Tue, 18 Jun 2024 18:37:55 +0100 Subject: [PATCH 20/32] Updated .zap files after adding provisional flag. --- .../all-clusters-common/all-clusters-app.zap | 11 ++++++----- src/controller/data_model/controller-clusters.zap | 3 ++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap index ceced1409f5834..a217675903bacd 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap @@ -13420,6 +13420,7 @@ "define": "WATER_HEATER_MANAGEMENT_CLUSTER", "side": "server", "enabled": 1, + "apiMaturity": "provisional", "commands": [ { "name": "Boost", @@ -13497,7 +13498,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -13513,7 +13514,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -13529,7 +13530,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -13545,7 +13546,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -13561,7 +13562,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, diff --git a/src/controller/data_model/controller-clusters.zap b/src/controller/data_model/controller-clusters.zap index a9759583747532..54c0caf764d50d 100644 --- a/src/controller/data_model/controller-clusters.zap +++ b/src/controller/data_model/controller-clusters.zap @@ -3196,6 +3196,7 @@ "define": "WATER_HEATER_MANAGEMENT_CLUSTER", "side": "client", "enabled": 1, + "apiMaturity": "provisional", "commands": [ { "name": "Boost", @@ -3225,7 +3226,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, From aa58bed8cd70454fd7d324d566d7970599670a10 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Tue, 18 Jun 2024 18:47:21 +0100 Subject: [PATCH 21/32] Added Java matter controller now that apiMaturity=provisional has popped out. --- .../clusters/WaterHeaterManagementCluster.kt | 1228 +++++++++++++++++ 1 file changed, 1228 insertions(+) create mode 100644 src/controller/java/generated/java/matter/controller/cluster/clusters/WaterHeaterManagementCluster.kt diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/WaterHeaterManagementCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/WaterHeaterManagementCluster.kt new file mode 100644 index 00000000000000..4285f7f5c4a6fc --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/WaterHeaterManagementCluster.kt @@ -0,0 +1,1228 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package matter.controller.cluster.clusters + +import java.time.Duration +import java.util.logging.Level +import java.util.logging.Logger +import kotlinx.coroutines.flow.Flow +import kotlinx.coroutines.flow.transform +import matter.controller.InvokeRequest +import matter.controller.InvokeResponse +import matter.controller.LongSubscriptionState +import matter.controller.MatterController +import matter.controller.ReadData +import matter.controller.ReadRequest +import matter.controller.SubscribeRequest +import matter.controller.SubscriptionState +import matter.controller.UByteSubscriptionState +import matter.controller.UIntSubscriptionState +import matter.controller.UShortSubscriptionState +import matter.controller.cluster.structs.* +import matter.controller.model.AttributePath +import matter.controller.model.CommandPath +import matter.tlv.AnonymousTag +import matter.tlv.ContextSpecificTag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class WaterHeaterManagementCluster( + private val controller: MatterController, + private val endpointId: UShort +) { + class GeneratedCommandListAttribute(val value: List) + + sealed class GeneratedCommandListAttributeSubscriptionState { + data class Success(val value: List) : GeneratedCommandListAttributeSubscriptionState() + + data class Error(val exception: Exception) : GeneratedCommandListAttributeSubscriptionState() + + object SubscriptionEstablished : GeneratedCommandListAttributeSubscriptionState() + } + + class AcceptedCommandListAttribute(val value: List) + + sealed class AcceptedCommandListAttributeSubscriptionState { + data class Success(val value: List) : AcceptedCommandListAttributeSubscriptionState() + + data class Error(val exception: Exception) : AcceptedCommandListAttributeSubscriptionState() + + object SubscriptionEstablished : AcceptedCommandListAttributeSubscriptionState() + } + + class EventListAttribute(val value: List) + + sealed class EventListAttributeSubscriptionState { + data class Success(val value: List) : EventListAttributeSubscriptionState() + + data class Error(val exception: Exception) : EventListAttributeSubscriptionState() + + object SubscriptionEstablished : EventListAttributeSubscriptionState() + } + + class AttributeListAttribute(val value: List) + + sealed class AttributeListAttributeSubscriptionState { + data class Success(val value: List) : AttributeListAttributeSubscriptionState() + + data class Error(val exception: Exception) : AttributeListAttributeSubscriptionState() + + object SubscriptionEstablished : AttributeListAttributeSubscriptionState() + } + + suspend fun boost( + duration: UInt, + oneShot: Boolean?, + emergencyBoost: Boolean?, + temporarySetpoint: Short?, + targetPercentage: UByte?, + targetReheat: UByte?, + timedInvokeTimeout: Duration? = null + ) { + val commandId: UInt = 0u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + + val TAG_DURATION_REQ: Int = 0 + tlvWriter.put(ContextSpecificTag(TAG_DURATION_REQ), duration) + + val TAG_ONE_SHOT_REQ: Int = 1 + oneShot?.let { tlvWriter.put(ContextSpecificTag(TAG_ONE_SHOT_REQ), oneShot) } + + val TAG_EMERGENCY_BOOST_REQ: Int = 2 + emergencyBoost?.let { + tlvWriter.put(ContextSpecificTag(TAG_EMERGENCY_BOOST_REQ), emergencyBoost) + } + + val TAG_TEMPORARY_SETPOINT_REQ: Int = 3 + temporarySetpoint?.let { + tlvWriter.put(ContextSpecificTag(TAG_TEMPORARY_SETPOINT_REQ), temporarySetpoint) + } + + val TAG_TARGET_PERCENTAGE_REQ: Int = 4 + targetPercentage?.let { + tlvWriter.put(ContextSpecificTag(TAG_TARGET_PERCENTAGE_REQ), targetPercentage) + } + + val TAG_TARGET_REHEAT_REQ: Int = 5 + targetReheat?.let { tlvWriter.put(ContextSpecificTag(TAG_TARGET_REHEAT_REQ), targetReheat) } + tlvWriter.endStructure() + + val request: InvokeRequest = + InvokeRequest( + CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), + tlvPayload = tlvWriter.getEncoded(), + timedRequest = timedInvokeTimeout + ) + + val response: InvokeResponse = controller.invoke(request) + logger.log(Level.FINE, "Invoke command succeeded: ${response}") + } + + suspend fun cancelBoost(timedInvokeTimeout: Duration? = null) { + val commandId: UInt = 1u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + tlvWriter.endStructure() + + val request: InvokeRequest = + InvokeRequest( + CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), + tlvPayload = tlvWriter.getEncoded(), + timedRequest = timedInvokeTimeout + ) + + val response: InvokeResponse = controller.invoke(request) + logger.log(Level.FINE, "Invoke command succeeded: ${response}") + } + + suspend fun readHeaterTypesAttribute(): UByte { + val ATTRIBUTE_ID: UInt = 0u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Heatertypes attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte = tlvReader.getUByte(AnonymousTag) + + return decodedValue + } + + suspend fun subscribeHeaterTypesAttribute( + minInterval: Int, + maxInterval: Int + ): Flow { + val ATTRIBUTE_ID: UInt = 0u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()) + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + UByteSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { "Heatertypes attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte = tlvReader.getUByte(AnonymousTag) + + emit(UByteSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(UByteSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readHeatDemandAttribute(): UByte { + val ATTRIBUTE_ID: UInt = 1u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Heatdemand attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte = tlvReader.getUByte(AnonymousTag) + + return decodedValue + } + + suspend fun subscribeHeatDemandAttribute( + minInterval: Int, + maxInterval: Int + ): Flow { + val ATTRIBUTE_ID: UInt = 1u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()) + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + UByteSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { "Heatdemand attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte = tlvReader.getUByte(AnonymousTag) + + emit(UByteSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(UByteSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readTankVolumeAttribute(): UShort? { + val ATTRIBUTE_ID: UInt = 2u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Tankvolume attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UShort? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUShort(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun subscribeTankVolumeAttribute( + minInterval: Int, + maxInterval: Int + ): Flow { + val ATTRIBUTE_ID: UInt = 2u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()) + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + UShortSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { "Tankvolume attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UShort? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUShort(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(UShortSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readEstimatedHeatRequiredAttribute(): Long? { + val ATTRIBUTE_ID: UInt = 3u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Estimatedheatrequired attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Long? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getLong(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun subscribeEstimatedHeatRequiredAttribute( + minInterval: Int, + maxInterval: Int + ): Flow { + val ATTRIBUTE_ID: UInt = 3u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()) + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + LongSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Estimatedheatrequired attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Long? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getLong(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(LongSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(LongSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readTankPercentageAttribute(): UByte? { + val ATTRIBUTE_ID: UInt = 4u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Tankpercentage attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUByte(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun subscribeTankPercentageAttribute( + minInterval: Int, + maxInterval: Int + ): Flow { + val ATTRIBUTE_ID: UInt = 4u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()) + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + UByteSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Tankpercentage attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUByte(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(UByteSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(UByteSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readBoostStateAttribute(): UByte { + val ATTRIBUTE_ID: UInt = 5u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Booststate attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte = tlvReader.getUByte(AnonymousTag) + + return decodedValue + } + + suspend fun subscribeBoostStateAttribute( + minInterval: Int, + maxInterval: Int + ): Flow { + val ATTRIBUTE_ID: UInt = 5u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()) + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + UByteSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { "Booststate attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte = tlvReader.getUByte(AnonymousTag) + + emit(UByteSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(UByteSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readGeneratedCommandListAttribute(): GeneratedCommandListAttribute { + val ATTRIBUTE_ID: UInt = 65528u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Generatedcommandlist attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + return GeneratedCommandListAttribute(decodedValue) + } + + suspend fun subscribeGeneratedCommandListAttribute( + minInterval: Int, + maxInterval: Int + ): Flow { + val ATTRIBUTE_ID: UInt = 65528u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()) + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + GeneratedCommandListAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Generatedcommandlist attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + emit(GeneratedCommandListAttributeSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(GeneratedCommandListAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readAcceptedCommandListAttribute(): AcceptedCommandListAttribute { + val ATTRIBUTE_ID: UInt = 65529u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Acceptedcommandlist attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + return AcceptedCommandListAttribute(decodedValue) + } + + suspend fun subscribeAcceptedCommandListAttribute( + minInterval: Int, + maxInterval: Int + ): Flow { + val ATTRIBUTE_ID: UInt = 65529u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()) + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + AcceptedCommandListAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Acceptedcommandlist attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + emit(AcceptedCommandListAttributeSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(AcceptedCommandListAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readEventListAttribute(): EventListAttribute { + val ATTRIBUTE_ID: UInt = 65530u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Eventlist attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + return EventListAttribute(decodedValue) + } + + suspend fun subscribeEventListAttribute( + minInterval: Int, + maxInterval: Int + ): Flow { + val ATTRIBUTE_ID: UInt = 65530u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()) + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + EventListAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { "Eventlist attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + emit(EventListAttributeSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(EventListAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readAttributeListAttribute(): AttributeListAttribute { + val ATTRIBUTE_ID: UInt = 65531u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Attributelist attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + return AttributeListAttribute(decodedValue) + } + + suspend fun subscribeAttributeListAttribute( + minInterval: Int, + maxInterval: Int + ): Flow { + val ATTRIBUTE_ID: UInt = 65531u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()) + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + AttributeListAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { "Attributelist attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + emit(AttributeListAttributeSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(AttributeListAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readFeatureMapAttribute(): UInt { + val ATTRIBUTE_ID: UInt = 65532u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Featuremap attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UInt = tlvReader.getUInt(AnonymousTag) + + return decodedValue + } + + suspend fun subscribeFeatureMapAttribute( + minInterval: Int, + maxInterval: Int + ): Flow { + val ATTRIBUTE_ID: UInt = 65532u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()) + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + UIntSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { "Featuremap attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UInt = tlvReader.getUInt(AnonymousTag) + + emit(UIntSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(UIntSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readClusterRevisionAttribute(): UShort { + val ATTRIBUTE_ID: UInt = 65533u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Clusterrevision attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UShort = tlvReader.getUShort(AnonymousTag) + + return decodedValue + } + + suspend fun subscribeClusterRevisionAttribute( + minInterval: Int, + maxInterval: Int + ): Flow { + val ATTRIBUTE_ID: UInt = 65533u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()) + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + UShortSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Clusterrevision attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UShort = tlvReader.getUShort(AnonymousTag) + + emit(UShortSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(UShortSubscriptionState.SubscriptionEstablished) + } + } + } + } + + companion object { + private val logger = Logger.getLogger(WaterHeaterManagementCluster::class.java.name) + const val CLUSTER_ID: UInt = 148u + } +} From ad2739997364cf8551fd91f04c7d793300454ce7 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Tue, 18 Jun 2024 18:58:22 +0100 Subject: [PATCH 22/32] Trying to remove Thread Border Router Management in controller-clusters.zap as a test. --- .../data_model/controller-clusters.zap | 76 ------------------- 1 file changed, 76 deletions(-) diff --git a/src/controller/data_model/controller-clusters.zap b/src/controller/data_model/controller-clusters.zap index 54c0caf764d50d..bfcde25322feaf 100644 --- a/src/controller/data_model/controller-clusters.zap +++ b/src/controller/data_model/controller-clusters.zap @@ -4808,82 +4808,6 @@ } ] }, - { - "name": "Thread Border Router Management", - "code": 1106, - "mfgCode": null, - "define": "THREAD_BORDER_ROUTER_MANAGEMENT", - "side": "client", - "enabled": 1, - "commands": [ - { - "name": "GetActiveDatasetRequest", - "code": 0, - "mfgCode": null, - "source": "client", - "isIncoming": 0, - "isEnabled": 1 - }, - { - "name": "GetPendingDatasetRequest", - "code": 1, - "mfgCode": null, - "source": "client", - "isIncoming": 0, - "isEnabled": 1 - }, - { - "name": "SetActiveDatasetRequest", - "code": 4, - "mfgCode": null, - "source": "client", - "isIncoming": 0, - "isEnabled": 1 - }, - { - "name": "SetPendingDatasetRequest", - "code": 5, - "mfgCode": null, - "source": "client", - "isIncoming": 0, - "isEnabled": 1 - } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "2", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, { "name": "Wake on LAN", "code": 1283, From 50308fde33aadc9612050451f490c4ec25400c5a Mon Sep 17 00:00:00 2001 From: James Harrow Date: Tue, 18 Jun 2024 19:04:58 +0100 Subject: [PATCH 23/32] Removed water-heater-management-server for now so compilers don't try to compile it. --- src/app/zap_cluster_list.json | 1 + 1 file changed, 1 insertion(+) diff --git a/src/app/zap_cluster_list.json b/src/app/zap_cluster_list.json index 5972895bfbd41a..32fd04ec372290 100644 --- a/src/app/zap_cluster_list.json +++ b/src/app/zap_cluster_list.json @@ -312,6 +312,7 @@ "WIFI_NETWORK_DIAGNOSTICS_CLUSTER": ["wifi-network-diagnostics-server"], "WIFI_NETWORK_MANAGEMENT_CLUSTER": ["wifi-network-management-server"], "WINDOW_COVERING_CLUSTER": ["window-covering-server"], + "WATER_HEATER_MANAGEMENT_CLUSTER": [], "WATER_HEATER_MANAGEMENT_CLUSTER": ["water-heater-management-server"], "ZLL_COMMISSIONING_CLUSTER": [] } From 533071233a74433ff1ef5f800893dced4ce465e5 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Tue, 18 Jun 2024 19:10:39 +0100 Subject: [PATCH 24/32] Reverted all-clusters-app.zap (removed Water heater). Reverted controller-clusters.zap (put back Thread Border Router, removed Water Heater) --- .../all-clusters-common/all-clusters-app.zap | 173 ------------------ .../data_model/controller-clusters.zap | 137 ++++++++------ 2 files changed, 76 insertions(+), 234 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap index a217675903bacd..f0afbd78296bd2 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap @@ -13413,179 +13413,6 @@ } ] }, - { - "name": "Water Heater Management", - "code": 148, - "mfgCode": null, - "define": "WATER_HEATER_MANAGEMENT_CLUSTER", - "side": "server", - "enabled": 1, - "apiMaturity": "provisional", - "commands": [ - { - "name": "Boost", - "code": 0, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - }, - { - "name": "CancelBoost", - "code": 1, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - } - ], - "attributes": [ - { - "name": "HeaterTypes", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "WaterHeaterTypeBitmap", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "HeatDemand", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "WaterHeaterDemandBitmap", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "BoostState", - "code": 5, - "mfgCode": null, - "side": "server", - "type": "BoostStateEnum", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "GeneratedCommandList", - "code": 65528, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "AcceptedCommandList", - "code": 65529, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "EventList", - "code": 65530, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "AttributeList", - "code": 65531, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] - }, { "name": "Device Energy Management", "code": 152, diff --git a/src/controller/data_model/controller-clusters.zap b/src/controller/data_model/controller-clusters.zap index bfcde25322feaf..ba03cf7709beb8 100644 --- a/src/controller/data_model/controller-clusters.zap +++ b/src/controller/data_model/controller-clusters.zap @@ -3189,67 +3189,6 @@ } ] }, - { - "name": "Water Heater Management", - "code": 148, - "mfgCode": null, - "define": "WATER_HEATER_MANAGEMENT_CLUSTER", - "side": "client", - "enabled": 1, - "apiMaturity": "provisional", - "commands": [ - { - "name": "Boost", - "code": 0, - "mfgCode": null, - "source": "client", - "isIncoming": 0, - "isEnabled": 1 - }, - { - "name": "CancelBoost", - "code": 1, - "mfgCode": null, - "source": "client", - "isIncoming": 0, - "isEnabled": 1 - } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] - }, { "name": "Device Energy Management", "code": 152, @@ -4808,6 +4747,82 @@ } ] }, + { + "name": "Thread Border Router Management", + "code": 1106, + "mfgCode": null, + "define": "THREAD_BORDER_ROUTER_MANAGEMENT", + "side": "client", + "enabled": 1, + "commands": [ + { + "name": "GetActiveDatasetRequest", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "GetPendingDatasetRequest", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "DatasetResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "SetActiveDatasetRequest", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, { "name": "Wake on LAN", "code": 1283, From 2cbeab7ae0551c627b63cec32e9bba38f901744c Mon Sep 17 00:00:00 2001 From: James Harrow Date: Tue, 18 Jun 2024 19:22:56 +0100 Subject: [PATCH 25/32] updated all-clusters-app.matter after removing WaterHeaterManagement cluster (to avoid compile failures). --- .../all-clusters-app.matter | 73 ------------------- 1 file changed, 73 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index 79ee652f1d214d..b5d847383c760e 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -4068,64 +4068,6 @@ cluster ElectricalEnergyMeasurement = 145 { readonly attribute int16u clusterRevision = 65533; } -/** This cluster is used to allow clients to control the operation of a hot water heating appliance so that it can be used with energy management. */ -provisional cluster WaterHeaterManagement = 148 { - revision 1; - - enum BoostStateEnum : enum8 { - kInactive = 0; - kActive = 1; - } - - bitmap Feature : bitmap32 { - kEnergyManagement = 0x1; - kTankPercent = 0x2; - } - - bitmap WaterHeaterDemandBitmap : bitmap8 { - kImmersionElement1 = 0x1; - kImmersionElement2 = 0x2; - kHeatPump = 0x4; - kBoiler = 0x8; - kOther = 0x10; - } - - bitmap WaterHeaterTypeBitmap : bitmap8 { - kImmersionElement1 = 0x1; - kImmersionElement2 = 0x2; - kHeatPump = 0x4; - kBoiler = 0x8; - kOther = 0x10; - } - - readonly attribute WaterHeaterTypeBitmap heaterTypes = 0; - readonly attribute WaterHeaterDemandBitmap heatDemand = 1; - readonly attribute optional int16u tankVolume = 2; - readonly attribute optional energy_mwh estimatedHeatRequired = 3; - readonly attribute optional percent tankPercentage = 4; - readonly attribute BoostStateEnum boostState = 5; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; - - request struct BoostRequest { - elapsed_s duration = 0; - optional boolean oneShot = 1; - optional boolean emergencyBoost = 2; - optional temperature temporarySetpoint = 3; - optional percent targetPercentage = 4; - optional percent targetReheat = 5; - } - - /** Allows a client to request that the water heater is put into a Boost state. */ - command access(invoke: manage) Boost(BoostRequest): DefaultSuccess = 0; - /** Allows a client to cancel an ongoing Boost operation. */ - command access(invoke: manage) CancelBoost(): DefaultSuccess = 1; -} - /** This cluster allows a client to manage the power draw of a device. An example of such a client could be an Energy Management System (EMS) which controls an Energy Smart Appliance (ESA). */ provisional cluster DeviceEnergyManagement = 152 { revision 4; @@ -8397,21 +8339,6 @@ endpoint 1 { ram attribute clusterRevision default = 1; } - server cluster WaterHeaterManagement { - ram attribute heaterTypes default = 0x00; - ram attribute heatDemand default = 0x00; - ram attribute boostState default = 0; - callback attribute generatedCommandList; - callback attribute acceptedCommandList; - callback attribute eventList; - callback attribute attributeList; - callback attribute featureMap; - ram attribute clusterRevision default = 1; - - handle command Boost; - handle command CancelBoost; - } - server cluster DeviceEnergyManagement { emits event PowerAdjustStart; emits event PowerAdjustEnd; From 494412727b778d86d6b57dc51c5d740e3644abf9 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Tue, 18 Jun 2024 20:01:14 +0100 Subject: [PATCH 26/32] Candidate fix for THREAD_BORDER_ROUTER_MANAGEMENT_CLUSTER which resolves the error. [Should be a duplicate of PR #34000 when that merges. --- .../data-model/chip/thread-border-router-management-cluster.xml | 2 +- src/controller/data_model/controller-clusters.zap | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/zap-templates/zcl/data-model/chip/thread-border-router-management-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/thread-border-router-management-cluster.xml index 2f87416f815b80..2c1cd01d67c7b2 100644 --- a/src/app/zap-templates/zcl/data-model/chip/thread-border-router-management-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/thread-border-router-management-cluster.xml @@ -26,7 +26,7 @@ limitations under the License. HRAP Thread Border Router Management 0x0452 - THREAD_BORDER_ROUTER_MANAGEMENT + THREAD_BORDER_ROUTER_MANAGEMENT_CLUSTER true true Manage the Thread network of Thread Border Router diff --git a/src/controller/data_model/controller-clusters.zap b/src/controller/data_model/controller-clusters.zap index ba03cf7709beb8..91ac9927b7268d 100644 --- a/src/controller/data_model/controller-clusters.zap +++ b/src/controller/data_model/controller-clusters.zap @@ -4751,7 +4751,7 @@ "name": "Thread Border Router Management", "code": 1106, "mfgCode": null, - "define": "THREAD_BORDER_ROUTER_MANAGEMENT", + "define": "THREAD_BORDER_ROUTER_MANAGEMENT_CLUSTER", "side": "client", "enabled": 1, "commands": [ From 3c3af3a8b57f0d5f244f8064f33356d357a07d2f Mon Sep 17 00:00:00 2001 From: pcoleman Date: Wed, 26 Jun 2024 14:26:07 +0100 Subject: [PATCH 27/32] Addressing review comments from Boris --- src/app/zap-templates/zcl/zcl-with-test-extensions.json | 1 - src/app/zap-templates/zcl/zcl.json | 1 - src/app/zap_cluster_list.json | 3 --- 3 files changed, 5 deletions(-) diff --git a/src/app/zap-templates/zcl/zcl-with-test-extensions.json b/src/app/zap-templates/zcl/zcl-with-test-extensions.json index 11c89aa3f9db99..da2af88accf245 100644 --- a/src/app/zap-templates/zcl/zcl-with-test-extensions.json +++ b/src/app/zap-templates/zcl/zcl-with-test-extensions.json @@ -638,7 +638,6 @@ "Power Topology": ["FeatureMap"], "Valve Configuration and Control": ["RemainingDuration"], "Boolean State Configuration": ["CurrentSensitivityLevel"], - "Water Heater Management": ["FeatureMap"], "Wi-Fi Network Management": ["SSID"] }, "defaultReportingPolicy": "mandatory", diff --git a/src/app/zap-templates/zcl/zcl.json b/src/app/zap-templates/zcl/zcl.json index 8e16b26072364b..79d4a3b88278f3 100644 --- a/src/app/zap-templates/zcl/zcl.json +++ b/src/app/zap-templates/zcl/zcl.json @@ -636,7 +636,6 @@ "Power Topology": ["FeatureMap"], "Valve Configuration and Control": ["RemainingDuration"], "Boolean State Configuration": ["CurrentSensitivityLevel"], - "Water Heater Management": ["FeatureMap"], "Wi-Fi Network Management": ["SSID"] }, "defaultReportingPolicy": "mandatory", diff --git a/src/app/zap_cluster_list.json b/src/app/zap_cluster_list.json index 32fd04ec372290..4c7757224b1a7d 100644 --- a/src/app/zap_cluster_list.json +++ b/src/app/zap_cluster_list.json @@ -129,7 +129,6 @@ "WAKE_ON_LAN_CLUSTER": [], "LAUNDRY_WASHER_CONTROLS_CLUSTER": [], "LAUNDRY_DRYER_CONTROLS_CLUSTER": [], - "WATER_HEATER_MANAGEMENT_CLUSTER": [], "WIFI_NETWORK_DIAGNOSTICS_CLUSTER": [], "WINDOW_COVERING_CLUSTER": [], "ZLL_COMMISSIONING_CLUSTER": [] @@ -312,8 +311,6 @@ "WIFI_NETWORK_DIAGNOSTICS_CLUSTER": ["wifi-network-diagnostics-server"], "WIFI_NETWORK_MANAGEMENT_CLUSTER": ["wifi-network-management-server"], "WINDOW_COVERING_CLUSTER": ["window-covering-server"], - "WATER_HEATER_MANAGEMENT_CLUSTER": [], - "WATER_HEATER_MANAGEMENT_CLUSTER": ["water-heater-management-server"], "ZLL_COMMISSIONING_CLUSTER": [] } } From 3ba3ff91032796d215d2ecf82e354ebedb41b62e Mon Sep 17 00:00:00 2001 From: pcoleman Date: Wed, 26 Jun 2024 14:46:14 +0100 Subject: [PATCH 28/32] Regenerate files --- .../zap-generated/attributes/Accessors.cpp | 47 +++++++++++++++++++ .../zap-generated/attributes/Accessors.h | 6 +++ 2 files changed, 53 insertions(+) diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp index 6f2533dbf2cf11..fa201901e0b88f 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp @@ -15294,6 +15294,53 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::app::Cl } // namespace BoostState +namespace FeatureMap { + +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint32_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::WaterHeaterManagement::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::WaterHeaterManagement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE, + markDirty); +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::WaterHeaterManagement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); +} + +} // namespace FeatureMap + namespace ClusterRevision { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h index 869a58cd5fb35b..5a9a55fac3f746 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h @@ -2519,6 +2519,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::app::Cl MarkAttributeDirty markDirty); } // namespace BoostState +namespace FeatureMap { +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint32_t * value); // bitmap32 +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value); +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty); +} // namespace FeatureMap + namespace ClusterRevision { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value); // int16u Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value); From 3fbdfecdf694066a2e424f50ff0f3be16fbade92 Mon Sep 17 00:00:00 2001 From: pcoleman Date: Wed, 26 Jun 2024 16:34:43 +0100 Subject: [PATCH 29/32] Regenerate files correctly --- ...gyEvseClusterEnergyTransferStartedEvent.kt | 3 +- ...gyEvseClusterEnergyTransferStoppedEvent.kt | 2 + ...EvseClusterChargingTargetScheduleStruct.kt | 4 +- .../clusters/WaterHeaterManagementCluster.kt | 56 +++++++++---------- ...gyEvseClusterEnergyTransferStartedEvent.kt | 3 +- ...gyEvseClusterEnergyTransferStoppedEvent.kt | 2 + ...EvseClusterChargingTargetScheduleStruct.kt | 2 +- 7 files changed, 39 insertions(+), 33 deletions(-) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/EnergyEvseClusterEnergyTransferStartedEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/EnergyEvseClusterEnergyTransferStartedEvent.kt index 93497b7ab7bb3c..a4260a87133977 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/EnergyEvseClusterEnergyTransferStartedEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/EnergyEvseClusterEnergyTransferStartedEvent.kt @@ -27,6 +27,7 @@ class EnergyEvseClusterEnergyTransferStartedEvent( val sessionID: ULong, val state: UInt, val maximumCurrent: Long, + val maximumDischargingCurrent: Optional, ) { override fun toString(): String = buildString { append("EnergyEvseClusterEnergyTransferStartedEvent {\n") @@ -75,7 +76,7 @@ class EnergyEvseClusterEnergyTransferStartedEvent( sessionID, state, maximumCurrent, - maximumDischargingCurrent + maximumDischargingCurrent, ) } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/EnergyEvseClusterEnergyTransferStoppedEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/EnergyEvseClusterEnergyTransferStoppedEvent.kt index 3f1491cd845f39..b6c3f8cc88f71b 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/EnergyEvseClusterEnergyTransferStoppedEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/EnergyEvseClusterEnergyTransferStoppedEvent.kt @@ -28,6 +28,7 @@ class EnergyEvseClusterEnergyTransferStoppedEvent( val state: UInt, val reason: UInt, val energyTransferred: Long, + val energyDischarged: Optional, ) { override fun toString(): String = buildString { append("EnergyEvseClusterEnergyTransferStoppedEvent {\n") @@ -81,6 +82,7 @@ class EnergyEvseClusterEnergyTransferStoppedEvent( state, reason, energyTransferred, + energyDischarged, ) } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/EnergyEvseClusterChargingTargetScheduleStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/EnergyEvseClusterChargingTargetScheduleStruct.kt index d5b637e3c72256..bd367283c4afba 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/EnergyEvseClusterChargingTargetScheduleStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/EnergyEvseClusterChargingTargetScheduleStruct.kt @@ -25,8 +25,8 @@ import matter.tlv.TlvReader import matter.tlv.TlvWriter class EnergyEvseClusterChargingTargetScheduleStruct( - val dayOfWeekForSequence: UInt, - val chargingTargets: List, + val dayOfWeekForSequence: Optional, + val chargingTargets: Optional>, ) { override fun toString(): String = buildString { append("EnergyEvseClusterChargingTargetScheduleStruct {\n") diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/WaterHeaterManagementCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/WaterHeaterManagementCluster.kt index 4285f7f5c4a6fc..7d0ce89e2a612e 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/WaterHeaterManagementCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/WaterHeaterManagementCluster.kt @@ -43,7 +43,7 @@ import matter.tlv.TlvWriter class WaterHeaterManagementCluster( private val controller: MatterController, - private val endpointId: UShort + private val endpointId: UShort, ) { class GeneratedCommandListAttribute(val value: List) @@ -92,7 +92,7 @@ class WaterHeaterManagementCluster( temporarySetpoint: Short?, targetPercentage: UByte?, targetReheat: UByte?, - timedInvokeTimeout: Duration? = null + timedInvokeTimeout: Duration? = null, ) { val commandId: UInt = 0u @@ -128,7 +128,7 @@ class WaterHeaterManagementCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timedInvokeTimeout + timedRequest = timedInvokeTimeout, ) val response: InvokeResponse = controller.invoke(request) @@ -146,7 +146,7 @@ class WaterHeaterManagementCluster( InvokeRequest( CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), tlvPayload = tlvWriter.getEncoded(), - timedRequest = timedInvokeTimeout + timedRequest = timedInvokeTimeout, ) val response: InvokeResponse = controller.invoke(request) @@ -186,7 +186,7 @@ class WaterHeaterManagementCluster( suspend fun subscribeHeaterTypesAttribute( minInterval: Int, - maxInterval: Int + maxInterval: Int, ): Flow { val ATTRIBUTE_ID: UInt = 0u val attributePaths = @@ -199,7 +199,7 @@ class WaterHeaterManagementCluster( eventPaths = emptyList(), attributePaths = attributePaths, minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()) + maxInterval = Duration.ofSeconds(maxInterval.toLong()), ) return controller.subscribe(subscribeRequest).transform { subscriptionState -> @@ -267,7 +267,7 @@ class WaterHeaterManagementCluster( suspend fun subscribeHeatDemandAttribute( minInterval: Int, - maxInterval: Int + maxInterval: Int, ): Flow { val ATTRIBUTE_ID: UInt = 1u val attributePaths = @@ -280,7 +280,7 @@ class WaterHeaterManagementCluster( eventPaths = emptyList(), attributePaths = attributePaths, minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()) + maxInterval = Duration.ofSeconds(maxInterval.toLong()), ) return controller.subscribe(subscribeRequest).transform { subscriptionState -> @@ -353,7 +353,7 @@ class WaterHeaterManagementCluster( suspend fun subscribeTankVolumeAttribute( minInterval: Int, - maxInterval: Int + maxInterval: Int, ): Flow { val ATTRIBUTE_ID: UInt = 2u val attributePaths = @@ -366,7 +366,7 @@ class WaterHeaterManagementCluster( eventPaths = emptyList(), attributePaths = attributePaths, minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()) + maxInterval = Duration.ofSeconds(maxInterval.toLong()), ) return controller.subscribe(subscribeRequest).transform { subscriptionState -> @@ -444,7 +444,7 @@ class WaterHeaterManagementCluster( suspend fun subscribeEstimatedHeatRequiredAttribute( minInterval: Int, - maxInterval: Int + maxInterval: Int, ): Flow { val ATTRIBUTE_ID: UInt = 3u val attributePaths = @@ -457,7 +457,7 @@ class WaterHeaterManagementCluster( eventPaths = emptyList(), attributePaths = attributePaths, minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()) + maxInterval = Duration.ofSeconds(maxInterval.toLong()), ) return controller.subscribe(subscribeRequest).transform { subscriptionState -> @@ -537,7 +537,7 @@ class WaterHeaterManagementCluster( suspend fun subscribeTankPercentageAttribute( minInterval: Int, - maxInterval: Int + maxInterval: Int, ): Flow { val ATTRIBUTE_ID: UInt = 4u val attributePaths = @@ -550,7 +550,7 @@ class WaterHeaterManagementCluster( eventPaths = emptyList(), attributePaths = attributePaths, minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()) + maxInterval = Duration.ofSeconds(maxInterval.toLong()), ) return controller.subscribe(subscribeRequest).transform { subscriptionState -> @@ -625,7 +625,7 @@ class WaterHeaterManagementCluster( suspend fun subscribeBoostStateAttribute( minInterval: Int, - maxInterval: Int + maxInterval: Int, ): Flow { val ATTRIBUTE_ID: UInt = 5u val attributePaths = @@ -638,7 +638,7 @@ class WaterHeaterManagementCluster( eventPaths = emptyList(), attributePaths = attributePaths, minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()) + maxInterval = Duration.ofSeconds(maxInterval.toLong()), ) return controller.subscribe(subscribeRequest).transform { subscriptionState -> @@ -713,7 +713,7 @@ class WaterHeaterManagementCluster( suspend fun subscribeGeneratedCommandListAttribute( minInterval: Int, - maxInterval: Int + maxInterval: Int, ): Flow { val ATTRIBUTE_ID: UInt = 65528u val attributePaths = @@ -726,7 +726,7 @@ class WaterHeaterManagementCluster( eventPaths = emptyList(), attributePaths = attributePaths, minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()) + maxInterval = Duration.ofSeconds(maxInterval.toLong()), ) return controller.subscribe(subscribeRequest).transform { subscriptionState -> @@ -810,7 +810,7 @@ class WaterHeaterManagementCluster( suspend fun subscribeAcceptedCommandListAttribute( minInterval: Int, - maxInterval: Int + maxInterval: Int, ): Flow { val ATTRIBUTE_ID: UInt = 65529u val attributePaths = @@ -823,7 +823,7 @@ class WaterHeaterManagementCluster( eventPaths = emptyList(), attributePaths = attributePaths, minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()) + maxInterval = Duration.ofSeconds(maxInterval.toLong()), ) return controller.subscribe(subscribeRequest).transform { subscriptionState -> @@ -907,7 +907,7 @@ class WaterHeaterManagementCluster( suspend fun subscribeEventListAttribute( minInterval: Int, - maxInterval: Int + maxInterval: Int, ): Flow { val ATTRIBUTE_ID: UInt = 65530u val attributePaths = @@ -920,7 +920,7 @@ class WaterHeaterManagementCluster( eventPaths = emptyList(), attributePaths = attributePaths, minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()) + maxInterval = Duration.ofSeconds(maxInterval.toLong()), ) return controller.subscribe(subscribeRequest).transform { subscriptionState -> @@ -1002,7 +1002,7 @@ class WaterHeaterManagementCluster( suspend fun subscribeAttributeListAttribute( minInterval: Int, - maxInterval: Int + maxInterval: Int, ): Flow { val ATTRIBUTE_ID: UInt = 65531u val attributePaths = @@ -1015,7 +1015,7 @@ class WaterHeaterManagementCluster( eventPaths = emptyList(), attributePaths = attributePaths, minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()) + maxInterval = Duration.ofSeconds(maxInterval.toLong()), ) return controller.subscribe(subscribeRequest).transform { subscriptionState -> @@ -1090,7 +1090,7 @@ class WaterHeaterManagementCluster( suspend fun subscribeFeatureMapAttribute( minInterval: Int, - maxInterval: Int + maxInterval: Int, ): Flow { val ATTRIBUTE_ID: UInt = 65532u val attributePaths = @@ -1103,7 +1103,7 @@ class WaterHeaterManagementCluster( eventPaths = emptyList(), attributePaths = attributePaths, minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()) + maxInterval = Duration.ofSeconds(maxInterval.toLong()), ) return controller.subscribe(subscribeRequest).transform { subscriptionState -> @@ -1171,7 +1171,7 @@ class WaterHeaterManagementCluster( suspend fun subscribeClusterRevisionAttribute( minInterval: Int, - maxInterval: Int + maxInterval: Int, ): Flow { val ATTRIBUTE_ID: UInt = 65533u val attributePaths = @@ -1184,7 +1184,7 @@ class WaterHeaterManagementCluster( eventPaths = emptyList(), attributePaths = attributePaths, minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()) + maxInterval = Duration.ofSeconds(maxInterval.toLong()), ) return controller.subscribe(subscribeRequest).transform { subscriptionState -> diff --git a/src/controller/java/generated/java/matter/controller/cluster/eventstructs/EnergyEvseClusterEnergyTransferStartedEvent.kt b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/EnergyEvseClusterEnergyTransferStartedEvent.kt index 9445f32a16d7a3..41c82109c4716b 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/eventstructs/EnergyEvseClusterEnergyTransferStartedEvent.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/EnergyEvseClusterEnergyTransferStartedEvent.kt @@ -27,6 +27,7 @@ class EnergyEvseClusterEnergyTransferStartedEvent( val sessionID: UInt, val state: UByte, val maximumCurrent: Long, + val maximumDischargingCurrent: Optional, ) { override fun toString(): String = buildString { append("EnergyEvseClusterEnergyTransferStartedEvent {\n") @@ -75,7 +76,7 @@ class EnergyEvseClusterEnergyTransferStartedEvent( sessionID, state, maximumCurrent, - maximumDischargingCurrent + maximumDischargingCurrent, ) } } diff --git a/src/controller/java/generated/java/matter/controller/cluster/eventstructs/EnergyEvseClusterEnergyTransferStoppedEvent.kt b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/EnergyEvseClusterEnergyTransferStoppedEvent.kt index 62da1699d25203..56c91b5c1beb71 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/eventstructs/EnergyEvseClusterEnergyTransferStoppedEvent.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/EnergyEvseClusterEnergyTransferStoppedEvent.kt @@ -28,6 +28,7 @@ class EnergyEvseClusterEnergyTransferStoppedEvent( val state: UByte, val reason: UByte, val energyTransferred: Long, + val energyDischarged: Optional, ) { override fun toString(): String = buildString { append("EnergyEvseClusterEnergyTransferStoppedEvent {\n") @@ -81,6 +82,7 @@ class EnergyEvseClusterEnergyTransferStoppedEvent( state, reason, energyTransferred, + energyDischarged, ) } } diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/EnergyEvseClusterChargingTargetScheduleStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/EnergyEvseClusterChargingTargetScheduleStruct.kt index 417b0657103494..09d6cb2fb9039e 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/structs/EnergyEvseClusterChargingTargetScheduleStruct.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/EnergyEvseClusterChargingTargetScheduleStruct.kt @@ -26,7 +26,7 @@ import matter.tlv.TlvWriter class EnergyEvseClusterChargingTargetScheduleStruct( val dayOfWeekForSequence: Optional, - val chargingTargets: Optional> + val chargingTargets: Optional>, ) { override fun toString(): String = buildString { append("EnergyEvseClusterChargingTargetScheduleStruct {\n") From e43ff1e747e02b33d58a59f903b363eb736a0d10 Mon Sep 17 00:00:00 2001 From: pcoleman Date: Thu, 27 Jun 2024 08:25:32 +0100 Subject: [PATCH 30/32] Removal optional conformance fro DayOfWeekForSequence/ChargingTargets fields in ChargingTargetScheduleStruct + regen zap files --- .../all-clusters-app.matter | 4 +- .../energy-management-app.matter | 4 +- .../data-model/chip/energy-evse-cluster.xml | 4 +- .../data_model/controller-clusters.matter | 4 +- .../chip/devicecontroller/ChipStructs.java | 20 ++-- ...EvseClusterChargingTargetScheduleStruct.kt | 46 +++----- ...EvseClusterChargingTargetScheduleStruct.kt | 45 +++---- .../python/chip/clusters/Objects.py | 8 +- .../zap-generated/MTRCommandPayloadsObjc.mm | 110 ++++++++---------- .../CHIP/zap-generated/MTRStructsObjc.h | 4 +- .../CHIP/zap-generated/MTRStructsObjc.mm | 4 +- .../zap-generated/cluster-objects.h | 8 +- .../cluster/ComplexArgumentParser.cpp | 21 ++-- .../zap-generated/cluster/Commands.h | 44 +++---- 14 files changed, 134 insertions(+), 192 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index b5d847383c760e..65f9db4b9bda57 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -4363,8 +4363,8 @@ cluster EnergyEvse = 153 { } struct ChargingTargetScheduleStruct { - optional TargetDayOfWeekBitmap dayOfWeekForSequence = 0; - optional ChargingTargetStruct chargingTargets[] = 1; + TargetDayOfWeekBitmap dayOfWeekForSequence = 0; + ChargingTargetStruct chargingTargets[] = 1; } info event EVConnected = 0 { diff --git a/examples/energy-management-app/energy-management-common/energy-management-app.matter b/examples/energy-management-app/energy-management-common/energy-management-app.matter index b8ffbf598d129c..299c8969f2c2ea 100644 --- a/examples/energy-management-app/energy-management-common/energy-management-app.matter +++ b/examples/energy-management-app/energy-management-common/energy-management-app.matter @@ -1723,8 +1723,8 @@ cluster EnergyEvse = 153 { } struct ChargingTargetScheduleStruct { - optional TargetDayOfWeekBitmap dayOfWeekForSequence = 0; - optional ChargingTargetStruct chargingTargets[] = 1; + TargetDayOfWeekBitmap dayOfWeekForSequence = 0; + ChargingTargetStruct chargingTargets[] = 1; } info event EVConnected = 0 { diff --git a/src/app/zap-templates/zcl/data-model/chip/energy-evse-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/energy-evse-cluster.xml index 8a34a0cc32f1bb..c7de452a53341f 100644 --- a/src/app/zap-templates/zcl/data-model/chip/energy-evse-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/energy-evse-cluster.xml @@ -82,8 +82,8 @@ limitations under the License. - - + + diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index c856a1c88abd1c..09a5c9c5abf584 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -4946,8 +4946,8 @@ cluster EnergyEvse = 153 { } struct ChargingTargetScheduleStruct { - optional TargetDayOfWeekBitmap dayOfWeekForSequence = 0; - optional ChargingTargetStruct chargingTargets[] = 1; + TargetDayOfWeekBitmap dayOfWeekForSequence = 0; + ChargingTargetStruct chargingTargets[] = 1; } info event EVConnected = 0 { diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java b/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java index 4982d68ded5233..426e73b9ab524a 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java @@ -8230,14 +8230,14 @@ public String toString() { } } public static class EnergyEvseClusterChargingTargetScheduleStruct { - public Optional dayOfWeekForSequence; - public Optional> chargingTargets; + public Integer dayOfWeekForSequence; + public ArrayList chargingTargets; private static final long DAY_OF_WEEK_FOR_SEQUENCE_ID = 0L; private static final long CHARGING_TARGETS_ID = 1L; public EnergyEvseClusterChargingTargetScheduleStruct( - Optional dayOfWeekForSequence, - Optional> chargingTargets + Integer dayOfWeekForSequence, + ArrayList chargingTargets ) { this.dayOfWeekForSequence = dayOfWeekForSequence; this.chargingTargets = chargingTargets; @@ -8245,8 +8245,8 @@ public EnergyEvseClusterChargingTargetScheduleStruct( public StructType encodeTlv() { ArrayList values = new ArrayList<>(); - values.add(new StructElement(DAY_OF_WEEK_FOR_SEQUENCE_ID, dayOfWeekForSequence.map((nonOptionaldayOfWeekForSequence) -> new UIntType(nonOptionaldayOfWeekForSequence)).orElse(new EmptyType()))); - values.add(new StructElement(CHARGING_TARGETS_ID, chargingTargets.map((nonOptionalchargingTargets) -> ArrayType.generateArrayType(nonOptionalchargingTargets, (elementnonOptionalchargingTargets) -> elementnonOptionalchargingTargets.encodeTlv())).orElse(new EmptyType()))); + values.add(new StructElement(DAY_OF_WEEK_FOR_SEQUENCE_ID, new UIntType(dayOfWeekForSequence))); + values.add(new StructElement(CHARGING_TARGETS_ID, ArrayType.generateArrayType(chargingTargets, (elementchargingTargets) -> elementchargingTargets.encodeTlv()))); return new StructType(values); } @@ -8255,18 +8255,18 @@ public static EnergyEvseClusterChargingTargetScheduleStruct decodeTlv(BaseTLVTyp if (tlvValue == null || tlvValue.type() != TLVType.Struct) { return null; } - Optional dayOfWeekForSequence = Optional.empty(); - Optional> chargingTargets = Optional.empty(); + Integer dayOfWeekForSequence = null; + ArrayList chargingTargets = null; for (StructElement element: ((StructType)tlvValue).value()) { if (element.contextTagNum() == DAY_OF_WEEK_FOR_SEQUENCE_ID) { if (element.value(BaseTLVType.class).type() == TLVType.UInt) { UIntType castingValue = element.value(UIntType.class); - dayOfWeekForSequence = Optional.of(castingValue.value(Integer.class)); + dayOfWeekForSequence = castingValue.value(Integer.class); } } else if (element.contextTagNum() == CHARGING_TARGETS_ID) { if (element.value(BaseTLVType.class).type() == TLVType.Array) { ArrayType castingValue = element.value(ArrayType.class); - chargingTargets = Optional.of(castingValue.map((elementcastingValue) -> ChipStructs.EnergyEvseClusterChargingTargetStruct.decodeTlv(elementcastingValue))); + chargingTargets = castingValue.map((elementcastingValue) -> ChipStructs.EnergyEvseClusterChargingTargetStruct.decodeTlv(elementcastingValue)); } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/EnergyEvseClusterChargingTargetScheduleStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/EnergyEvseClusterChargingTargetScheduleStruct.kt index bd367283c4afba..adf9332f760761 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/EnergyEvseClusterChargingTargetScheduleStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/EnergyEvseClusterChargingTargetScheduleStruct.kt @@ -17,7 +17,6 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* -import java.util.Optional import matter.tlv.AnonymousTag import matter.tlv.ContextSpecificTag import matter.tlv.Tag @@ -25,8 +24,8 @@ import matter.tlv.TlvReader import matter.tlv.TlvWriter class EnergyEvseClusterChargingTargetScheduleStruct( - val dayOfWeekForSequence: Optional, - val chargingTargets: Optional>, + val dayOfWeekForSequence: UInt, + val chargingTargets: List, ) { override fun toString(): String = buildString { append("EnergyEvseClusterChargingTargetScheduleStruct {\n") @@ -38,18 +37,12 @@ class EnergyEvseClusterChargingTargetScheduleStruct( fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { tlvWriter.apply { startStructure(tlvTag) - if (dayOfWeekForSequence.isPresent) { - val optdayOfWeekForSequence = dayOfWeekForSequence.get() - put(ContextSpecificTag(TAG_DAY_OF_WEEK_FOR_SEQUENCE), optdayOfWeekForSequence) - } - if (chargingTargets.isPresent) { - val optchargingTargets = chargingTargets.get() - startArray(ContextSpecificTag(TAG_CHARGING_TARGETS)) - for (item in optchargingTargets.iterator()) { - item.toTlv(AnonymousTag, this) - } - endArray() + put(ContextSpecificTag(TAG_DAY_OF_WEEK_FOR_SEQUENCE), dayOfWeekForSequence) + startArray(ContextSpecificTag(TAG_CHARGING_TARGETS)) + for (item in chargingTargets.iterator()) { + item.toTlv(AnonymousTag, this) } + endArray() endStructure() } } @@ -60,25 +53,14 @@ class EnergyEvseClusterChargingTargetScheduleStruct( fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): EnergyEvseClusterChargingTargetScheduleStruct { tlvReader.enterStructure(tlvTag) - val dayOfWeekForSequence = - if (tlvReader.isNextTag(ContextSpecificTag(TAG_DAY_OF_WEEK_FOR_SEQUENCE))) { - Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_DAY_OF_WEEK_FOR_SEQUENCE))) - } else { - Optional.empty() - } + val dayOfWeekForSequence = tlvReader.getUInt(ContextSpecificTag(TAG_DAY_OF_WEEK_FOR_SEQUENCE)) val chargingTargets = - if (tlvReader.isNextTag(ContextSpecificTag(TAG_CHARGING_TARGETS))) { - Optional.of( - buildList { - tlvReader.enterArray(ContextSpecificTag(TAG_CHARGING_TARGETS)) - while (!tlvReader.isEndOfContainer()) { - add(EnergyEvseClusterChargingTargetStruct.fromTlv(AnonymousTag, tlvReader)) - } - tlvReader.exitContainer() - } - ) - } else { - Optional.empty() + buildList { + tlvReader.enterArray(ContextSpecificTag(TAG_CHARGING_TARGETS)) + while (!tlvReader.isEndOfContainer()) { + add(EnergyEvseClusterChargingTargetStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() } tlvReader.exitContainer() diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/EnergyEvseClusterChargingTargetScheduleStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/EnergyEvseClusterChargingTargetScheduleStruct.kt index 09d6cb2fb9039e..a293094e84b288 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/structs/EnergyEvseClusterChargingTargetScheduleStruct.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/EnergyEvseClusterChargingTargetScheduleStruct.kt @@ -16,7 +16,6 @@ */ package matter.controller.cluster.structs -import java.util.Optional import matter.controller.cluster.* import matter.tlv.AnonymousTag import matter.tlv.ContextSpecificTag @@ -25,8 +24,8 @@ import matter.tlv.TlvReader import matter.tlv.TlvWriter class EnergyEvseClusterChargingTargetScheduleStruct( - val dayOfWeekForSequence: Optional, - val chargingTargets: Optional>, + val dayOfWeekForSequence: UByte, + val chargingTargets: List, ) { override fun toString(): String = buildString { append("EnergyEvseClusterChargingTargetScheduleStruct {\n") @@ -38,18 +37,12 @@ class EnergyEvseClusterChargingTargetScheduleStruct( fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { tlvWriter.apply { startStructure(tlvTag) - if (dayOfWeekForSequence.isPresent) { - val optdayOfWeekForSequence = dayOfWeekForSequence.get() - put(ContextSpecificTag(TAG_DAY_OF_WEEK_FOR_SEQUENCE), optdayOfWeekForSequence) - } - if (chargingTargets.isPresent) { - val optchargingTargets = chargingTargets.get() - startArray(ContextSpecificTag(TAG_CHARGING_TARGETS)) - for (item in optchargingTargets.iterator()) { - item.toTlv(AnonymousTag, this) - } - endArray() + put(ContextSpecificTag(TAG_DAY_OF_WEEK_FOR_SEQUENCE), dayOfWeekForSequence) + startArray(ContextSpecificTag(TAG_CHARGING_TARGETS)) + for (item in chargingTargets.iterator()) { + item.toTlv(AnonymousTag, this) } + endArray() endStructure() } } @@ -61,24 +54,14 @@ class EnergyEvseClusterChargingTargetScheduleStruct( fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): EnergyEvseClusterChargingTargetScheduleStruct { tlvReader.enterStructure(tlvTag) val dayOfWeekForSequence = - if (tlvReader.isNextTag(ContextSpecificTag(TAG_DAY_OF_WEEK_FOR_SEQUENCE))) { - Optional.of(tlvReader.getUByte(ContextSpecificTag(TAG_DAY_OF_WEEK_FOR_SEQUENCE))) - } else { - Optional.empty() - } + tlvReader.getUByte(ContextSpecificTag(TAG_DAY_OF_WEEK_FOR_SEQUENCE)) val chargingTargets = - if (tlvReader.isNextTag(ContextSpecificTag(TAG_CHARGING_TARGETS))) { - Optional.of( - buildList { - tlvReader.enterArray(ContextSpecificTag(TAG_CHARGING_TARGETS)) - while (!tlvReader.isEndOfContainer()) { - add(EnergyEvseClusterChargingTargetStruct.fromTlv(AnonymousTag, tlvReader)) - } - tlvReader.exitContainer() - } - ) - } else { - Optional.empty() + buildList { + tlvReader.enterArray(ContextSpecificTag(TAG_CHARGING_TARGETS)) + while (!tlvReader.isEndOfContainer()) { + add(EnergyEvseClusterChargingTargetStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() } tlvReader.exitContainer() diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 355f8ef0c64e86..8249c2482237b5 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -25330,12 +25330,12 @@ class ChargingTargetScheduleStruct(ClusterObject): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="dayOfWeekForSequence", Tag=0, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="chargingTargets", Tag=1, Type=typing.Optional[typing.List[EnergyEvse.Structs.ChargingTargetStruct]]), + ClusterObjectFieldDescriptor(Label="dayOfWeekForSequence", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="chargingTargets", Tag=1, Type=typing.List[EnergyEvse.Structs.ChargingTargetStruct]), ]) - dayOfWeekForSequence: 'typing.Optional[uint]' = None - chargingTargets: 'typing.Optional[typing.List[EnergyEvse.Structs.ChargingTargetStruct]]' = None + dayOfWeekForSequence: 'uint' = 0 + chargingTargets: 'typing.List[EnergyEvse.Structs.ChargingTargetStruct]' = field(default_factory=lambda: []) class Commands: @dataclass diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm index facfe84e413676..65d278c7e49e18 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm @@ -16693,40 +16693,32 @@ - (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::EnergyEv auto & entry_0 = iter_0.GetValue(); MTREnergyEVSEClusterChargingTargetScheduleStruct * newElement_0; newElement_0 = [MTREnergyEVSEClusterChargingTargetScheduleStruct new]; - if (entry_0.dayOfWeekForSequence.HasValue()) { - newElement_0.dayOfWeekForSequence = [NSNumber numberWithUnsignedChar:entry_0.dayOfWeekForSequence.Value().Raw()]; - } else { - newElement_0.dayOfWeekForSequence = nil; - } - if (entry_0.chargingTargets.HasValue()) { - { // Scope for our temporary variables - auto * array_3 = [NSMutableArray new]; - auto iter_3 = entry_0.chargingTargets.Value().begin(); - while (iter_3.Next()) { - auto & entry_3 = iter_3.GetValue(); - MTREnergyEVSEClusterChargingTargetStruct * newElement_3; - newElement_3 = [MTREnergyEVSEClusterChargingTargetStruct new]; - newElement_3.targetTimeMinutesPastMidnight = [NSNumber numberWithUnsignedShort:entry_3.targetTimeMinutesPastMidnight]; - if (entry_3.targetSoC.HasValue()) { - newElement_3.targetSoC = [NSNumber numberWithUnsignedChar:entry_3.targetSoC.Value()]; - } else { - newElement_3.targetSoC = nil; - } - if (entry_3.addedEnergy.HasValue()) { - newElement_3.addedEnergy = [NSNumber numberWithLongLong:entry_3.addedEnergy.Value()]; - } else { - newElement_3.addedEnergy = nil; - } - [array_3 addObject:newElement_3]; + newElement_0.dayOfWeekForSequence = [NSNumber numberWithUnsignedChar:entry_0.dayOfWeekForSequence.Raw()]; + { // Scope for our temporary variables + auto * array_2 = [NSMutableArray new]; + auto iter_2 = entry_0.chargingTargets.begin(); + while (iter_2.Next()) { + auto & entry_2 = iter_2.GetValue(); + MTREnergyEVSEClusterChargingTargetStruct * newElement_2; + newElement_2 = [MTREnergyEVSEClusterChargingTargetStruct new]; + newElement_2.targetTimeMinutesPastMidnight = [NSNumber numberWithUnsignedShort:entry_2.targetTimeMinutesPastMidnight]; + if (entry_2.targetSoC.HasValue()) { + newElement_2.targetSoC = [NSNumber numberWithUnsignedChar:entry_2.targetSoC.Value()]; + } else { + newElement_2.targetSoC = nil; } - CHIP_ERROR err = iter_3.GetStatus(); - if (err != CHIP_NO_ERROR) { - return err; + if (entry_2.addedEnergy.HasValue()) { + newElement_2.addedEnergy = [NSNumber numberWithLongLong:entry_2.addedEnergy.Value()]; + } else { + newElement_2.addedEnergy = nil; } - newElement_0.chargingTargets = array_3; + [array_2 addObject:newElement_2]; } - } else { - newElement_0.chargingTargets = nil; + CHIP_ERROR err = iter_2.GetStatus(); + if (err != CHIP_NO_ERROR) { + return err; + } + newElement_0.chargingTargets = array_2; } [array_0 addObject:newElement_0]; } @@ -17127,41 +17119,35 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader return CHIP_ERROR_INVALID_ARGUMENT; } auto element_0 = (MTREnergyEVSEClusterChargingTargetScheduleStruct *) self.chargingTargetSchedules[i_0]; - if (element_0.dayOfWeekForSequence != nil) { - auto & definedValue_2 = listHolder_0->mList[i_0].dayOfWeekForSequence.Emplace(); - definedValue_2 = static_cast>(element_0.dayOfWeekForSequence.unsignedCharValue); - } - if (element_0.chargingTargets != nil) { - auto & definedValue_2 = listHolder_0->mList[i_0].chargingTargets.Emplace(); - { - using ListType_3 = std::remove_reference_t; - using ListMemberType_3 = ListMemberTypeGetter::Type; - if (element_0.chargingTargets.count != 0) { - auto * listHolder_3 = new ListHolder(element_0.chargingTargets.count); - if (listHolder_3 == nullptr || listHolder_3->mList == nullptr) { + listHolder_0->mList[i_0].dayOfWeekForSequence = static_castmList[i_0].dayOfWeekForSequence)>>(element_0.dayOfWeekForSequence.unsignedCharValue); + { + using ListType_2 = std::remove_reference_tmList[i_0].chargingTargets)>; + using ListMemberType_2 = ListMemberTypeGetter::Type; + if (element_0.chargingTargets.count != 0) { + auto * listHolder_2 = new ListHolder(element_0.chargingTargets.count); + if (listHolder_2 == nullptr || listHolder_2->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_2); + for (size_t i_2 = 0; i_2 < element_0.chargingTargets.count; ++i_2) { + if (![element_0.chargingTargets[i_2] isKindOfClass:[MTREnergyEVSEClusterChargingTargetStruct class]]) { + // Wrong kind of value. return CHIP_ERROR_INVALID_ARGUMENT; } - listFreer.add(listHolder_3); - for (size_t i_3 = 0; i_3 < element_0.chargingTargets.count; ++i_3) { - if (![element_0.chargingTargets[i_3] isKindOfClass:[MTREnergyEVSEClusterChargingTargetStruct class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_3 = (MTREnergyEVSEClusterChargingTargetStruct *) element_0.chargingTargets[i_3]; - listHolder_3->mList[i_3].targetTimeMinutesPastMidnight = element_3.targetTimeMinutesPastMidnight.unsignedShortValue; - if (element_3.targetSoC != nil) { - auto & definedValue_5 = listHolder_3->mList[i_3].targetSoC.Emplace(); - definedValue_5 = element_3.targetSoC.unsignedCharValue; - } - if (element_3.addedEnergy != nil) { - auto & definedValue_5 = listHolder_3->mList[i_3].addedEnergy.Emplace(); - definedValue_5 = element_3.addedEnergy.longLongValue; - } + auto element_2 = (MTREnergyEVSEClusterChargingTargetStruct *) element_0.chargingTargets[i_2]; + listHolder_2->mList[i_2].targetTimeMinutesPastMidnight = element_2.targetTimeMinutesPastMidnight.unsignedShortValue; + if (element_2.targetSoC != nil) { + auto & definedValue_4 = listHolder_2->mList[i_2].targetSoC.Emplace(); + definedValue_4 = element_2.targetSoC.unsignedCharValue; + } + if (element_2.addedEnergy != nil) { + auto & definedValue_4 = listHolder_2->mList[i_2].addedEnergy.Emplace(); + definedValue_4 = element_2.addedEnergy.longLongValue; } - definedValue_2 = ListType_3(listHolder_3->mList, element_0.chargingTargets.count); - } else { - definedValue_2 = ListType_3(); } + listHolder_0->mList[i_0].chargingTargets = ListType_2(listHolder_2->mList, element_0.chargingTargets.count); + } else { + listHolder_0->mList[i_0].chargingTargets = ListType_2(); } } } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h index ea331e093313d7..f343d1423c0321 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h @@ -1379,8 +1379,8 @@ MTR_PROVISIONALLY_AVAILABLE MTR_PROVISIONALLY_AVAILABLE @interface MTREnergyEVSEClusterChargingTargetScheduleStruct : NSObject -@property (nonatomic, copy) NSNumber * _Nullable dayOfWeekForSequence MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSArray * _Nullable chargingTargets MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull dayOfWeekForSequence MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSArray * _Nonnull chargingTargets MTR_PROVISIONALLY_AVAILABLE; @end MTR_PROVISIONALLY_AVAILABLE diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm index ff1d78301a70d4..126376bbf8503b 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm @@ -5662,9 +5662,9 @@ - (instancetype)init { if (self = [super init]) { - _dayOfWeekForSequence = nil; + _dayOfWeekForSequence = @(0); - _chargingTargets = nil; + _chargingTargets = [NSArray array]; } return self; } diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index cebd2309cf1db7..8f873aa4872d2a 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h @@ -22985,8 +22985,8 @@ enum class Fields : uint8_t struct Type { public: - Optional> dayOfWeekForSequence; - Optional> chargingTargets; + chip::BitMask dayOfWeekForSequence = static_cast>(0); + DataModel::List chargingTargets; static constexpr bool kIsFabricScoped = false; @@ -22996,8 +22996,8 @@ struct Type struct DecodableType { public: - Optional> dayOfWeekForSequence; - Optional> chargingTargets; + chip::BitMask dayOfWeekForSequence = static_cast>(0); + DataModel::DecodableList chargingTargets; CHIP_ERROR Decode(TLV::TLVReader & reader); diff --git a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp index 2e1e1bc4e28208..f0970c2c4cdeea 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp @@ -3596,20 +3596,19 @@ CHIP_ERROR ComplexArgumentParser::Setup(const char * label, // Copy to track which members we already processed. Json::Value valueCopy(value); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ChargingTargetScheduleStruct.dayOfWeekForSequence", + "dayOfWeekForSequence", value.isMember("dayOfWeekForSequence"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ChargingTargetScheduleStruct.chargingTargets", "chargingTargets", + value.isMember("chargingTargets"))); + char labelWithMember[kMaxLabelLength]; - if (value.isMember("dayOfWeekForSequence")) - { - snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "dayOfWeekForSequence"); - ReturnErrorOnFailure( - ComplexArgumentParser::Setup(labelWithMember, request.dayOfWeekForSequence, value["dayOfWeekForSequence"])); - } + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "dayOfWeekForSequence"); + ReturnErrorOnFailure( + ComplexArgumentParser::Setup(labelWithMember, request.dayOfWeekForSequence, value["dayOfWeekForSequence"])); valueCopy.removeMember("dayOfWeekForSequence"); - if (value.isMember("chargingTargets")) - { - snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "chargingTargets"); - ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.chargingTargets, value["chargingTargets"])); - } + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "chargingTargets"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.chargingTargets, value["chargingTargets"])); valueCopy.removeMember("chargingTargets"); return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); diff --git a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h index 7e0eb5112f9476..71f2231754a518 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -84748,34 +84748,26 @@ class EnergyEvseSetTargets : public ClusterCommand { for (auto & entry_0 : mRequest.chargingTargetSchedules) { MTREnergyEVSEClusterChargingTargetScheduleStruct * newElement_0; newElement_0 = [MTREnergyEVSEClusterChargingTargetScheduleStruct new]; - if (entry_0.dayOfWeekForSequence.HasValue()) { - newElement_0.dayOfWeekForSequence = [NSNumber numberWithUnsignedChar:entry_0.dayOfWeekForSequence.Value().Raw()]; - } else { - newElement_0.dayOfWeekForSequence = nil; - } - if (entry_0.chargingTargets.HasValue()) { - { // Scope for our temporary variables - auto * array_3 = [NSMutableArray new]; - for (auto & entry_3 : entry_0.chargingTargets.Value()) { - MTREnergyEVSEClusterChargingTargetStruct * newElement_3; - newElement_3 = [MTREnergyEVSEClusterChargingTargetStruct new]; - newElement_3.targetTimeMinutesPastMidnight = [NSNumber numberWithUnsignedShort:entry_3.targetTimeMinutesPastMidnight]; - if (entry_3.targetSoC.HasValue()) { - newElement_3.targetSoC = [NSNumber numberWithUnsignedChar:entry_3.targetSoC.Value()]; - } else { - newElement_3.targetSoC = nil; - } - if (entry_3.addedEnergy.HasValue()) { - newElement_3.addedEnergy = [NSNumber numberWithLongLong:entry_3.addedEnergy.Value()]; - } else { - newElement_3.addedEnergy = nil; - } - [array_3 addObject:newElement_3]; + newElement_0.dayOfWeekForSequence = [NSNumber numberWithUnsignedChar:entry_0.dayOfWeekForSequence.Raw()]; + { // Scope for our temporary variables + auto * array_2 = [NSMutableArray new]; + for (auto & entry_2 : entry_0.chargingTargets) { + MTREnergyEVSEClusterChargingTargetStruct * newElement_2; + newElement_2 = [MTREnergyEVSEClusterChargingTargetStruct new]; + newElement_2.targetTimeMinutesPastMidnight = [NSNumber numberWithUnsignedShort:entry_2.targetTimeMinutesPastMidnight]; + if (entry_2.targetSoC.HasValue()) { + newElement_2.targetSoC = [NSNumber numberWithUnsignedChar:entry_2.targetSoC.Value()]; + } else { + newElement_2.targetSoC = nil; } - newElement_0.chargingTargets = array_3; + if (entry_2.addedEnergy.HasValue()) { + newElement_2.addedEnergy = [NSNumber numberWithLongLong:entry_2.addedEnergy.Value()]; + } else { + newElement_2.addedEnergy = nil; + } + [array_2 addObject:newElement_2]; } - } else { - newElement_0.chargingTargets = nil; + newElement_0.chargingTargets = array_2; } [array_0 addObject:newElement_0]; } From 35d9aac4c51c349d70a718adb936c97a8cb9b69f Mon Sep 17 00:00:00 2001 From: James Harrow Date: Mon, 8 Jul 2024 17:53:54 +0100 Subject: [PATCH 31/32] Updated energy-evse-cluster using Alchemy to match Spec PR:9317 based on review that DischargingCurrent was inconsistent. --- .../zcl/data-model/chip/energy-evse-cluster.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/zap-templates/zcl/data-model/chip/energy-evse-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/energy-evse-cluster.xml index c7de452a53341f..94774774d53a10 100644 --- a/src/app/zap-templates/zcl/data-model/chip/energy-evse-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/energy-evse-cluster.xml @@ -169,13 +169,13 @@ limitations under the License. - Allows a client to enable the EVSE to charge an EV. + This command allows a client to enable the EVSE to charge an EV, - Allows a client to enable the EVSE to discharge an EV. + Upon receipt, this SHALL allow a client to enable the discharge of an EV, @@ -188,7 +188,7 @@ limitations under the License. - Allows a client to retrieve the user specified charging targets. + Allows a client to retrieve the current set of charging targets. @@ -219,7 +219,7 @@ limitations under the License. - + From e9a80deaafa194aa4d3e75d3d298c4f62745d163 Mon Sep 17 00:00:00 2001 From: James Harrow Date: Mon, 8 Jul 2024 19:04:34 +0100 Subject: [PATCH 32/32] Updated after regen_all --- .../all-clusters-app.matter | 8 +++--- .../energy-management-app.matter | 8 +++--- .../data_model/controller-clusters.matter | 8 +++--- .../devicecontroller/ChipEventStructs.java | 22 +++++++-------- ...gyEvseClusterEnergyTransferStartedEvent.kt | 20 +++++++------- ...gyEvseClusterEnergyTransferStartedEvent.kt | 20 +++++++------- .../CHIPEventTLVValueDecoder.cpp | 27 +++++++++---------- .../python/chip/clusters/Objects.py | 4 +-- .../CHIP/zap-generated/MTRBaseClusters.h | 6 ++--- .../zap-generated/MTREventTLVValueDecoder.mm | 6 ++--- .../CHIP/zap-generated/MTRStructsObjc.h | 2 +- .../CHIP/zap-generated/MTRStructsObjc.mm | 6 ++--- .../zap-generated/cluster-objects.cpp | 7 +++-- .../zap-generated/cluster-objects.h | 12 ++++----- .../cluster/logging/DataModelLogger.cpp | 4 +-- 15 files changed, 79 insertions(+), 81 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index 90bfb9b94d379f..335a4247ee9476 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -4390,7 +4390,7 @@ cluster EnergyEvse = 153 { int32u sessionID = 0; StateEnum state = 1; amperage_ma maximumCurrent = 2; - optional amperage_ma maximumDischargingCurrent = 3; + optional amperage_ma maximumDischargeCurrent = 3; } info event EnergyTransferStopped = 3 { @@ -4463,15 +4463,15 @@ cluster EnergyEvse = 153 { /** Allows a client to disable the EVSE from charging and discharging. */ timed command Disable(): DefaultSuccess = 1; - /** Allows a client to enable the EVSE to charge an EV. */ + /** This command allows a client to enable the EVSE to charge an EV, */ timed command EnableCharging(EnableChargingRequest): DefaultSuccess = 2; - /** Allows a client to enable the EVSE to discharge an EV. */ + /** Upon receipt, this SHALL allow a client to enable the discharge of an EV, */ timed command EnableDischarging(EnableDischargingRequest): DefaultSuccess = 3; /** Allows a client to put the EVSE into a self-diagnostics mode. */ timed command StartDiagnostics(): DefaultSuccess = 4; /** Allows a client to set the user specified charging targets. */ timed command SetTargets(SetTargetsRequest): DefaultSuccess = 5; - /** Allows a client to retrieve the user specified charging targets. */ + /** Allows a client to retrieve the current set of charging targets. */ timed command GetTargets(): GetTargetsResponse = 6; /** Allows a client to clear all stored charging targets. */ timed command ClearTargets(): DefaultSuccess = 7; diff --git a/examples/energy-management-app/energy-management-common/energy-management-app.matter b/examples/energy-management-app/energy-management-common/energy-management-app.matter index b022b26a005e63..f34ffd80cdf87b 100644 --- a/examples/energy-management-app/energy-management-common/energy-management-app.matter +++ b/examples/energy-management-app/energy-management-common/energy-management-app.matter @@ -1743,7 +1743,7 @@ cluster EnergyEvse = 153 { int32u sessionID = 0; StateEnum state = 1; amperage_ma maximumCurrent = 2; - optional amperage_ma maximumDischargingCurrent = 3; + optional amperage_ma maximumDischargeCurrent = 3; } info event EnergyTransferStopped = 3 { @@ -1816,15 +1816,15 @@ cluster EnergyEvse = 153 { /** Allows a client to disable the EVSE from charging and discharging. */ timed command Disable(): DefaultSuccess = 1; - /** Allows a client to enable the EVSE to charge an EV. */ + /** This command allows a client to enable the EVSE to charge an EV, */ timed command EnableCharging(EnableChargingRequest): DefaultSuccess = 2; - /** Allows a client to enable the EVSE to discharge an EV. */ + /** Upon receipt, this SHALL allow a client to enable the discharge of an EV, */ timed command EnableDischarging(EnableDischargingRequest): DefaultSuccess = 3; /** Allows a client to put the EVSE into a self-diagnostics mode. */ timed command StartDiagnostics(): DefaultSuccess = 4; /** Allows a client to set the user specified charging targets. */ timed command SetTargets(SetTargetsRequest): DefaultSuccess = 5; - /** Allows a client to retrieve the user specified charging targets. */ + /** Allows a client to retrieve the current set of charging targets. */ timed command GetTargets(): GetTargetsResponse = 6; /** Allows a client to clear all stored charging targets. */ timed command ClearTargets(): DefaultSuccess = 7; diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 25dea133051b99..093de845b6f4a9 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -4980,7 +4980,7 @@ cluster EnergyEvse = 153 { int32u sessionID = 0; StateEnum state = 1; amperage_ma maximumCurrent = 2; - optional amperage_ma maximumDischargingCurrent = 3; + optional amperage_ma maximumDischargeCurrent = 3; } info event EnergyTransferStopped = 3 { @@ -5053,15 +5053,15 @@ cluster EnergyEvse = 153 { /** Allows a client to disable the EVSE from charging and discharging. */ timed command Disable(): DefaultSuccess = 1; - /** Allows a client to enable the EVSE to charge an EV. */ + /** This command allows a client to enable the EVSE to charge an EV, */ timed command EnableCharging(EnableChargingRequest): DefaultSuccess = 2; - /** Allows a client to enable the EVSE to discharge an EV. */ + /** Upon receipt, this SHALL allow a client to enable the discharge of an EV, */ timed command EnableDischarging(EnableDischargingRequest): DefaultSuccess = 3; /** Allows a client to put the EVSE into a self-diagnostics mode. */ timed command StartDiagnostics(): DefaultSuccess = 4; /** Allows a client to set the user specified charging targets. */ timed command SetTargets(SetTargetsRequest): DefaultSuccess = 5; - /** Allows a client to retrieve the user specified charging targets. */ + /** Allows a client to retrieve the current set of charging targets. */ timed command GetTargets(): GetTargetsResponse = 6; /** Allows a client to clear all stored charging targets. */ timed command ClearTargets(): DefaultSuccess = 7; diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipEventStructs.java b/src/controller/java/generated/java/chip/devicecontroller/ChipEventStructs.java index 401603070016a2..5cdcb6843ec864 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipEventStructs.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipEventStructs.java @@ -4323,22 +4323,22 @@ public static class EnergyEvseClusterEnergyTransferStartedEvent { public Long sessionID; public Integer state; public Long maximumCurrent; - public Optional maximumDischargingCurrent; + public Optional maximumDischargeCurrent; private static final long SESSION_I_D_ID = 0L; private static final long STATE_ID = 1L; private static final long MAXIMUM_CURRENT_ID = 2L; - private static final long MAXIMUM_DISCHARGING_CURRENT_ID = 3L; + private static final long MAXIMUM_DISCHARGE_CURRENT_ID = 3L; public EnergyEvseClusterEnergyTransferStartedEvent( Long sessionID, Integer state, Long maximumCurrent, - Optional maximumDischargingCurrent + Optional maximumDischargeCurrent ) { this.sessionID = sessionID; this.state = state; this.maximumCurrent = maximumCurrent; - this.maximumDischargingCurrent = maximumDischargingCurrent; + this.maximumDischargeCurrent = maximumDischargeCurrent; } public StructType encodeTlv() { @@ -4346,7 +4346,7 @@ public StructType encodeTlv() { values.add(new StructElement(SESSION_I_D_ID, new UIntType(sessionID))); values.add(new StructElement(STATE_ID, new UIntType(state))); values.add(new StructElement(MAXIMUM_CURRENT_ID, new IntType(maximumCurrent))); - values.add(new StructElement(MAXIMUM_DISCHARGING_CURRENT_ID, maximumDischargingCurrent.map((nonOptionalmaximumDischargingCurrent) -> new IntType(nonOptionalmaximumDischargingCurrent)).orElse(new EmptyType()))); + values.add(new StructElement(MAXIMUM_DISCHARGE_CURRENT_ID, maximumDischargeCurrent.map((nonOptionalmaximumDischargeCurrent) -> new IntType(nonOptionalmaximumDischargeCurrent)).orElse(new EmptyType()))); return new StructType(values); } @@ -4358,7 +4358,7 @@ public static EnergyEvseClusterEnergyTransferStartedEvent decodeTlv(BaseTLVType Long sessionID = null; Integer state = null; Long maximumCurrent = null; - Optional maximumDischargingCurrent = Optional.empty(); + Optional maximumDischargeCurrent = Optional.empty(); for (StructElement element: ((StructType)tlvValue).value()) { if (element.contextTagNum() == SESSION_I_D_ID) { if (element.value(BaseTLVType.class).type() == TLVType.UInt) { @@ -4375,10 +4375,10 @@ public static EnergyEvseClusterEnergyTransferStartedEvent decodeTlv(BaseTLVType IntType castingValue = element.value(IntType.class); maximumCurrent = castingValue.value(Long.class); } - } else if (element.contextTagNum() == MAXIMUM_DISCHARGING_CURRENT_ID) { + } else if (element.contextTagNum() == MAXIMUM_DISCHARGE_CURRENT_ID) { if (element.value(BaseTLVType.class).type() == TLVType.Int) { IntType castingValue = element.value(IntType.class); - maximumDischargingCurrent = Optional.of(castingValue.value(Long.class)); + maximumDischargeCurrent = Optional.of(castingValue.value(Long.class)); } } } @@ -4386,7 +4386,7 @@ public static EnergyEvseClusterEnergyTransferStartedEvent decodeTlv(BaseTLVType sessionID, state, maximumCurrent, - maximumDischargingCurrent + maximumDischargeCurrent ); } @@ -4403,8 +4403,8 @@ public String toString() { output.append("\tmaximumCurrent: "); output.append(maximumCurrent); output.append("\n"); - output.append("\tmaximumDischargingCurrent: "); - output.append(maximumDischargingCurrent); + output.append("\tmaximumDischargeCurrent: "); + output.append(maximumDischargeCurrent); output.append("\n"); output.append("}\n"); return output.toString(); diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/EnergyEvseClusterEnergyTransferStartedEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/EnergyEvseClusterEnergyTransferStartedEvent.kt index a4260a87133977..345a0aef9f870e 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/EnergyEvseClusterEnergyTransferStartedEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/EnergyEvseClusterEnergyTransferStartedEvent.kt @@ -27,14 +27,14 @@ class EnergyEvseClusterEnergyTransferStartedEvent( val sessionID: ULong, val state: UInt, val maximumCurrent: Long, - val maximumDischargingCurrent: Optional, + val maximumDischargeCurrent: Optional, ) { override fun toString(): String = buildString { append("EnergyEvseClusterEnergyTransferStartedEvent {\n") append("\tsessionID : $sessionID\n") append("\tstate : $state\n") append("\tmaximumCurrent : $maximumCurrent\n") - append("\tmaximumDischargingCurrent : $maximumDischargingCurrent\n") + append("\tmaximumDischargeCurrent : $maximumDischargeCurrent\n") append("}\n") } @@ -44,9 +44,9 @@ class EnergyEvseClusterEnergyTransferStartedEvent( put(ContextSpecificTag(TAG_SESSION_I_D), sessionID) put(ContextSpecificTag(TAG_STATE), state) put(ContextSpecificTag(TAG_MAXIMUM_CURRENT), maximumCurrent) - if (maximumDischargingCurrent.isPresent) { - val optmaximumDischargingCurrent = maximumDischargingCurrent.get() - put(ContextSpecificTag(TAG_MAXIMUM_DISCHARGING_CURRENT), optmaximumDischargingCurrent) + if (maximumDischargeCurrent.isPresent) { + val optmaximumDischargeCurrent = maximumDischargeCurrent.get() + put(ContextSpecificTag(TAG_MAXIMUM_DISCHARGE_CURRENT), optmaximumDischargeCurrent) } endStructure() } @@ -56,16 +56,16 @@ class EnergyEvseClusterEnergyTransferStartedEvent( private const val TAG_SESSION_I_D = 0 private const val TAG_STATE = 1 private const val TAG_MAXIMUM_CURRENT = 2 - private const val TAG_MAXIMUM_DISCHARGING_CURRENT = 3 + private const val TAG_MAXIMUM_DISCHARGE_CURRENT = 3 fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): EnergyEvseClusterEnergyTransferStartedEvent { tlvReader.enterStructure(tlvTag) val sessionID = tlvReader.getULong(ContextSpecificTag(TAG_SESSION_I_D)) val state = tlvReader.getUInt(ContextSpecificTag(TAG_STATE)) val maximumCurrent = tlvReader.getLong(ContextSpecificTag(TAG_MAXIMUM_CURRENT)) - val maximumDischargingCurrent = - if (tlvReader.isNextTag(ContextSpecificTag(TAG_MAXIMUM_DISCHARGING_CURRENT))) { - Optional.of(tlvReader.getLong(ContextSpecificTag(TAG_MAXIMUM_DISCHARGING_CURRENT))) + val maximumDischargeCurrent = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_MAXIMUM_DISCHARGE_CURRENT))) { + Optional.of(tlvReader.getLong(ContextSpecificTag(TAG_MAXIMUM_DISCHARGE_CURRENT))) } else { Optional.empty() } @@ -76,7 +76,7 @@ class EnergyEvseClusterEnergyTransferStartedEvent( sessionID, state, maximumCurrent, - maximumDischargingCurrent, + maximumDischargeCurrent, ) } } diff --git a/src/controller/java/generated/java/matter/controller/cluster/eventstructs/EnergyEvseClusterEnergyTransferStartedEvent.kt b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/EnergyEvseClusterEnergyTransferStartedEvent.kt index 41c82109c4716b..17459394a0bfef 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/eventstructs/EnergyEvseClusterEnergyTransferStartedEvent.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/EnergyEvseClusterEnergyTransferStartedEvent.kt @@ -27,14 +27,14 @@ class EnergyEvseClusterEnergyTransferStartedEvent( val sessionID: UInt, val state: UByte, val maximumCurrent: Long, - val maximumDischargingCurrent: Optional, + val maximumDischargeCurrent: Optional, ) { override fun toString(): String = buildString { append("EnergyEvseClusterEnergyTransferStartedEvent {\n") append("\tsessionID : $sessionID\n") append("\tstate : $state\n") append("\tmaximumCurrent : $maximumCurrent\n") - append("\tmaximumDischargingCurrent : $maximumDischargingCurrent\n") + append("\tmaximumDischargeCurrent : $maximumDischargeCurrent\n") append("}\n") } @@ -44,9 +44,9 @@ class EnergyEvseClusterEnergyTransferStartedEvent( put(ContextSpecificTag(TAG_SESSION_I_D), sessionID) put(ContextSpecificTag(TAG_STATE), state) put(ContextSpecificTag(TAG_MAXIMUM_CURRENT), maximumCurrent) - if (maximumDischargingCurrent.isPresent) { - val optmaximumDischargingCurrent = maximumDischargingCurrent.get() - put(ContextSpecificTag(TAG_MAXIMUM_DISCHARGING_CURRENT), optmaximumDischargingCurrent) + if (maximumDischargeCurrent.isPresent) { + val optmaximumDischargeCurrent = maximumDischargeCurrent.get() + put(ContextSpecificTag(TAG_MAXIMUM_DISCHARGE_CURRENT), optmaximumDischargeCurrent) } endStructure() } @@ -56,16 +56,16 @@ class EnergyEvseClusterEnergyTransferStartedEvent( private const val TAG_SESSION_I_D = 0 private const val TAG_STATE = 1 private const val TAG_MAXIMUM_CURRENT = 2 - private const val TAG_MAXIMUM_DISCHARGING_CURRENT = 3 + private const val TAG_MAXIMUM_DISCHARGE_CURRENT = 3 fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): EnergyEvseClusterEnergyTransferStartedEvent { tlvReader.enterStructure(tlvTag) val sessionID = tlvReader.getUInt(ContextSpecificTag(TAG_SESSION_I_D)) val state = tlvReader.getUByte(ContextSpecificTag(TAG_STATE)) val maximumCurrent = tlvReader.getLong(ContextSpecificTag(TAG_MAXIMUM_CURRENT)) - val maximumDischargingCurrent = - if (tlvReader.isNextTag(ContextSpecificTag(TAG_MAXIMUM_DISCHARGING_CURRENT))) { - Optional.of(tlvReader.getLong(ContextSpecificTag(TAG_MAXIMUM_DISCHARGING_CURRENT))) + val maximumDischargeCurrent = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_MAXIMUM_DISCHARGE_CURRENT))) { + Optional.of(tlvReader.getLong(ContextSpecificTag(TAG_MAXIMUM_DISCHARGE_CURRENT))) } else { Optional.empty() } @@ -76,7 +76,7 @@ class EnergyEvseClusterEnergyTransferStartedEvent( sessionID, state, maximumCurrent, - maximumDischargingCurrent, + maximumDischargeCurrent, ) } } diff --git a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp index 5a366690008c47..301efce5eb3634 100644 --- a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp @@ -5872,24 +5872,23 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & value_maximumCurrentCtorSignature.c_str(), jnivalue_maximumCurrent, value_maximumCurrent); - jobject value_maximumDischargingCurrent; - if (!cppValue.maximumDischargingCurrent.HasValue()) + jobject value_maximumDischargeCurrent; + if (!cppValue.maximumDischargeCurrent.HasValue()) { - chip::JniReferences::GetInstance().CreateOptional(nullptr, value_maximumDischargingCurrent); + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_maximumDischargeCurrent); } else { - jobject value_maximumDischargingCurrentInsideOptional; - std::string value_maximumDischargingCurrentInsideOptionalClassName = "java/lang/Long"; - std::string value_maximumDischargingCurrentInsideOptionalCtorSignature = "(J)V"; - jlong jnivalue_maximumDischargingCurrentInsideOptional = - static_cast(cppValue.maximumDischargingCurrent.Value()); + jobject value_maximumDischargeCurrentInsideOptional; + std::string value_maximumDischargeCurrentInsideOptionalClassName = "java/lang/Long"; + std::string value_maximumDischargeCurrentInsideOptionalCtorSignature = "(J)V"; + jlong jnivalue_maximumDischargeCurrentInsideOptional = static_cast(cppValue.maximumDischargeCurrent.Value()); chip::JniReferences::GetInstance().CreateBoxedObject( - value_maximumDischargingCurrentInsideOptionalClassName.c_str(), - value_maximumDischargingCurrentInsideOptionalCtorSignature.c_str(), - jnivalue_maximumDischargingCurrentInsideOptional, value_maximumDischargingCurrentInsideOptional); - chip::JniReferences::GetInstance().CreateOptional(value_maximumDischargingCurrentInsideOptional, - value_maximumDischargingCurrent); + value_maximumDischargeCurrentInsideOptionalClassName.c_str(), + value_maximumDischargeCurrentInsideOptionalCtorSignature.c_str(), + jnivalue_maximumDischargeCurrentInsideOptional, value_maximumDischargeCurrentInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_maximumDischargeCurrentInsideOptional, + value_maximumDischargeCurrent); } jclass energyTransferStartedStructClass; @@ -5913,7 +5912,7 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & } jobject value = env->NewObject(energyTransferStartedStructClass, energyTransferStartedStructCtor, value_sessionID, - value_state, value_maximumCurrent, value_maximumDischargingCurrent); + value_state, value_maximumCurrent, value_maximumDischargeCurrent); return value; } diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 1fc4e3b91615c9..95d7e317b05840 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -26044,13 +26044,13 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="sessionID", Tag=0, Type=uint), ClusterObjectFieldDescriptor(Label="state", Tag=1, Type=EnergyEvse.Enums.StateEnum), ClusterObjectFieldDescriptor(Label="maximumCurrent", Tag=2, Type=int), - ClusterObjectFieldDescriptor(Label="maximumDischargingCurrent", Tag=3, Type=typing.Optional[int]), + ClusterObjectFieldDescriptor(Label="maximumDischargeCurrent", Tag=3, Type=typing.Optional[int]), ]) sessionID: 'uint' = 0 state: 'EnergyEvse.Enums.StateEnum' = 0 maximumCurrent: 'int' = 0 - maximumDischargingCurrent: 'typing.Optional[int]' = None + maximumDischargeCurrent: 'typing.Optional[int]' = None @dataclass class EnergyTransferStopped(ClusterEvent): diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index 60df4fea21180a..6d07feed120cba 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -8029,13 +8029,13 @@ MTR_PROVISIONALLY_AVAILABLE /** * Command EnableCharging * - * Allows a client to enable the EVSE to charge an EV. + * This command allows a client to enable the EVSE to charge an EV, */ - (void)enableChargingWithParams:(MTREnergyEVSEClusterEnableChargingParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; /** * Command EnableDischarging * - * Allows a client to enable the EVSE to discharge an EV. + * Upon receipt, this SHALL allow a client to enable the discharge of an EV, */ - (void)enableDischargingWithParams:(MTREnergyEVSEClusterEnableDischargingParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; /** @@ -8055,7 +8055,7 @@ MTR_PROVISIONALLY_AVAILABLE /** * Command GetTargets * - * Allows a client to retrieve the user specified charging targets. + * Allows a client to retrieve the current set of charging targets. */ - (void)getTargetsWithParams:(MTREnergyEVSEClusterGetTargetsParams * _Nullable)params completion:(void (^)(MTREnergyEVSEClusterGetTargetsResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; - (void)getTargetsWithCompletion:(void (^)(MTREnergyEVSEClusterGetTargetsResponseParams * _Nullable data, NSError * _Nullable error))completion diff --git a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm index 013a509a2daa09..4a5dba79c49565 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm @@ -3158,12 +3158,12 @@ static id _Nullable DecodeEventPayloadForEnergyEVSECluster(EventId aEventId, TLV } while (0); do { NSNumber * _Nullable memberValue; - if (cppValue.maximumDischargingCurrent.HasValue()) { - memberValue = [NSNumber numberWithLongLong:cppValue.maximumDischargingCurrent.Value()]; + if (cppValue.maximumDischargeCurrent.HasValue()) { + memberValue = [NSNumber numberWithLongLong:cppValue.maximumDischargeCurrent.Value()]; } else { memberValue = nil; } - value.maximumDischargingCurrent = memberValue; + value.maximumDischargeCurrent = memberValue; } while (0); return value; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h index 5951a0e1e8e34f..172c5f76731356 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h @@ -1410,7 +1410,7 @@ MTR_PROVISIONALLY_AVAILABLE @property (nonatomic, copy) NSNumber * _Nonnull sessionID MTR_PROVISIONALLY_AVAILABLE; @property (nonatomic, copy) NSNumber * _Nonnull state MTR_PROVISIONALLY_AVAILABLE; @property (nonatomic, copy) NSNumber * _Nonnull maximumCurrent MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nullable maximumDischargingCurrent MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable maximumDischargeCurrent MTR_PROVISIONALLY_AVAILABLE; @end MTR_PROVISIONALLY_AVAILABLE diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm index 77e2bcaa97b1fd..aee0f31d37afc6 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm @@ -5788,7 +5788,7 @@ - (instancetype)init _maximumCurrent = @(0); - _maximumDischargingCurrent = nil; + _maximumDischargeCurrent = nil; } return self; } @@ -5800,14 +5800,14 @@ - (id)copyWithZone:(NSZone * _Nullable)zone other.sessionID = self.sessionID; other.state = self.state; other.maximumCurrent = self.maximumCurrent; - other.maximumDischargingCurrent = self.maximumDischargingCurrent; + other.maximumDischargeCurrent = self.maximumDischargeCurrent; return other; } - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: sessionID:%@; state:%@; maximumCurrent:%@; maximumDischargingCurrent:%@; >", NSStringFromClass([self class]), _sessionID, _state, _maximumCurrent, _maximumDischargingCurrent]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: sessionID:%@; state:%@; maximumCurrent:%@; maximumDischargeCurrent:%@; >", NSStringFromClass([self class]), _sessionID, _state, _maximumCurrent, _maximumDischargeCurrent]; return descriptionString; } diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp index 633aaa3578491c..f2f6869b217ffb 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp @@ -17086,8 +17086,7 @@ CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kSessionID), sessionID)); ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kState), state)); ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kMaximumCurrent), maximumCurrent)); - ReturnErrorOnFailure( - DataModel::Encode(aWriter, TLV::ContextTag(Fields::kMaximumDischargingCurrent), maximumDischargingCurrent)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kMaximumDischargeCurrent), maximumDischargeCurrent)); return aWriter.EndContainer(outer); } @@ -17117,9 +17116,9 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) { err = DataModel::Decode(reader, maximumCurrent); } - else if (__context_tag == to_underlying(Fields::kMaximumDischargingCurrent)) + else if (__context_tag == to_underlying(Fields::kMaximumDischargeCurrent)) { - err = DataModel::Decode(reader, maximumDischargingCurrent); + err = DataModel::Decode(reader, maximumDischargeCurrent); } else { diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index c2c842af6cdb6d..338820b159e47b 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h @@ -23765,10 +23765,10 @@ static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; enum class Fields : uint8_t { - kSessionID = 0, - kState = 1, - kMaximumCurrent = 2, - kMaximumDischargingCurrent = 3, + kSessionID = 0, + kState = 1, + kMaximumCurrent = 2, + kMaximumDischargeCurrent = 3, }; struct Type @@ -23782,7 +23782,7 @@ struct Type uint32_t sessionID = static_cast(0); StateEnum state = static_cast(0); int64_t maximumCurrent = static_cast(0); - Optional maximumDischargingCurrent; + Optional maximumDischargeCurrent; CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; }; @@ -23797,7 +23797,7 @@ struct DecodableType uint32_t sessionID = static_cast(0); StateEnum state = static_cast(0); int64_t maximumCurrent = static_cast(0); - Optional maximumDischargingCurrent; + Optional maximumDischargeCurrent; CHIP_ERROR Decode(TLV::TLVReader & reader); }; diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp index d701c475ac0e11..c41f5734712528 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -6851,10 +6851,10 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, } } { - CHIP_ERROR err = DataModelLogger::LogValue("MaximumDischargingCurrent", indent + 1, value.maximumDischargingCurrent); + CHIP_ERROR err = DataModelLogger::LogValue("MaximumDischargeCurrent", indent + 1, value.maximumDischargeCurrent); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'MaximumDischargingCurrent'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'MaximumDischargeCurrent'"); return err; } }