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 776b241c6ed958..58bce0390915f7 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 @@ -4386,7 +4386,7 @@ cluster ElectricalEnergyMeasurement = 145 { /** 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; + revision 2; enum BoostStateEnum : enum8 { kInactive = 0; @@ -4398,7 +4398,7 @@ provisional cluster WaterHeaterManagement = 148 { kTankPercent = 0x2; } - bitmap WaterHeaterDemandBitmap : bitmap8 { + bitmap WaterHeaterHeatSourceBitmap : bitmap8 { kImmersionElement1 = 0x1; kImmersionElement2 = 0x2; kHeatPump = 0x4; @@ -4406,16 +4406,24 @@ provisional cluster WaterHeaterManagement = 148 { kOther = 0x10; } - bitmap WaterHeaterTypeBitmap : bitmap8 { - kImmersionElement1 = 0x1; - kImmersionElement2 = 0x2; - kHeatPump = 0x4; - kBoiler = 0x8; - kOther = 0x10; + struct WaterHeaterBoostInfoStruct { + elapsed_s duration = 0; + optional boolean oneShot = 1; + optional boolean emergencyBoost = 2; + optional temperature temporarySetpoint = 3; + optional percent targetPercentage = 4; + optional percent targetReheat = 5; + } + + info event BoostStarted = 0 { + WaterHeaterBoostInfoStruct boostInfo = 0; } - readonly attribute WaterHeaterTypeBitmap heaterTypes = 0; - readonly attribute WaterHeaterDemandBitmap heatDemand = 1; + info event BoostEnded = 1 { + } + + readonly attribute WaterHeaterHeatSourceBitmap heaterTypes = 0; + readonly attribute WaterHeaterHeatSourceBitmap heatDemand = 1; readonly attribute optional int16u tankVolume = 2; readonly attribute optional energy_mwh estimatedHeatRequired = 3; readonly attribute optional percent tankPercentage = 4; @@ -4428,12 +4436,7 @@ provisional cluster WaterHeaterManagement = 148 { 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; + WaterHeaterBoostInfoStruct boostInfo = 0; } /** Allows a client to request that the water heater is put into a Boost state. */ diff --git a/examples/all-clusters-app/all-clusters-common/include/WhmDelegate.h b/examples/all-clusters-app/all-clusters-common/include/WhmDelegate.h index ad73239e77990d..27d8cd7cd96ecf 100644 --- a/examples/all-clusters-app/all-clusters-common/include/WhmDelegate.h +++ b/examples/all-clusters-app/all-clusters-common/include/WhmDelegate.h @@ -56,30 +56,52 @@ class WaterHeaterManagementDelegate : public WaterHeaterManagement::Delegate *********************************************************************************/ /** - * @brief Delegate should implement a handler to start boosting the water temperature as required. - * Upon receipt, the Water Heater SHALL transition into the BOOST state, which SHALL cause the - * water in the tank (or the TargetPercentage of the water, if included) to be heated towards - * the set point (or the TemporarySetpoint, if included), which in turn may cause a call for heat, - * even if the mode is OFF, or is TIMED and it is during one of the Off periods. + * @brief Delegate should implement a handler to start boosting the water + * temperature as required. Upon receipt, the Water Heater SHALL + * transition into the BOOST state, which SHALL cause the water in + * the tank (or the TargetPercentage of the water, if included) to be + * heated towards the set point (or the TemporarySetpoint, if + * included), which in turn may cause a call for heat, even if the + * mode is OFF, or is TIMED and it is during one of the Off periods. * - * @param duration Indicates the time period in seconds for which the BOOST state is activated before it - * automatically reverts to the previous mode (e.g. OFF, MANUAL or TIMED). - * @param oneShot Indicates whether the BOOST state should be automatically canceled once the hot water has - * first reached the set point temperature (or the TemporarySetpoint temperature, if specified) - * for the TargetPercentage (if specified). - * @param emergencyBoost Indicates that the consumer wants the water to be heated as quickly as practicable. - * This MAY cause multiple heat sources to be activated (e.g. a heat pump and direct - * electric heating element). - * @param temporarySetpoint Indicates the target temperature to which to heat the hot water for this Boost command. - * It SHALL be used instead of the normal set point temperature whilst the BOOST state is active. - * @param targetPercentage If the tank supports the TankPercent feature, this field indicates the amount of water - * that SHALL be heated by this Boost command before the heater is switched off. - * @param targetReheat If the tank supports the TankPercent feature, and the heating by this Boost command has ceased - * because the TargetPercentage of the water in the tank has been heated to the set point (or - * TemporarySetpoint if included), this field indicates the percentage to which the hot water in - * the tank SHALL be allowed to fall before again beginning to reheat it. + * @param duration Indicates the time period in seconds for which + * the BOOST state is activated before it + * automatically reverts to the previous mode + * (e.g. OFF, MANUAL or TIMED). * - * @return Success if the boost command is accepted; otherwise the command SHALL be rejected with appropriate error. + * @param oneShot Indicates whether the BOOST state should be + * automatically canceled once the hot water has + * first reached the set point temperature (or the + * TemporarySetpoint temperature, if specified) + * for the TargetPercentage (if specified). + * + * @param emergencyBoost Indicates that the consumer wants the water to + * be heated as quickly as practicable. This MAY + * cause multiple heat sources to be activated + * (e.g. a heat pump and direct electric heating + * element). + * + * @param temporarySetpoint Indicates the target temperature to which to + * heat the hot water for this Boost command. It + * SHALL be used instead of the normal set point + * temperature whilst the BOOST state is active. + * + * @param targetPercentage If the tank supports the TankPercent feature, + * this field indicates the amount of water that + * SHALL be heated by this Boost command before + * the heater is switched off. + * + * @param targetReheat If the tank supports the TankPercent feature, + * and the heating by this Boost command has + * ceased because the TargetPercentage of the + * water in the tank has been heated to the set + * point (or TemporarySetpoint if included), this + * field indicates the percentage to which the hot + * water in the tank SHALL be allowed to fall + * before again beginning to reheat it. + * + * @return Success if the boost command is accepted; otherwise the command + * SHALL be rejected with appropriate error. */ Protocols::InteractionModel::Status HandleBoost(uint32_t duration, Optional oneShot, Optional emergencyBoost, Optional temporarySetpoint, Optional targetPercentage, @@ -87,8 +109,8 @@ class WaterHeaterManagementDelegate : public WaterHeaterManagement::Delegate /** * @brief Delegate should implement a handler to cancel a boost command. - * Upon receipt, the Water Heater SHALL transition back from the BOOST state to the previous mode - * (e.g. OFF, MANUAL or TIMED). + * Upon receipt, the Water Heater SHALL transition back from the + * BOOST state to the previous mode (e.g. OFF, MANUAL or TIMED). * * @return It should report SUCCESS if successful and FAILURE otherwise. */ @@ -96,8 +118,8 @@ class WaterHeaterManagementDelegate : public WaterHeaterManagement::Delegate // ------------------------------------------------------------------ // Get attribute methods - BitMask GetHeaterTypes() override; - BitMask GetHeatDemand() override; + BitMask GetHeaterTypes() override; + BitMask GetHeatDemand() override; uint16_t GetTankVolume() override; int64_t GetEstimatedHeatRequired() override; Percent GetTankPercentage() override; @@ -105,18 +127,18 @@ class WaterHeaterManagementDelegate : public WaterHeaterManagement::Delegate // ------------------------------------------------------------------ // Set attribute methods - void SetHeaterTypes(BitMask heaterTypes); - void SetHeatDemand(BitMask heatDemand); + void SetHeaterTypes(BitMask heaterTypes); + void SetHeatDemand(BitMask heatDemand); void SetTankVolume(uint16_t tankVolume); void SetEstimatedHeatRequired(int64_t estimatedHeatRequired); void SetTankPercentage(Percent tankPercentage); void SetBoostState(BoostStateEnum boostState); - /********************************************************************************* + /*************************************************************************** * * WaterHeaterManagementDelegate specific methods * - *********************************************************************************/ + ***************************************************************************/ /** * @brief Set the Water Header Mode and act accordingly. @@ -155,36 +177,44 @@ class WaterHeaterManagementDelegate : public WaterHeaterManagement::Delegate void HandleBoostTimerExpiry(); /** - * Determines whether the tank water temperature has reached the target temperature. + * Determines whether the tank water temperature has reached the target + * temperature. * - * @return Returns True is tank water temperature has reached the target temperature, False otherwise. + * @return Returns True is tank water temperature has reached the target + * temperature, False otherwise. */ bool HasWaterTemperatureReachedTarget() const; /** * Simulates water being drawn from the water tank. * - * @param percentageReplaced The % of water being replaced with water with a temperature of replacedWaterTemperature. - * @param replacedWaterTemperature The temperature of the percentageReplaced water. + * @param percentageReplaced The % of water being replaced with water with + * a temperature of replacedWaterTemperature. + * + * @param replacedWaterTemperature The temperature of the + * percentageReplaced water. */ void DrawOffHotWater(chip::Percent percentageReplaced, uint16_t replacedWaterTemperature); private: /** - * @brief Determine whether heating needs to be turned on or off or left as is. + * @brief Determine whether heating needs to be turned on or off or left as + * is. * - * @param heatingOp[out] Set as determined whether heating needs to be turned on/off or left unchanged. + * @param heatingOp[out] Set as determined whether heating needs to be + * turned on/off or left unchanged. * - * @return Success if the heating operation could be determined otherwise returns with appropriate error. + * @return Success if the heating operation could be determined otherwise + * returns with appropriate error. */ Protocols::InteractionModel::Status DetermineIfChangingHeatingState(HeatingOp & heatingOp); private: - /********************************************************************************* + /*************************************************************************** * * WaterHeaterManagementDelegate specific attributes * - *********************************************************************************/ + ***************************************************************************/ // Need the following so can determine which features are supported WaterHeaterManagement::Instance * mpWhmInstance; @@ -203,34 +233,44 @@ class WaterHeaterManagementDelegate : public WaterHeaterManagement::Delegate // Boost command parameters - // This field SHALL indicate whether the BOOST state should be automatically canceled once the hot water has first reached the - // set point temperature (or the TemporarySetpoint temperature, if specified) for the TargetPercentage (if specified). + // This field SHALL indicate whether the BOOST state should be automatically + // canceled once the hot water has first reached the set point temperature + // (or the TemporarySetpoint temperature, if specified) for the + // TargetPercentage (if specified). Optional mBoostOneShot; - // This field indicates that the consumer wants the water to be heated as quickly as practicable. This MAY cause multiple heat - // sources to be activated (e.g. a heat pump and direct electric heating element). + // This field indicates that the consumer wants the water to be heated as + // quickly as practicable. This MAY cause multiple heat sources to be + // activated (e.g. a heat pump and direct electric heating element). Optional mBoostEmergencyBoost; - // This field indicates the target temperature to which to heat the hot water for this Boost command. It SHALL be used instead - // of the normal set point temperature whilst the BOOST state is active. + // This field indicates the target temperature to which to heat the hot + // water for this Boost command. It SHALL be used instead of the normal set + // point temperature whilst the BOOST state is active. Optional mBoostTemporarySetpoint; - // If the tank supports the TankPercent feature, this field indicates the amount of water that SHALL be heated by this Boost - // command before the heater is switched off. This field is optional, however it SHALL be included if the TargetReheat field is - // included. + // If the tank supports the TankPercent feature, this field indicates the + // amount of water that SHALL be heated by this Boost command before the + // heater is switched off. This field is optional, however it SHALL be + // included if the TargetReheat field is included. Optional mBoostTargetPercentage; - // If the tank supports the TankPercent feature, and the heating by this Boost command has ceased because the TargetPercentage - // of the water in the tank has been heated to the set point (or TemporarySetpoint if included), this field indicates the - // percentage to which the hot water in the tank SHALL be allowed to fall before again beginning to reheat it. For example if - // the TargetPercentage was 80%, and the TargetReheat was 40%, then after initial heating to 80% hot water, the tank may have - // hot water drawn off until only 40% hot water remains. At this point the heater will begin to heat back up to 80% of hot - // water. If this field and the OneShot field were both omitted, heating would begin again after any water draw which reduced - // the TankPercentage below 80%. + // If the tank supports the TankPercent feature, and the heating by this + // Boost command has ceased because the TargetPercentage of the water in the + // tank has been heated to the set point (or TemporarySetpoint if included), + // this field indicates the percentage to which the hot water in the tank + // SHALL be allowed to fall before again beginning to reheat it. For example + // if the TargetPercentage was 80%, and the TargetReheat was 40%, then after + // initial heating to 80% hot water, the tank may have hot water drawn off + // until only 40% hot water remains. At this point the heater will begin to + // heat back up to 80% of hot water. If this field and the OneShot field + // were both omitted, heating would begin again after any water draw which + // reduced the TankPercentage below 80%. Optional mBoostTargetReheat; - // Track whether the water temperature has reached the water temperature specified in the boost command. Used in conjunction - // with the boost command boostTargetReheat parameter + // Track whether the water temperature has reached the water temperature + // specified in the boost command. Used in conjunction with the boost + // command boostTargetReheat parameter bool mBoostTargetTemperatureReached; /********************************************************************************* @@ -239,28 +279,35 @@ class WaterHeaterManagementDelegate : public WaterHeaterManagement::Delegate * *********************************************************************************/ - // This attribute SHALL indicate the methods to call for heat that the controller supports. If a bit is set then the controller - // supports the corresponding method. - BitMask mHeaterTypes; + // This attribute SHALL indicate the methods to call for heat that the + // controller supports. If a bit is set then the controller supports the + // corresponding method. + BitMask mHeaterTypes; - // This attribute SHALL indicate if the controller is asking for heat. If a bit is set then the corresponding call for heat is - // active. - BitMask mHeatDemand; + // This attribute SHALL indicate if the controller is asking for heat. If a + // bit is set then the corresponding call for heat is active. + BitMask mHeatDemand; - // This attribute SHALL indicate the volume of water that the hot water tank can hold (in units of Litres). This allows an - // energy management system to estimate the required heating energy needed to reach the target temperature. + // This attribute SHALL indicate the volume of water that the hot water tank + // can hold (in units of Litres). This allows an energy management system to + // estimate the required heating energy needed to reach the target + // temperature. uint16_t mTankVolume; - // This attribute SHALL indicate the estimated heat energy needed to raise the water temperature to the target setpoint. This - // can be computed by taking the specific heat capacity of water (4182 J/kg °C) and by knowing the current temperature of the - // water, the tank volume and target temperature. + // This attribute SHALL indicate the estimated heat energy needed to raise + // the water temperature to the target setpoint. This can be computed by + // taking the specific heat capacity of water (4182 J/kg °C) and by knowing + // the current temperature of the water, the tank volume and target + // temperature. int64_t mEstimatedHeatRequired; - // This attribute SHALL indicate an approximate level of hot water stored in the tank, which may help consumers understand the - // amount of hot water remaining in the tank. + // This attribute SHALL indicate an approximate level of hot water stored in + // the tank, which may help consumers understand the amount of hot water + // remaining in the tank. Percent mTankPercentage; - // This attribute SHALL indicate if the BOOST state, as triggered by a Boost command, is currently active. + // This attribute SHALL indicate if the BOOST state, as triggered by a Boost + // command, is currently active. BoostStateEnum mBoostState; }; diff --git a/examples/all-clusters-app/all-clusters-common/include/WhmManufacturer.h b/examples/all-clusters-app/all-clusters-common/include/WhmManufacturer.h index d51e6a62f2021c..b56aa24abf491f 100644 --- a/examples/all-clusters-app/all-clusters-common/include/WhmManufacturer.h +++ b/examples/all-clusters-app/all-clusters-common/include/WhmManufacturer.h @@ -62,7 +62,7 @@ class WhmManufacturer /** * @brief Called to determine which heating sources to use, */ - BitMask DetermineHeatingSources(); + BitMask DetermineHeatingSources(); /** * @brief Turn the heating of the water tank on. @@ -83,23 +83,44 @@ class WhmManufacturer /** * @brief Called to handle a boost command. * - * @param duration Indicates the time period in seconds for which the BOOST state is activated before it automatically reverts - * to the previous mode (e.g. OFF, MANUAL or TIMED). - * @param oneShot Indicates whether the BOOST state should be automatically canceled once the hot water has first reached the - * set point temperature (or the TemporarySetpoint temperature, if specified) for the TargetPercentage (if - * specified). - * @param emergencyBoost Indicates that the consumer wants the water to be heated as quickly as practicable. This MAY cause - * multiple heat sources to be activated (e.g. a heat pump and direct electric heating element). - * @param temporarySetpoint Indicates the target temperature to which to heat the hot water for this Boost command. It SHALL be - * used instead of the normal set point temperature whilst the BOOST state is active. - * @param targetPercentage If the tank supports the TankPercent feature, this field indicates the amount of water that SHALL be - * heated by this Boost command before the heater is switched off. - * @param targetReheat If the tank supports the TankPercent feature, and the heating by this Boost command has ceased because - * the TargetPercentage of the water in the tank has been heated to the set point (or TemporarySetpoint if - * included), this field indicates the percentage to which the hot water in the tank SHALL be allowed to fall before again - * beginning to reheat it. + * @param duration Indicates the time period in seconds for which + * the BOOST state is activated before it + * automatically reverts to the previous mode + * (e.g. OFF, MANUAL or TIMED). * - * @return Success if the boost command is successful; otherwise return the appropriate error. + * @param oneShot Indicates whether the BOOST state should be + * automatically canceled once the hot water has + * first reached the set point temperature (or the + * TemporarySetpoint temperature, if specified) + * for the TargetPercentage (if specified). + * + * @param emergencyBoost Indicates that the consumer wants the water to + * be heated as quickly as practicable. This MAY + * cause multiple heat sources to be activated + * (e.g. a heat pump and direct electric heating + * element). + * + * @param temporarySetpoint Indicates the target temperature to which to + * heat the hot water for this Boost command. It + * SHALL be used instead of the normal set point + * temperature whilst the BOOST state is active. + * + * @param targetPercentage If the tank supports the TankPercent feature, + * this field indicates the amount of water that + * SHALL be heated by this Boost command before + * the heater is switched off. + * + * @param targetReheat If the tank supports the TankPercent feature, + * and the heating by this Boost command has + * ceased because the TargetPercentage of the + * water in the tank has been heated to the set + * point (or TemporarySetpoint if included), this + * field indicates the percentage to which the hot + * water in the tank SHALL be allowed to fall + * before again beginning to reheat it. + * + * @return Success if the boost command is successful; otherwise return the + * appropriate error. */ Protocols::InteractionModel::Status BoostCommandStarted(uint32_t duration, Optional oneShot, Optional emergencyBoost, Optional temporarySetpoint, diff --git a/examples/all-clusters-app/all-clusters-common/src/WhmDelegateImpl.cpp b/examples/all-clusters-app/all-clusters-common/src/WhmDelegateImpl.cpp index 0568e5c9c7d002..af09a13a0dab2d 100644 --- a/examples/all-clusters-app/all-clusters-common/src/WhmDelegateImpl.cpp +++ b/examples/all-clusters-app/all-clusters-common/src/WhmDelegateImpl.cpp @@ -50,12 +50,12 @@ void WaterHeaterManagementDelegate::SetWhmManufacturer(WhmManufacturer & whmManu * *********************************************************************************/ -BitMask WaterHeaterManagementDelegate::GetHeaterTypes() +BitMask WaterHeaterManagementDelegate::GetHeaterTypes() { return mHeaterTypes; } -BitMask WaterHeaterManagementDelegate::GetHeatDemand() +BitMask WaterHeaterManagementDelegate::GetHeatDemand() { return mHeatDemand; } @@ -80,7 +80,7 @@ BoostStateEnum WaterHeaterManagementDelegate::GetBoostState() return mBoostState; } -void WaterHeaterManagementDelegate::SetHeaterTypes(BitMask heaterTypes) +void WaterHeaterManagementDelegate::SetHeaterTypes(BitMask heaterTypes) { if (mHeaterTypes != heaterTypes) { @@ -90,7 +90,7 @@ void WaterHeaterManagementDelegate::SetHeaterTypes(BitMask heatDemand) +void WaterHeaterManagementDelegate::SetHeatDemand(BitMask heatDemand) { if (mHeatDemand != heatDemand) { diff --git a/examples/all-clusters-app/all-clusters-common/src/WhmManufacturer.cpp b/examples/all-clusters-app/all-clusters-common/src/WhmManufacturer.cpp index dd8452a5c816ca..8865501fcca6fe 100644 --- a/examples/all-clusters-app/all-clusters-common/src/WhmManufacturer.cpp +++ b/examples/all-clusters-app/all-clusters-common/src/WhmManufacturer.cpp @@ -43,8 +43,8 @@ CHIP_ERROR WhmManufacturer::Init() return CHIP_ERROR_UNINITIALIZED; } - dg->SetHeaterTypes(BitMask(WaterHeaterTypeBitmap::kImmersionElement1)); - dg->SetHeatDemand(BitMask(WaterHeaterDemandBitmap::kImmersionElement1)); + dg->SetHeaterTypes(BitMask(WaterHeaterHeatSourceBitmap::kImmersionElement1)); + dg->SetHeatDemand(BitMask(WaterHeaterHeatSourceBitmap::kImmersionElement1)); dg->SetEstimatedHeatRequired(10000); return CHIP_NO_ERROR; @@ -55,36 +55,36 @@ CHIP_ERROR WhmManufacturer::Shutdown() return CHIP_NO_ERROR; } -BitMask WhmManufacturer::DetermineHeatingSources() +BitMask WhmManufacturer::DetermineHeatingSources() { WaterHeaterManagementDelegate * dg = GetWhmManufacturer()->GetWhmDelegate(); if (dg == nullptr) { ChipLogError(AppServer, "WhmDelegate is not initialized"); - return BitMask(0); + return BitMask(0); } // A list of valid heaterTypes uint8_t waterHeaterTypeValues[] = { - static_cast(WaterHeaterTypeBitmap::kImmersionElement1), - static_cast(WaterHeaterTypeBitmap::kImmersionElement2), - static_cast(WaterHeaterTypeBitmap::kHeatPump), - static_cast(WaterHeaterTypeBitmap::kBoiler), - static_cast(WaterHeaterTypeBitmap::kOther), + static_cast(WaterHeaterHeatSourceBitmap::kImmersionElement1), + static_cast(WaterHeaterHeatSourceBitmap::kImmersionElement2), + static_cast(WaterHeaterHeatSourceBitmap::kHeatPump), + static_cast(WaterHeaterHeatSourceBitmap::kBoiler), + static_cast(WaterHeaterHeatSourceBitmap::kOther), }; // The corresponding list of valid headerDemands uint8_t waterHeaterDemandValues[] = { - static_cast(WaterHeaterDemandBitmap::kImmersionElement1), - static_cast(WaterHeaterDemandBitmap::kImmersionElement2), - static_cast(WaterHeaterDemandBitmap::kHeatPump), - static_cast(WaterHeaterDemandBitmap::kBoiler), - static_cast(WaterHeaterDemandBitmap::kOther), + static_cast(WaterHeaterHeatSourceBitmap::kImmersionElement1), + static_cast(WaterHeaterHeatSourceBitmap::kImmersionElement2), + static_cast(WaterHeaterHeatSourceBitmap::kHeatPump), + static_cast(WaterHeaterHeatSourceBitmap::kBoiler), + static_cast(WaterHeaterHeatSourceBitmap::kOther), }; // Iterate across the valid waterHeaterTypes seeing which heating sources are available based on heaterTypes. // Set the corresponding bit in the heaterDemand bitmap. - BitMask heaterTypes = dg->GetHeaterTypes(); + BitMask heaterTypes = dg->GetHeaterTypes(); uint8_t heaterDemandMask = 0; for (uint16_t idx = 0; idx < static_cast(sizeof(waterHeaterTypeValues) / sizeof(waterHeaterTypeValues[0])); idx++) @@ -96,7 +96,7 @@ BitMask WhmManufacturer::DetermineHeatingSources() } } - return BitMask(heaterDemandMask); + return BitMask(heaterDemandMask); } Status WhmManufacturer::TurnHeatingOn(bool emergencyBoost) @@ -111,12 +111,12 @@ Status WhmManufacturer::TurnHeatingOn(bool emergencyBoost) { // emergencyBoost that the consumer wants the water to be heated as quickly as practicable. // Thus, cause multiple heat sources to be activated - dg->SetHeatDemand(BitMask(WaterHeaterDemandBitmap::kImmersionElement1, - WaterHeaterDemandBitmap::kImmersionElement2)); + dg->SetHeatDemand(BitMask(WaterHeaterHeatSourceBitmap::kImmersionElement1, + WaterHeaterHeatSourceBitmap::kImmersionElement2)); } else { - dg->SetHeatDemand(BitMask(WaterHeaterDemandBitmap::kImmersionElement1)); + dg->SetHeatDemand(BitMask(WaterHeaterHeatSourceBitmap::kImmersionElement1)); } return status; @@ -130,7 +130,7 @@ Status WhmManufacturer::TurnHeatingOff() WaterHeaterManagementDelegate * dg = GetWhmDelegate(); - dg->SetHeatDemand(BitMask(0)); + dg->SetHeatDemand(BitMask(0)); return status; } @@ -167,7 +167,7 @@ void SetTestEventTrigger_BasicInstallationTestEvent() // Simulate installation in a 100L tank full of water at 20C, with a target temperature of 60C, in OFF mode dg->SetTankVolume(100); dg->SetTargetWaterTemperature(6000); - dg->SetHeaterTypes(BitMask(WaterHeaterTypeBitmap::kImmersionElement1)); + dg->SetHeaterTypes(BitMask(WaterHeaterHeatSourceBitmap::kImmersionElement1)); dg->DrawOffHotWater(100, 2000); } diff --git a/src/app/clusters/water-heater-management-server/water-heater-management-server.cpp b/src/app/clusters/water-heater-management-server/water-heater-management-server.cpp index 0806638dd7ee4d..3cbe76f60d38f4 100644 --- a/src/app/clusters/water-heater-management-server/water-heater-management-server.cpp +++ b/src/app/clusters/water-heater-management-server/water-heater-management-server.cpp @@ -117,12 +117,12 @@ void Instance::InvokeCommand(HandlerContext & handlerContext) void Instance::HandleBoost(HandlerContext & ctx, const Commands::Boost::DecodableType & commandData) { - uint32_t duration = commandData.duration; - Optional oneShot = commandData.oneShot; - Optional emergencyBoost = commandData.emergencyBoost; - Optional temporarySetpoint = commandData.temporarySetpoint; - Optional targetPercentage = commandData.targetPercentage; - Optional targetReheat = commandData.targetReheat; + uint32_t duration = commandData.boostInfo.duration; + Optional oneShot = commandData.boostInfo.oneShot; + Optional emergencyBoost = commandData.boostInfo.emergencyBoost; + Optional temporarySetpoint = commandData.boostInfo.temporarySetpoint; + Optional targetPercentage = commandData.boostInfo.targetPercentage; + Optional targetReheat = commandData.boostInfo.targetReheat; // Notify the appliance if the appliance hardware cannot be adjusted, then return Failure if (HasFeature(WaterHeaterManagement::Feature::kTankPercent)) diff --git a/src/app/clusters/water-heater-management-server/water-heater-management-server.h b/src/app/clusters/water-heater-management-server/water-heater-management-server.h index a0a48ab900c200..71a52de9b45eef 100644 --- a/src/app/clusters/water-heater-management-server/water-heater-management-server.h +++ b/src/app/clusters/water-heater-management-server/water-heater-management-server.h @@ -43,29 +43,52 @@ class Delegate void SetEndpointId(EndpointId aEndpoint) { mEndpointId = aEndpoint; } /** - * @brief Delegate should implement a handler to start boosting the water temperature as required. - * Upon receipt, the Water Heater SHALL transition into the BOOST state, which SHALL cause the water in the - * tank (or the TargetPercentage of the water, if included) to be heated towards the set point (or the - * TemporarySetpoint, if included), which in turn may cause a call for heat, even if the mode is OFF, or - * is TIMED and it is during one of the Off periods. + * @brief Delegate should implement a handler to start boosting the water + * temperature as required. Upon receipt, the Water Heater SHALL + * transition into the BOOST state, which SHALL cause the water in + * the tank (or the TargetPercentage of the water, if included) to be + * heated towards the set point (or the TemporarySetpoint, if + * included), which in turn may cause a call for heat, even if the + * mode is OFF, or is TIMED and it is during one of the Off periods. * - * @param duration Indicates the time period in seconds for which the BOOST state is activated before it automatically reverts - * to the previous mode (e.g. OFF, MANUAL or TIMED). - * @param oneShot Indicates whether the BOOST state should be automatically canceled once the hot water has first reached the - * set point temperature (or the TemporarySetpoint temperature, if specified) for the TargetPercentage (if - * specified). - * @param emergencyBoost Indicates that the consumer wants the water to be heated as quickly as practicable. This MAY cause - * multiple heat sources to be activated (e.g. a heat pump and direct electric heating element). - * @param temporarySetpoint Indicates the target temperature to which to heat the hot water for this Boost command. It SHALL be - * used instead of the normal set point temperature whilst the BOOST state is active. - * @param targetPercentage If the tank supports the TankPercent feature, this field indicates the amount of water that SHALL be - * heated by this Boost command before the heater is switched off. - * @param targetReheat If the tank supports the TankPercent feature, and the heating by this Boost command has ceased because - * the TargetPercentage of the water in the tank has been heated to the set point (or TemporarySetpoint if - * included), this field indicates the percentage to which the hot water in the tank SHALL be allowed to - * fall before again beginning to reheat it. + * @param duration Indicates the time period in seconds for which + * the BOOST state is activated before it + * automatically reverts to the previous mode + * (e.g. OFF, MANUAL or TIMED). * - * @return Success if the boost command is accepted; otherwise the command SHALL be rejected with appropriate error. + * @param oneShot Indicates whether the BOOST state should be + * automatically canceled once the hot water has + * first reached the set point temperature (or the + * TemporarySetpoint temperature, if specified) + * for the TargetPercentage (if specified). + * + * @param emergencyBoost Indicates that the consumer wants the water to + * be heated as quickly as practicable. This MAY + * cause multiple heat sources to be activated + * (e.g. a heat pump and direct electric heating + * element). + * + * @param temporarySetpoint Indicates the target temperature to which to + * heat the hot water for this Boost command. It + * SHALL be used instead of the normal set point + * temperature whilst the BOOST state is active. + * + * @param targetPercentage If the tank supports the TankPercent feature, + * this field indicates the amount of water that + * SHALL be heated by this Boost command before + * the heater is switched off. + * + * @param targetReheat If the tank supports the TankPercent feature, + * and the heating by this Boost command has + * ceased because the TargetPercentage of the + * water in the tank has been heated to the set + * point (or TemporarySetpoint if included), this + * field indicates the percentage to which the hot + * water in the tank SHALL be allowed to fall + * before again beginning to reheat it. + * + * @return Success if the boost command is accepted; otherwise the command + * SHALL be rejected with appropriate error. */ virtual Protocols::InteractionModel::Status HandleBoost(uint32_t duration, Optional oneShot, Optional emergencyBoost, Optional temporarySetpoint, @@ -73,8 +96,8 @@ class Delegate /** * @brief Delegate should implement a handler to cancel a boost command. - * Upon receipt, the Water Heater SHALL transition back from the BOOST state to the previous mode (e.g. OFF, - * MANUAL or TIMED). + * Upon receipt, the Water Heater SHALL transition back from the + * BOOST state to the previous mode (e.g. OFF, MANUAL or TIMED). * * @return It should report SUCCESS if successful and FAILURE otherwise. */ @@ -82,12 +105,12 @@ class Delegate // ------------------------------------------------------------------ // Get attribute methods - virtual BitMask GetHeaterTypes() = 0; - virtual BitMask GetHeatDemand() = 0; - virtual uint16_t GetTankVolume() = 0; - virtual int64_t GetEstimatedHeatRequired() = 0; - virtual Percent GetTankPercentage() = 0; - virtual BoostStateEnum GetBoostState() = 0; + virtual BitMask GetHeaterTypes() = 0; + virtual BitMask GetHeatDemand() = 0; + virtual uint16_t GetTankVolume() = 0; + virtual int64_t GetEstimatedHeatRequired() = 0; + virtual Percent GetTankPercentage() = 0; + virtual BoostStateEnum GetBoostState() = 0; protected: EndpointId mEndpointId = 0; 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 0c5a9a1efea2fa..8246930e5b4dab 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,16 +16,7 @@ limitations under the License. --> - - - - - - - - - - + @@ -40,6 +31,16 @@ limitations under the License. + + + + + + + + + + Energy Management Water Heater Management @@ -51,26 +52,21 @@ limitations under the License. - + true - - HeaterTypes - HeatDemand + + HeaterTypes + HeatDemand TankVolume - EstimatedHeatRequired + EstimatedHeatRequired TankPercentage BoostState Allows a client to request that the water heater is put into a Boost state. - - - - - - + @@ -79,5 +75,14 @@ limitations under the License. + + BoostStarted + + + + + BoostEnded + + diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 2e41cad5a77fe2..02408e1ecf74b0 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -4647,7 +4647,7 @@ cluster ElectricalEnergyMeasurement = 145 { /** 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; + revision 2; enum BoostStateEnum : enum8 { kInactive = 0; @@ -4659,7 +4659,7 @@ provisional cluster WaterHeaterManagement = 148 { kTankPercent = 0x2; } - bitmap WaterHeaterDemandBitmap : bitmap8 { + bitmap WaterHeaterHeatSourceBitmap : bitmap8 { kImmersionElement1 = 0x1; kImmersionElement2 = 0x2; kHeatPump = 0x4; @@ -4667,16 +4667,24 @@ provisional cluster WaterHeaterManagement = 148 { kOther = 0x10; } - bitmap WaterHeaterTypeBitmap : bitmap8 { - kImmersionElement1 = 0x1; - kImmersionElement2 = 0x2; - kHeatPump = 0x4; - kBoiler = 0x8; - kOther = 0x10; + struct WaterHeaterBoostInfoStruct { + elapsed_s duration = 0; + optional boolean oneShot = 1; + optional boolean emergencyBoost = 2; + optional temperature temporarySetpoint = 3; + optional percent targetPercentage = 4; + optional percent targetReheat = 5; + } + + info event BoostStarted = 0 { + WaterHeaterBoostInfoStruct boostInfo = 0; } - readonly attribute WaterHeaterTypeBitmap heaterTypes = 0; - readonly attribute WaterHeaterDemandBitmap heatDemand = 1; + info event BoostEnded = 1 { + } + + readonly attribute WaterHeaterHeatSourceBitmap heaterTypes = 0; + readonly attribute WaterHeaterHeatSourceBitmap heatDemand = 1; readonly attribute optional int16u tankVolume = 2; readonly attribute optional energy_mwh estimatedHeatRequired = 3; readonly attribute optional percent tankPercentage = 4; @@ -4689,12 +4697,7 @@ provisional cluster WaterHeaterManagement = 148 { 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; + WaterHeaterBoostInfoStruct boostInfo = 0; } /** Allows a client to request that the water heater is put into a Boost state. */ diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java index 5944e05356d9c5..8b112f53c6f36d 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java @@ -30541,37 +30541,17 @@ 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, ChipStructs.WaterHeaterManagementClusterWaterHeaterBoostInfoStruct boostInfo) { + boost(callback, boostInfo, 0); } - public void boost(DefaultClusterCallback callback, Long duration, Optional oneShot, Optional emergencyBoost, Optional temporarySetpoint, Optional targetPercentage, Optional targetReheat, int timedInvokeTimeoutMs) { + public void boost(DefaultClusterCallback callback, ChipStructs.WaterHeaterManagementClusterWaterHeaterBoostInfoStruct boostInfo, 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)); + final long boostInfoFieldID = 0L; + BaseTLVType boostInfotlvValue = boostInfo.encodeTlv(); + elements.add(new StructElement(boostInfoFieldID, boostInfotlvValue)); StructType commandArgs = new StructType(elements); invoke(new InvokeCallbackImpl(callback) { diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipEventStructs.java b/src/controller/java/generated/java/chip/devicecontroller/ChipEventStructs.java index 7a7634b395cb38..4e3c6ce296c7b7 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipEventStructs.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipEventStructs.java @@ -3808,6 +3808,80 @@ public String toString() { return output.toString(); } } +public static class WaterHeaterManagementClusterBoostStartedEvent { + public ChipStructs.WaterHeaterManagementClusterWaterHeaterBoostInfoStruct boostInfo; + private static final long BOOST_INFO_ID = 0L; + + public WaterHeaterManagementClusterBoostStartedEvent( + ChipStructs.WaterHeaterManagementClusterWaterHeaterBoostInfoStruct boostInfo + ) { + this.boostInfo = boostInfo; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(BOOST_INFO_ID, boostInfo.encodeTlv())); + + return new StructType(values); + } + + public static WaterHeaterManagementClusterBoostStartedEvent decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + ChipStructs.WaterHeaterManagementClusterWaterHeaterBoostInfoStruct boostInfo = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == BOOST_INFO_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Struct) { + StructType castingValue = element.value(StructType.class); + boostInfo = ChipStructs.WaterHeaterManagementClusterWaterHeaterBoostInfoStruct.decodeTlv(castingValue); + } + } + } + return new WaterHeaterManagementClusterBoostStartedEvent( + boostInfo + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("WaterHeaterManagementClusterBoostStartedEvent {\n"); + output.append("\tboostInfo: "); + output.append(boostInfo); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class WaterHeaterManagementClusterBoostEndedEvent { + + public WaterHeaterManagementClusterBoostEndedEvent( + ) { + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + + return new StructType(values); + } + + public static WaterHeaterManagementClusterBoostEndedEvent decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + return new WaterHeaterManagementClusterBoostEndedEvent( + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("WaterHeaterManagementClusterBoostEndedEvent {\n"); + output.append("}\n"); + return output.toString(); + } +} public static class DemandResponseLoadControlClusterLoadControlEventStatusChangeEvent { public byte[] eventID; public @Nullable Integer transitionIndex; diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java b/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java index 4e07b6d86182d9..2871071475fe69 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java @@ -6744,6 +6744,127 @@ public String toString() { return output.toString(); } } +public static class WaterHeaterManagementClusterWaterHeaterBoostInfoStruct { + public Long duration; + public Optional oneShot; + public Optional emergencyBoost; + public Optional temporarySetpoint; + public Optional targetPercentage; + public Optional targetReheat; + private static final long DURATION_ID = 0L; + private static final long ONE_SHOT_ID = 1L; + private static final long EMERGENCY_BOOST_ID = 2L; + private static final long TEMPORARY_SETPOINT_ID = 3L; + private static final long TARGET_PERCENTAGE_ID = 4L; + private static final long TARGET_REHEAT_ID = 5L; + + public WaterHeaterManagementClusterWaterHeaterBoostInfoStruct( + Long duration, + Optional oneShot, + Optional emergencyBoost, + Optional temporarySetpoint, + Optional targetPercentage, + Optional targetReheat + ) { + this.duration = duration; + this.oneShot = oneShot; + this.emergencyBoost = emergencyBoost; + this.temporarySetpoint = temporarySetpoint; + this.targetPercentage = targetPercentage; + this.targetReheat = targetReheat; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(DURATION_ID, new UIntType(duration))); + values.add(new StructElement(ONE_SHOT_ID, oneShot.map((nonOptionaloneShot) -> new BooleanType(nonOptionaloneShot)).orElse(new EmptyType()))); + values.add(new StructElement(EMERGENCY_BOOST_ID, emergencyBoost.map((nonOptionalemergencyBoost) -> new BooleanType(nonOptionalemergencyBoost)).orElse(new EmptyType()))); + values.add(new StructElement(TEMPORARY_SETPOINT_ID, temporarySetpoint.map((nonOptionaltemporarySetpoint) -> new IntType(nonOptionaltemporarySetpoint)).orElse(new EmptyType()))); + values.add(new StructElement(TARGET_PERCENTAGE_ID, targetPercentage.map((nonOptionaltargetPercentage) -> new UIntType(nonOptionaltargetPercentage)).orElse(new EmptyType()))); + values.add(new StructElement(TARGET_REHEAT_ID, targetReheat.map((nonOptionaltargetReheat) -> new UIntType(nonOptionaltargetReheat)).orElse(new EmptyType()))); + + return new StructType(values); + } + + public static WaterHeaterManagementClusterWaterHeaterBoostInfoStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Long duration = null; + Optional oneShot = Optional.empty(); + Optional emergencyBoost = Optional.empty(); + Optional temporarySetpoint = Optional.empty(); + Optional targetPercentage = Optional.empty(); + Optional targetReheat = Optional.empty(); + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == DURATION_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + duration = castingValue.value(Long.class); + } + } else if (element.contextTagNum() == ONE_SHOT_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Boolean) { + BooleanType castingValue = element.value(BooleanType.class); + oneShot = Optional.of(castingValue.value(Boolean.class)); + } + } else if (element.contextTagNum() == EMERGENCY_BOOST_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Boolean) { + BooleanType castingValue = element.value(BooleanType.class); + emergencyBoost = Optional.of(castingValue.value(Boolean.class)); + } + } else if (element.contextTagNum() == TEMPORARY_SETPOINT_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Int) { + IntType castingValue = element.value(IntType.class); + temporarySetpoint = Optional.of(castingValue.value(Integer.class)); + } + } else if (element.contextTagNum() == TARGET_PERCENTAGE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + targetPercentage = Optional.of(castingValue.value(Integer.class)); + } + } else if (element.contextTagNum() == TARGET_REHEAT_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + targetReheat = Optional.of(castingValue.value(Integer.class)); + } + } + } + return new WaterHeaterManagementClusterWaterHeaterBoostInfoStruct( + duration, + oneShot, + emergencyBoost, + temporarySetpoint, + targetPercentage, + targetReheat + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("WaterHeaterManagementClusterWaterHeaterBoostInfoStruct {\n"); + output.append("\tduration: "); + output.append(duration); + output.append("\n"); + output.append("\toneShot: "); + output.append(oneShot); + output.append("\n"); + output.append("\temergencyBoost: "); + output.append(emergencyBoost); + output.append("\n"); + output.append("\ttemporarySetpoint: "); + output.append(temporarySetpoint); + output.append("\n"); + output.append("\ttargetPercentage: "); + output.append(targetPercentage); + output.append("\n"); + output.append("\ttargetReheat: "); + output.append(targetReheat); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} public static class DemandResponseLoadControlClusterHeatingSourceControlStruct { public Integer heatingSource; private static final long HEATING_SOURCE_ID = 0L; diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java index c6677b6aa93f47..5dbefbab1da2b7 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java @@ -9415,7 +9415,9 @@ public static Attribute value(long id) throws NoSuchFieldError { } } - public enum Event {; + public enum Event { + BoostStarted(0L), + BoostEnded(1L),; private final long id; Event(long id) { this.id = id; @@ -9455,7 +9457,7 @@ public static Command value(long id) throws NoSuchFieldError { } throw new NoSuchFieldError(); } - }public enum BoostCommandField {Duration(0),OneShot(1),EmergencyBoost(2),TemporarySetpoint(3),TargetPercentage(4),TargetReheat(5),; + }public enum BoostCommandField {BoostInfo(0),; private final int id; BoostCommandField(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 986d59f3635af1..f58ac0f6e47798 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java @@ -25754,39 +25754,12 @@ public Map> getCommandMap() { 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") + , (ChipStructs.WaterHeaterManagementClusterWaterHeaterBoostInfoStruct) + commandArguments.get("boostInfo") ); }, () -> new DelegatedDefaultClusterCallback(), diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/WaterHeaterManagementClusterBoostStartedEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/WaterHeaterManagementClusterBoostStartedEvent.kt new file mode 100644 index 00000000000000..f8a5e55e2e7894 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/WaterHeaterManagementClusterBoostStartedEvent.kt @@ -0,0 +1,57 @@ +/* + * + * 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.eventstructs + +import chip.devicecontroller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class WaterHeaterManagementClusterBoostStartedEvent( + val boostInfo: + chip.devicecontroller.cluster.structs.WaterHeaterManagementClusterWaterHeaterBoostInfoStruct +) { + override fun toString(): String = buildString { + append("WaterHeaterManagementClusterBoostStartedEvent {\n") + append("\tboostInfo : $boostInfo\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + boostInfo.toTlv(ContextSpecificTag(TAG_BOOST_INFO), this) + endStructure() + } + } + + companion object { + private const val TAG_BOOST_INFO = 0 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): WaterHeaterManagementClusterBoostStartedEvent { + tlvReader.enterStructure(tlvTag) + val boostInfo = + chip.devicecontroller.cluster.structs.WaterHeaterManagementClusterWaterHeaterBoostInfoStruct + .fromTlv(ContextSpecificTag(TAG_BOOST_INFO), tlvReader) + + tlvReader.exitContainer() + + return WaterHeaterManagementClusterBoostStartedEvent(boostInfo) + } + } +} 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 ca6223a2c1f96e..9665346b3d04b2 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni @@ -156,6 +156,7 @@ structs_sources = [ "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterTestGlobalStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterTestListStructOctet.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UserLabelClusterLabelStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/WaterHeaterManagementClusterWaterHeaterBoostInfoStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/WaterHeaterModeClusterModeOptionStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/WaterHeaterModeClusterModeTagStruct.kt", ] @@ -241,6 +242,7 @@ eventstructs_sources = [ "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/UnitTestingClusterTestFabricScopedEventEvent.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ValveConfigurationAndControlClusterValveFaultEvent.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ValveConfigurationAndControlClusterValveStateChangedEvent.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/WaterHeaterManagementClusterBoostStartedEvent.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/WiFiNetworkDiagnosticsClusterAssociationFailureEvent.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/WiFiNetworkDiagnosticsClusterConnectionStatusEvent.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/WiFiNetworkDiagnosticsClusterDisconnectionEvent.kt", diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/WaterHeaterManagementClusterWaterHeaterBoostInfoStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/WaterHeaterManagementClusterWaterHeaterBoostInfoStruct.kt new file mode 100644 index 00000000000000..c9f95799bd18ba --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/WaterHeaterManagementClusterWaterHeaterBoostInfoStruct.kt @@ -0,0 +1,130 @@ +/* + * + * 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 java.util.Optional +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class WaterHeaterManagementClusterWaterHeaterBoostInfoStruct( + val duration: ULong, + val oneShot: Optional, + val emergencyBoost: Optional, + val temporarySetpoint: Optional, + val targetPercentage: Optional, + val targetReheat: Optional, +) { + override fun toString(): String = buildString { + append("WaterHeaterManagementClusterWaterHeaterBoostInfoStruct {\n") + append("\tduration : $duration\n") + append("\toneShot : $oneShot\n") + append("\temergencyBoost : $emergencyBoost\n") + append("\ttemporarySetpoint : $temporarySetpoint\n") + append("\ttargetPercentage : $targetPercentage\n") + append("\ttargetReheat : $targetReheat\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_DURATION), duration) + if (oneShot.isPresent) { + val optoneShot = oneShot.get() + put(ContextSpecificTag(TAG_ONE_SHOT), optoneShot) + } + if (emergencyBoost.isPresent) { + val optemergencyBoost = emergencyBoost.get() + put(ContextSpecificTag(TAG_EMERGENCY_BOOST), optemergencyBoost) + } + if (temporarySetpoint.isPresent) { + val opttemporarySetpoint = temporarySetpoint.get() + put(ContextSpecificTag(TAG_TEMPORARY_SETPOINT), opttemporarySetpoint) + } + if (targetPercentage.isPresent) { + val opttargetPercentage = targetPercentage.get() + put(ContextSpecificTag(TAG_TARGET_PERCENTAGE), opttargetPercentage) + } + if (targetReheat.isPresent) { + val opttargetReheat = targetReheat.get() + put(ContextSpecificTag(TAG_TARGET_REHEAT), opttargetReheat) + } + endStructure() + } + } + + companion object { + private const val TAG_DURATION = 0 + private const val TAG_ONE_SHOT = 1 + private const val TAG_EMERGENCY_BOOST = 2 + private const val TAG_TEMPORARY_SETPOINT = 3 + private const val TAG_TARGET_PERCENTAGE = 4 + private const val TAG_TARGET_REHEAT = 5 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): WaterHeaterManagementClusterWaterHeaterBoostInfoStruct { + tlvReader.enterStructure(tlvTag) + val duration = tlvReader.getULong(ContextSpecificTag(TAG_DURATION)) + val oneShot = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_ONE_SHOT))) { + Optional.of(tlvReader.getBoolean(ContextSpecificTag(TAG_ONE_SHOT))) + } else { + Optional.empty() + } + val emergencyBoost = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_EMERGENCY_BOOST))) { + Optional.of(tlvReader.getBoolean(ContextSpecificTag(TAG_EMERGENCY_BOOST))) + } else { + Optional.empty() + } + val temporarySetpoint = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_TEMPORARY_SETPOINT))) { + Optional.of(tlvReader.getInt(ContextSpecificTag(TAG_TEMPORARY_SETPOINT))) + } else { + Optional.empty() + } + val targetPercentage = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_TARGET_PERCENTAGE))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_TARGET_PERCENTAGE))) + } else { + Optional.empty() + } + val targetReheat = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_TARGET_REHEAT))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_TARGET_REHEAT))) + } else { + Optional.empty() + } + + tlvReader.exitContainer() + + return WaterHeaterManagementClusterWaterHeaterBoostInfoStruct( + duration, + oneShot, + emergencyBoost, + temporarySetpoint, + targetPercentage, + targetReheat, + ) + } + } +} 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 7d0ce89e2a612e..5f7fb25dd58f77 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 @@ -86,12 +86,7 @@ class WaterHeaterManagementCluster( } suspend fun boost( - duration: UInt, - oneShot: Boolean?, - emergencyBoost: Boolean?, - temporarySetpoint: Short?, - targetPercentage: UByte?, - targetReheat: UByte?, + boostInfo: WaterHeaterManagementClusterWaterHeaterBoostInfoStruct, timedInvokeTimeout: Duration? = null, ) { val commandId: UInt = 0u @@ -99,29 +94,8 @@ class WaterHeaterManagementCluster( 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) } + val TAG_BOOST_INFO_REQ: Int = 0 + boostInfo.toTlv(ContextSpecificTag(TAG_BOOST_INFO_REQ), tlvWriter) tlvWriter.endStructure() val request: InvokeRequest = diff --git a/src/controller/java/generated/java/matter/controller/cluster/eventstructs/WaterHeaterManagementClusterBoostStartedEvent.kt b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/WaterHeaterManagementClusterBoostStartedEvent.kt new file mode 100644 index 00000000000000..44e51796c1fa50 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/WaterHeaterManagementClusterBoostStartedEvent.kt @@ -0,0 +1,57 @@ +/* + * + * 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.eventstructs + +import matter.controller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class WaterHeaterManagementClusterBoostStartedEvent( + val boostInfo: + matter.controller.cluster.structs.WaterHeaterManagementClusterWaterHeaterBoostInfoStruct +) { + override fun toString(): String = buildString { + append("WaterHeaterManagementClusterBoostStartedEvent {\n") + append("\tboostInfo : $boostInfo\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + boostInfo.toTlv(ContextSpecificTag(TAG_BOOST_INFO), this) + endStructure() + } + } + + companion object { + private const val TAG_BOOST_INFO = 0 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): WaterHeaterManagementClusterBoostStartedEvent { + tlvReader.enterStructure(tlvTag) + val boostInfo = + matter.controller.cluster.structs.WaterHeaterManagementClusterWaterHeaterBoostInfoStruct + .fromTlv(ContextSpecificTag(TAG_BOOST_INFO), tlvReader) + + tlvReader.exitContainer() + + return WaterHeaterManagementClusterBoostStartedEvent(boostInfo) + } + } +} 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 844c6692f5b9ad..62769c99e0bb89 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/files.gni +++ b/src/controller/java/generated/java/matter/controller/cluster/files.gni @@ -156,6 +156,7 @@ matter_structs_sources = [ "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/UnitTestingClusterTestGlobalStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/UnitTestingClusterTestListStructOctet.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/UserLabelClusterLabelStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/WaterHeaterManagementClusterWaterHeaterBoostInfoStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/WaterHeaterModeClusterModeOptionStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/WaterHeaterModeClusterModeTagStruct.kt", ] @@ -241,6 +242,7 @@ matter_eventstructs_sources = [ "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/eventstructs/UnitTestingClusterTestFabricScopedEventEvent.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/eventstructs/ValveConfigurationAndControlClusterValveFaultEvent.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/eventstructs/ValveConfigurationAndControlClusterValveStateChangedEvent.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/eventstructs/WaterHeaterManagementClusterBoostStartedEvent.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/eventstructs/WiFiNetworkDiagnosticsClusterAssociationFailureEvent.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/eventstructs/WiFiNetworkDiagnosticsClusterConnectionStatusEvent.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/eventstructs/WiFiNetworkDiagnosticsClusterDisconnectionEvent.kt", diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/WaterHeaterManagementClusterWaterHeaterBoostInfoStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/WaterHeaterManagementClusterWaterHeaterBoostInfoStruct.kt new file mode 100644 index 00000000000000..0b2fede4f1537a --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/WaterHeaterManagementClusterWaterHeaterBoostInfoStruct.kt @@ -0,0 +1,130 @@ +/* + * + * 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 java.util.Optional +import matter.controller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class WaterHeaterManagementClusterWaterHeaterBoostInfoStruct( + val duration: UInt, + val oneShot: Optional, + val emergencyBoost: Optional, + val temporarySetpoint: Optional, + val targetPercentage: Optional, + val targetReheat: Optional, +) { + override fun toString(): String = buildString { + append("WaterHeaterManagementClusterWaterHeaterBoostInfoStruct {\n") + append("\tduration : $duration\n") + append("\toneShot : $oneShot\n") + append("\temergencyBoost : $emergencyBoost\n") + append("\ttemporarySetpoint : $temporarySetpoint\n") + append("\ttargetPercentage : $targetPercentage\n") + append("\ttargetReheat : $targetReheat\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_DURATION), duration) + if (oneShot.isPresent) { + val optoneShot = oneShot.get() + put(ContextSpecificTag(TAG_ONE_SHOT), optoneShot) + } + if (emergencyBoost.isPresent) { + val optemergencyBoost = emergencyBoost.get() + put(ContextSpecificTag(TAG_EMERGENCY_BOOST), optemergencyBoost) + } + if (temporarySetpoint.isPresent) { + val opttemporarySetpoint = temporarySetpoint.get() + put(ContextSpecificTag(TAG_TEMPORARY_SETPOINT), opttemporarySetpoint) + } + if (targetPercentage.isPresent) { + val opttargetPercentage = targetPercentage.get() + put(ContextSpecificTag(TAG_TARGET_PERCENTAGE), opttargetPercentage) + } + if (targetReheat.isPresent) { + val opttargetReheat = targetReheat.get() + put(ContextSpecificTag(TAG_TARGET_REHEAT), opttargetReheat) + } + endStructure() + } + } + + companion object { + private const val TAG_DURATION = 0 + private const val TAG_ONE_SHOT = 1 + private const val TAG_EMERGENCY_BOOST = 2 + private const val TAG_TEMPORARY_SETPOINT = 3 + private const val TAG_TARGET_PERCENTAGE = 4 + private const val TAG_TARGET_REHEAT = 5 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): WaterHeaterManagementClusterWaterHeaterBoostInfoStruct { + tlvReader.enterStructure(tlvTag) + val duration = tlvReader.getUInt(ContextSpecificTag(TAG_DURATION)) + val oneShot = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_ONE_SHOT))) { + Optional.of(tlvReader.getBoolean(ContextSpecificTag(TAG_ONE_SHOT))) + } else { + Optional.empty() + } + val emergencyBoost = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_EMERGENCY_BOOST))) { + Optional.of(tlvReader.getBoolean(ContextSpecificTag(TAG_EMERGENCY_BOOST))) + } else { + Optional.empty() + } + val temporarySetpoint = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_TEMPORARY_SETPOINT))) { + Optional.of(tlvReader.getShort(ContextSpecificTag(TAG_TEMPORARY_SETPOINT))) + } else { + Optional.empty() + } + val targetPercentage = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_TARGET_PERCENTAGE))) { + Optional.of(tlvReader.getUByte(ContextSpecificTag(TAG_TARGET_PERCENTAGE))) + } else { + Optional.empty() + } + val targetReheat = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_TARGET_REHEAT))) { + Optional.of(tlvReader.getUByte(ContextSpecificTag(TAG_TARGET_REHEAT))) + } else { + Optional.empty() + } + + tlvReader.exitContainer() + + return WaterHeaterManagementClusterWaterHeaterBoostInfoStruct( + duration, + oneShot, + emergencyBoost, + temporarySetpoint, + targetPercentage, + targetReheat, + ) + } + } +} diff --git a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp index 89a4a256880158..b9d5e76c909135 100644 --- a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp @@ -5050,6 +5050,193 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & using namespace app::Clusters::WaterHeaterManagement; switch (aPath.mEventId) { + case Events::BoostStarted::Id: { + Events::BoostStarted::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value_boostInfo; + jobject value_boostInfo_duration; + std::string value_boostInfo_durationClassName = "java/lang/Long"; + std::string value_boostInfo_durationCtorSignature = "(J)V"; + jlong jnivalue_boostInfo_duration = static_cast(cppValue.boostInfo.duration); + chip::JniReferences::GetInstance().CreateBoxedObject(value_boostInfo_durationClassName.c_str(), + value_boostInfo_durationCtorSignature.c_str(), + jnivalue_boostInfo_duration, value_boostInfo_duration); + jobject value_boostInfo_oneShot; + if (!cppValue.boostInfo.oneShot.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_boostInfo_oneShot); + } + else + { + jobject value_boostInfo_oneShotInsideOptional; + std::string value_boostInfo_oneShotInsideOptionalClassName = "java/lang/Boolean"; + std::string value_boostInfo_oneShotInsideOptionalCtorSignature = "(Z)V"; + jboolean jnivalue_boostInfo_oneShotInsideOptional = static_cast(cppValue.boostInfo.oneShot.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_boostInfo_oneShotInsideOptionalClassName.c_str(), + value_boostInfo_oneShotInsideOptionalCtorSignature.c_str(), jnivalue_boostInfo_oneShotInsideOptional, + value_boostInfo_oneShotInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_boostInfo_oneShotInsideOptional, value_boostInfo_oneShot); + } + jobject value_boostInfo_emergencyBoost; + if (!cppValue.boostInfo.emergencyBoost.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_boostInfo_emergencyBoost); + } + else + { + jobject value_boostInfo_emergencyBoostInsideOptional; + std::string value_boostInfo_emergencyBoostInsideOptionalClassName = "java/lang/Boolean"; + std::string value_boostInfo_emergencyBoostInsideOptionalCtorSignature = "(Z)V"; + jboolean jnivalue_boostInfo_emergencyBoostInsideOptional = + static_cast(cppValue.boostInfo.emergencyBoost.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_boostInfo_emergencyBoostInsideOptionalClassName.c_str(), + value_boostInfo_emergencyBoostInsideOptionalCtorSignature.c_str(), + jnivalue_boostInfo_emergencyBoostInsideOptional, value_boostInfo_emergencyBoostInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_boostInfo_emergencyBoostInsideOptional, + value_boostInfo_emergencyBoost); + } + jobject value_boostInfo_temporarySetpoint; + if (!cppValue.boostInfo.temporarySetpoint.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_boostInfo_temporarySetpoint); + } + else + { + jobject value_boostInfo_temporarySetpointInsideOptional; + std::string value_boostInfo_temporarySetpointInsideOptionalClassName = "java/lang/Integer"; + std::string value_boostInfo_temporarySetpointInsideOptionalCtorSignature = "(I)V"; + jint jnivalue_boostInfo_temporarySetpointInsideOptional = + static_cast(cppValue.boostInfo.temporarySetpoint.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_boostInfo_temporarySetpointInsideOptionalClassName.c_str(), + value_boostInfo_temporarySetpointInsideOptionalCtorSignature.c_str(), + jnivalue_boostInfo_temporarySetpointInsideOptional, value_boostInfo_temporarySetpointInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_boostInfo_temporarySetpointInsideOptional, + value_boostInfo_temporarySetpoint); + } + jobject value_boostInfo_targetPercentage; + if (!cppValue.boostInfo.targetPercentage.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_boostInfo_targetPercentage); + } + else + { + jobject value_boostInfo_targetPercentageInsideOptional; + std::string value_boostInfo_targetPercentageInsideOptionalClassName = "java/lang/Integer"; + std::string value_boostInfo_targetPercentageInsideOptionalCtorSignature = "(I)V"; + jint jnivalue_boostInfo_targetPercentageInsideOptional = + static_cast(cppValue.boostInfo.targetPercentage.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_boostInfo_targetPercentageInsideOptionalClassName.c_str(), + value_boostInfo_targetPercentageInsideOptionalCtorSignature.c_str(), + jnivalue_boostInfo_targetPercentageInsideOptional, value_boostInfo_targetPercentageInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_boostInfo_targetPercentageInsideOptional, + value_boostInfo_targetPercentage); + } + jobject value_boostInfo_targetReheat; + if (!cppValue.boostInfo.targetReheat.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_boostInfo_targetReheat); + } + else + { + jobject value_boostInfo_targetReheatInsideOptional; + std::string value_boostInfo_targetReheatInsideOptionalClassName = "java/lang/Integer"; + std::string value_boostInfo_targetReheatInsideOptionalCtorSignature = "(I)V"; + jint jnivalue_boostInfo_targetReheatInsideOptional = static_cast(cppValue.boostInfo.targetReheat.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_boostInfo_targetReheatInsideOptionalClassName.c_str(), + value_boostInfo_targetReheatInsideOptionalCtorSignature.c_str(), jnivalue_boostInfo_targetReheatInsideOptional, + value_boostInfo_targetReheatInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_boostInfo_targetReheatInsideOptional, + value_boostInfo_targetReheat); + } + + jclass waterHeaterBoostInfoStructStructClass_0; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$WaterHeaterManagementClusterWaterHeaterBoostInfoStruct", + waterHeaterBoostInfoStructStructClass_0); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$WaterHeaterManagementClusterWaterHeaterBoostInfoStruct"); + return nullptr; + } + + jmethodID waterHeaterBoostInfoStructStructCtor_0; + err = chip::JniReferences::GetInstance().FindMethod(env, waterHeaterBoostInfoStructStructClass_0, "", + "(Ljava/lang/Long;Ljava/util/Optional;Ljava/util/Optional;Ljava/" + "util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", + &waterHeaterBoostInfoStructStructCtor_0); + if (err != CHIP_NO_ERROR || waterHeaterBoostInfoStructStructCtor_0 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$WaterHeaterManagementClusterWaterHeaterBoostInfoStruct constructor"); + return nullptr; + } + + value_boostInfo = + env->NewObject(waterHeaterBoostInfoStructStructClass_0, waterHeaterBoostInfoStructStructCtor_0, + value_boostInfo_duration, value_boostInfo_oneShot, value_boostInfo_emergencyBoost, + value_boostInfo_temporarySetpoint, value_boostInfo_targetPercentage, value_boostInfo_targetReheat); + + jclass boostStartedStructClass; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipEventStructs$WaterHeaterManagementClusterBoostStartedEvent", + boostStartedStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipEventStructs$WaterHeaterManagementClusterBoostStartedEvent"); + return nullptr; + } + + jmethodID boostStartedStructCtor; + err = chip::JniReferences::GetInstance().FindMethod( + env, boostStartedStructClass, "", + "(Lchip/devicecontroller/ChipStructs$WaterHeaterManagementClusterWaterHeaterBoostInfoStruct;)V", + &boostStartedStructCtor); + if (err != CHIP_NO_ERROR || boostStartedStructCtor == nullptr) + { + ChipLogError(Zcl, "Could not find ChipEventStructs$WaterHeaterManagementClusterBoostStartedEvent constructor"); + return nullptr; + } + + jobject value = env->NewObject(boostStartedStructClass, boostStartedStructCtor, value_boostInfo); + + return value; + } + case Events::BoostEnded::Id: { + Events::BoostEnded::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jclass boostEndedStructClass; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipEventStructs$WaterHeaterManagementClusterBoostEndedEvent", boostEndedStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipEventStructs$WaterHeaterManagementClusterBoostEndedEvent"); + return nullptr; + } + + jmethodID boostEndedStructCtor; + err = chip::JniReferences::GetInstance().FindMethod(env, boostEndedStructClass, "", "()V", &boostEndedStructCtor); + if (err != CHIP_NO_ERROR || boostEndedStructCtor == nullptr) + { + ChipLogError(Zcl, "Could not find ChipEventStructs$WaterHeaterManagementClusterBoostEndedEvent constructor"); + return nullptr; + } + + jobject value = env->NewObject(boostEndedStructClass, boostEndedStructCtor); + + return value; + } default: *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index c573d69dc78e6c..028810afd4eb77 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -6658,12 +6658,7 @@ class ChipClusters: "commandId": 0x00000000, "commandName": "Boost", "args": { - "duration": "int", - "oneShot": "bool", - "emergencyBoost": "bool", - "temporarySetpoint": "int", - "targetPercentage": "int", - "targetReheat": "int", + "boostInfo": "WaterHeaterBoostInfoStruct", }, }, 0x00000001: { diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 405d8b8872bcba..cff7adf4ae6fbb 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -23909,28 +23909,16 @@ class Feature(IntFlag): kEnergyManagement = 0x1 kTankPercent = 0x2 - class WaterHeaterDemandBitmap(IntFlag): + class WaterHeaterHeatSourceBitmap(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: + class Structs: @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 - + class WaterHeaterBoostInfoStruct(ClusterObject): @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( @@ -23950,6 +23938,23 @@ def descriptor(cls) -> ClusterObjectDescriptor: targetPercentage: 'typing.Optional[uint]' = None targetReheat: 'typing.Optional[uint]' = None + 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="boostInfo", Tag=0, Type=WaterHeaterManagement.Structs.WaterHeaterBoostInfoStruct), + ]) + + boostInfo: 'WaterHeaterManagement.Structs.WaterHeaterBoostInfoStruct' = field(default_factory=lambda: WaterHeaterManagement.Structs.WaterHeaterBoostInfoStruct()) + @dataclass class CancelBoost(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x00000094 @@ -24156,6 +24161,42 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: value: 'uint' = 0 + class Events: + @dataclass + class BoostStarted(ClusterEvent): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000094 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000000 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="boostInfo", Tag=0, Type=WaterHeaterManagement.Structs.WaterHeaterBoostInfoStruct), + ]) + + boostInfo: 'WaterHeaterManagement.Structs.WaterHeaterBoostInfoStruct' = field(default_factory=lambda: WaterHeaterManagement.Structs.WaterHeaterBoostInfoStruct()) + + @dataclass + class BoostEnded(ClusterEvent): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000094 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000001 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ]) + @dataclass class DemandResponseLoadControl(Cluster): diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index 9e864b458de94d..fab6862dd96a67 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -18913,20 +18913,12 @@ typedef NS_OPTIONS(uint32_t, MTRWaterHeaterManagementFeature) { 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, +typedef NS_OPTIONS(uint8_t, MTRWaterHeaterManagementWaterHeaterHeatSourceBitmap) { + MTRWaterHeaterManagementWaterHeaterHeatSourceBitmapImmersionElement1 MTR_PROVISIONALLY_AVAILABLE = 0x1, + MTRWaterHeaterManagementWaterHeaterHeatSourceBitmapImmersionElement2 MTR_PROVISIONALLY_AVAILABLE = 0x2, + MTRWaterHeaterManagementWaterHeaterHeatSourceBitmapHeatPump MTR_PROVISIONALLY_AVAILABLE = 0x4, + MTRWaterHeaterManagementWaterHeaterHeatSourceBitmapBoiler MTR_PROVISIONALLY_AVAILABLE = 0x8, + MTRWaterHeaterManagementWaterHeaterHeatSourceBitmapOther MTR_PROVISIONALLY_AVAILABLE = 0x10, } MTR_PROVISIONALLY_AVAILABLE; typedef NS_ENUM(uint8_t, MTRDemandResponseLoadControlCriticalityLevel) { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h index 2e5c8cc7dc1b44..33251439bbc237 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h @@ -7372,6 +7372,10 @@ typedef NS_ENUM(uint32_t, MTREventIDType) { MTREventIDTypeClusterElectricalEnergyMeasurementEventCumulativeEnergyMeasuredID MTR_AVAILABLE(ios(17.6), macos(14.6), watchos(10.6), tvos(17.6)) = 0x00000000, MTREventIDTypeClusterElectricalEnergyMeasurementEventPeriodicEnergyMeasuredID MTR_AVAILABLE(ios(17.6), macos(14.6), watchos(10.6), tvos(17.6)) = 0x00000001, + // Cluster WaterHeaterManagement events + MTREventIDTypeClusterWaterHeaterManagementEventBoostStartedID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, + MTREventIDTypeClusterWaterHeaterManagementEventBoostEndedID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, + // Cluster DemandResponseLoadControl events MTREventIDTypeClusterDemandResponseLoadControlEventLoadControlEventStatusChangeID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm index fa08192303b8fd..d3715b49d0d250 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm @@ -10355,6 +10355,15 @@ switch (eventID) { + // Cluster WaterHeaterManagement events + case MTREventIDTypeClusterWaterHeaterManagementEventBoostStartedID: + result = @"BoostStarted"; + break; + + case MTREventIDTypeClusterWaterHeaterManagementEventBoostEndedID: + result = @"BoostEnded"; + break; + default: result = [NSString stringWithFormat:@"", eventID]; break; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h index b276bb8b1986ac..5c869616268ecc 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h @@ -5495,17 +5495,7 @@ MTR_AVAILABLE(ios(17.6), macos(14.6), watchos(10.6), tvos(17.6)) 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; +@property (nonatomic, copy) MTRWaterHeaterManagementClusterWaterHeaterBoostInfoStruct * _Nonnull boostInfo MTR_PROVISIONALLY_AVAILABLE; /** * Controls whether the command is a timed command (using Timed Invoke). * diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm index 7aa736277256f6..976d5a0ef241be 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm @@ -15466,17 +15466,7 @@ - (instancetype)init { if (self = [super init]) { - _duration = @(0); - - _oneShot = nil; - - _emergencyBoost = nil; - - _temporarySetpoint = nil; - - _targetPercentage = nil; - - _targetReheat = nil; + _boostInfo = [MTRWaterHeaterManagementClusterWaterHeaterBoostInfoStruct new]; _timedInvokeTimeoutMs = nil; _serverSideProcessingTimeout = nil; } @@ -15487,12 +15477,7 @@ - (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.boostInfo = self.boostInfo; other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; @@ -15501,7 +15486,7 @@ - (id)copyWithZone:(NSZone * _Nullable)zone; - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: duration:%@; oneShot:%@; emergencyBoost:%@; temporarySetpoint:%@; targetPercentage:%@; targetReheat:%@; >", NSStringFromClass([self class]), _duration, _oneShot, _emergencyBoost, _temporarySetpoint, _targetPercentage, _targetReheat]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: boostInfo:%@; >", NSStringFromClass([self class]), _boostInfo]; return descriptionString; } @@ -15514,36 +15499,26 @@ - (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; + encodableStruct.boostInfo.duration = self.boostInfo.duration.unsignedIntValue; + if (self.boostInfo.oneShot != nil) { + auto & definedValue_1 = encodableStruct.boostInfo.oneShot.Emplace(); + definedValue_1 = self.boostInfo.oneShot.boolValue; } - } - { - if (self.emergencyBoost != nil) { - auto & definedValue_0 = encodableStruct.emergencyBoost.Emplace(); - definedValue_0 = self.emergencyBoost.boolValue; + if (self.boostInfo.emergencyBoost != nil) { + auto & definedValue_1 = encodableStruct.boostInfo.emergencyBoost.Emplace(); + definedValue_1 = self.boostInfo.emergencyBoost.boolValue; } - } - { - if (self.temporarySetpoint != nil) { - auto & definedValue_0 = encodableStruct.temporarySetpoint.Emplace(); - definedValue_0 = self.temporarySetpoint.shortValue; + if (self.boostInfo.temporarySetpoint != nil) { + auto & definedValue_1 = encodableStruct.boostInfo.temporarySetpoint.Emplace(); + definedValue_1 = self.boostInfo.temporarySetpoint.shortValue; } - } - { - if (self.targetPercentage != nil) { - auto & definedValue_0 = encodableStruct.targetPercentage.Emplace(); - definedValue_0 = self.targetPercentage.unsignedCharValue; + if (self.boostInfo.targetPercentage != nil) { + auto & definedValue_1 = encodableStruct.boostInfo.targetPercentage.Emplace(); + definedValue_1 = self.boostInfo.targetPercentage.unsignedCharValue; } - } - { - if (self.targetReheat != nil) { - auto & definedValue_0 = encodableStruct.targetReheat.Emplace(); - definedValue_0 = self.targetReheat.unsignedCharValue; + if (self.boostInfo.targetReheat != nil) { + auto & definedValue_1 = encodableStruct.boostInfo.targetReheat.Emplace(); + definedValue_1 = self.boostInfo.targetReheat.unsignedCharValue; } } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm index 821b8f6d58173d..cb2e1800de750f 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm @@ -2807,6 +2807,60 @@ static id _Nullable DecodeEventPayloadForWaterHeaterManagementCluster(EventId aE { using namespace Clusters::WaterHeaterManagement; switch (aEventId) { + case Events::BoostStarted::Id: { + Events::BoostStarted::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + + __auto_type * value = [MTRWaterHeaterManagementClusterBoostStartedEvent new]; + + do { + MTRWaterHeaterManagementClusterWaterHeaterBoostInfoStruct * _Nonnull memberValue; + memberValue = [MTRWaterHeaterManagementClusterWaterHeaterBoostInfoStruct new]; + memberValue.duration = [NSNumber numberWithUnsignedInt:cppValue.boostInfo.duration]; + if (cppValue.boostInfo.oneShot.HasValue()) { + memberValue.oneShot = [NSNumber numberWithBool:cppValue.boostInfo.oneShot.Value()]; + } else { + memberValue.oneShot = nil; + } + if (cppValue.boostInfo.emergencyBoost.HasValue()) { + memberValue.emergencyBoost = [NSNumber numberWithBool:cppValue.boostInfo.emergencyBoost.Value()]; + } else { + memberValue.emergencyBoost = nil; + } + if (cppValue.boostInfo.temporarySetpoint.HasValue()) { + memberValue.temporarySetpoint = [NSNumber numberWithShort:cppValue.boostInfo.temporarySetpoint.Value()]; + } else { + memberValue.temporarySetpoint = nil; + } + if (cppValue.boostInfo.targetPercentage.HasValue()) { + memberValue.targetPercentage = [NSNumber numberWithUnsignedChar:cppValue.boostInfo.targetPercentage.Value()]; + } else { + memberValue.targetPercentage = nil; + } + if (cppValue.boostInfo.targetReheat.HasValue()) { + memberValue.targetReheat = [NSNumber numberWithUnsignedChar:cppValue.boostInfo.targetReheat.Value()]; + } else { + memberValue.targetReheat = nil; + } + value.boostInfo = memberValue; + } while (0); + + return value; + } + case Events::BoostEnded::Id: { + Events::BoostEnded::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + + __auto_type * value = [MTRWaterHeaterManagementClusterBoostEndedEvent new]; + + return value; + } default: { break; } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h index 8590079420a854..35df5cc3e32495 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h @@ -1235,6 +1235,25 @@ MTR_AVAILABLE(ios(17.6), macos(14.6), watchos(10.6), tvos(17.6)) @property (nonatomic, copy) MTRElectricalEnergyMeasurementClusterEnergyMeasurementStruct * _Nullable energyExported MTR_AVAILABLE(ios(17.6), macos(14.6), watchos(10.6), tvos(17.6)); @end +MTR_PROVISIONALLY_AVAILABLE +@interface MTRWaterHeaterManagementClusterWaterHeaterBoostInfoStruct : 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; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRWaterHeaterManagementClusterBoostStartedEvent : NSObject +@property (nonatomic, copy) MTRWaterHeaterManagementClusterWaterHeaterBoostInfoStruct * _Nonnull boostInfo MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRWaterHeaterManagementClusterBoostEndedEvent : NSObject +@end + MTR_PROVISIONALLY_AVAILABLE @interface MTRDemandResponseLoadControlClusterHeatingSourceControlStruct : NSObject @property (nonatomic, copy) NSNumber * _Nonnull heatingSource MTR_PROVISIONALLY_AVAILABLE; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm index 02aac9e24ec0ae..6c3fc19e9b68bf 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm @@ -5029,6 +5029,98 @@ - (NSString *)description @end +@implementation MTRWaterHeaterManagementClusterWaterHeaterBoostInfoStruct +- (instancetype)init +{ + if (self = [super init]) { + + _duration = @(0); + + _oneShot = nil; + + _emergencyBoost = nil; + + _temporarySetpoint = nil; + + _targetPercentage = nil; + + _targetReheat = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRWaterHeaterManagementClusterWaterHeaterBoostInfoStruct 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; + + 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 MTRWaterHeaterManagementClusterBoostStartedEvent +- (instancetype)init +{ + if (self = [super init]) { + + _boostInfo = [MTRWaterHeaterManagementClusterWaterHeaterBoostInfoStruct new]; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRWaterHeaterManagementClusterBoostStartedEvent alloc] init]; + + other.boostInfo = self.boostInfo; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: boostInfo:%@; >", NSStringFromClass([self class]), _boostInfo]; + return descriptionString; +} + +@end + +@implementation MTRWaterHeaterManagementClusterBoostEndedEvent +- (instancetype)init +{ + if (self = [super init]) { + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRWaterHeaterManagementClusterBoostEndedEvent alloc] init]; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + return descriptionString; +} + +@end + @implementation MTRDemandResponseLoadControlClusterHeatingSourceControlStruct - (instancetype)init { diff --git a/src/python_testing/TC_EWATERHTRBase.py b/src/python_testing/TC_EWATERHTRBase.py index 0bf42a7eb4d0a0..6aba67edd20140 100644 --- a/src/python_testing/TC_EWATERHTRBase.py +++ b/src/python_testing/TC_EWATERHTRBase.py @@ -42,15 +42,16 @@ async def send_boost_command(self, duration: int, one_shot: typing.Optional[bool endpoint: int = None, timedRequestTimeoutMs: int = 3000, expected_status: Status = Status.Success): try: - await self.send_single_cmd(cmd=Clusters.WaterHeaterManagement.Commands.Boost( - duration=duration, - oneShot=one_shot, - emergencyBoost=emergency_boost, - temporarySetpoint=temporary_setpoint, - targetPercentage=target_percentage, - targetReheat=target_reheat), - endpoint=endpoint, - timedRequestTimeoutMs=timedRequestTimeoutMs) + boostInfo = Clusters.WaterHeaterManagement.Structs.WaterHeaterBoostInfoStruct(duration=duration, + oneShot=one_shot, + emergencyBoost=emergency_boost, + temporarySetpoint=temporary_setpoint, + targetPercentage=target_percentage, + targetReheat=target_reheat) + + await self.send_single_cmd(cmd=Clusters.WaterHeaterManagement.Commands.Boost(boostInfo=boostInfo), + endpoint=endpoint, + timedRequestTimeoutMs=timedRequestTimeoutMs) asserts.assert_equal(expected_status, Status.Success) diff --git a/src/python_testing/TC_EWATERHTR_2_1.py b/src/python_testing/TC_EWATERHTR_2_1.py index c50a082ae2afa1..176ecf2f95a173 100644 --- a/src/python_testing/TC_EWATERHTR_2_1.py +++ b/src/python_testing/TC_EWATERHTR_2_1.py @@ -23,7 +23,7 @@ # test-runner-run/run1/app: ${ALL_CLUSTERS_APP} # test-runner-run/run1/factoryreset: True # test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json --enable-key 000102030405060708090a0b0c0d0e0f --featureSet 0x03 +# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json --enable-key 000102030405060708090a0b0c0d0e0f # test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --hex-arg enableKey:000102030405060708090a0b0c0d0e0f --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto --int-arg PIXIT.EWATERHTR.EM:1 PIXIT.EWATERHTR.TP:2 # === END CI TEST ARGUMENTS === @@ -53,9 +53,9 @@ def steps_TC_EWATERHTR_2_1(self) -> list[TestStep]: TestStep("1", "Commissioning, already done", is_commissioning=True), TestStep("2", "TH reads HeaterTypes attribute.", - "DUT as Server replies with a WaterHeaterTypeBitmap (enum8) greater than 0x00 (at least one type supported), and less than 0x20 (no undefined types supported)."), + "DUT as Server replies with a WaterHeaterHeatSourceBitmap (enum8) greater than 0x00 (at least one type supported), and less than 0x20 (no undefined types supported)."), TestStep("3", "TH reads HeatDemand attribute.", - "DUT as Server replies with a WaterHeaterDemandBitmap (enum8)."), + "DUT as Server replies with a WaterHeaterHeatSourceBitmap (enum8)."), TestStep("4", "TH reads TankVolume attribute.", "DUT as Server replies with a uint16 value."), TestStep("5", "TH reads EstimatedHeatRequired attribute.", @@ -81,15 +81,15 @@ async def test_TC_EWATERHTR_2_1(self): heaterTypes = await self.read_whm_attribute_expect_success(attribute="HeaterTypes") asserts.assert_greater(heaterTypes, 0, f"Unexpected HeaterTypes value - expected {heaterTypes} > 0") - asserts.assert_less_equal(heaterTypes, Clusters.WaterHeaterManagement.Bitmaps.WaterHeaterTypeBitmap.kOther, - f"Unexpected HeaterTypes value - expected {heaterTypes} <= WaterHeaterTypeBitmap.kOther") + asserts.assert_less_equal(heaterTypes, Clusters.WaterHeaterManagement.Bitmaps.WaterHeaterHeatSourceBitmap.kOther, + f"Unexpected HeaterTypes value - expected {heaterTypes} <= WaterHeaterHeatSourceBitmap.kOther") self.step("3") heatDemand = await self.read_whm_attribute_expect_success(attribute="HeatDemand") asserts.assert_greater(heatDemand, 0, f"Unexpected HeatDemand value - expected {heatDemand} > 0") - asserts.assert_less_equal(heatDemand, Clusters.WaterHeaterManagement.Bitmaps.WaterHeaterDemandBitmap.kOther, - f"Unexpected HeatDemand value - expected {heatDemand} <= WaterHeaterDemandBitmap.kOther") + asserts.assert_less_equal(heatDemand, Clusters.WaterHeaterManagement.Bitmaps.WaterHeaterHeatSourceBitmap.kOther, + f"Unexpected HeatDemand value - expected {heatDemand} <= WaterHeaterHeatSourceBitmap.kOther") self.step("4") if em_supported: diff --git a/src/python_testing/TC_EWATERHTR_2_2.py b/src/python_testing/TC_EWATERHTR_2_2.py index 7ce8c815a63a3b..9eafd35afaed33 100644 --- a/src/python_testing/TC_EWATERHTR_2_2.py +++ b/src/python_testing/TC_EWATERHTR_2_2.py @@ -23,7 +23,7 @@ # test-runner-run/run1/app: ${ALL_CLUSTERS_APP} # test-runner-run/run1/factoryreset: True # test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json --enable-key 000102030405060708090a0b0c0d0e0f --featureSet 0x00 +# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json --enable-key 000102030405060708090a0b0c0d0e0f # test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --hex-arg enableKey:000102030405060708090a0b0c0d0e0f --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto # === END CI TEST ARGUMENTS === @@ -191,8 +191,8 @@ async def test_TC_EWATERHTR_2_2(self): heaterTypes = await self.read_whm_attribute_expect_success(attribute="HeaterTypes") asserts.assert_greater(heaterTypes, 0, f"Unexpected HeaterTypes value - expected {heaterTypes} > 0") - asserts.assert_less_equal(heaterTypes, Clusters.WaterHeaterManagement.Bitmaps.WaterHeaterTypeBitmap.kOther, - f"Unexpected HeaterTypes value - expected {heaterTypes} <= WaterHeaterTypeBitmap.kOther") + asserts.assert_less_equal(heaterTypes, Clusters.WaterHeaterManagement.Bitmaps.WaterHeaterHeatSourceBitmap.kOther, + f"Unexpected HeaterTypes value - expected {heaterTypes} <= WaterHeaterHeatSourceBitmap.kOther") self.step("4") await self.send_test_event_trigger_manual_mode_test_event() diff --git a/src/python_testing/TC_EWATERHTR_2_3.py b/src/python_testing/TC_EWATERHTR_2_3.py index b3ed4bdc252cb4..41500bd3ea586e 100644 --- a/src/python_testing/TC_EWATERHTR_2_3.py +++ b/src/python_testing/TC_EWATERHTR_2_3.py @@ -22,7 +22,7 @@ # test-runner-run/run1/app: ${ALL_CLUSTERS_APP} # test-runner-run/run1/factoryreset: True # test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json --enable-key 000102030405060708090a0b0c0d0e0f --featureSet 0x03 +# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json --enable-key 000102030405060708090a0b0c0d0e0f # test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --hex-arg enableKey:000102030405060708090a0b0c0d0e0f --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto # === END CI TEST ARGUMENTS === 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 a6121b3681348e..571439625e121a 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 @@ -2631,18 +2631,8 @@ enum class Feature : uint32_t 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 +// Bitmap for WaterHeaterHeatSourceBitmap +enum class WaterHeaterHeatSourceBitmap : uint8_t { kImmersionElement1 = 0x1, kImmersionElement2 = 0x2, 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 90eddd9b2f1f0d..20fdd126514076 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 @@ -15168,9 +15168,9 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } // namespace ElectricalEnergyMeasurement namespace WaterHeaterManagement { +namespace Structs { -namespace Commands { -namespace Boost { +namespace WaterHeaterBoostInfoStruct { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; @@ -15228,6 +15228,44 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); } } + +} // namespace WaterHeaterBoostInfoStruct +} // namespace Structs + +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::kBoostInfo), boostInfo); + 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::kBoostInfo)) + { + err = DataModel::Decode(reader, boostInfo); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} } // namespace Boost. namespace CancelBoost { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const @@ -15286,7 +15324,64 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre } } // namespace Attributes -namespace Events {} // namespace Events +namespace Events { +namespace BoostStarted { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(aWriter.StartContainer(aTag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kBoostInfo), boostInfo)); + return aWriter.EndContainer(outer); +} + +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::kBoostInfo)) + { + err = DataModel::Decode(reader, boostInfo); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace BoostStarted. +namespace BoostEnded { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(aWriter.StartContainer(aTag, TLV::kTLVType_Structure, outer)); + return aWriter.EndContainer(outer); +} + +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 BoostEnded. +} // namespace Events } // namespace WaterHeaterManagement namespace DemandResponseLoadControl { 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 27ee806af6e9a9..f0f1dea1de536d 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 @@ -21449,6 +21449,39 @@ struct DecodableType } // namespace Events } // namespace ElectricalEnergyMeasurement namespace WaterHeaterManagement { +namespace Structs { +namespace WaterHeaterBoostInfoStruct { +enum class Fields : uint8_t +{ + kDuration = 0, + kOneShot = 1, + kEmergencyBoost = 2, + kTemporarySetpoint = 3, + kTargetPercentage = 4, + kTargetReheat = 5, +}; + +struct Type +{ +public: + uint32_t duration = static_cast(0); + Optional oneShot; + Optional emergencyBoost; + Optional temporarySetpoint; + Optional targetPercentage; + Optional targetReheat; + + 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 WaterHeaterBoostInfoStruct +} // namespace Structs namespace Commands { // Forward-declarations so we can reference these later. @@ -21469,12 +21502,7 @@ namespace Commands { namespace Boost { enum class Fields : uint8_t { - kDuration = 0, - kOneShot = 1, - kEmergencyBoost = 2, - kTemporarySetpoint = 3, - kTargetPercentage = 4, - kTargetReheat = 5, + kBoostInfo = 0, }; struct Type @@ -21484,12 +21512,7 @@ struct Type 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; + Structs::WaterHeaterBoostInfoStruct::Type boostInfo; CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; @@ -21504,12 +21527,7 @@ struct DecodableType 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; + Structs::WaterHeaterBoostInfoStruct::DecodableType boostInfo; CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace Boost @@ -21548,9 +21566,9 @@ namespace Attributes { namespace HeaterTypes { struct TypeInfo { - using Type = chip::BitMask; - using DecodableType = chip::BitMask; - using DecodableArgType = chip::BitMask; + 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; } @@ -21560,9 +21578,9 @@ struct TypeInfo namespace HeatDemand { struct TypeInfo { - using Type = chip::BitMask; - using DecodableType = chip::BitMask; - using DecodableArgType = chip::BitMask; + 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; } @@ -21663,9 +21681,9 @@ struct TypeInfo CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); Attributes::HeaterTypes::TypeInfo::DecodableType heaterTypes = - static_cast>(0); + static_cast>(0); Attributes::HeatDemand::TypeInfo::DecodableType heatDemand = - static_cast>(0); + 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); @@ -21680,6 +21698,69 @@ struct TypeInfo }; }; } // namespace Attributes +namespace Events { +namespace BoostStarted { +static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; + +enum class Fields : uint8_t +{ + kBoostInfo = 0, +}; + +struct Type +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::BoostStarted::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::WaterHeaterManagement::Id; } + static constexpr bool kIsFabricScoped = false; + + Structs::WaterHeaterBoostInfoStruct::Type boostInfo; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +struct DecodableType +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::BoostStarted::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::WaterHeaterManagement::Id; } + + Structs::WaterHeaterBoostInfoStruct::DecodableType boostInfo; + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +} // namespace BoostStarted +namespace BoostEnded { +static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; + +enum class Fields : uint8_t +{ +}; + +struct Type +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::BoostEnded::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::WaterHeaterManagement::Id; } + static constexpr bool kIsFabricScoped = false; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +struct DecodableType +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::BoostEnded::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::WaterHeaterManagement::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +} // namespace BoostEnded +} // namespace Events } // namespace WaterHeaterManagement namespace DemandResponseLoadControl { namespace Structs { diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Events.h b/zzz_generated/app-common/app-common/zap-generated/ids/Events.h index f8243c506f906d..4227a6ab527ba2 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Events.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Events.h @@ -443,6 +443,20 @@ static constexpr EventId Id = 0x00000001; } // namespace Events } // namespace ElectricalEnergyMeasurement +namespace WaterHeaterManagement { +namespace Events { + +namespace BoostStarted { +static constexpr EventId Id = 0x00000000; +} // namespace BoostStarted + +namespace BoostEnded { +static constexpr EventId Id = 0x00000001; +} // namespace BoostEnded + +} // namespace Events +} // namespace WaterHeaterManagement + namespace DemandResponseLoadControl { namespace Events { diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index 85a45a057b7eab..57259e33d69d44 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -6731,6 +6731,8 @@ class ValveConfigurationAndControlClose : public ClusterCommand | * ClusterRevision | 0xFFFD | |------------------------------------------------------------------------------| | Events: | | +| * BoostStarted | 0x0000 | +| * BoostEnded | 0x0001 | \*----------------------------------------------------------------------------*/ /* @@ -6739,14 +6741,10 @@ class ValveConfigurationAndControlClose : public ClusterCommand class WaterHeaterManagementBoost : public ClusterCommand { public: - WaterHeaterManagementBoost(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("boost", credsIssuerConfig) + WaterHeaterManagementBoost(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("boost", credsIssuerConfig), mComplex_BoostInfo(&mRequest.boostInfo) { - 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); + AddArgument("BoostInfo", &mComplex_BoostInfo); ClusterCommand::AddArguments(); } @@ -6773,6 +6771,7 @@ class WaterHeaterManagementBoost : public ClusterCommand private: chip::app::Clusters::WaterHeaterManagement::Commands::Boost::Type mRequest; + TypedComplexArgument mComplex_BoostInfo; }; /* @@ -21293,9 +21292,9 @@ void registerClusterWaterHeaterManagement(Commands & commands, CredentialIssuerC make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // make_unique>(Id, credsIssuerConfig), // - make_unique>>( + make_unique>>( Id, "heater-types", 0, UINT8_MAX, Attributes::HeaterTypes::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>>( + 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), // @@ -21335,8 +21334,12 @@ void registerClusterWaterHeaterManagement(Commands & commands, CredentialIssuerC // // Events // - make_unique(Id, credsIssuerConfig), // - make_unique(Id, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "boost-started", Events::BoostStarted::Id, credsIssuerConfig), // + make_unique(Id, "boost-ended", Events::BoostEnded::Id, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "boost-started", Events::BoostStarted::Id, credsIssuerConfig), // + make_unique(Id, "boost-ended", Events::BoostEnded::Id, credsIssuerConfig), // }; commands.RegisterCluster(clusterName, clusterCommands); diff --git a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp index d4f67568a7f746..202a6efcb06a01 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp @@ -2897,6 +2897,73 @@ void ComplexArgumentParser::Finalize( ComplexArgumentParser::Finalize(request.endSystime); } +CHIP_ERROR +ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::WaterHeaterManagement::Structs::WaterHeaterBoostInfoStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("WaterHeaterBoostInfoStruct.duration", "duration", value.isMember("duration"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "duration"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.duration, value["duration"])); + valueCopy.removeMember("duration"); + + if (value.isMember("oneShot")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "oneShot"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.oneShot, value["oneShot"])); + } + valueCopy.removeMember("oneShot"); + + if (value.isMember("emergencyBoost")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "emergencyBoost"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.emergencyBoost, value["emergencyBoost"])); + } + valueCopy.removeMember("emergencyBoost"); + + if (value.isMember("temporarySetpoint")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "temporarySetpoint"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.temporarySetpoint, value["temporarySetpoint"])); + } + valueCopy.removeMember("temporarySetpoint"); + + if (value.isMember("targetPercentage")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "targetPercentage"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.targetPercentage, value["targetPercentage"])); + } + valueCopy.removeMember("targetPercentage"); + + if (value.isMember("targetReheat")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "targetReheat"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.targetReheat, value["targetReheat"])); + } + valueCopy.removeMember("targetReheat"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize( + chip::app::Clusters::WaterHeaterManagement::Structs::WaterHeaterBoostInfoStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.duration); + ComplexArgumentParser::Finalize(request.oneShot); + ComplexArgumentParser::Finalize(request.emergencyBoost); + ComplexArgumentParser::Finalize(request.temporarySetpoint); + ComplexArgumentParser::Finalize(request.targetPercentage); + ComplexArgumentParser::Finalize(request.targetReheat); +} + CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::DemandResponseLoadControl::Structs::HeatingSourceControlStruct::Type & request, diff --git a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h index dfca56f4c3afba..ccce33ece63cd8 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h @@ -343,6 +343,12 @@ static CHIP_ERROR Setup(const char * label, static void Finalize(chip::app::Clusters::ElectricalEnergyMeasurement::Structs::EnergyMeasurementStruct::Type & request); +static CHIP_ERROR Setup(const char * label, + chip::app::Clusters::WaterHeaterManagement::Structs::WaterHeaterBoostInfoStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::WaterHeaterManagement::Structs::WaterHeaterBoostInfoStruct::Type & request); + static CHIP_ERROR Setup(const char * label, chip::app::Clusters::DemandResponseLoadControl::Structs::HeatingSourceControlStruct::Type & request, Json::Value & value); 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 2eddf2f356bd07..aa122cb62da046 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -2583,6 +2583,64 @@ CHIP_ERROR DataModelLogger::LogValue( return CHIP_NO_ERROR; } +CHIP_ERROR DataModelLogger::LogValue( + const char * label, size_t indent, + const chip::app::Clusters::WaterHeaterManagement::Structs::WaterHeaterBoostInfoStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("Duration", indent + 1, value.duration); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Duration'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("OneShot", indent + 1, value.oneShot); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'OneShot'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("EmergencyBoost", indent + 1, value.emergencyBoost); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'EmergencyBoost'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("TemporarySetpoint", indent + 1, value.temporarySetpoint); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'TemporarySetpoint'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("TargetPercentage", indent + 1, value.targetPercentage); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'TargetPercentage'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("TargetReheat", indent + 1, value.targetReheat); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'TargetReheat'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + CHIP_ERROR DataModelLogger::LogValue( const char * label, size_t indent, const chip::app::Clusters::DemandResponseLoadControl::Structs::HeatingSourceControlStruct::DecodableType & value) @@ -6891,6 +6949,30 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const WaterHeaterManagement::Events::BoostStarted::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = DataModelLogger::LogValue("BoostInfo", indent + 1, value.boostInfo); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'BoostInfo'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const WaterHeaterManagement::Events::BoostEnded::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const DemandResponseLoadControl::Events::LoadControlEventStatusChange::DecodableType & value) { @@ -13547,12 +13629,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP switch (path.mAttributeId) { case WaterHeaterManagement::Attributes::HeaterTypes::Id: { - chip::BitMask value; + chip::BitMask value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("HeaterTypes", 1, value); } case WaterHeaterManagement::Attributes::HeatDemand::Id: { - chip::BitMask value; + chip::BitMask value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("HeatDemand", 1, value); } @@ -20629,6 +20711,22 @@ CHIP_ERROR DataModelLogger::LogEvent(const chip::app::EventHeader & header, chip } break; } + case WaterHeaterManagement::Id: { + switch (header.mPath.mEventId) + { + case WaterHeaterManagement::Events::BoostStarted::Id: { + chip::app::Clusters::WaterHeaterManagement::Events::BoostStarted::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("BoostStarted", 1, value); + } + case WaterHeaterManagement::Events::BoostEnded::Id: { + chip::app::Clusters::WaterHeaterManagement::Events::BoostEnded::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("BoostEnded", 1, value); + } + } + break; + } case DemandResponseLoadControl::Id: { switch (header.mPath.mEventId) { 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 60398d0f3d2911..5646abd25a011a 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h @@ -214,6 +214,10 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::ElectricalEnergyMeasurement::Structs::EnergyMeasurementStruct::DecodableType & value); +static CHIP_ERROR +LogValue(const char * label, size_t indent, + const chip::app::Clusters::WaterHeaterManagement::Structs::WaterHeaterBoostInfoStruct::DecodableType & value); + static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::DemandResponseLoadControl::Structs::HeatingSourceControlStruct::DecodableType & value); @@ -574,6 +578,10 @@ LogValue(const char * label, size_t indent, static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::ElectricalEnergyMeasurement::Events::PeriodicEnergyMeasured::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::WaterHeaterManagement::Events::BoostStarted::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::WaterHeaterManagement::Events::BoostEnded::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::DemandResponseLoadControl::Events::LoadControlEventStatusChange::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 67f8781db8fd5d..a61f2a6fa6b27e 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -79923,6 +79923,8 @@ class SubscribeAttributeElectricalEnergyMeasurementClusterRevision : public Subs | * ClusterRevision | 0xFFFD | |------------------------------------------------------------------------------| | Events: | | +| * BoostStarted | 0x0000 | +| * BoostEnded | 0x0001 | \*----------------------------------------------------------------------------*/ #if MTR_ENABLE_PROVISIONAL @@ -79933,24 +79935,10 @@ class WaterHeaterManagementBoost : public ClusterCommand { public: WaterHeaterManagementBoost() : ClusterCommand("boost") + , mComplex_BoostInfo(&mRequest.boostInfo) { #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); + AddArgument("BoostInfo", &mComplex_BoostInfo); #endif // MTR_ENABLE_PROVISIONAL ClusterCommand::AddArguments(); } @@ -79967,41 +79955,32 @@ class WaterHeaterManagementBoost : public ClusterCommand { __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()]; + params.boostInfo = [MTRWaterHeaterManagementClusterWaterHeaterBoostInfoStruct new]; + params.boostInfo.duration = [NSNumber numberWithUnsignedInt:mRequest.boostInfo.duration]; + if (mRequest.boostInfo.oneShot.HasValue()) { + params.boostInfo.oneShot = [NSNumber numberWithBool:mRequest.boostInfo.oneShot.Value()]; } else { - params.oneShot = nil; + params.boostInfo.oneShot = nil; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - if (mRequest.emergencyBoost.HasValue()) { - params.emergencyBoost = [NSNumber numberWithBool:mRequest.emergencyBoost.Value()]; + if (mRequest.boostInfo.emergencyBoost.HasValue()) { + params.boostInfo.emergencyBoost = [NSNumber numberWithBool:mRequest.boostInfo.emergencyBoost.Value()]; } else { - params.emergencyBoost = nil; + params.boostInfo.emergencyBoost = nil; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - if (mRequest.temporarySetpoint.HasValue()) { - params.temporarySetpoint = [NSNumber numberWithShort:mRequest.temporarySetpoint.Value()]; + if (mRequest.boostInfo.temporarySetpoint.HasValue()) { + params.boostInfo.temporarySetpoint = [NSNumber numberWithShort:mRequest.boostInfo.temporarySetpoint.Value()]; } else { - params.temporarySetpoint = nil; + params.boostInfo.temporarySetpoint = nil; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - if (mRequest.targetPercentage.HasValue()) { - params.targetPercentage = [NSNumber numberWithUnsignedChar:mRequest.targetPercentage.Value()]; + if (mRequest.boostInfo.targetPercentage.HasValue()) { + params.boostInfo.targetPercentage = [NSNumber numberWithUnsignedChar:mRequest.boostInfo.targetPercentage.Value()]; } else { - params.targetPercentage = nil; + params.boostInfo.targetPercentage = nil; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - if (mRequest.targetReheat.HasValue()) { - params.targetReheat = [NSNumber numberWithUnsignedChar:mRequest.targetReheat.Value()]; + if (mRequest.boostInfo.targetReheat.HasValue()) { + params.boostInfo.targetReheat = [NSNumber numberWithUnsignedChar:mRequest.boostInfo.targetReheat.Value()]; } else { - params.targetReheat = nil; + params.boostInfo.targetReheat = nil; } #endif // MTR_ENABLE_PROVISIONAL uint16_t repeatCount = mRepeatCount.ValueOr(1); @@ -80025,6 +80004,7 @@ class WaterHeaterManagementBoost : public ClusterCommand { private: chip::app::Clusters::WaterHeaterManagement::Commands::Boost::Type mRequest; + TypedComplexArgument mComplex_BoostInfo; }; #endif // MTR_ENABLE_PROVISIONAL @@ -195156,6 +195136,8 @@ void registerClusterWaterHeaterManagement(Commands & commands) make_unique(), // make_unique(), // #endif // MTR_ENABLE_PROVISIONAL + make_unique(Id), // + make_unique(Id), // }; commands.RegisterCluster(clusterName, clusterCommands);