Skip to content

Commit aebc768

Browse files
nivi-applerestyled-commitsbzbarsky-apple
authored andcommitted
Add support for Presets attributes and commands to the Thermostat cluster (project-chip#34532)
* Add support for Presets attributes and commands to the Thermostat cluster Clean up the Thermostat cluster and remove the TemperatureSetpointHoldPolicy attribute and SetTemperatureSetpointHoldPolicy command * Restyled by whitespace * Restyled by clang-format * Restyled by gn. * Fix build error for Linux configure build of all-clusters-app * Fix Darwin CI issues Editorial fixes * Restyled by clang-format * More fixes * Restyled by clang-format * BUILD.gn fixes for CI * Apply suggestions from code review Co-authored-by: Boris Zbarsky <bzbarsky@apple.com> * Address review comments. * Restyled by clang-format * Apply suggestions from code review Co-authored-by: Boris Zbarsky <bzbarsky@apple.com> * Remove Presets and Schedules attributes from all-cluster-app.zap. --------- Co-authored-by: Restyled.io <commits@restyled.io> Co-authored-by: Boris Zbarsky <bzbarsky@apple.com>
1 parent f8d03b1 commit aebc768

File tree

61 files changed

+2665
-1554
lines changed

Some content is hidden

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

61 files changed

+2665
-1554
lines changed

examples/air-purifier-app/air-purifier-common/air-purifier-app.matter

+3-14
Original file line numberDiff line numberDiff line change
@@ -1294,7 +1294,8 @@ cluster Thermostat = 513 {
12941294
kSleep = 3;
12951295
kWake = 4;
12961296
kVacation = 5;
1297-
kUserDefined = 6;
1297+
kGoingToSleep = 6;
1298+
kUserDefined = 254;
12981299
}
12991300

13001301
enum SetpointChangeSourceEnum : enum8 {
@@ -1420,11 +1421,6 @@ cluster Thermostat = 513 {
14201421
kSupportsOff = 0x8;
14211422
}
14221423

1423-
bitmap TemperatureSetpointHoldPolicyBitmap : bitmap8 {
1424-
kHoldDurationElapsed = 0x1;
1425-
kHoldDurationElapsedOrPresetChanged = 0x2;
1426-
}
1427-
14281424
struct ScheduleTransitionStruct {
14291425
ScheduleDayOfWeekBitmap dayOfWeek = 0;
14301426
int16u transitionTime = 1;
@@ -1530,8 +1526,7 @@ cluster Thermostat = 513 {
15301526
attribute access(write: manage) optional PresetStruct presets[] = 80;
15311527
attribute access(write: manage) optional ScheduleStruct schedules[] = 81;
15321528
readonly attribute optional boolean presetsSchedulesEditable = 82;
1533-
readonly attribute optional TemperatureSetpointHoldPolicyBitmap temperatureSetpointHoldPolicy = 83;
1534-
readonly attribute optional nullable epoch_s setpointHoldExpiryTimestamp = 84;
1529+
readonly attribute optional nullable epoch_s setpointHoldExpiryTimestamp = 83;
15351530
readonly attribute command_id generatedCommandList[] = 65528;
15361531
readonly attribute command_id acceptedCommandList[] = 65529;
15371532
readonly attribute event_id eventList[] = 65530;
@@ -1575,10 +1570,6 @@ cluster Thermostat = 513 {
15751570
int16u timeoutSeconds = 0;
15761571
}
15771572

1578-
request struct SetTemperatureSetpointHoldPolicyRequest {
1579-
TemperatureSetpointHoldPolicyBitmap temperatureSetpointHoldPolicy = 0;
1580-
}
1581-
15821573
/** Command description for SetpointRaiseLower */
15831574
command SetpointRaiseLower(SetpointRaiseLowerRequest): DefaultSuccess = 0;
15841575
/** Command description for SetWeeklySchedule */
@@ -1597,8 +1588,6 @@ cluster Thermostat = 513 {
15971588
command access(invoke: manage) CancelPresetsSchedulesEditRequest(): DefaultSuccess = 8;
15981589
/** This command is used to notify the server that all edits are done and should be committed. */
15991590
command access(invoke: manage) CommitPresetsSchedulesRequest(): DefaultSuccess = 9;
1600-
/** This command sets the set point hold policy. */
1601-
command SetTemperatureSetpointHoldPolicy(SetTemperatureSetpointHoldPolicyRequest): DefaultSuccess = 11;
16021591
}
16031592

16041593
/** An interface for controlling a fan in a heating/cooling system. */

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

+3-26
Original file line numberDiff line numberDiff line change
@@ -5131,7 +5131,8 @@ cluster Thermostat = 513 {
51315131
kSleep = 3;
51325132
kWake = 4;
51335133
kVacation = 5;
5134-
kUserDefined = 6;
5134+
kGoingToSleep = 6;
5135+
kUserDefined = 254;
51355136
}
51365137

51375138
enum SetpointChangeSourceEnum : enum8 {
@@ -5257,11 +5258,6 @@ cluster Thermostat = 513 {
52575258
kSupportsOff = 0x8;
52585259
}
52595260

5260-
bitmap TemperatureSetpointHoldPolicyBitmap : bitmap8 {
5261-
kHoldDurationElapsed = 0x1;
5262-
kHoldDurationElapsedOrPresetChanged = 0x2;
5263-
}
5264-
52655261
struct ScheduleTransitionStruct {
52665262
ScheduleDayOfWeekBitmap dayOfWeek = 0;
52675263
int16u transitionTime = 1;
@@ -5367,8 +5363,7 @@ cluster Thermostat = 513 {
53675363
attribute access(write: manage) optional PresetStruct presets[] = 80;
53685364
attribute access(write: manage) optional ScheduleStruct schedules[] = 81;
53695365
readonly attribute optional boolean presetsSchedulesEditable = 82;
5370-
readonly attribute optional TemperatureSetpointHoldPolicyBitmap temperatureSetpointHoldPolicy = 83;
5371-
readonly attribute optional nullable epoch_s setpointHoldExpiryTimestamp = 84;
5366+
readonly attribute optional nullable epoch_s setpointHoldExpiryTimestamp = 83;
53725367
readonly attribute command_id generatedCommandList[] = 65528;
53735368
readonly attribute command_id acceptedCommandList[] = 65529;
53745369
readonly attribute event_id eventList[] = 65530;
@@ -5412,10 +5407,6 @@ cluster Thermostat = 513 {
54125407
int16u timeoutSeconds = 0;
54135408
}
54145409

5415-
request struct SetTemperatureSetpointHoldPolicyRequest {
5416-
TemperatureSetpointHoldPolicyBitmap temperatureSetpointHoldPolicy = 0;
5417-
}
5418-
54195410
/** Command description for SetpointRaiseLower */
54205411
command SetpointRaiseLower(SetpointRaiseLowerRequest): DefaultSuccess = 0;
54215412
/** Command description for SetWeeklySchedule */
@@ -5434,8 +5425,6 @@ cluster Thermostat = 513 {
54345425
command access(invoke: manage) CancelPresetsSchedulesEditRequest(): DefaultSuccess = 8;
54355426
/** This command is used to notify the server that all edits are done and should be committed. */
54365427
command access(invoke: manage) CommitPresetsSchedulesRequest(): DefaultSuccess = 9;
5437-
/** This command sets the set point hold policy. */
5438-
command SetTemperatureSetpointHoldPolicy(SetTemperatureSetpointHoldPolicyRequest): DefaultSuccess = 11;
54395428
}
54405429

54415430
/** An interface for controlling a fan in a heating/cooling system. */
@@ -8748,18 +8737,6 @@ endpoint 1 {
87488737
ram attribute minSetpointDeadBand default = 0x19;
87498738
ram attribute controlSequenceOfOperation default = 0x04;
87508739
ram attribute systemMode default = 0x01;
8751-
callback attribute presetTypes;
8752-
callback attribute scheduleTypes;
8753-
ram attribute numberOfPresets default = 0;
8754-
ram attribute numberOfSchedules default = 0;
8755-
ram attribute numberOfScheduleTransitionPerDay default = 0xFF;
8756-
ram attribute activePresetHandle;
8757-
ram attribute activeScheduleHandle;
8758-
callback attribute presets;
8759-
callback attribute schedules;
8760-
ram attribute presetsSchedulesEditable;
8761-
ram attribute temperatureSetpointHoldPolicy default = 0;
8762-
ram attribute setpointHoldExpiryTimestamp;
87638740
callback attribute generatedCommandList;
87648741
callback attribute acceptedCommandList;
87658742
callback attribute eventList;

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

-208
Original file line numberDiff line numberDiff line change
@@ -16636,214 +16636,6 @@
1663616636
"maxInterval": 65344,
1663716637
"reportableChange": 0
1663816638
},
16639-
{
16640-
"name": "PresetTypes",
16641-
"code": 72,
16642-
"mfgCode": null,
16643-
"side": "server",
16644-
"type": "array",
16645-
"included": 1,
16646-
"storageOption": "External",
16647-
"singleton": 0,
16648-
"bounded": 0,
16649-
"defaultValue": null,
16650-
"reportable": 1,
16651-
"minInterval": 1,
16652-
"maxInterval": 65534,
16653-
"reportableChange": 0
16654-
},
16655-
{
16656-
"name": "ScheduleTypes",
16657-
"code": 73,
16658-
"mfgCode": null,
16659-
"side": "server",
16660-
"type": "array",
16661-
"included": 1,
16662-
"storageOption": "External",
16663-
"singleton": 0,
16664-
"bounded": 0,
16665-
"defaultValue": null,
16666-
"reportable": 1,
16667-
"minInterval": 1,
16668-
"maxInterval": 65534,
16669-
"reportableChange": 0
16670-
},
16671-
{
16672-
"name": "NumberOfPresets",
16673-
"code": 74,
16674-
"mfgCode": null,
16675-
"side": "server",
16676-
"type": "int8u",
16677-
"included": 1,
16678-
"storageOption": "RAM",
16679-
"singleton": 0,
16680-
"bounded": 0,
16681-
"defaultValue": "0",
16682-
"reportable": 1,
16683-
"minInterval": 1,
16684-
"maxInterval": 65534,
16685-
"reportableChange": 0
16686-
},
16687-
{
16688-
"name": "NumberOfSchedules",
16689-
"code": 75,
16690-
"mfgCode": null,
16691-
"side": "server",
16692-
"type": "int8u",
16693-
"included": 1,
16694-
"storageOption": "RAM",
16695-
"singleton": 0,
16696-
"bounded": 0,
16697-
"defaultValue": "0",
16698-
"reportable": 1,
16699-
"minInterval": 1,
16700-
"maxInterval": 65534,
16701-
"reportableChange": 0
16702-
},
16703-
{
16704-
"name": "NumberOfScheduleTransitionPerDay",
16705-
"code": 77,
16706-
"mfgCode": null,
16707-
"side": "server",
16708-
"type": "int8u",
16709-
"included": 1,
16710-
"storageOption": "RAM",
16711-
"singleton": 0,
16712-
"bounded": 0,
16713-
"defaultValue": "0xFF",
16714-
"reportable": 1,
16715-
"minInterval": 1,
16716-
"maxInterval": 65534,
16717-
"reportableChange": 0
16718-
},
16719-
{
16720-
"name": "ActivePresetHandle",
16721-
"code": 78,
16722-
"mfgCode": null,
16723-
"side": "server",
16724-
"type": "octet_string",
16725-
"included": 1,
16726-
"storageOption": "RAM",
16727-
"singleton": 0,
16728-
"bounded": 0,
16729-
"defaultValue": "",
16730-
"reportable": 1,
16731-
"minInterval": 1,
16732-
"maxInterval": 65534,
16733-
"reportableChange": 0
16734-
},
16735-
{
16736-
"name": "ActiveScheduleHandle",
16737-
"code": 79,
16738-
"mfgCode": null,
16739-
"side": "server",
16740-
"type": "octet_string",
16741-
"included": 1,
16742-
"storageOption": "RAM",
16743-
"singleton": 0,
16744-
"bounded": 0,
16745-
"defaultValue": "",
16746-
"reportable": 1,
16747-
"minInterval": 1,
16748-
"maxInterval": 65534,
16749-
"reportableChange": 0
16750-
},
16751-
{
16752-
"name": "Presets",
16753-
"code": 80,
16754-
"mfgCode": null,
16755-
"side": "server",
16756-
"type": "array",
16757-
"included": 1,
16758-
"storageOption": "External",
16759-
"singleton": 0,
16760-
"bounded": 0,
16761-
"defaultValue": null,
16762-
"reportable": 1,
16763-
"minInterval": 1,
16764-
"maxInterval": 65534,
16765-
"reportableChange": 0
16766-
},
16767-
{
16768-
"name": "Schedules",
16769-
"code": 81,
16770-
"mfgCode": null,
16771-
"side": "server",
16772-
"type": "array",
16773-
"included": 1,
16774-
"storageOption": "External",
16775-
"singleton": 0,
16776-
"bounded": 0,
16777-
"defaultValue": null,
16778-
"reportable": 1,
16779-
"minInterval": 1,
16780-
"maxInterval": 65534,
16781-
"reportableChange": 0
16782-
},
16783-
{
16784-
"name": "PresetsSchedulesEditable",
16785-
"code": 82,
16786-
"mfgCode": null,
16787-
"side": "server",
16788-
"type": "boolean",
16789-
"included": 1,
16790-
"storageOption": "RAM",
16791-
"singleton": 0,
16792-
"bounded": 0,
16793-
"defaultValue": "",
16794-
"reportable": 1,
16795-
"minInterval": 1,
16796-
"maxInterval": 65534,
16797-
"reportableChange": 0
16798-
},
16799-
{
16800-
"name": "TemperatureSetpointHoldPolicy",
16801-
"code": 83,
16802-
"mfgCode": null,
16803-
"side": "server",
16804-
"type": "TemperatureSetpointHoldPolicyBitmap",
16805-
"included": 1,
16806-
"storageOption": "RAM",
16807-
"singleton": 0,
16808-
"bounded": 0,
16809-
"defaultValue": "0",
16810-
"reportable": 1,
16811-
"minInterval": 1,
16812-
"maxInterval": 65534,
16813-
"reportableChange": 0
16814-
},
16815-
{
16816-
"name": "SetpointHoldExpiryTimestamp",
16817-
"code": 84,
16818-
"mfgCode": null,
16819-
"side": "server",
16820-
"type": "epoch_s",
16821-
"included": 1,
16822-
"storageOption": "RAM",
16823-
"singleton": 0,
16824-
"bounded": 0,
16825-
"defaultValue": "",
16826-
"reportable": 1,
16827-
"minInterval": 1,
16828-
"maxInterval": 65534,
16829-
"reportableChange": 0
16830-
},
16831-
{
16832-
"name": "QueuedPreset",
16833-
"code": 85,
16834-
"mfgCode": null,
16835-
"side": "server",
16836-
"type": "QueuedPresetStruct",
16837-
"included": 1,
16838-
"storageOption": "External",
16839-
"singleton": 0,
16840-
"bounded": 0,
16841-
"defaultValue": null,
16842-
"reportable": 1,
16843-
"minInterval": 1,
16844-
"maxInterval": 65534,
16845-
"reportableChange": 0
16846-
},
1684716639
{
1684816640
"name": "GeneratedCommandList",
1684916641
"code": 65528,

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

+3-14
Original file line numberDiff line numberDiff line change
@@ -3568,7 +3568,8 @@ cluster Thermostat = 513 {
35683568
kSleep = 3;
35693569
kWake = 4;
35703570
kVacation = 5;
3571-
kUserDefined = 6;
3571+
kGoingToSleep = 6;
3572+
kUserDefined = 254;
35723573
}
35733574

35743575
enum SetpointChangeSourceEnum : enum8 {
@@ -3694,11 +3695,6 @@ cluster Thermostat = 513 {
36943695
kSupportsOff = 0x8;
36953696
}
36963697

3697-
bitmap TemperatureSetpointHoldPolicyBitmap : bitmap8 {
3698-
kHoldDurationElapsed = 0x1;
3699-
kHoldDurationElapsedOrPresetChanged = 0x2;
3700-
}
3701-
37023698
struct ScheduleTransitionStruct {
37033699
ScheduleDayOfWeekBitmap dayOfWeek = 0;
37043700
int16u transitionTime = 1;
@@ -3804,8 +3800,7 @@ cluster Thermostat = 513 {
38043800
attribute access(write: manage) optional PresetStruct presets[] = 80;
38053801
attribute access(write: manage) optional ScheduleStruct schedules[] = 81;
38063802
readonly attribute optional boolean presetsSchedulesEditable = 82;
3807-
readonly attribute optional TemperatureSetpointHoldPolicyBitmap temperatureSetpointHoldPolicy = 83;
3808-
readonly attribute optional nullable epoch_s setpointHoldExpiryTimestamp = 84;
3803+
readonly attribute optional nullable epoch_s setpointHoldExpiryTimestamp = 83;
38093804
readonly attribute command_id generatedCommandList[] = 65528;
38103805
readonly attribute command_id acceptedCommandList[] = 65529;
38113806
readonly attribute event_id eventList[] = 65530;
@@ -3849,10 +3844,6 @@ cluster Thermostat = 513 {
38493844
int16u timeoutSeconds = 0;
38503845
}
38513846

3852-
request struct SetTemperatureSetpointHoldPolicyRequest {
3853-
TemperatureSetpointHoldPolicyBitmap temperatureSetpointHoldPolicy = 0;
3854-
}
3855-
38563847
/** Command description for SetpointRaiseLower */
38573848
command SetpointRaiseLower(SetpointRaiseLowerRequest): DefaultSuccess = 0;
38583849
/** Command description for SetWeeklySchedule */
@@ -3871,8 +3862,6 @@ cluster Thermostat = 513 {
38713862
command access(invoke: manage) CancelPresetsSchedulesEditRequest(): DefaultSuccess = 8;
38723863
/** This command is used to notify the server that all edits are done and should be committed. */
38733864
command access(invoke: manage) CommitPresetsSchedulesRequest(): DefaultSuccess = 9;
3874-
/** This command sets the set point hold policy. */
3875-
command SetTemperatureSetpointHoldPolicy(SetTemperatureSetpointHoldPolicyRequest): DefaultSuccess = 11;
38763865
}
38773866

38783867
/** An interface for controlling a fan in a heating/cooling system. */

0 commit comments

Comments
 (0)