Skip to content

Commit a608b59

Browse files
authored
Merge branch 'master' into feature/easy-review-pr
2 parents 360a102 + c4cdbf6 commit a608b59

File tree

46 files changed

+1800
-493
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1800
-493
lines changed

examples/all-clusters-app/all-clusters-common/all-clusters-app.matter

+19-16
Original file line numberDiff line numberDiff line change
@@ -4386,7 +4386,7 @@ cluster ElectricalEnergyMeasurement = 145 {
43864386

43874387
/** 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. */
43884388
provisional cluster WaterHeaterManagement = 148 {
4389-
revision 1;
4389+
revision 2;
43904390

43914391
enum BoostStateEnum : enum8 {
43924392
kInactive = 0;
@@ -4398,24 +4398,32 @@ provisional cluster WaterHeaterManagement = 148 {
43984398
kTankPercent = 0x2;
43994399
}
44004400

4401-
bitmap WaterHeaterDemandBitmap : bitmap8 {
4401+
bitmap WaterHeaterHeatSourceBitmap : bitmap8 {
44024402
kImmersionElement1 = 0x1;
44034403
kImmersionElement2 = 0x2;
44044404
kHeatPump = 0x4;
44054405
kBoiler = 0x8;
44064406
kOther = 0x10;
44074407
}
44084408

4409-
bitmap WaterHeaterTypeBitmap : bitmap8 {
4410-
kImmersionElement1 = 0x1;
4411-
kImmersionElement2 = 0x2;
4412-
kHeatPump = 0x4;
4413-
kBoiler = 0x8;
4414-
kOther = 0x10;
4409+
struct WaterHeaterBoostInfoStruct {
4410+
elapsed_s duration = 0;
4411+
optional boolean oneShot = 1;
4412+
optional boolean emergencyBoost = 2;
4413+
optional temperature temporarySetpoint = 3;
4414+
optional percent targetPercentage = 4;
4415+
optional percent targetReheat = 5;
4416+
}
4417+
4418+
info event BoostStarted = 0 {
4419+
WaterHeaterBoostInfoStruct boostInfo = 0;
44154420
}
44164421

4417-
readonly attribute WaterHeaterTypeBitmap heaterTypes = 0;
4418-
readonly attribute WaterHeaterDemandBitmap heatDemand = 1;
4422+
info event BoostEnded = 1 {
4423+
}
4424+
4425+
readonly attribute WaterHeaterHeatSourceBitmap heaterTypes = 0;
4426+
readonly attribute WaterHeaterHeatSourceBitmap heatDemand = 1;
44194427
readonly attribute optional int16u tankVolume = 2;
44204428
readonly attribute optional energy_mwh estimatedHeatRequired = 3;
44214429
readonly attribute optional percent tankPercentage = 4;
@@ -4428,12 +4436,7 @@ provisional cluster WaterHeaterManagement = 148 {
44284436
readonly attribute int16u clusterRevision = 65533;
44294437

44304438
request struct BoostRequest {
4431-
elapsed_s duration = 0;
4432-
optional boolean oneShot = 1;
4433-
optional boolean emergencyBoost = 2;
4434-
optional temperature temporarySetpoint = 3;
4435-
optional percent targetPercentage = 4;
4436-
optional percent targetReheat = 5;
4439+
WaterHeaterBoostInfoStruct boostInfo = 0;
44374440
}
44384441

44394442
/** Allows a client to request that the water heater is put into a Boost state. */

examples/all-clusters-app/all-clusters-common/include/WhmDelegate.h

+118-71
Large diffs are not rendered by default.

examples/all-clusters-app/all-clusters-common/include/WhmManufacturer.h

+38-17
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class WhmManufacturer
6262
/**
6363
* @brief Called to determine which heating sources to use,
6464
*/
65-
BitMask<WaterHeaterDemandBitmap> DetermineHeatingSources();
65+
BitMask<WaterHeaterHeatSourceBitmap> DetermineHeatingSources();
6666

6767
/**
6868
* @brief Turn the heating of the water tank on.
@@ -83,23 +83,44 @@ class WhmManufacturer
8383
/**
8484
* @brief Called to handle a boost command.
8585
*
86-
* @param duration Indicates the time period in seconds for which the BOOST state is activated before it automatically reverts
87-
* to the previous mode (e.g. OFF, MANUAL or TIMED).
88-
* @param oneShot Indicates whether the BOOST state should be automatically canceled once the hot water has first reached the
89-
* set point temperature (or the TemporarySetpoint temperature, if specified) for the TargetPercentage (if
90-
* specified).
91-
* @param emergencyBoost Indicates that the consumer wants the water to be heated as quickly as practicable. This MAY cause
92-
* multiple heat sources to be activated (e.g. a heat pump and direct electric heating element).
93-
* @param temporarySetpoint Indicates the target temperature to which to heat the hot water for this Boost command. It SHALL be
94-
* used instead of the normal set point temperature whilst the BOOST state is active.
95-
* @param targetPercentage If the tank supports the TankPercent feature, this field indicates the amount of water that SHALL be
96-
* heated by this Boost command before the heater is switched off.
97-
* @param targetReheat If the tank supports the TankPercent feature, and the heating by this Boost command has ceased because
98-
* the TargetPercentage of the water in the tank has been heated to the set point (or TemporarySetpoint if
99-
* included), this field indicates the percentage to which the hot water in the tank SHALL be allowed to fall before again
100-
* beginning to reheat it.
86+
* @param duration Indicates the time period in seconds for which
87+
* the BOOST state is activated before it
88+
* automatically reverts to the previous mode
89+
* (e.g. OFF, MANUAL or TIMED).
10190
*
102-
* @return Success if the boost command is successful; otherwise return the appropriate error.
91+
* @param oneShot Indicates whether the BOOST state should be
92+
* automatically canceled once the hot water has
93+
* first reached the set point temperature (or the
94+
* TemporarySetpoint temperature, if specified)
95+
* for the TargetPercentage (if specified).
96+
*
97+
* @param emergencyBoost Indicates that the consumer wants the water to
98+
* be heated as quickly as practicable. This MAY
99+
* cause multiple heat sources to be activated
100+
* (e.g. a heat pump and direct electric heating
101+
* element).
102+
*
103+
* @param temporarySetpoint Indicates the target temperature to which to
104+
* heat the hot water for this Boost command. It
105+
* SHALL be used instead of the normal set point
106+
* temperature whilst the BOOST state is active.
107+
*
108+
* @param targetPercentage If the tank supports the TankPercent feature,
109+
* this field indicates the amount of water that
110+
* SHALL be heated by this Boost command before
111+
* the heater is switched off.
112+
*
113+
* @param targetReheat If the tank supports the TankPercent feature,
114+
* and the heating by this Boost command has
115+
* ceased because the TargetPercentage of the
116+
* water in the tank has been heated to the set
117+
* point (or TemporarySetpoint if included), this
118+
* field indicates the percentage to which the hot
119+
* water in the tank SHALL be allowed to fall
120+
* before again beginning to reheat it.
121+
*
122+
* @return Success if the boost command is successful; otherwise return the
123+
* appropriate error.
103124
*/
104125
Protocols::InteractionModel::Status BoostCommandStarted(uint32_t duration, Optional<bool> oneShot,
105126
Optional<bool> emergencyBoost, Optional<int16_t> temporarySetpoint,

examples/all-clusters-app/all-clusters-common/src/WhmDelegateImpl.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ void WaterHeaterManagementDelegate::SetWhmManufacturer(WhmManufacturer & whmManu
5050
*
5151
*********************************************************************************/
5252

53-
BitMask<WaterHeaterTypeBitmap> WaterHeaterManagementDelegate::GetHeaterTypes()
53+
BitMask<WaterHeaterHeatSourceBitmap> WaterHeaterManagementDelegate::GetHeaterTypes()
5454
{
5555
return mHeaterTypes;
5656
}
5757

58-
BitMask<WaterHeaterDemandBitmap> WaterHeaterManagementDelegate::GetHeatDemand()
58+
BitMask<WaterHeaterHeatSourceBitmap> WaterHeaterManagementDelegate::GetHeatDemand()
5959
{
6060
return mHeatDemand;
6161
}
@@ -80,7 +80,7 @@ BoostStateEnum WaterHeaterManagementDelegate::GetBoostState()
8080
return mBoostState;
8181
}
8282

83-
void WaterHeaterManagementDelegate::SetHeaterTypes(BitMask<WaterHeaterTypeBitmap> heaterTypes)
83+
void WaterHeaterManagementDelegate::SetHeaterTypes(BitMask<WaterHeaterHeatSourceBitmap> heaterTypes)
8484
{
8585
if (mHeaterTypes != heaterTypes)
8686
{
@@ -90,7 +90,7 @@ void WaterHeaterManagementDelegate::SetHeaterTypes(BitMask<WaterHeaterTypeBitmap
9090
}
9191
}
9292

93-
void WaterHeaterManagementDelegate::SetHeatDemand(BitMask<WaterHeaterDemandBitmap> heatDemand)
93+
void WaterHeaterManagementDelegate::SetHeatDemand(BitMask<WaterHeaterHeatSourceBitmap> heatDemand)
9494
{
9595
if (mHeatDemand != heatDemand)
9696
{

examples/all-clusters-app/all-clusters-common/src/WhmManufacturer.cpp

+21-21
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ CHIP_ERROR WhmManufacturer::Init()
4343
return CHIP_ERROR_UNINITIALIZED;
4444
}
4545

46-
dg->SetHeaterTypes(BitMask<WaterHeaterTypeBitmap>(WaterHeaterTypeBitmap::kImmersionElement1));
47-
dg->SetHeatDemand(BitMask<WaterHeaterDemandBitmap>(WaterHeaterDemandBitmap::kImmersionElement1));
46+
dg->SetHeaterTypes(BitMask<WaterHeaterHeatSourceBitmap>(WaterHeaterHeatSourceBitmap::kImmersionElement1));
47+
dg->SetHeatDemand(BitMask<WaterHeaterHeatSourceBitmap>(WaterHeaterHeatSourceBitmap::kImmersionElement1));
4848
dg->SetEstimatedHeatRequired(10000);
4949

5050
return CHIP_NO_ERROR;
@@ -55,36 +55,36 @@ CHIP_ERROR WhmManufacturer::Shutdown()
5555
return CHIP_NO_ERROR;
5656
}
5757

58-
BitMask<WaterHeaterDemandBitmap> WhmManufacturer::DetermineHeatingSources()
58+
BitMask<WaterHeaterHeatSourceBitmap> WhmManufacturer::DetermineHeatingSources()
5959
{
6060
WaterHeaterManagementDelegate * dg = GetWhmManufacturer()->GetWhmDelegate();
6161
if (dg == nullptr)
6262
{
6363
ChipLogError(AppServer, "WhmDelegate is not initialized");
64-
return BitMask<WaterHeaterDemandBitmap>(0);
64+
return BitMask<WaterHeaterHeatSourceBitmap>(0);
6565
}
6666

6767
// A list of valid heaterTypes
6868
uint8_t waterHeaterTypeValues[] = {
69-
static_cast<uint8_t>(WaterHeaterTypeBitmap::kImmersionElement1),
70-
static_cast<uint8_t>(WaterHeaterTypeBitmap::kImmersionElement2),
71-
static_cast<uint8_t>(WaterHeaterTypeBitmap::kHeatPump),
72-
static_cast<uint8_t>(WaterHeaterTypeBitmap::kBoiler),
73-
static_cast<uint8_t>(WaterHeaterTypeBitmap::kOther),
69+
static_cast<uint8_t>(WaterHeaterHeatSourceBitmap::kImmersionElement1),
70+
static_cast<uint8_t>(WaterHeaterHeatSourceBitmap::kImmersionElement2),
71+
static_cast<uint8_t>(WaterHeaterHeatSourceBitmap::kHeatPump),
72+
static_cast<uint8_t>(WaterHeaterHeatSourceBitmap::kBoiler),
73+
static_cast<uint8_t>(WaterHeaterHeatSourceBitmap::kOther),
7474
};
7575

7676
// The corresponding list of valid headerDemands
7777
uint8_t waterHeaterDemandValues[] = {
78-
static_cast<uint8_t>(WaterHeaterDemandBitmap::kImmersionElement1),
79-
static_cast<uint8_t>(WaterHeaterDemandBitmap::kImmersionElement2),
80-
static_cast<uint8_t>(WaterHeaterDemandBitmap::kHeatPump),
81-
static_cast<uint8_t>(WaterHeaterDemandBitmap::kBoiler),
82-
static_cast<uint8_t>(WaterHeaterDemandBitmap::kOther),
78+
static_cast<uint8_t>(WaterHeaterHeatSourceBitmap::kImmersionElement1),
79+
static_cast<uint8_t>(WaterHeaterHeatSourceBitmap::kImmersionElement2),
80+
static_cast<uint8_t>(WaterHeaterHeatSourceBitmap::kHeatPump),
81+
static_cast<uint8_t>(WaterHeaterHeatSourceBitmap::kBoiler),
82+
static_cast<uint8_t>(WaterHeaterHeatSourceBitmap::kOther),
8383
};
8484

8585
// Iterate across the valid waterHeaterTypes seeing which heating sources are available based on heaterTypes.
8686
// Set the corresponding bit in the heaterDemand bitmap.
87-
BitMask<WaterHeaterTypeBitmap> heaterTypes = dg->GetHeaterTypes();
87+
BitMask<WaterHeaterHeatSourceBitmap> heaterTypes = dg->GetHeaterTypes();
8888

8989
uint8_t heaterDemandMask = 0;
9090
for (uint16_t idx = 0; idx < static_cast<uint16_t>(sizeof(waterHeaterTypeValues) / sizeof(waterHeaterTypeValues[0])); idx++)
@@ -96,7 +96,7 @@ BitMask<WaterHeaterDemandBitmap> WhmManufacturer::DetermineHeatingSources()
9696
}
9797
}
9898

99-
return BitMask<WaterHeaterDemandBitmap>(heaterDemandMask);
99+
return BitMask<WaterHeaterHeatSourceBitmap>(heaterDemandMask);
100100
}
101101

102102
Status WhmManufacturer::TurnHeatingOn(bool emergencyBoost)
@@ -111,12 +111,12 @@ Status WhmManufacturer::TurnHeatingOn(bool emergencyBoost)
111111
{
112112
// emergencyBoost that the consumer wants the water to be heated as quickly as practicable.
113113
// Thus, cause multiple heat sources to be activated
114-
dg->SetHeatDemand(BitMask<WaterHeaterDemandBitmap>(WaterHeaterDemandBitmap::kImmersionElement1,
115-
WaterHeaterDemandBitmap::kImmersionElement2));
114+
dg->SetHeatDemand(BitMask<WaterHeaterHeatSourceBitmap>(WaterHeaterHeatSourceBitmap::kImmersionElement1,
115+
WaterHeaterHeatSourceBitmap::kImmersionElement2));
116116
}
117117
else
118118
{
119-
dg->SetHeatDemand(BitMask<WaterHeaterDemandBitmap>(WaterHeaterDemandBitmap::kImmersionElement1));
119+
dg->SetHeatDemand(BitMask<WaterHeaterHeatSourceBitmap>(WaterHeaterHeatSourceBitmap::kImmersionElement1));
120120
}
121121

122122
return status;
@@ -130,7 +130,7 @@ Status WhmManufacturer::TurnHeatingOff()
130130

131131
WaterHeaterManagementDelegate * dg = GetWhmDelegate();
132132

133-
dg->SetHeatDemand(BitMask<WaterHeaterDemandBitmap>(0));
133+
dg->SetHeatDemand(BitMask<WaterHeaterHeatSourceBitmap>(0));
134134

135135
return status;
136136
}
@@ -167,7 +167,7 @@ void SetTestEventTrigger_BasicInstallationTestEvent()
167167
// Simulate installation in a 100L tank full of water at 20C, with a target temperature of 60C, in OFF mode
168168
dg->SetTankVolume(100);
169169
dg->SetTargetWaterTemperature(6000);
170-
dg->SetHeaterTypes(BitMask<WaterHeaterTypeBitmap>(WaterHeaterTypeBitmap::kImmersionElement1));
170+
dg->SetHeaterTypes(BitMask<WaterHeaterHeatSourceBitmap>(WaterHeaterHeatSourceBitmap::kImmersionElement1));
171171
dg->DrawOffHotWater(100, 2000);
172172
}
173173

src/app/clusters/water-heater-management-server/water-heater-management-server.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,12 @@ void Instance::InvokeCommand(HandlerContext & handlerContext)
117117

118118
void Instance::HandleBoost(HandlerContext & ctx, const Commands::Boost::DecodableType & commandData)
119119
{
120-
uint32_t duration = commandData.duration;
121-
Optional<bool> oneShot = commandData.oneShot;
122-
Optional<bool> emergencyBoost = commandData.emergencyBoost;
123-
Optional<int16_t> temporarySetpoint = commandData.temporarySetpoint;
124-
Optional<Percent> targetPercentage = commandData.targetPercentage;
125-
Optional<Percent> targetReheat = commandData.targetReheat;
120+
uint32_t duration = commandData.boostInfo.duration;
121+
Optional<bool> oneShot = commandData.boostInfo.oneShot;
122+
Optional<bool> emergencyBoost = commandData.boostInfo.emergencyBoost;
123+
Optional<int16_t> temporarySetpoint = commandData.boostInfo.temporarySetpoint;
124+
Optional<Percent> targetPercentage = commandData.boostInfo.targetPercentage;
125+
Optional<Percent> targetReheat = commandData.boostInfo.targetReheat;
126126

127127
// Notify the appliance if the appliance hardware cannot be adjusted, then return Failure
128128
if (HasFeature(WaterHeaterManagement::Feature::kTankPercent))

0 commit comments

Comments
 (0)