19
19
#pragma once
20
20
21
21
#include < app-common/zap-generated/cluster-objects.h>
22
- #include < app/clusters/mode-base-server/mode-base-server.h>
23
22
#include < app/clusters/water-heater-management-server/water-heater-management-server.h>
24
23
25
24
#include < protocols/interaction_model/StatusCode.h>
@@ -34,7 +33,7 @@ using ModeTagStructType = detail::Structs::ModeTagStruct::Type;
34
33
class WhmManufacturer ;
35
34
36
35
// This is an application level delegate to handle operational state commands according to the specific business logic.
37
- class WaterHeaterManagementDelegate : public WaterHeaterManagement ::Delegate, public ModeBase::Delegate
36
+ class WaterHeaterManagementDelegate : public WaterHeaterManagement ::Delegate
38
37
{
39
38
public:
40
39
WaterHeaterManagementDelegate (EndpointId clustersEndpoint);
@@ -47,29 +46,33 @@ class WaterHeaterManagementDelegate : public WaterHeaterManagement::Delegate, pu
47
46
48
47
/* ********************************************************************************
49
48
*
50
- * Methods implementing the WaterHeaterManagement::Delegate interace
49
+ * Methods implementing the WaterHeaterManagement::Delegate interface
51
50
*
52
51
*********************************************************************************/
53
52
54
53
/* *
55
54
* @brief Delegate should implement a handler to start boosting the water temperature as required.
56
- * Upon receipt, the Water Heater SHALL transition into the BOOST state, which SHALL cause the water in the tank (or the
57
- * TargetPercentage of the water, if included) to be heated towards the set point (or the TemporarySetpoint, if included), which
58
- * 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.
55
+ * Upon receipt, the Water Heater SHALL transition into the BOOST state, which SHALL cause the
56
+ * water in the tank (or the TargetPercentage of the water, if included) to be heated towards
57
+ * the set point (or the TemporarySetpoint, if included), which in turn may cause a call for heat,
58
+ * even if the mode is OFF, or is TIMED and it is during one of the Off periods.
59
59
*
60
- * @param duration Indicates the time period in seconds for which the BOOST state is activated before it automatically reverts
61
- * to the previous mode (e.g. OFF, MANUAL or TIMED).
62
- * @param oneShot Indicates whether the BOOST state should be automatically canceled once the hot water has first reached the
63
- * set point temperature (or the TemporarySetpoint temperature, if specified) for the TargetPercentage (if specified).
64
- * @param emergencyBoost Indicates that the consumer wants the water to be heated as quickly as practicable. This MAY cause
65
- * multiple heat sources to be activated (e.g. a heat pump and direct electric heating element).
66
- * @param temporarySetpoint Indicates the target temperature to which to heat the hot water for this Boost command. It SHALL be
67
- * used instead of the normal set point temperature whilst the BOOST state is active.
68
- * @param targetPercentage If the tank supports the TankPercent feature, this field indicates the amount of water that SHALL be
69
- * heated by this Boost command before the heater is switched off.
70
- * @param targetReheat If the tank supports the TankPercent feature, and the heating by this Boost command has ceased because
71
- * the TargetPercentage of the water in the tank has been heated to the set point (or TemporarySetpoint if included), this field
72
- * indicates the percentage to which the hot water in the tank SHALL be allowed to fall before again beginning to reheat it.
60
+ * @param duration Indicates the time period in seconds for which the BOOST state is activated before it
61
+ * automatically reverts to the previous mode (e.g. OFF, MANUAL or TIMED).
62
+ * @param oneShot Indicates whether the BOOST state should be automatically canceled once the hot water has
63
+ * first reached the set point temperature (or the TemporarySetpoint temperature, if specified)
64
+ * for the TargetPercentage (if specified).
65
+ * @param emergencyBoost Indicates that the consumer wants the water to be heated as quickly as practicable.
66
+ * This MAY cause multiple heat sources to be activated (e.g. a heat pump and direct
67
+ * electric heating element).
68
+ * @param temporarySetpoint Indicates the target temperature to which to heat the hot water for this Boost command.
69
+ * It SHALL be used instead of the normal set point temperature whilst the BOOST state is active.
70
+ * @param targetPercentage If the tank supports the TankPercent feature, this field indicates the amount of water
71
+ * that SHALL be heated by this Boost command before the heater is switched off.
72
+ * @param targetReheat If the tank supports the TankPercent feature, and the heating by this Boost command has ceased
73
+ * because the TargetPercentage of the water in the tank has been heated to the set point (or
74
+ * TemporarySetpoint if included), this field indicates the percentage to which the hot water in
75
+ * the tank SHALL be allowed to fall before again beginning to reheat it.
73
76
*
74
77
* @return Success if the boost command is accepted; otherwise the command SHALL be rejected with appropriate error.
75
78
*/
@@ -104,57 +107,6 @@ class WaterHeaterManagementDelegate : public WaterHeaterManagement::Delegate, pu
104
107
void SetTankPercentage (Percent tankPercentage);
105
108
void SetBoostState (BoostStateEnum boostState);
106
109
107
- /* ********************************************************************************
108
- *
109
- * Methods implementing the ModeBase::Delegate interface
110
- *
111
- *********************************************************************************/
112
-
113
- CHIP_ERROR Init () override ;
114
-
115
- /* *
116
- * Handle application logic when the mode is changing.
117
- *
118
- * @param mode The new mode that the device is requested to transition to.
119
- * @param response A reference to a response that will be sent to the client. The contents of which con be modified by the
120
- * application.
121
- */
122
- void HandleChangeToMode (uint8_t mode, ModeBase::Commands::ChangeToModeResponse::Type & response) override ;
123
-
124
- /* *
125
- * Get the mode label of the Nth mode in the list of modes.
126
- *
127
- * @param modeIndex The index of the mode to be returned. It is assumed that modes are indexable from 0 and with no gaps.
128
- * @param label A reference to the mutable char span which will be mutated to receive the label on success. Use
129
- * CopyCharSpanToMutableCharSpan to copy into the MutableCharSpan.
130
- *
131
- * @return Returns a CHIP_NO_ERROR if there was no error and the label was returned successfully.
132
- * CHIP_ERROR_PROVIDER_LIST_EXHAUSTED if the modeIndex in beyond the list of available labels.
133
- */
134
- CHIP_ERROR GetModeLabelByIndex (uint8_t modeIndex, MutableCharSpan & label) override ;
135
-
136
- /* *
137
- * Get the mode value of the Nth mode in the list of modes.
138
- *
139
- * @param modeIndex The index of the mode to be returned. It is assumed that modes are indexable from 0 and with no gaps.
140
- * @param value a reference to the uint8_t variable that is to contain the mode value.
141
- *
142
- * @return Returns a CHIP_NO_ERROR if there was no error and the value was returned successfully.
143
- * CHIP_ERROR_PROVIDER_LIST_EXHAUSTED if the modeIndex in beyond the list of available values.
144
- */
145
- CHIP_ERROR GetModeValueByIndex (uint8_t modeIndex, uint8_t & value) override ;
146
-
147
- /* *
148
- * Get the mode tags of the Nth mode in the list of modes.
149
- * @param modeIndex The index of the mode to be returned. It is assumed that modes are indexable from 0 and with no gaps.
150
- * @param tags a reference to an existing and initialised buffer that is to contain the mode tags. std::copy can be used
151
- * to copy into the buffer.
152
- *
153
- * @return Returns a CHIP_NO_ERROR if there was no error and the mode tags were returned successfully.
154
- * CHIP_ERROR_PROVIDER_LIST_EXHAUSTED if the modeIndex in beyond the list of available mode tags.
155
- */
156
- CHIP_ERROR GetModeTagsByIndex (uint8_t modeIndex, DataModel::List<ModeTagStructType> & tags) override ;
157
-
158
110
/* ********************************************************************************
159
111
*
160
112
* WaterHeaterManagementDelegate specific methods
@@ -293,9 +245,6 @@ class WaterHeaterManagementDelegate : public WaterHeaterManagement::Delegate, pu
293
245
*
294
246
*********************************************************************************/
295
247
296
- // Access to the Water Heater Mode instance
297
- ModeBase::Instance mWaterHeaterModeInstance ;
298
-
299
248
// This attribute SHALL indicate the methods to call for heat that the controller supports. If a bit is set then the controller
300
249
// supports the corresponding method.
301
250
BitMask<WaterHeaterTypeBitmap> mHeaterTypes ;
@@ -319,28 +268,6 @@ class WaterHeaterManagementDelegate : public WaterHeaterManagement::Delegate, pu
319
268
320
269
// This attribute SHALL indicate if the BOOST state, as triggered by a Boost command, is currently active.
321
270
BoostStateEnum mBoostState ;
322
-
323
- /* ********************************************************************************
324
- *
325
- * Member variables implementing the ModeBase::Delegate interface
326
- *
327
- *********************************************************************************/
328
-
329
- ModeTagStructType modeTagsOff[1 ] = { { .value = to_underlying (WaterHeaterMode::ModeTag::kOff ) } };
330
- ModeTagStructType modeTagsManual[1 ] = { { .value = to_underlying (WaterHeaterMode::ModeTag::kManual ) } };
331
- ModeTagStructType modeTagsTimed[1 ] = { { .value = to_underlying (WaterHeaterMode::ModeTag::kTimed ) } };
332
-
333
- const detail::Structs::ModeOptionStruct::Type kModeOptions [3 ] = {
334
- detail::Structs::ModeOptionStruct::Type{ .label = CharSpan::fromCharString (" Off" ),
335
- .mode = ModeOff,
336
- .modeTags = DataModel::List<const ModeTagStructType>(modeTagsOff) },
337
- detail::Structs::ModeOptionStruct::Type{ .label = CharSpan::fromCharString (" Manual" ),
338
- .mode = ModeManual,
339
- .modeTags = DataModel::List<const ModeTagStructType>(modeTagsManual) },
340
- detail::Structs::ModeOptionStruct::Type{ .label = CharSpan::fromCharString (" Timed" ),
341
- .mode = ModeTimed,
342
- .modeTags = DataModel::List<const ModeTagStructType>(modeTagsTimed) }
343
- };
344
271
};
345
272
346
273
} // namespace WaterHeaterManagement
0 commit comments