Skip to content

Commit

Permalink
Doing the great thermostat renaming. (#30758)
Browse files Browse the repository at this point in the history
* Doing the great thermostat renaming.

* Fixed a bad merge

* and missed this rename

* Restyled by whitespace

* Restyled by clang-format

* Adjust Darwin availability for the renames.

* Update src/app/clusters/thermostat-server/thermostat-server.cpp

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

* Update src/app/clusters/thermostat-server/thermostat-server.cpp

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

* Bunch of changes related to review

* restored the min/max's for the writable attributes

* Reverted the min/max's to int16s again.  Using temperature was causing
the test suite to fail when writing to them.  Temperature is the only
type defined in chip-types.xml as signed (even signed int's aren't) and
it looks like the min/max checking in attribute-table.cpp didn't like
that.

* Removed log line again (guess I didn't add/commit again before pushing)

* Update src/app/clusters/thermostat-server/thermostat-server.cpp

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

* fixed some white space issues and restored defaults

---------

Co-authored-by: Restyled.io <[email protected]>
Co-authored-by: Boris Zbarsky <[email protected]>
  • Loading branch information
3 people authored Dec 8, 2023
1 parent 0ea15eb commit 0d9332e
Show file tree
Hide file tree
Showing 65 changed files with 3,846 additions and 1,437 deletions.
201 changes: 147 additions & 54 deletions examples/all-clusters-app/all-clusters-common/all-clusters-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -3961,13 +3961,41 @@ cluster PumpConfigurationAndControl = 512 {
cluster Thermostat = 513 {
revision 6;

enum SetpointAdjustMode : enum8 {
kHeat = 0;
kCool = 1;
kBoth = 2;
enum ACCapacityFormatEnum : enum8 {
kBTUh = 0;
}

enum ACCompressorTypeEnum : enum8 {
kUnknown = 0;
kT1 = 1;
kT2 = 2;
kT3 = 3;
}

enum ACLouverPositionEnum : enum8 {
kClosed = 1;
kOpen = 2;
kQuarter = 3;
kHalf = 4;
kThreeQuarters = 5;
}

enum ThermostatControlSequence : enum8 {
enum ACRefrigerantTypeEnum : enum8 {
kUnknown = 0;
kR22 = 1;
kR410a = 2;
kR407c = 3;
}

enum ACTypeEnum : enum8 {
kUnknown = 0;
kCoolingFixed = 1;
kHeatPumpFixed = 2;
kCoolingInverter = 3;
kHeatPumpInverter = 4;
}

enum ControlSequenceOfOperationEnum : enum8 {
kCoolingOnly = 0;
kCoolingWithReheat = 1;
kHeatingOnly = 2;
Expand All @@ -3976,13 +4004,29 @@ cluster Thermostat = 513 {
kCoolingAndHeatingWithReheat = 5;
}

enum ThermostatRunningMode : enum8 {
kOff = 0;
kCool = 3;
kHeat = 4;
enum SetpointChangeSourceEnum : enum8 {
kManual = 0;
kSchedule = 1;
kExternal = 2;
}

enum SetpointRaiseLowerModeEnum : enum8 {
kHeat = 0;
kCool = 1;
kBoth = 2;
}

enum ThermostatSystemMode : enum8 {
enum StartOfWeekEnum : enum8 {
kSunday = 0;
kMonday = 1;
kTuesday = 2;
kWednesday = 3;
kThursday = 4;
kFriday = 5;
kSaturday = 6;
}

enum SystemModeEnum : enum8 {
kOff = 0;
kAuto = 1;
kCool = 3;
Expand All @@ -3994,15 +4038,23 @@ cluster Thermostat = 513 {
kSleep = 9;
}

bitmap DayOfWeek : bitmap8 {
kSunday = 0x1;
kMonday = 0x2;
kTuesday = 0x4;
kWednesday = 0x8;
kThursday = 0x10;
kFriday = 0x20;
kSaturday = 0x40;
kAway = 0x80;
enum TemperatureSetpointHoldEnum : enum8 {
kSetpointHoldOff = 0;
kSetpointHoldOn = 1;
}

enum ThermostatRunningModeEnum : enum8 {
kOff = 0;
kCool = 3;
kHeat = 4;
}

bitmap ACErrorCodeBitmap : bitmap32 {
kCompressorFail = 0x1;
kRoomSensorFail = 0x2;
kOutdoorSensorFail = 0x4;
kCoilSensorFail = 0x8;
kFanFail = 0x10;
}

bitmap Feature : bitmap32 {
Expand All @@ -4015,24 +4067,64 @@ cluster Thermostat = 513 {
kLocalTemperatureNotExposed = 0x40;
}

bitmap ModeForSequence : bitmap8 {
bitmap HVACSystemTypeBitmap : bitmap8 {
kCoolingStage = 0x3;
kHeatingStage = 0xC;
kHeatingIsHeatPump = 0x10;
kHeatingUsesFuel = 0x20;
}

bitmap ProgrammingOperationModeBitmap : bitmap8 {
kScheduleActive = 0x1;
kAutoRecovery = 0x2;
kEconomy = 0x4;
}

bitmap RelayStateBitmap : bitmap16 {
kHeat = 0x1;
kCool = 0x2;
kFan = 0x4;
kHeatStage2 = 0x8;
kCoolStage2 = 0x10;
kFanStage2 = 0x20;
kFanStage3 = 0x40;
}

bitmap RemoteSensingBitmap : bitmap8 {
kLocalTemperature = 0x1;
kOutdoorTemperature = 0x2;
kOccupancy = 0x4;
}

bitmap ScheduleDayOfWeekBitmap : bitmap8 {
kSunday = 0x1;
kMonday = 0x2;
kTuesday = 0x4;
kWednesday = 0x8;
kThursday = 0x10;
kFriday = 0x20;
kSaturday = 0x40;
kAway = 0x80;
}

bitmap ScheduleModeBitmap : bitmap8 {
kHeatSetpointPresent = 0x1;
kCoolSetpointPresent = 0x2;
}

struct ThermostatScheduleTransition {
struct WeeklyScheduleTransitionStruct {
int16u transitionTime = 0;
nullable int16s heatSetpoint = 1;
nullable int16s coolSetpoint = 2;
nullable temperature heatSetpoint = 1;
nullable temperature coolSetpoint = 2;
}

readonly attribute nullable int16s localTemperature = 0;
readonly attribute optional nullable int16s outdoorTemperature = 1;
readonly attribute nullable temperature localTemperature = 0;
readonly attribute optional nullable temperature outdoorTemperature = 1;
readonly attribute optional bitmap8 occupancy = 2;
readonly attribute optional int16s absMinHeatSetpointLimit = 3;
readonly attribute optional int16s absMaxHeatSetpointLimit = 4;
readonly attribute optional int16s absMinCoolSetpointLimit = 5;
readonly attribute optional int16s absMaxCoolSetpointLimit = 6;
readonly attribute optional temperature absMinHeatSetpointLimit = 3;
readonly attribute optional temperature absMaxHeatSetpointLimit = 4;
readonly attribute optional temperature absMinCoolSetpointLimit = 5;
readonly attribute optional temperature absMaxCoolSetpointLimit = 6;
readonly attribute optional int8u PICoolingDemand = 7;
readonly attribute optional int8u PIHeatingDemand = 8;
attribute access(write: manage) optional bitmap8 HVACSystemTypeConfiguration = 9;
Expand All @@ -4046,18 +4138,18 @@ cluster Thermostat = 513 {
attribute access(write: manage) optional int16s minCoolSetpointLimit = 23;
attribute access(write: manage) optional int16s maxCoolSetpointLimit = 24;
attribute access(write: manage) optional int8s minSetpointDeadBand = 25;
attribute access(write: manage) optional bitmap8 remoteSensing = 26;
attribute access(write: manage) ThermostatControlSequence controlSequenceOfOperation = 27;
attribute access(write: manage) enum8 systemMode = 28;
readonly attribute optional enum8 thermostatRunningMode = 30;
readonly attribute optional enum8 startOfWeek = 32;
attribute access(write: manage) optional RemoteSensingBitmap remoteSensing = 26;
attribute access(write: manage) ControlSequenceOfOperationEnum controlSequenceOfOperation = 27;
attribute access(write: manage) SystemModeEnum systemMode = 28;
readonly attribute optional ThermostatRunningModeEnum thermostatRunningMode = 30;
readonly attribute optional StartOfWeekEnum startOfWeek = 32;
readonly attribute optional int8u numberOfWeeklyTransitions = 33;
readonly attribute optional int8u numberOfDailyTransitions = 34;
attribute access(write: manage) optional enum8 temperatureSetpointHold = 35;
attribute access(write: manage) optional TemperatureSetpointHoldEnum temperatureSetpointHold = 35;
attribute access(write: manage) optional nullable int16u temperatureSetpointHoldDuration = 36;
attribute access(write: manage) optional bitmap8 thermostatProgrammingOperationMode = 37;
readonly attribute optional bitmap16 thermostatRunningState = 41;
readonly attribute optional enum8 setpointChangeSource = 48;
attribute access(write: manage) optional ProgrammingOperationModeBitmap thermostatProgrammingOperationMode = 37;
readonly attribute optional RelayStateBitmap thermostatRunningState = 41;
readonly attribute optional SetpointChangeSourceEnum setpointChangeSource = 48;
readonly attribute optional nullable int16s setpointChangeAmount = 49;
readonly attribute optional epoch_s setpointChangeSourceTimestamp = 50;
attribute access(write: manage) optional nullable int8u occupiedSetback = 52;
Expand All @@ -4067,14 +4159,14 @@ cluster Thermostat = 513 {
readonly attribute optional nullable int8u unoccupiedSetbackMin = 56;
readonly attribute optional nullable int8u unoccupiedSetbackMax = 57;
attribute access(write: manage) optional int8u emergencyHeatDelta = 58;
attribute access(write: manage) optional enum8 ACType = 64;
attribute access(write: manage) optional ACTypeEnum ACType = 64;
attribute access(write: manage) optional int16u ACCapacity = 65;
attribute access(write: manage) optional enum8 ACRefrigerantType = 66;
attribute access(write: manage) optional enum8 ACCompressorType = 67;
attribute access(write: manage) optional bitmap32 ACErrorCode = 68;
attribute access(write: manage) optional enum8 ACLouverPosition = 69;
readonly attribute optional nullable int16s ACCoilTemperature = 70;
attribute access(write: manage) optional enum8 ACCapacityformat = 71;
attribute access(write: manage) optional ACRefrigerantTypeEnum ACRefrigerantType = 66;
attribute access(write: manage) optional ACCompressorTypeEnum ACCompressorType = 67;
attribute access(write: manage) optional ACErrorCodeBitmap ACErrorCode = 68;
attribute access(write: manage) optional ACLouverPositionEnum ACLouverPosition = 69;
readonly attribute optional nullable temperature ACCoilTemperature = 70;
attribute access(write: manage) optional ACCapacityFormatEnum ACCapacityformat = 71;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
readonly attribute event_id eventList[] = 65530;
Expand All @@ -4083,27 +4175,27 @@ cluster Thermostat = 513 {
readonly attribute int16u clusterRevision = 65533;

request struct SetpointRaiseLowerRequest {
SetpointAdjustMode mode = 0;
SetpointRaiseLowerModeEnum mode = 0;
int8s amount = 1;
}

response struct GetWeeklyScheduleResponse = 0 {
int8u numberOfTransitionsForSequence = 0;
DayOfWeek dayOfWeekForSequence = 1;
ModeForSequence modeForSequence = 2;
ThermostatScheduleTransition transitions[] = 3;
ScheduleDayOfWeekBitmap dayOfWeekForSequence = 1;
ScheduleModeBitmap modeForSequence = 2;
WeeklyScheduleTransitionStruct transitions[] = 3;
}

request struct SetWeeklyScheduleRequest {
int8u numberOfTransitionsForSequence = 0;
DayOfWeek dayOfWeekForSequence = 1;
ModeForSequence modeForSequence = 2;
ThermostatScheduleTransition transitions[] = 3;
ScheduleDayOfWeekBitmap dayOfWeekForSequence = 1;
ScheduleModeBitmap modeForSequence = 2;
WeeklyScheduleTransitionStruct transitions[] = 3;
}

request struct GetWeeklyScheduleRequest {
DayOfWeek daysToReturn = 0;
ModeForSequence modeToReturn = 1;
ScheduleDayOfWeekBitmap daysToReturn = 0;
ScheduleModeBitmap modeToReturn = 1;
}

/** Command description for SetpointRaiseLower */
Expand Down Expand Up @@ -7049,6 +7141,7 @@ endpoint 1 {
ram attribute systemMode default = 0x01;
callback attribute generatedCommandList;
callback attribute acceptedCommandList;
callback attribute eventList;
callback attribute attributeList;
ram attribute featureMap default = 0x0023;
ram attribute clusterRevision default = 6;
Expand Down
Loading

0 comments on commit 0d9332e

Please sign in to comment.