Skip to content

Commit

Permalink
Add support for Presets attributes and commands to the Thermostat clu…
Browse files Browse the repository at this point in the history
…ster (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 <[email protected]>

* Address review comments.

* Restyled by clang-format

* Apply suggestions from code review

Co-authored-by: Boris Zbarsky <[email protected]>

* Remove Presets and Schedules attributes from all-cluster-app.zap.

---------

Co-authored-by: Restyled.io <[email protected]>
Co-authored-by: Boris Zbarsky <[email protected]>
  • Loading branch information
3 people authored and rochaferraz committed Jul 31, 2024
1 parent f8d03b1 commit aebc768
Show file tree
Hide file tree
Showing 61 changed files with 2,665 additions and 1,554 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1294,7 +1294,8 @@ cluster Thermostat = 513 {
kSleep = 3;
kWake = 4;
kVacation = 5;
kUserDefined = 6;
kGoingToSleep = 6;
kUserDefined = 254;
}

enum SetpointChangeSourceEnum : enum8 {
Expand Down Expand Up @@ -1420,11 +1421,6 @@ cluster Thermostat = 513 {
kSupportsOff = 0x8;
}

bitmap TemperatureSetpointHoldPolicyBitmap : bitmap8 {
kHoldDurationElapsed = 0x1;
kHoldDurationElapsedOrPresetChanged = 0x2;
}

struct ScheduleTransitionStruct {
ScheduleDayOfWeekBitmap dayOfWeek = 0;
int16u transitionTime = 1;
Expand Down Expand Up @@ -1530,8 +1526,7 @@ cluster Thermostat = 513 {
attribute access(write: manage) optional PresetStruct presets[] = 80;
attribute access(write: manage) optional ScheduleStruct schedules[] = 81;
readonly attribute optional boolean presetsSchedulesEditable = 82;
readonly attribute optional TemperatureSetpointHoldPolicyBitmap temperatureSetpointHoldPolicy = 83;
readonly attribute optional nullable epoch_s setpointHoldExpiryTimestamp = 84;
readonly attribute optional nullable epoch_s setpointHoldExpiryTimestamp = 83;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
readonly attribute event_id eventList[] = 65530;
Expand Down Expand Up @@ -1575,10 +1570,6 @@ cluster Thermostat = 513 {
int16u timeoutSeconds = 0;
}

request struct SetTemperatureSetpointHoldPolicyRequest {
TemperatureSetpointHoldPolicyBitmap temperatureSetpointHoldPolicy = 0;
}

/** Command description for SetpointRaiseLower */
command SetpointRaiseLower(SetpointRaiseLowerRequest): DefaultSuccess = 0;
/** Command description for SetWeeklySchedule */
Expand All @@ -1597,8 +1588,6 @@ cluster Thermostat = 513 {
command access(invoke: manage) CancelPresetsSchedulesEditRequest(): DefaultSuccess = 8;
/** This command is used to notify the server that all edits are done and should be committed. */
command access(invoke: manage) CommitPresetsSchedulesRequest(): DefaultSuccess = 9;
/** This command sets the set point hold policy. */
command SetTemperatureSetpointHoldPolicy(SetTemperatureSetpointHoldPolicyRequest): DefaultSuccess = 11;
}

/** An interface for controlling a fan in a heating/cooling system. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5131,7 +5131,8 @@ cluster Thermostat = 513 {
kSleep = 3;
kWake = 4;
kVacation = 5;
kUserDefined = 6;
kGoingToSleep = 6;
kUserDefined = 254;
}

enum SetpointChangeSourceEnum : enum8 {
Expand Down Expand Up @@ -5257,11 +5258,6 @@ cluster Thermostat = 513 {
kSupportsOff = 0x8;
}

bitmap TemperatureSetpointHoldPolicyBitmap : bitmap8 {
kHoldDurationElapsed = 0x1;
kHoldDurationElapsedOrPresetChanged = 0x2;
}

struct ScheduleTransitionStruct {
ScheduleDayOfWeekBitmap dayOfWeek = 0;
int16u transitionTime = 1;
Expand Down Expand Up @@ -5367,8 +5363,7 @@ cluster Thermostat = 513 {
attribute access(write: manage) optional PresetStruct presets[] = 80;
attribute access(write: manage) optional ScheduleStruct schedules[] = 81;
readonly attribute optional boolean presetsSchedulesEditable = 82;
readonly attribute optional TemperatureSetpointHoldPolicyBitmap temperatureSetpointHoldPolicy = 83;
readonly attribute optional nullable epoch_s setpointHoldExpiryTimestamp = 84;
readonly attribute optional nullable epoch_s setpointHoldExpiryTimestamp = 83;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
readonly attribute event_id eventList[] = 65530;
Expand Down Expand Up @@ -5412,10 +5407,6 @@ cluster Thermostat = 513 {
int16u timeoutSeconds = 0;
}

request struct SetTemperatureSetpointHoldPolicyRequest {
TemperatureSetpointHoldPolicyBitmap temperatureSetpointHoldPolicy = 0;
}

/** Command description for SetpointRaiseLower */
command SetpointRaiseLower(SetpointRaiseLowerRequest): DefaultSuccess = 0;
/** Command description for SetWeeklySchedule */
Expand All @@ -5434,8 +5425,6 @@ cluster Thermostat = 513 {
command access(invoke: manage) CancelPresetsSchedulesEditRequest(): DefaultSuccess = 8;
/** This command is used to notify the server that all edits are done and should be committed. */
command access(invoke: manage) CommitPresetsSchedulesRequest(): DefaultSuccess = 9;
/** This command sets the set point hold policy. */
command SetTemperatureSetpointHoldPolicy(SetTemperatureSetpointHoldPolicyRequest): DefaultSuccess = 11;
}

/** An interface for controlling a fan in a heating/cooling system. */
Expand Down Expand Up @@ -8748,18 +8737,6 @@ endpoint 1 {
ram attribute minSetpointDeadBand default = 0x19;
ram attribute controlSequenceOfOperation default = 0x04;
ram attribute systemMode default = 0x01;
callback attribute presetTypes;
callback attribute scheduleTypes;
ram attribute numberOfPresets default = 0;
ram attribute numberOfSchedules default = 0;
ram attribute numberOfScheduleTransitionPerDay default = 0xFF;
ram attribute activePresetHandle;
ram attribute activeScheduleHandle;
callback attribute presets;
callback attribute schedules;
ram attribute presetsSchedulesEditable;
ram attribute temperatureSetpointHoldPolicy default = 0;
ram attribute setpointHoldExpiryTimestamp;
callback attribute generatedCommandList;
callback attribute acceptedCommandList;
callback attribute eventList;
Expand Down
208 changes: 0 additions & 208 deletions examples/all-clusters-app/all-clusters-common/all-clusters-app.zap
Original file line number Diff line number Diff line change
Expand Up @@ -16636,214 +16636,6 @@
"maxInterval": 65344,
"reportableChange": 0
},
{
"name": "PresetTypes",
"code": 72,
"mfgCode": null,
"side": "server",
"type": "array",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "ScheduleTypes",
"code": 73,
"mfgCode": null,
"side": "server",
"type": "array",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "NumberOfPresets",
"code": 74,
"mfgCode": null,
"side": "server",
"type": "int8u",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "0",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "NumberOfSchedules",
"code": 75,
"mfgCode": null,
"side": "server",
"type": "int8u",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "0",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "NumberOfScheduleTransitionPerDay",
"code": 77,
"mfgCode": null,
"side": "server",
"type": "int8u",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "0xFF",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "ActivePresetHandle",
"code": 78,
"mfgCode": null,
"side": "server",
"type": "octet_string",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "ActiveScheduleHandle",
"code": 79,
"mfgCode": null,
"side": "server",
"type": "octet_string",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "Presets",
"code": 80,
"mfgCode": null,
"side": "server",
"type": "array",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "Schedules",
"code": 81,
"mfgCode": null,
"side": "server",
"type": "array",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "PresetsSchedulesEditable",
"code": 82,
"mfgCode": null,
"side": "server",
"type": "boolean",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "TemperatureSetpointHoldPolicy",
"code": 83,
"mfgCode": null,
"side": "server",
"type": "TemperatureSetpointHoldPolicyBitmap",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "0",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "SetpointHoldExpiryTimestamp",
"code": 84,
"mfgCode": null,
"side": "server",
"type": "epoch_s",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "QueuedPreset",
"code": 85,
"mfgCode": null,
"side": "server",
"type": "QueuedPresetStruct",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "GeneratedCommandList",
"code": 65528,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3568,7 +3568,8 @@ cluster Thermostat = 513 {
kSleep = 3;
kWake = 4;
kVacation = 5;
kUserDefined = 6;
kGoingToSleep = 6;
kUserDefined = 254;
}

enum SetpointChangeSourceEnum : enum8 {
Expand Down Expand Up @@ -3694,11 +3695,6 @@ cluster Thermostat = 513 {
kSupportsOff = 0x8;
}

bitmap TemperatureSetpointHoldPolicyBitmap : bitmap8 {
kHoldDurationElapsed = 0x1;
kHoldDurationElapsedOrPresetChanged = 0x2;
}

struct ScheduleTransitionStruct {
ScheduleDayOfWeekBitmap dayOfWeek = 0;
int16u transitionTime = 1;
Expand Down Expand Up @@ -3804,8 +3800,7 @@ cluster Thermostat = 513 {
attribute access(write: manage) optional PresetStruct presets[] = 80;
attribute access(write: manage) optional ScheduleStruct schedules[] = 81;
readonly attribute optional boolean presetsSchedulesEditable = 82;
readonly attribute optional TemperatureSetpointHoldPolicyBitmap temperatureSetpointHoldPolicy = 83;
readonly attribute optional nullable epoch_s setpointHoldExpiryTimestamp = 84;
readonly attribute optional nullable epoch_s setpointHoldExpiryTimestamp = 83;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
readonly attribute event_id eventList[] = 65530;
Expand Down Expand Up @@ -3849,10 +3844,6 @@ cluster Thermostat = 513 {
int16u timeoutSeconds = 0;
}

request struct SetTemperatureSetpointHoldPolicyRequest {
TemperatureSetpointHoldPolicyBitmap temperatureSetpointHoldPolicy = 0;
}

/** Command description for SetpointRaiseLower */
command SetpointRaiseLower(SetpointRaiseLowerRequest): DefaultSuccess = 0;
/** Command description for SetWeeklySchedule */
Expand All @@ -3871,8 +3862,6 @@ cluster Thermostat = 513 {
command access(invoke: manage) CancelPresetsSchedulesEditRequest(): DefaultSuccess = 8;
/** This command is used to notify the server that all edits are done and should be committed. */
command access(invoke: manage) CommitPresetsSchedulesRequest(): DefaultSuccess = 9;
/** This command sets the set point hold policy. */
command SetTemperatureSetpointHoldPolicy(SetTemperatureSetpointHoldPolicyRequest): DefaultSuccess = 11;
}

/** An interface for controlling a fan in a heating/cooling system. */
Expand Down
Loading

0 comments on commit aebc768

Please sign in to comment.