diff --git a/examples/air-purifier-app/air-purifier-common/air-purifier-app.matter b/examples/air-purifier-app/air-purifier-common/air-purifier-app.matter index 864e3115bc06a9..f46f28ccab7174 100644 --- a/examples/air-purifier-app/air-purifier-common/air-purifier-app.matter +++ b/examples/air-purifier-app/air-purifier-common/air-purifier-app.matter @@ -1242,7 +1242,7 @@ cluster ActivatedCarbonFilterMonitoring = 114 { /** An interface for configuring and controlling the functionality of a thermostat. */ cluster Thermostat = 513 { - revision 6; + revision 7; enum ACCapacityFormatEnum : enum8 { kBTUh = 0; @@ -1278,6 +1278,12 @@ cluster Thermostat = 513 { kHeatPumpInverter = 4; } + enum AtomicRequestTypeEnum : enum8 { + kBeginWrite = 0; + kCommitWrite = 1; + kRollbackWrite = 2; + } + enum ControlSequenceOfOperationEnum : enum8 { kCoolingOnly = 0; kCoolingWithReheat = 1; @@ -1288,13 +1294,13 @@ cluster Thermostat = 513 { } enum PresetScenarioEnum : enum8 { - kUnspecified = 0; kOccupied = 1; kUnoccupied = 2; kSleep = 3; kWake = 4; kVacation = 5; - kUserDefined = 6; + kGoingToSleep = 6; + kUserDefined = 254; } enum SetpointChangeSourceEnum : enum8 { @@ -1360,7 +1366,6 @@ cluster Thermostat = 513 { kLocalTemperatureNotExposed = 0x40; kMatterScheduleConfiguration = 0x80; kPresets = 0x100; - kSetpoints = 0x200; } bitmap HVACSystemTypeBitmap : bitmap8 { @@ -1370,6 +1375,10 @@ cluster Thermostat = 513 { kHeatingUsesFuel = 0x20; } + bitmap OccupancyBitmap : bitmap8 { + kOccupied = 0x1; + } + bitmap PresetTypeFeaturesBitmap : bitmap16 { kAutomatic = 0x1; kSupportsNames = 0x2; @@ -1420,11 +1429,6 @@ cluster Thermostat = 513 { kSupportsOff = 0x8; } - bitmap TemperatureSetpointHoldPolicyBitmap : bitmap8 { - kHoldDurationElapsed = 0x1; - kHoldDurationElapsedOrPresetChanged = 0x2; - } - struct ScheduleTransitionStruct { ScheduleDayOfWeekBitmap dayOfWeek = 0; int16u transitionTime = 1; @@ -1440,7 +1444,12 @@ cluster Thermostat = 513 { optional char_string<64> name = 2; optional octet_string<16> presetHandle = 3; ScheduleTransitionStruct transitions[] = 4; - optional nullable boolean builtIn = 5; + nullable boolean builtIn = 5; + } + + struct AtomicAttributeStatusStruct { + optional attrib_id attributeID = 0; + optional status statusCode = 1; } struct PresetStruct { @@ -1472,23 +1481,23 @@ cluster Thermostat = 513 { readonly attribute nullable temperature localTemperature = 0; readonly attribute optional nullable temperature outdoorTemperature = 1; - readonly attribute optional bitmap8 occupancy = 2; + readonly attribute optional OccupancyBitmap occupancy = 2; 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; + attribute access(write: manage) optional HVACSystemTypeBitmap HVACSystemTypeConfiguration = 9; attribute access(write: manage) optional int8s localTemperatureCalibration = 16; - attribute optional int16s occupiedCoolingSetpoint = 17; - attribute optional int16s occupiedHeatingSetpoint = 18; - attribute optional int16s unoccupiedCoolingSetpoint = 19; - attribute optional int16s unoccupiedHeatingSetpoint = 20; - attribute access(write: manage) optional int16s minHeatSetpointLimit = 21; - attribute access(write: manage) optional int16s maxHeatSetpointLimit = 22; - attribute access(write: manage) optional int16s minCoolSetpointLimit = 23; - attribute access(write: manage) optional int16s maxCoolSetpointLimit = 24; + attribute optional temperature occupiedCoolingSetpoint = 17; + attribute optional temperature occupiedHeatingSetpoint = 18; + attribute optional temperature unoccupiedCoolingSetpoint = 19; + attribute optional temperature unoccupiedHeatingSetpoint = 20; + attribute access(write: manage) optional temperature minHeatSetpointLimit = 21; + attribute access(write: manage) optional temperature maxHeatSetpointLimit = 22; + attribute access(write: manage) optional temperature minCoolSetpointLimit = 23; + attribute access(write: manage) optional temperature maxCoolSetpointLimit = 24; attribute access(write: manage) optional int8s minSetpointDeadBand = 25; attribute access(write: manage) optional RemoteSensingBitmap remoteSensing = 26; attribute access(write: manage) ControlSequenceOfOperationEnum controlSequenceOfOperation = 27; @@ -1518,7 +1527,7 @@ cluster Thermostat = 513 { 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; + attribute access(write: manage) optional ACCapacityFormatEnum ACCapacityFormat = 71; readonly attribute optional PresetTypeStruct presetTypes[] = 72; readonly attribute optional ScheduleTypeStruct scheduleTypes[] = 73; readonly attribute optional int8u numberOfPresets = 74; @@ -1529,9 +1538,7 @@ cluster Thermostat = 513 { readonly attribute optional nullable octet_string<16> activeScheduleHandle = 79; 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 = 82; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1571,34 +1578,32 @@ cluster Thermostat = 513 { octet_string<16> presetHandle = 0; } - request struct StartPresetsSchedulesEditRequestRequest { - int16u timeoutSeconds = 0; + response struct AtomicResponse = 253 { + status statusCode = 0; + AtomicAttributeStatusStruct attributeStatus[] = 1; + optional int16u timeout = 2; } - request struct SetTemperatureSetpointHoldPolicyRequest { - TemperatureSetpointHoldPolicyBitmap temperatureSetpointHoldPolicy = 0; + request struct AtomicRequestRequest { + AtomicRequestTypeEnum requestType = 0; + attrib_id attributeRequests[] = 1; + optional int16u timeout = 2; } - /** Command description for SetpointRaiseLower */ + /** Upon receipt, the attributes for the indicated setpoint(s) SHALL have the amount specified in the Amount field added to them. */ command SetpointRaiseLower(SetpointRaiseLowerRequest): DefaultSuccess = 0; - /** Command description for SetWeeklySchedule */ + /** Upon receipt, the weekly schedule for updating setpoints SHALL be stored in the */ command access(invoke: manage) SetWeeklySchedule(SetWeeklyScheduleRequest): DefaultSuccess = 1; - /** Command description for GetWeeklySchedule */ + /** Upon receipt, the unit SHOULD send in return the Get */ command GetWeeklySchedule(GetWeeklyScheduleRequest): GetWeeklyScheduleResponse = 2; - /** This command is used to clear the weekly schedule. The ClearWeeklySchedule command has no payload. */ + /** This command is used to clear the weekly schedule. */ command access(invoke: manage) ClearWeeklySchedule(): DefaultSuccess = 3; - /** This command is used to set the active schedule. */ + /** Upon receipt, if the */ command SetActiveScheduleRequest(SetActiveScheduleRequestRequest): DefaultSuccess = 5; - /** This command is used to set the active preset. */ + /** ID */ command SetActivePresetRequest(SetActivePresetRequestRequest): DefaultSuccess = 6; - /** This command is used to start editing the presets and schedules. */ - command access(invoke: manage) StartPresetsSchedulesEditRequest(StartPresetsSchedulesEditRequestRequest): DefaultSuccess = 7; - /** This command is used to cancel editing presets and schedules. */ - 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; + /** Begins, Commits or Cancels an atomic write */ + command access(invoke: manage) AtomicRequest(AtomicRequestRequest): AtomicResponse = 254; } /** An interface for controlling a fan in a heating/cooling system. */ diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index c4a159841dc100..582058abbd18a6 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -5021,7 +5021,7 @@ cluster PumpConfigurationAndControl = 512 { /** An interface for configuring and controlling the functionality of a thermostat. */ cluster Thermostat = 513 { - revision 6; + revision 7; enum ACCapacityFormatEnum : enum8 { kBTUh = 0; @@ -5057,6 +5057,12 @@ cluster Thermostat = 513 { kHeatPumpInverter = 4; } + enum AtomicRequestTypeEnum : enum8 { + kBeginWrite = 0; + kCommitWrite = 1; + kRollbackWrite = 2; + } + enum ControlSequenceOfOperationEnum : enum8 { kCoolingOnly = 0; kCoolingWithReheat = 1; @@ -5067,13 +5073,13 @@ cluster Thermostat = 513 { } enum PresetScenarioEnum : enum8 { - kUnspecified = 0; kOccupied = 1; kUnoccupied = 2; kSleep = 3; kWake = 4; kVacation = 5; - kUserDefined = 6; + kGoingToSleep = 6; + kUserDefined = 254; } enum SetpointChangeSourceEnum : enum8 { @@ -5139,7 +5145,6 @@ cluster Thermostat = 513 { kLocalTemperatureNotExposed = 0x40; kMatterScheduleConfiguration = 0x80; kPresets = 0x100; - kSetpoints = 0x200; } bitmap HVACSystemTypeBitmap : bitmap8 { @@ -5149,6 +5154,10 @@ cluster Thermostat = 513 { kHeatingUsesFuel = 0x20; } + bitmap OccupancyBitmap : bitmap8 { + kOccupied = 0x1; + } + bitmap PresetTypeFeaturesBitmap : bitmap16 { kAutomatic = 0x1; kSupportsNames = 0x2; @@ -5199,11 +5208,6 @@ cluster Thermostat = 513 { kSupportsOff = 0x8; } - bitmap TemperatureSetpointHoldPolicyBitmap : bitmap8 { - kHoldDurationElapsed = 0x1; - kHoldDurationElapsedOrPresetChanged = 0x2; - } - struct ScheduleTransitionStruct { ScheduleDayOfWeekBitmap dayOfWeek = 0; int16u transitionTime = 1; @@ -5219,7 +5223,12 @@ cluster Thermostat = 513 { optional char_string<64> name = 2; optional octet_string<16> presetHandle = 3; ScheduleTransitionStruct transitions[] = 4; - optional nullable boolean builtIn = 5; + nullable boolean builtIn = 5; + } + + struct AtomicAttributeStatusStruct { + optional attrib_id attributeID = 0; + optional status statusCode = 1; } struct PresetStruct { @@ -5251,23 +5260,23 @@ cluster Thermostat = 513 { readonly attribute nullable temperature localTemperature = 0; readonly attribute optional nullable temperature outdoorTemperature = 1; - readonly attribute optional bitmap8 occupancy = 2; + readonly attribute optional OccupancyBitmap occupancy = 2; 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; + attribute access(write: manage) optional HVACSystemTypeBitmap HVACSystemTypeConfiguration = 9; attribute access(write: manage) optional int8s localTemperatureCalibration = 16; - attribute optional int16s occupiedCoolingSetpoint = 17; - attribute optional int16s occupiedHeatingSetpoint = 18; - attribute optional int16s unoccupiedCoolingSetpoint = 19; - attribute optional int16s unoccupiedHeatingSetpoint = 20; - attribute access(write: manage) optional int16s minHeatSetpointLimit = 21; - attribute access(write: manage) optional int16s maxHeatSetpointLimit = 22; - attribute access(write: manage) optional int16s minCoolSetpointLimit = 23; - attribute access(write: manage) optional int16s maxCoolSetpointLimit = 24; + attribute optional temperature occupiedCoolingSetpoint = 17; + attribute optional temperature occupiedHeatingSetpoint = 18; + attribute optional temperature unoccupiedCoolingSetpoint = 19; + attribute optional temperature unoccupiedHeatingSetpoint = 20; + attribute access(write: manage) optional temperature minHeatSetpointLimit = 21; + attribute access(write: manage) optional temperature maxHeatSetpointLimit = 22; + attribute access(write: manage) optional temperature minCoolSetpointLimit = 23; + attribute access(write: manage) optional temperature maxCoolSetpointLimit = 24; attribute access(write: manage) optional int8s minSetpointDeadBand = 25; attribute access(write: manage) optional RemoteSensingBitmap remoteSensing = 26; attribute access(write: manage) ControlSequenceOfOperationEnum controlSequenceOfOperation = 27; @@ -5297,7 +5306,7 @@ cluster Thermostat = 513 { 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; + attribute access(write: manage) optional ACCapacityFormatEnum ACCapacityFormat = 71; readonly attribute optional PresetTypeStruct presetTypes[] = 72; readonly attribute optional ScheduleTypeStruct scheduleTypes[] = 73; readonly attribute optional int8u numberOfPresets = 74; @@ -5308,9 +5317,7 @@ cluster Thermostat = 513 { readonly attribute optional nullable octet_string<16> activeScheduleHandle = 79; 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 = 82; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -5350,34 +5357,32 @@ cluster Thermostat = 513 { octet_string<16> presetHandle = 0; } - request struct StartPresetsSchedulesEditRequestRequest { - int16u timeoutSeconds = 0; + response struct AtomicResponse = 253 { + status statusCode = 0; + AtomicAttributeStatusStruct attributeStatus[] = 1; + optional int16u timeout = 2; } - request struct SetTemperatureSetpointHoldPolicyRequest { - TemperatureSetpointHoldPolicyBitmap temperatureSetpointHoldPolicy = 0; + request struct AtomicRequestRequest { + AtomicRequestTypeEnum requestType = 0; + attrib_id attributeRequests[] = 1; + optional int16u timeout = 2; } - /** Command description for SetpointRaiseLower */ + /** Upon receipt, the attributes for the indicated setpoint(s) SHALL have the amount specified in the Amount field added to them. */ command SetpointRaiseLower(SetpointRaiseLowerRequest): DefaultSuccess = 0; - /** Command description for SetWeeklySchedule */ + /** Upon receipt, the weekly schedule for updating setpoints SHALL be stored in the */ command access(invoke: manage) SetWeeklySchedule(SetWeeklyScheduleRequest): DefaultSuccess = 1; - /** Command description for GetWeeklySchedule */ + /** Upon receipt, the unit SHOULD send in return the Get */ command GetWeeklySchedule(GetWeeklyScheduleRequest): GetWeeklyScheduleResponse = 2; - /** This command is used to clear the weekly schedule. The ClearWeeklySchedule command has no payload. */ + /** This command is used to clear the weekly schedule. */ command access(invoke: manage) ClearWeeklySchedule(): DefaultSuccess = 3; - /** This command is used to set the active schedule. */ + /** Upon receipt, if the */ command SetActiveScheduleRequest(SetActiveScheduleRequestRequest): DefaultSuccess = 5; - /** This command is used to set the active preset. */ + /** ID */ command SetActivePresetRequest(SetActivePresetRequestRequest): DefaultSuccess = 6; - /** This command is used to start editing the presets and schedules. */ - command access(invoke: manage) StartPresetsSchedulesEditRequest(StartPresetsSchedulesEditRequestRequest): DefaultSuccess = 7; - /** This command is used to cancel editing presets and schedules. */ - 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; + /** Begins, Commits or Cancels an atomic write */ + command access(invoke: manage) AtomicRequest(AtomicRequestRequest): AtomicResponse = 254; } /** An interface for controlling a fan in a heating/cooling system. */ @@ -8674,24 +8679,27 @@ endpoint 1 { 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 numberOfPresets default = 0; + callback attribute numberOfSchedules default = 0; + callback attribute numberOfScheduleTransitions default = 0; + callback attribute numberOfScheduleTransitionPerDay default = 0xFF; + callback attribute activePresetHandle; + callback 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; callback attribute attributeList; - ram attribute featureMap default = 0x0023; + ram attribute featureMap default = 0x01A3; ram attribute clusterRevision default = 6; handle command SetpointRaiseLower; + handle command SetActiveScheduleRequest; + handle command SetActivePresetRequest; + handle command AtomicResponse; + handle command AtomicRequest; } server cluster FanControl { diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap index 2ed20d53a62605..eea8e5003aaaab 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap @@ -16172,6 +16172,38 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "SetActiveScheduleRequest", + "code": 5, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "SetActivePresetRequest", + "code": 6, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "AtomicResponse", + "code": 253, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "AtomicRequest", + "code": 254, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 } ], "attributes": [ @@ -16276,7 +16308,7 @@ "code": 17, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -16292,7 +16324,7 @@ "code": 18, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -16308,7 +16340,7 @@ "code": 21, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -16324,7 +16356,7 @@ "code": 22, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -16340,7 +16372,7 @@ "code": 23, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -16356,7 +16388,7 @@ "code": 24, "mfgCode": null, "side": "server", - "type": "int16s", + "type": "temperature", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -16454,7 +16486,7 @@ "side": "server", "type": "int8u", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -16470,7 +16502,23 @@ "side": "server", "type": "int8u", "included": 1, - "storageOption": "RAM", + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "NumberOfScheduleTransitions", + "code": 76, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -16486,7 +16534,7 @@ "side": "server", "type": "int8u", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0xFF", @@ -16502,7 +16550,7 @@ "side": "server", "type": "octet_string", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -16518,7 +16566,7 @@ "side": "server", "type": "octet_string", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -16559,41 +16607,9 @@ "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, + "code": 82, "mfgCode": null, "side": "server", "type": "epoch_s", @@ -16607,22 +16623,6 @@ "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, @@ -16697,7 +16697,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0023", + "defaultValue": "0x01A3", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/all-clusters-app/linux/BUILD.gn b/examples/all-clusters-app/linux/BUILD.gn index 3564153a482cca..bb8ff002b76c57 100644 --- a/examples/all-clusters-app/linux/BUILD.gn +++ b/examples/all-clusters-app/linux/BUILD.gn @@ -66,6 +66,7 @@ source_set("chip-all-clusters-common") { "${chip_root}/examples/energy-management-app/energy-management-common/src/ElectricalPowerMeasurementDelegate.cpp", "${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp", "${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyEvseManager.cpp", + "${chip_root}/examples/thermostat/thermostat-common/src/thermostat-schedules-manager.cpp", "${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyEvseTargetsStore.cpp", "${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyTimeUtils.cpp", "${chip_root}/examples/energy-management-app/energy-management-common/src/device-energy-management-mode.cpp", diff --git a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter index 946733b5ebe9da..98814ab4f0b38e 100644 --- a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter +++ b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter @@ -3516,7 +3516,7 @@ cluster PumpConfigurationAndControl = 512 { /** An interface for configuring and controlling the functionality of a thermostat. */ cluster Thermostat = 513 { - revision 6; + revision 7; enum ACCapacityFormatEnum : enum8 { kBTUh = 0; @@ -3552,6 +3552,12 @@ cluster Thermostat = 513 { kHeatPumpInverter = 4; } + enum AtomicRequestTypeEnum : enum8 { + kBeginWrite = 0; + kCommitWrite = 1; + kRollbackWrite = 2; + } + enum ControlSequenceOfOperationEnum : enum8 { kCoolingOnly = 0; kCoolingWithReheat = 1; @@ -3562,13 +3568,13 @@ cluster Thermostat = 513 { } enum PresetScenarioEnum : enum8 { - kUnspecified = 0; kOccupied = 1; kUnoccupied = 2; kSleep = 3; kWake = 4; kVacation = 5; - kUserDefined = 6; + kGoingToSleep = 6; + kUserDefined = 254; } enum SetpointChangeSourceEnum : enum8 { @@ -3634,7 +3640,6 @@ cluster Thermostat = 513 { kLocalTemperatureNotExposed = 0x40; kMatterScheduleConfiguration = 0x80; kPresets = 0x100; - kSetpoints = 0x200; } bitmap HVACSystemTypeBitmap : bitmap8 { @@ -3644,6 +3649,10 @@ cluster Thermostat = 513 { kHeatingUsesFuel = 0x20; } + bitmap OccupancyBitmap : bitmap8 { + kOccupied = 0x1; + } + bitmap PresetTypeFeaturesBitmap : bitmap16 { kAutomatic = 0x1; kSupportsNames = 0x2; @@ -3694,11 +3703,6 @@ cluster Thermostat = 513 { kSupportsOff = 0x8; } - bitmap TemperatureSetpointHoldPolicyBitmap : bitmap8 { - kHoldDurationElapsed = 0x1; - kHoldDurationElapsedOrPresetChanged = 0x2; - } - struct ScheduleTransitionStruct { ScheduleDayOfWeekBitmap dayOfWeek = 0; int16u transitionTime = 1; @@ -3714,7 +3718,12 @@ cluster Thermostat = 513 { optional char_string<64> name = 2; optional octet_string<16> presetHandle = 3; ScheduleTransitionStruct transitions[] = 4; - optional nullable boolean builtIn = 5; + nullable boolean builtIn = 5; + } + + struct AtomicAttributeStatusStruct { + optional attrib_id attributeID = 0; + optional status statusCode = 1; } struct PresetStruct { @@ -3746,23 +3755,23 @@ cluster Thermostat = 513 { readonly attribute nullable temperature localTemperature = 0; readonly attribute optional nullable temperature outdoorTemperature = 1; - readonly attribute optional bitmap8 occupancy = 2; + readonly attribute optional OccupancyBitmap occupancy = 2; 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; + attribute access(write: manage) optional HVACSystemTypeBitmap HVACSystemTypeConfiguration = 9; attribute access(write: manage) optional int8s localTemperatureCalibration = 16; - attribute optional int16s occupiedCoolingSetpoint = 17; - attribute optional int16s occupiedHeatingSetpoint = 18; - attribute optional int16s unoccupiedCoolingSetpoint = 19; - attribute optional int16s unoccupiedHeatingSetpoint = 20; - attribute access(write: manage) optional int16s minHeatSetpointLimit = 21; - attribute access(write: manage) optional int16s maxHeatSetpointLimit = 22; - attribute access(write: manage) optional int16s minCoolSetpointLimit = 23; - attribute access(write: manage) optional int16s maxCoolSetpointLimit = 24; + attribute optional temperature occupiedCoolingSetpoint = 17; + attribute optional temperature occupiedHeatingSetpoint = 18; + attribute optional temperature unoccupiedCoolingSetpoint = 19; + attribute optional temperature unoccupiedHeatingSetpoint = 20; + attribute access(write: manage) optional temperature minHeatSetpointLimit = 21; + attribute access(write: manage) optional temperature maxHeatSetpointLimit = 22; + attribute access(write: manage) optional temperature minCoolSetpointLimit = 23; + attribute access(write: manage) optional temperature maxCoolSetpointLimit = 24; attribute access(write: manage) optional int8s minSetpointDeadBand = 25; attribute access(write: manage) optional RemoteSensingBitmap remoteSensing = 26; attribute access(write: manage) ControlSequenceOfOperationEnum controlSequenceOfOperation = 27; @@ -3792,7 +3801,7 @@ cluster Thermostat = 513 { 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; + attribute access(write: manage) optional ACCapacityFormatEnum ACCapacityFormat = 71; readonly attribute optional PresetTypeStruct presetTypes[] = 72; readonly attribute optional ScheduleTypeStruct scheduleTypes[] = 73; readonly attribute optional int8u numberOfPresets = 74; @@ -3803,9 +3812,7 @@ cluster Thermostat = 513 { readonly attribute optional nullable octet_string<16> activeScheduleHandle = 79; 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 = 82; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -3845,34 +3852,32 @@ cluster Thermostat = 513 { octet_string<16> presetHandle = 0; } - request struct StartPresetsSchedulesEditRequestRequest { - int16u timeoutSeconds = 0; + response struct AtomicResponse = 253 { + status statusCode = 0; + AtomicAttributeStatusStruct attributeStatus[] = 1; + optional int16u timeout = 2; } - request struct SetTemperatureSetpointHoldPolicyRequest { - TemperatureSetpointHoldPolicyBitmap temperatureSetpointHoldPolicy = 0; + request struct AtomicRequestRequest { + AtomicRequestTypeEnum requestType = 0; + attrib_id attributeRequests[] = 1; + optional int16u timeout = 2; } - /** Command description for SetpointRaiseLower */ + /** Upon receipt, the attributes for the indicated setpoint(s) SHALL have the amount specified in the Amount field added to them. */ command SetpointRaiseLower(SetpointRaiseLowerRequest): DefaultSuccess = 0; - /** Command description for SetWeeklySchedule */ + /** Upon receipt, the weekly schedule for updating setpoints SHALL be stored in the */ command access(invoke: manage) SetWeeklySchedule(SetWeeklyScheduleRequest): DefaultSuccess = 1; - /** Command description for GetWeeklySchedule */ + /** Upon receipt, the unit SHOULD send in return the Get */ command GetWeeklySchedule(GetWeeklyScheduleRequest): GetWeeklyScheduleResponse = 2; - /** This command is used to clear the weekly schedule. The ClearWeeklySchedule command has no payload. */ + /** This command is used to clear the weekly schedule. */ command access(invoke: manage) ClearWeeklySchedule(): DefaultSuccess = 3; - /** This command is used to set the active schedule. */ + /** Upon receipt, if the */ command SetActiveScheduleRequest(SetActiveScheduleRequestRequest): DefaultSuccess = 5; - /** This command is used to set the active preset. */ + /** ID */ command SetActivePresetRequest(SetActivePresetRequestRequest): DefaultSuccess = 6; - /** This command is used to start editing the presets and schedules. */ - command access(invoke: manage) StartPresetsSchedulesEditRequest(StartPresetsSchedulesEditRequestRequest): DefaultSuccess = 7; - /** This command is used to cancel editing presets and schedules. */ - 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; + /** Begins, Commits or Cancels an atomic write */ + command access(invoke: manage) AtomicRequest(AtomicRequestRequest): AtomicResponse = 254; } /** An interface for controlling a fan in a heating/cooling system. */ diff --git a/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter b/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter index 1976a0d6af169b..3e91781b1bc142 100644 --- a/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter +++ b/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter @@ -1165,7 +1165,7 @@ cluster ActivatedCarbonFilterMonitoring = 114 { /** An interface for configuring and controlling the functionality of a thermostat. */ cluster Thermostat = 513 { - revision 6; + revision 7; enum ACCapacityFormatEnum : enum8 { kBTUh = 0; @@ -1201,6 +1201,12 @@ cluster Thermostat = 513 { kHeatPumpInverter = 4; } + enum AtomicRequestTypeEnum : enum8 { + kBeginWrite = 0; + kCommitWrite = 1; + kRollbackWrite = 2; + } + enum ControlSequenceOfOperationEnum : enum8 { kCoolingOnly = 0; kCoolingWithReheat = 1; @@ -1211,13 +1217,13 @@ cluster Thermostat = 513 { } enum PresetScenarioEnum : enum8 { - kUnspecified = 0; kOccupied = 1; kUnoccupied = 2; kSleep = 3; kWake = 4; kVacation = 5; - kUserDefined = 6; + kGoingToSleep = 6; + kUserDefined = 254; } enum SetpointChangeSourceEnum : enum8 { @@ -1283,7 +1289,6 @@ cluster Thermostat = 513 { kLocalTemperatureNotExposed = 0x40; kMatterScheduleConfiguration = 0x80; kPresets = 0x100; - kSetpoints = 0x200; } bitmap HVACSystemTypeBitmap : bitmap8 { @@ -1293,6 +1298,10 @@ cluster Thermostat = 513 { kHeatingUsesFuel = 0x20; } + bitmap OccupancyBitmap : bitmap8 { + kOccupied = 0x1; + } + bitmap PresetTypeFeaturesBitmap : bitmap16 { kAutomatic = 0x1; kSupportsNames = 0x2; @@ -1343,11 +1352,6 @@ cluster Thermostat = 513 { kSupportsOff = 0x8; } - bitmap TemperatureSetpointHoldPolicyBitmap : bitmap8 { - kHoldDurationElapsed = 0x1; - kHoldDurationElapsedOrPresetChanged = 0x2; - } - struct ScheduleTransitionStruct { ScheduleDayOfWeekBitmap dayOfWeek = 0; int16u transitionTime = 1; @@ -1363,7 +1367,12 @@ cluster Thermostat = 513 { optional char_string<64> name = 2; optional octet_string<16> presetHandle = 3; ScheduleTransitionStruct transitions[] = 4; - optional nullable boolean builtIn = 5; + nullable boolean builtIn = 5; + } + + struct AtomicAttributeStatusStruct { + optional attrib_id attributeID = 0; + optional status statusCode = 1; } struct PresetStruct { @@ -1395,23 +1404,23 @@ cluster Thermostat = 513 { readonly attribute nullable temperature localTemperature = 0; readonly attribute optional nullable temperature outdoorTemperature = 1; - readonly attribute optional bitmap8 occupancy = 2; + readonly attribute optional OccupancyBitmap occupancy = 2; 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; + attribute access(write: manage) optional HVACSystemTypeBitmap HVACSystemTypeConfiguration = 9; attribute access(write: manage) optional int8s localTemperatureCalibration = 16; - attribute optional int16s occupiedCoolingSetpoint = 17; - attribute optional int16s occupiedHeatingSetpoint = 18; - attribute optional int16s unoccupiedCoolingSetpoint = 19; - attribute optional int16s unoccupiedHeatingSetpoint = 20; - attribute access(write: manage) optional int16s minHeatSetpointLimit = 21; - attribute access(write: manage) optional int16s maxHeatSetpointLimit = 22; - attribute access(write: manage) optional int16s minCoolSetpointLimit = 23; - attribute access(write: manage) optional int16s maxCoolSetpointLimit = 24; + attribute optional temperature occupiedCoolingSetpoint = 17; + attribute optional temperature occupiedHeatingSetpoint = 18; + attribute optional temperature unoccupiedCoolingSetpoint = 19; + attribute optional temperature unoccupiedHeatingSetpoint = 20; + attribute access(write: manage) optional temperature minHeatSetpointLimit = 21; + attribute access(write: manage) optional temperature maxHeatSetpointLimit = 22; + attribute access(write: manage) optional temperature minCoolSetpointLimit = 23; + attribute access(write: manage) optional temperature maxCoolSetpointLimit = 24; attribute access(write: manage) optional int8s minSetpointDeadBand = 25; attribute access(write: manage) optional RemoteSensingBitmap remoteSensing = 26; attribute access(write: manage) ControlSequenceOfOperationEnum controlSequenceOfOperation = 27; @@ -1441,7 +1450,7 @@ cluster Thermostat = 513 { 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; + attribute access(write: manage) optional ACCapacityFormatEnum ACCapacityFormat = 71; readonly attribute optional PresetTypeStruct presetTypes[] = 72; readonly attribute optional ScheduleTypeStruct scheduleTypes[] = 73; readonly attribute optional int8u numberOfPresets = 74; @@ -1452,9 +1461,7 @@ cluster Thermostat = 513 { readonly attribute optional nullable octet_string<16> activeScheduleHandle = 79; 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 = 82; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1494,34 +1501,32 @@ cluster Thermostat = 513 { octet_string<16> presetHandle = 0; } - request struct StartPresetsSchedulesEditRequestRequest { - int16u timeoutSeconds = 0; + response struct AtomicResponse = 253 { + status statusCode = 0; + AtomicAttributeStatusStruct attributeStatus[] = 1; + optional int16u timeout = 2; } - request struct SetTemperatureSetpointHoldPolicyRequest { - TemperatureSetpointHoldPolicyBitmap temperatureSetpointHoldPolicy = 0; + request struct AtomicRequestRequest { + AtomicRequestTypeEnum requestType = 0; + attrib_id attributeRequests[] = 1; + optional int16u timeout = 2; } - /** Command description for SetpointRaiseLower */ + /** Upon receipt, the attributes for the indicated setpoint(s) SHALL have the amount specified in the Amount field added to them. */ command SetpointRaiseLower(SetpointRaiseLowerRequest): DefaultSuccess = 0; - /** Command description for SetWeeklySchedule */ + /** Upon receipt, the weekly schedule for updating setpoints SHALL be stored in the */ command access(invoke: manage) SetWeeklySchedule(SetWeeklyScheduleRequest): DefaultSuccess = 1; - /** Command description for GetWeeklySchedule */ + /** Upon receipt, the unit SHOULD send in return the Get */ command GetWeeklySchedule(GetWeeklyScheduleRequest): GetWeeklyScheduleResponse = 2; - /** This command is used to clear the weekly schedule. The ClearWeeklySchedule command has no payload. */ + /** This command is used to clear the weekly schedule. */ command access(invoke: manage) ClearWeeklySchedule(): DefaultSuccess = 3; - /** This command is used to set the active schedule. */ + /** Upon receipt, if the */ command SetActiveScheduleRequest(SetActiveScheduleRequestRequest): DefaultSuccess = 5; - /** This command is used to set the active preset. */ + /** ID */ command SetActivePresetRequest(SetActivePresetRequestRequest): DefaultSuccess = 6; - /** This command is used to start editing the presets and schedules. */ - command access(invoke: manage) StartPresetsSchedulesEditRequest(StartPresetsSchedulesEditRequestRequest): DefaultSuccess = 7; - /** This command is used to cancel editing presets and schedules. */ - 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; + /** Begins, Commits or Cancels an atomic write */ + command access(invoke: manage) AtomicRequest(AtomicRequestRequest): AtomicResponse = 254; } /** An interface for controlling a fan in a heating/cooling system. */ diff --git a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter index b0011ffb37983b..f4fdbef5fab69b 100644 --- a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter +++ b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter @@ -1522,7 +1522,7 @@ cluster FixedLabel = 64 { /** An interface for configuring and controlling the functionality of a thermostat. */ cluster Thermostat = 513 { - revision 6; + revision 7; enum ACCapacityFormatEnum : enum8 { kBTUh = 0; @@ -1558,6 +1558,12 @@ cluster Thermostat = 513 { kHeatPumpInverter = 4; } + enum AtomicRequestTypeEnum : enum8 { + kBeginWrite = 0; + kCommitWrite = 1; + kRollbackWrite = 2; + } + enum ControlSequenceOfOperationEnum : enum8 { kCoolingOnly = 0; kCoolingWithReheat = 1; @@ -1568,13 +1574,13 @@ cluster Thermostat = 513 { } enum PresetScenarioEnum : enum8 { - kUnspecified = 0; kOccupied = 1; kUnoccupied = 2; kSleep = 3; kWake = 4; kVacation = 5; - kUserDefined = 6; + kGoingToSleep = 6; + kUserDefined = 254; } enum SetpointChangeSourceEnum : enum8 { @@ -1640,7 +1646,6 @@ cluster Thermostat = 513 { kLocalTemperatureNotExposed = 0x40; kMatterScheduleConfiguration = 0x80; kPresets = 0x100; - kSetpoints = 0x200; } bitmap HVACSystemTypeBitmap : bitmap8 { @@ -1650,6 +1655,10 @@ cluster Thermostat = 513 { kHeatingUsesFuel = 0x20; } + bitmap OccupancyBitmap : bitmap8 { + kOccupied = 0x1; + } + bitmap PresetTypeFeaturesBitmap : bitmap16 { kAutomatic = 0x1; kSupportsNames = 0x2; @@ -1700,11 +1709,6 @@ cluster Thermostat = 513 { kSupportsOff = 0x8; } - bitmap TemperatureSetpointHoldPolicyBitmap : bitmap8 { - kHoldDurationElapsed = 0x1; - kHoldDurationElapsedOrPresetChanged = 0x2; - } - struct ScheduleTransitionStruct { ScheduleDayOfWeekBitmap dayOfWeek = 0; int16u transitionTime = 1; @@ -1720,7 +1724,12 @@ cluster Thermostat = 513 { optional char_string<64> name = 2; optional octet_string<16> presetHandle = 3; ScheduleTransitionStruct transitions[] = 4; - optional nullable boolean builtIn = 5; + nullable boolean builtIn = 5; + } + + struct AtomicAttributeStatusStruct { + optional attrib_id attributeID = 0; + optional status statusCode = 1; } struct PresetStruct { @@ -1752,23 +1761,23 @@ cluster Thermostat = 513 { readonly attribute nullable temperature localTemperature = 0; readonly attribute optional nullable temperature outdoorTemperature = 1; - readonly attribute optional bitmap8 occupancy = 2; + readonly attribute optional OccupancyBitmap occupancy = 2; 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; + attribute access(write: manage) optional HVACSystemTypeBitmap HVACSystemTypeConfiguration = 9; attribute access(write: manage) optional int8s localTemperatureCalibration = 16; - attribute optional int16s occupiedCoolingSetpoint = 17; - attribute optional int16s occupiedHeatingSetpoint = 18; - attribute optional int16s unoccupiedCoolingSetpoint = 19; - attribute optional int16s unoccupiedHeatingSetpoint = 20; - attribute access(write: manage) optional int16s minHeatSetpointLimit = 21; - attribute access(write: manage) optional int16s maxHeatSetpointLimit = 22; - attribute access(write: manage) optional int16s minCoolSetpointLimit = 23; - attribute access(write: manage) optional int16s maxCoolSetpointLimit = 24; + attribute optional temperature occupiedCoolingSetpoint = 17; + attribute optional temperature occupiedHeatingSetpoint = 18; + attribute optional temperature unoccupiedCoolingSetpoint = 19; + attribute optional temperature unoccupiedHeatingSetpoint = 20; + attribute access(write: manage) optional temperature minHeatSetpointLimit = 21; + attribute access(write: manage) optional temperature maxHeatSetpointLimit = 22; + attribute access(write: manage) optional temperature minCoolSetpointLimit = 23; + attribute access(write: manage) optional temperature maxCoolSetpointLimit = 24; attribute access(write: manage) optional int8s minSetpointDeadBand = 25; attribute access(write: manage) optional RemoteSensingBitmap remoteSensing = 26; attribute access(write: manage) ControlSequenceOfOperationEnum controlSequenceOfOperation = 27; @@ -1798,7 +1807,7 @@ cluster Thermostat = 513 { 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; + attribute access(write: manage) optional ACCapacityFormatEnum ACCapacityFormat = 71; readonly attribute optional PresetTypeStruct presetTypes[] = 72; readonly attribute optional ScheduleTypeStruct scheduleTypes[] = 73; readonly attribute optional int8u numberOfPresets = 74; @@ -1809,9 +1818,7 @@ cluster Thermostat = 513 { readonly attribute optional nullable octet_string<16> activeScheduleHandle = 79; 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 = 82; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1851,34 +1858,32 @@ cluster Thermostat = 513 { octet_string<16> presetHandle = 0; } - request struct StartPresetsSchedulesEditRequestRequest { - int16u timeoutSeconds = 0; + response struct AtomicResponse = 253 { + status statusCode = 0; + AtomicAttributeStatusStruct attributeStatus[] = 1; + optional int16u timeout = 2; } - request struct SetTemperatureSetpointHoldPolicyRequest { - TemperatureSetpointHoldPolicyBitmap temperatureSetpointHoldPolicy = 0; + request struct AtomicRequestRequest { + AtomicRequestTypeEnum requestType = 0; + attrib_id attributeRequests[] = 1; + optional int16u timeout = 2; } - /** Command description for SetpointRaiseLower */ + /** Upon receipt, the attributes for the indicated setpoint(s) SHALL have the amount specified in the Amount field added to them. */ command SetpointRaiseLower(SetpointRaiseLowerRequest): DefaultSuccess = 0; - /** Command description for SetWeeklySchedule */ + /** Upon receipt, the weekly schedule for updating setpoints SHALL be stored in the */ command access(invoke: manage) SetWeeklySchedule(SetWeeklyScheduleRequest): DefaultSuccess = 1; - /** Command description for GetWeeklySchedule */ + /** Upon receipt, the unit SHOULD send in return the Get */ command GetWeeklySchedule(GetWeeklyScheduleRequest): GetWeeklyScheduleResponse = 2; - /** This command is used to clear the weekly schedule. The ClearWeeklySchedule command has no payload. */ + /** This command is used to clear the weekly schedule. */ command access(invoke: manage) ClearWeeklySchedule(): DefaultSuccess = 3; - /** This command is used to set the active schedule. */ + /** Upon receipt, if the */ command SetActiveScheduleRequest(SetActiveScheduleRequestRequest): DefaultSuccess = 5; - /** This command is used to set the active preset. */ + /** ID */ command SetActivePresetRequest(SetActivePresetRequestRequest): DefaultSuccess = 6; - /** This command is used to start editing the presets and schedules. */ - command access(invoke: manage) StartPresetsSchedulesEditRequest(StartPresetsSchedulesEditRequestRequest): DefaultSuccess = 7; - /** This command is used to cancel editing presets and schedules. */ - 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; + /** Begins, Commits or Cancels an atomic write */ + command access(invoke: manage) AtomicRequest(AtomicRequestRequest): AtomicResponse = 254; } /** An interface for controlling a fan in a heating/cooling system. */ diff --git a/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter b/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter index 5a8aefa22762f6..f6c7c5bcb6e146 100644 --- a/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter +++ b/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter @@ -1105,7 +1105,7 @@ cluster GroupKeyManagement = 63 { /** An interface for configuring and controlling the functionality of a thermostat. */ cluster Thermostat = 513 { - revision 6; + revision 7; enum ACCapacityFormatEnum : enum8 { kBTUh = 0; @@ -1141,6 +1141,12 @@ cluster Thermostat = 513 { kHeatPumpInverter = 4; } + enum AtomicRequestTypeEnum : enum8 { + kBeginWrite = 0; + kCommitWrite = 1; + kRollbackWrite = 2; + } + enum ControlSequenceOfOperationEnum : enum8 { kCoolingOnly = 0; kCoolingWithReheat = 1; @@ -1151,13 +1157,13 @@ cluster Thermostat = 513 { } enum PresetScenarioEnum : enum8 { - kUnspecified = 0; kOccupied = 1; kUnoccupied = 2; kSleep = 3; kWake = 4; kVacation = 5; - kUserDefined = 6; + kGoingToSleep = 6; + kUserDefined = 254; } enum SetpointChangeSourceEnum : enum8 { @@ -1223,7 +1229,6 @@ cluster Thermostat = 513 { kLocalTemperatureNotExposed = 0x40; kMatterScheduleConfiguration = 0x80; kPresets = 0x100; - kSetpoints = 0x200; } bitmap HVACSystemTypeBitmap : bitmap8 { @@ -1233,6 +1238,10 @@ cluster Thermostat = 513 { kHeatingUsesFuel = 0x20; } + bitmap OccupancyBitmap : bitmap8 { + kOccupied = 0x1; + } + bitmap PresetTypeFeaturesBitmap : bitmap16 { kAutomatic = 0x1; kSupportsNames = 0x2; @@ -1283,11 +1292,6 @@ cluster Thermostat = 513 { kSupportsOff = 0x8; } - bitmap TemperatureSetpointHoldPolicyBitmap : bitmap8 { - kHoldDurationElapsed = 0x1; - kHoldDurationElapsedOrPresetChanged = 0x2; - } - struct ScheduleTransitionStruct { ScheduleDayOfWeekBitmap dayOfWeek = 0; int16u transitionTime = 1; @@ -1303,7 +1307,12 @@ cluster Thermostat = 513 { optional char_string<64> name = 2; optional octet_string<16> presetHandle = 3; ScheduleTransitionStruct transitions[] = 4; - optional nullable boolean builtIn = 5; + nullable boolean builtIn = 5; + } + + struct AtomicAttributeStatusStruct { + optional attrib_id attributeID = 0; + optional status statusCode = 1; } struct PresetStruct { @@ -1335,23 +1344,23 @@ cluster Thermostat = 513 { readonly attribute nullable temperature localTemperature = 0; readonly attribute optional nullable temperature outdoorTemperature = 1; - readonly attribute optional bitmap8 occupancy = 2; + readonly attribute optional OccupancyBitmap occupancy = 2; 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; + attribute access(write: manage) optional HVACSystemTypeBitmap HVACSystemTypeConfiguration = 9; attribute access(write: manage) optional int8s localTemperatureCalibration = 16; - attribute optional int16s occupiedCoolingSetpoint = 17; - attribute optional int16s occupiedHeatingSetpoint = 18; - attribute optional int16s unoccupiedCoolingSetpoint = 19; - attribute optional int16s unoccupiedHeatingSetpoint = 20; - attribute access(write: manage) optional int16s minHeatSetpointLimit = 21; - attribute access(write: manage) optional int16s maxHeatSetpointLimit = 22; - attribute access(write: manage) optional int16s minCoolSetpointLimit = 23; - attribute access(write: manage) optional int16s maxCoolSetpointLimit = 24; + attribute optional temperature occupiedCoolingSetpoint = 17; + attribute optional temperature occupiedHeatingSetpoint = 18; + attribute optional temperature unoccupiedCoolingSetpoint = 19; + attribute optional temperature unoccupiedHeatingSetpoint = 20; + attribute access(write: manage) optional temperature minHeatSetpointLimit = 21; + attribute access(write: manage) optional temperature maxHeatSetpointLimit = 22; + attribute access(write: manage) optional temperature minCoolSetpointLimit = 23; + attribute access(write: manage) optional temperature maxCoolSetpointLimit = 24; attribute access(write: manage) optional int8s minSetpointDeadBand = 25; attribute access(write: manage) optional RemoteSensingBitmap remoteSensing = 26; attribute access(write: manage) ControlSequenceOfOperationEnum controlSequenceOfOperation = 27; @@ -1381,7 +1390,7 @@ cluster Thermostat = 513 { 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; + attribute access(write: manage) optional ACCapacityFormatEnum ACCapacityFormat = 71; readonly attribute optional PresetTypeStruct presetTypes[] = 72; readonly attribute optional ScheduleTypeStruct scheduleTypes[] = 73; readonly attribute optional int8u numberOfPresets = 74; @@ -1392,9 +1401,7 @@ cluster Thermostat = 513 { readonly attribute optional nullable octet_string<16> activeScheduleHandle = 79; 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 = 82; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1434,34 +1441,32 @@ cluster Thermostat = 513 { octet_string<16> presetHandle = 0; } - request struct StartPresetsSchedulesEditRequestRequest { - int16u timeoutSeconds = 0; + response struct AtomicResponse = 253 { + status statusCode = 0; + AtomicAttributeStatusStruct attributeStatus[] = 1; + optional int16u timeout = 2; } - request struct SetTemperatureSetpointHoldPolicyRequest { - TemperatureSetpointHoldPolicyBitmap temperatureSetpointHoldPolicy = 0; + request struct AtomicRequestRequest { + AtomicRequestTypeEnum requestType = 0; + attrib_id attributeRequests[] = 1; + optional int16u timeout = 2; } - /** Command description for SetpointRaiseLower */ + /** Upon receipt, the attributes for the indicated setpoint(s) SHALL have the amount specified in the Amount field added to them. */ command SetpointRaiseLower(SetpointRaiseLowerRequest): DefaultSuccess = 0; - /** Command description for SetWeeklySchedule */ + /** Upon receipt, the weekly schedule for updating setpoints SHALL be stored in the */ command access(invoke: manage) SetWeeklySchedule(SetWeeklyScheduleRequest): DefaultSuccess = 1; - /** Command description for GetWeeklySchedule */ + /** Upon receipt, the unit SHOULD send in return the Get */ command GetWeeklySchedule(GetWeeklyScheduleRequest): GetWeeklyScheduleResponse = 2; - /** This command is used to clear the weekly schedule. The ClearWeeklySchedule command has no payload. */ + /** This command is used to clear the weekly schedule. */ command access(invoke: manage) ClearWeeklySchedule(): DefaultSuccess = 3; - /** This command is used to set the active schedule. */ + /** Upon receipt, if the */ command SetActiveScheduleRequest(SetActiveScheduleRequestRequest): DefaultSuccess = 5; - /** This command is used to set the active preset. */ + /** ID */ command SetActivePresetRequest(SetActivePresetRequestRequest): DefaultSuccess = 6; - /** This command is used to start editing the presets and schedules. */ - command access(invoke: manage) StartPresetsSchedulesEditRequest(StartPresetsSchedulesEditRequestRequest): DefaultSuccess = 7; - /** This command is used to cancel editing presets and schedules. */ - 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; + /** Begins, Commits or Cancels an atomic write */ + command access(invoke: manage) AtomicRequest(AtomicRequestRequest): AtomicResponse = 254; } /** An interface for controlling a fan in a heating/cooling system. */ diff --git a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter index f7ff21337d4e96..3842db4f72e11e 100644 --- a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter +++ b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter @@ -1325,7 +1325,7 @@ cluster FixedLabel = 64 { /** An interface for configuring and controlling the functionality of a thermostat. */ cluster Thermostat = 513 { - revision 6; + revision 7; enum ACCapacityFormatEnum : enum8 { kBTUh = 0; @@ -1361,6 +1361,12 @@ cluster Thermostat = 513 { kHeatPumpInverter = 4; } + enum AtomicRequestTypeEnum : enum8 { + kBeginWrite = 0; + kCommitWrite = 1; + kRollbackWrite = 2; + } + enum ControlSequenceOfOperationEnum : enum8 { kCoolingOnly = 0; kCoolingWithReheat = 1; @@ -1371,13 +1377,13 @@ cluster Thermostat = 513 { } enum PresetScenarioEnum : enum8 { - kUnspecified = 0; kOccupied = 1; kUnoccupied = 2; kSleep = 3; kWake = 4; kVacation = 5; - kUserDefined = 6; + kGoingToSleep = 6; + kUserDefined = 254; } enum SetpointChangeSourceEnum : enum8 { @@ -1443,7 +1449,6 @@ cluster Thermostat = 513 { kLocalTemperatureNotExposed = 0x40; kMatterScheduleConfiguration = 0x80; kPresets = 0x100; - kSetpoints = 0x200; } bitmap HVACSystemTypeBitmap : bitmap8 { @@ -1453,6 +1458,10 @@ cluster Thermostat = 513 { kHeatingUsesFuel = 0x20; } + bitmap OccupancyBitmap : bitmap8 { + kOccupied = 0x1; + } + bitmap PresetTypeFeaturesBitmap : bitmap16 { kAutomatic = 0x1; kSupportsNames = 0x2; @@ -1503,11 +1512,6 @@ cluster Thermostat = 513 { kSupportsOff = 0x8; } - bitmap TemperatureSetpointHoldPolicyBitmap : bitmap8 { - kHoldDurationElapsed = 0x1; - kHoldDurationElapsedOrPresetChanged = 0x2; - } - struct ScheduleTransitionStruct { ScheduleDayOfWeekBitmap dayOfWeek = 0; int16u transitionTime = 1; @@ -1523,7 +1527,12 @@ cluster Thermostat = 513 { optional char_string<64> name = 2; optional octet_string<16> presetHandle = 3; ScheduleTransitionStruct transitions[] = 4; - optional nullable boolean builtIn = 5; + nullable boolean builtIn = 5; + } + + struct AtomicAttributeStatusStruct { + optional attrib_id attributeID = 0; + optional status statusCode = 1; } struct PresetStruct { @@ -1555,23 +1564,23 @@ cluster Thermostat = 513 { readonly attribute nullable temperature localTemperature = 0; readonly attribute optional nullable temperature outdoorTemperature = 1; - readonly attribute optional bitmap8 occupancy = 2; + readonly attribute optional OccupancyBitmap occupancy = 2; 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; + attribute access(write: manage) optional HVACSystemTypeBitmap HVACSystemTypeConfiguration = 9; attribute access(write: manage) optional int8s localTemperatureCalibration = 16; - attribute optional int16s occupiedCoolingSetpoint = 17; - attribute optional int16s occupiedHeatingSetpoint = 18; - attribute optional int16s unoccupiedCoolingSetpoint = 19; - attribute optional int16s unoccupiedHeatingSetpoint = 20; - attribute access(write: manage) optional int16s minHeatSetpointLimit = 21; - attribute access(write: manage) optional int16s maxHeatSetpointLimit = 22; - attribute access(write: manage) optional int16s minCoolSetpointLimit = 23; - attribute access(write: manage) optional int16s maxCoolSetpointLimit = 24; + attribute optional temperature occupiedCoolingSetpoint = 17; + attribute optional temperature occupiedHeatingSetpoint = 18; + attribute optional temperature unoccupiedCoolingSetpoint = 19; + attribute optional temperature unoccupiedHeatingSetpoint = 20; + attribute access(write: manage) optional temperature minHeatSetpointLimit = 21; + attribute access(write: manage) optional temperature maxHeatSetpointLimit = 22; + attribute access(write: manage) optional temperature minCoolSetpointLimit = 23; + attribute access(write: manage) optional temperature maxCoolSetpointLimit = 24; attribute access(write: manage) optional int8s minSetpointDeadBand = 25; attribute access(write: manage) optional RemoteSensingBitmap remoteSensing = 26; attribute access(write: manage) ControlSequenceOfOperationEnum controlSequenceOfOperation = 27; @@ -1601,7 +1610,7 @@ cluster Thermostat = 513 { 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; + attribute access(write: manage) optional ACCapacityFormatEnum ACCapacityFormat = 71; readonly attribute optional PresetTypeStruct presetTypes[] = 72; readonly attribute optional ScheduleTypeStruct scheduleTypes[] = 73; readonly attribute optional int8u numberOfPresets = 74; @@ -1612,9 +1621,7 @@ cluster Thermostat = 513 { readonly attribute optional nullable octet_string<16> activeScheduleHandle = 79; 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 = 82; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1654,34 +1661,32 @@ cluster Thermostat = 513 { octet_string<16> presetHandle = 0; } - request struct StartPresetsSchedulesEditRequestRequest { - int16u timeoutSeconds = 0; + response struct AtomicResponse = 253 { + status statusCode = 0; + AtomicAttributeStatusStruct attributeStatus[] = 1; + optional int16u timeout = 2; } - request struct SetTemperatureSetpointHoldPolicyRequest { - TemperatureSetpointHoldPolicyBitmap temperatureSetpointHoldPolicy = 0; + request struct AtomicRequestRequest { + AtomicRequestTypeEnum requestType = 0; + attrib_id attributeRequests[] = 1; + optional int16u timeout = 2; } - /** Command description for SetpointRaiseLower */ + /** Upon receipt, the attributes for the indicated setpoint(s) SHALL have the amount specified in the Amount field added to them. */ command SetpointRaiseLower(SetpointRaiseLowerRequest): DefaultSuccess = 0; - /** Command description for SetWeeklySchedule */ + /** Upon receipt, the weekly schedule for updating setpoints SHALL be stored in the */ command access(invoke: manage) SetWeeklySchedule(SetWeeklyScheduleRequest): DefaultSuccess = 1; - /** Command description for GetWeeklySchedule */ + /** Upon receipt, the unit SHOULD send in return the Get */ command GetWeeklySchedule(GetWeeklyScheduleRequest): GetWeeklyScheduleResponse = 2; - /** This command is used to clear the weekly schedule. The ClearWeeklySchedule command has no payload. */ + /** This command is used to clear the weekly schedule. */ command access(invoke: manage) ClearWeeklySchedule(): DefaultSuccess = 3; - /** This command is used to set the active schedule. */ + /** Upon receipt, if the */ command SetActiveScheduleRequest(SetActiveScheduleRequestRequest): DefaultSuccess = 5; - /** This command is used to set the active preset. */ + /** ID */ command SetActivePresetRequest(SetActivePresetRequestRequest): DefaultSuccess = 6; - /** This command is used to start editing the presets and schedules. */ - command access(invoke: manage) StartPresetsSchedulesEditRequest(StartPresetsSchedulesEditRequestRequest): DefaultSuccess = 7; - /** This command is used to cancel editing presets and schedules. */ - 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; + /** Begins, Commits or Cancels an atomic write */ + command access(invoke: manage) AtomicRequest(AtomicRequestRequest): AtomicResponse = 254; } /** An interface for controlling a fan in a heating/cooling system. */ diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter index 9c1a05687d3c6a..f6a97bb3317f8e 100644 --- a/examples/placeholder/linux/apps/app1/config.matter +++ b/examples/placeholder/linux/apps/app1/config.matter @@ -4773,7 +4773,7 @@ cluster PumpConfigurationAndControl = 512 { /** An interface for configuring and controlling the functionality of a thermostat. */ cluster Thermostat = 513 { - revision 6; + revision 7; enum ACCapacityFormatEnum : enum8 { kBTUh = 0; @@ -4809,6 +4809,12 @@ cluster Thermostat = 513 { kHeatPumpInverter = 4; } + enum AtomicRequestTypeEnum : enum8 { + kBeginWrite = 0; + kCommitWrite = 1; + kRollbackWrite = 2; + } + enum ControlSequenceOfOperationEnum : enum8 { kCoolingOnly = 0; kCoolingWithReheat = 1; @@ -4819,13 +4825,13 @@ cluster Thermostat = 513 { } enum PresetScenarioEnum : enum8 { - kUnspecified = 0; kOccupied = 1; kUnoccupied = 2; kSleep = 3; kWake = 4; kVacation = 5; - kUserDefined = 6; + kGoingToSleep = 6; + kUserDefined = 254; } enum SetpointChangeSourceEnum : enum8 { @@ -4891,7 +4897,6 @@ cluster Thermostat = 513 { kLocalTemperatureNotExposed = 0x40; kMatterScheduleConfiguration = 0x80; kPresets = 0x100; - kSetpoints = 0x200; } bitmap HVACSystemTypeBitmap : bitmap8 { @@ -4901,6 +4906,10 @@ cluster Thermostat = 513 { kHeatingUsesFuel = 0x20; } + bitmap OccupancyBitmap : bitmap8 { + kOccupied = 0x1; + } + bitmap PresetTypeFeaturesBitmap : bitmap16 { kAutomatic = 0x1; kSupportsNames = 0x2; @@ -4951,11 +4960,6 @@ cluster Thermostat = 513 { kSupportsOff = 0x8; } - bitmap TemperatureSetpointHoldPolicyBitmap : bitmap8 { - kHoldDurationElapsed = 0x1; - kHoldDurationElapsedOrPresetChanged = 0x2; - } - struct ScheduleTransitionStruct { ScheduleDayOfWeekBitmap dayOfWeek = 0; int16u transitionTime = 1; @@ -4971,7 +4975,12 @@ cluster Thermostat = 513 { optional char_string<64> name = 2; optional octet_string<16> presetHandle = 3; ScheduleTransitionStruct transitions[] = 4; - optional nullable boolean builtIn = 5; + nullable boolean builtIn = 5; + } + + struct AtomicAttributeStatusStruct { + optional attrib_id attributeID = 0; + optional status statusCode = 1; } struct PresetStruct { @@ -5003,23 +5012,23 @@ cluster Thermostat = 513 { readonly attribute nullable temperature localTemperature = 0; readonly attribute optional nullable temperature outdoorTemperature = 1; - readonly attribute optional bitmap8 occupancy = 2; + readonly attribute optional OccupancyBitmap occupancy = 2; 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; + attribute access(write: manage) optional HVACSystemTypeBitmap HVACSystemTypeConfiguration = 9; attribute access(write: manage) optional int8s localTemperatureCalibration = 16; - attribute optional int16s occupiedCoolingSetpoint = 17; - attribute optional int16s occupiedHeatingSetpoint = 18; - attribute optional int16s unoccupiedCoolingSetpoint = 19; - attribute optional int16s unoccupiedHeatingSetpoint = 20; - attribute access(write: manage) optional int16s minHeatSetpointLimit = 21; - attribute access(write: manage) optional int16s maxHeatSetpointLimit = 22; - attribute access(write: manage) optional int16s minCoolSetpointLimit = 23; - attribute access(write: manage) optional int16s maxCoolSetpointLimit = 24; + attribute optional temperature occupiedCoolingSetpoint = 17; + attribute optional temperature occupiedHeatingSetpoint = 18; + attribute optional temperature unoccupiedCoolingSetpoint = 19; + attribute optional temperature unoccupiedHeatingSetpoint = 20; + attribute access(write: manage) optional temperature minHeatSetpointLimit = 21; + attribute access(write: manage) optional temperature maxHeatSetpointLimit = 22; + attribute access(write: manage) optional temperature minCoolSetpointLimit = 23; + attribute access(write: manage) optional temperature maxCoolSetpointLimit = 24; attribute access(write: manage) optional int8s minSetpointDeadBand = 25; attribute access(write: manage) optional RemoteSensingBitmap remoteSensing = 26; attribute access(write: manage) ControlSequenceOfOperationEnum controlSequenceOfOperation = 27; @@ -5049,7 +5058,7 @@ cluster Thermostat = 513 { 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; + attribute access(write: manage) optional ACCapacityFormatEnum ACCapacityFormat = 71; readonly attribute optional PresetTypeStruct presetTypes[] = 72; readonly attribute optional ScheduleTypeStruct scheduleTypes[] = 73; readonly attribute optional int8u numberOfPresets = 74; @@ -5060,9 +5069,7 @@ cluster Thermostat = 513 { readonly attribute optional nullable octet_string<16> activeScheduleHandle = 79; 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 = 82; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -5102,39 +5109,37 @@ cluster Thermostat = 513 { octet_string<16> presetHandle = 0; } - request struct StartPresetsSchedulesEditRequestRequest { - int16u timeoutSeconds = 0; + response struct AtomicResponse = 253 { + status statusCode = 0; + AtomicAttributeStatusStruct attributeStatus[] = 1; + optional int16u timeout = 2; } - request struct SetTemperatureSetpointHoldPolicyRequest { - TemperatureSetpointHoldPolicyBitmap temperatureSetpointHoldPolicy = 0; + request struct AtomicRequestRequest { + AtomicRequestTypeEnum requestType = 0; + attrib_id attributeRequests[] = 1; + optional int16u timeout = 2; } - /** Command description for SetpointRaiseLower */ + /** Upon receipt, the attributes for the indicated setpoint(s) SHALL have the amount specified in the Amount field added to them. */ command SetpointRaiseLower(SetpointRaiseLowerRequest): DefaultSuccess = 0; - /** Command description for SetWeeklySchedule */ + /** Upon receipt, the weekly schedule for updating setpoints SHALL be stored in the */ command access(invoke: manage) SetWeeklySchedule(SetWeeklyScheduleRequest): DefaultSuccess = 1; - /** Command description for GetWeeklySchedule */ + /** Upon receipt, the unit SHOULD send in return the Get */ command GetWeeklySchedule(GetWeeklyScheduleRequest): GetWeeklyScheduleResponse = 2; - /** This command is used to clear the weekly schedule. The ClearWeeklySchedule command has no payload. */ + /** This command is used to clear the weekly schedule. */ command access(invoke: manage) ClearWeeklySchedule(): DefaultSuccess = 3; - /** This command is used to set the active schedule. */ + /** Upon receipt, if the */ command SetActiveScheduleRequest(SetActiveScheduleRequestRequest): DefaultSuccess = 5; - /** This command is used to set the active preset. */ + /** ID */ command SetActivePresetRequest(SetActivePresetRequestRequest): DefaultSuccess = 6; - /** This command is used to start editing the presets and schedules. */ - command access(invoke: manage) StartPresetsSchedulesEditRequest(StartPresetsSchedulesEditRequestRequest): DefaultSuccess = 7; - /** This command is used to cancel editing presets and schedules. */ - 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; + /** Begins, Commits or Cancels an atomic write */ + command access(invoke: manage) AtomicRequest(AtomicRequestRequest): AtomicResponse = 254; } /** An interface for configuring and controlling the functionality of a thermostat. */ cluster Thermostat = 513 { - revision 6; + revision 7; enum ACCapacityFormatEnum : enum8 { kBTUh = 0; @@ -5170,6 +5175,12 @@ cluster Thermostat = 513 { kHeatPumpInverter = 4; } + enum AtomicRequestTypeEnum : enum8 { + kBeginWrite = 0; + kCommitWrite = 1; + kRollbackWrite = 2; + } + enum ControlSequenceOfOperationEnum : enum8 { kCoolingOnly = 0; kCoolingWithReheat = 1; @@ -5180,13 +5191,13 @@ cluster Thermostat = 513 { } enum PresetScenarioEnum : enum8 { - kUnspecified = 0; kOccupied = 1; kUnoccupied = 2; kSleep = 3; kWake = 4; kVacation = 5; - kUserDefined = 6; + kGoingToSleep = 6; + kUserDefined = 254; } enum SetpointChangeSourceEnum : enum8 { @@ -5252,7 +5263,6 @@ cluster Thermostat = 513 { kLocalTemperatureNotExposed = 0x40; kMatterScheduleConfiguration = 0x80; kPresets = 0x100; - kSetpoints = 0x200; } bitmap HVACSystemTypeBitmap : bitmap8 { @@ -5262,6 +5272,10 @@ cluster Thermostat = 513 { kHeatingUsesFuel = 0x20; } + bitmap OccupancyBitmap : bitmap8 { + kOccupied = 0x1; + } + bitmap PresetTypeFeaturesBitmap : bitmap16 { kAutomatic = 0x1; kSupportsNames = 0x2; @@ -5312,11 +5326,6 @@ cluster Thermostat = 513 { kSupportsOff = 0x8; } - bitmap TemperatureSetpointHoldPolicyBitmap : bitmap8 { - kHoldDurationElapsed = 0x1; - kHoldDurationElapsedOrPresetChanged = 0x2; - } - struct ScheduleTransitionStruct { ScheduleDayOfWeekBitmap dayOfWeek = 0; int16u transitionTime = 1; @@ -5332,7 +5341,12 @@ cluster Thermostat = 513 { optional char_string<64> name = 2; optional octet_string<16> presetHandle = 3; ScheduleTransitionStruct transitions[] = 4; - optional nullable boolean builtIn = 5; + nullable boolean builtIn = 5; + } + + struct AtomicAttributeStatusStruct { + optional attrib_id attributeID = 0; + optional status statusCode = 1; } struct PresetStruct { @@ -5364,23 +5378,23 @@ cluster Thermostat = 513 { readonly attribute nullable temperature localTemperature = 0; readonly attribute optional nullable temperature outdoorTemperature = 1; - readonly attribute optional bitmap8 occupancy = 2; + readonly attribute optional OccupancyBitmap occupancy = 2; 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; + attribute access(write: manage) optional HVACSystemTypeBitmap HVACSystemTypeConfiguration = 9; attribute access(write: manage) optional int8s localTemperatureCalibration = 16; - attribute optional int16s occupiedCoolingSetpoint = 17; - attribute optional int16s occupiedHeatingSetpoint = 18; - attribute optional int16s unoccupiedCoolingSetpoint = 19; - attribute optional int16s unoccupiedHeatingSetpoint = 20; - attribute access(write: manage) optional int16s minHeatSetpointLimit = 21; - attribute access(write: manage) optional int16s maxHeatSetpointLimit = 22; - attribute access(write: manage) optional int16s minCoolSetpointLimit = 23; - attribute access(write: manage) optional int16s maxCoolSetpointLimit = 24; + attribute optional temperature occupiedCoolingSetpoint = 17; + attribute optional temperature occupiedHeatingSetpoint = 18; + attribute optional temperature unoccupiedCoolingSetpoint = 19; + attribute optional temperature unoccupiedHeatingSetpoint = 20; + attribute access(write: manage) optional temperature minHeatSetpointLimit = 21; + attribute access(write: manage) optional temperature maxHeatSetpointLimit = 22; + attribute access(write: manage) optional temperature minCoolSetpointLimit = 23; + attribute access(write: manage) optional temperature maxCoolSetpointLimit = 24; attribute access(write: manage) optional int8s minSetpointDeadBand = 25; attribute access(write: manage) optional RemoteSensingBitmap remoteSensing = 26; attribute access(write: manage) ControlSequenceOfOperationEnum controlSequenceOfOperation = 27; @@ -5410,7 +5424,7 @@ cluster Thermostat = 513 { 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; + attribute access(write: manage) optional ACCapacityFormatEnum ACCapacityFormat = 71; readonly attribute optional PresetTypeStruct presetTypes[] = 72; readonly attribute optional ScheduleTypeStruct scheduleTypes[] = 73; readonly attribute optional int8u numberOfPresets = 74; @@ -5421,9 +5435,7 @@ cluster Thermostat = 513 { readonly attribute optional nullable octet_string<16> activeScheduleHandle = 79; 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 = 82; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -5463,34 +5475,32 @@ cluster Thermostat = 513 { octet_string<16> presetHandle = 0; } - request struct StartPresetsSchedulesEditRequestRequest { - int16u timeoutSeconds = 0; + response struct AtomicResponse = 253 { + status statusCode = 0; + AtomicAttributeStatusStruct attributeStatus[] = 1; + optional int16u timeout = 2; } - request struct SetTemperatureSetpointHoldPolicyRequest { - TemperatureSetpointHoldPolicyBitmap temperatureSetpointHoldPolicy = 0; + request struct AtomicRequestRequest { + AtomicRequestTypeEnum requestType = 0; + attrib_id attributeRequests[] = 1; + optional int16u timeout = 2; } - /** Command description for SetpointRaiseLower */ + /** Upon receipt, the attributes for the indicated setpoint(s) SHALL have the amount specified in the Amount field added to them. */ command SetpointRaiseLower(SetpointRaiseLowerRequest): DefaultSuccess = 0; - /** Command description for SetWeeklySchedule */ + /** Upon receipt, the weekly schedule for updating setpoints SHALL be stored in the */ command access(invoke: manage) SetWeeklySchedule(SetWeeklyScheduleRequest): DefaultSuccess = 1; - /** Command description for GetWeeklySchedule */ + /** Upon receipt, the unit SHOULD send in return the Get */ command GetWeeklySchedule(GetWeeklyScheduleRequest): GetWeeklyScheduleResponse = 2; - /** This command is used to clear the weekly schedule. The ClearWeeklySchedule command has no payload. */ + /** This command is used to clear the weekly schedule. */ command access(invoke: manage) ClearWeeklySchedule(): DefaultSuccess = 3; - /** This command is used to set the active schedule. */ + /** Upon receipt, if the */ command SetActiveScheduleRequest(SetActiveScheduleRequestRequest): DefaultSuccess = 5; - /** This command is used to set the active preset. */ + /** ID */ command SetActivePresetRequest(SetActivePresetRequestRequest): DefaultSuccess = 6; - /** This command is used to start editing the presets and schedules. */ - command access(invoke: manage) StartPresetsSchedulesEditRequest(StartPresetsSchedulesEditRequestRequest): DefaultSuccess = 7; - /** This command is used to cancel editing presets and schedules. */ - 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; + /** Begins, Commits or Cancels an atomic write */ + command access(invoke: manage) AtomicRequest(AtomicRequestRequest): AtomicResponse = 254; } /** An interface for configuring the user interface of a thermostat (which may be remote from the thermostat). */ @@ -8820,7 +8830,7 @@ endpoint 0 { callback attribute ACCompressorType default = 0x00; callback attribute ACLouverPosition default = 0x00; callback attribute ACCoilTemperature; - callback attribute ACCapacityformat default = 0x00; + callback attribute ACCapacityFormat default = 0x00; ram attribute featureMap default = 0x000b; ram attribute clusterRevision default = 6; } diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter index a48b8accff55c5..0383e2c67348c1 100644 --- a/examples/placeholder/linux/apps/app2/config.matter +++ b/examples/placeholder/linux/apps/app2/config.matter @@ -4730,7 +4730,7 @@ cluster PumpConfigurationAndControl = 512 { /** An interface for configuring and controlling the functionality of a thermostat. */ cluster Thermostat = 513 { - revision 6; + revision 7; enum ACCapacityFormatEnum : enum8 { kBTUh = 0; @@ -4766,6 +4766,12 @@ cluster Thermostat = 513 { kHeatPumpInverter = 4; } + enum AtomicRequestTypeEnum : enum8 { + kBeginWrite = 0; + kCommitWrite = 1; + kRollbackWrite = 2; + } + enum ControlSequenceOfOperationEnum : enum8 { kCoolingOnly = 0; kCoolingWithReheat = 1; @@ -4776,13 +4782,13 @@ cluster Thermostat = 513 { } enum PresetScenarioEnum : enum8 { - kUnspecified = 0; kOccupied = 1; kUnoccupied = 2; kSleep = 3; kWake = 4; kVacation = 5; - kUserDefined = 6; + kGoingToSleep = 6; + kUserDefined = 254; } enum SetpointChangeSourceEnum : enum8 { @@ -4848,7 +4854,6 @@ cluster Thermostat = 513 { kLocalTemperatureNotExposed = 0x40; kMatterScheduleConfiguration = 0x80; kPresets = 0x100; - kSetpoints = 0x200; } bitmap HVACSystemTypeBitmap : bitmap8 { @@ -4858,6 +4863,10 @@ cluster Thermostat = 513 { kHeatingUsesFuel = 0x20; } + bitmap OccupancyBitmap : bitmap8 { + kOccupied = 0x1; + } + bitmap PresetTypeFeaturesBitmap : bitmap16 { kAutomatic = 0x1; kSupportsNames = 0x2; @@ -4908,11 +4917,6 @@ cluster Thermostat = 513 { kSupportsOff = 0x8; } - bitmap TemperatureSetpointHoldPolicyBitmap : bitmap8 { - kHoldDurationElapsed = 0x1; - kHoldDurationElapsedOrPresetChanged = 0x2; - } - struct ScheduleTransitionStruct { ScheduleDayOfWeekBitmap dayOfWeek = 0; int16u transitionTime = 1; @@ -4928,7 +4932,12 @@ cluster Thermostat = 513 { optional char_string<64> name = 2; optional octet_string<16> presetHandle = 3; ScheduleTransitionStruct transitions[] = 4; - optional nullable boolean builtIn = 5; + nullable boolean builtIn = 5; + } + + struct AtomicAttributeStatusStruct { + optional attrib_id attributeID = 0; + optional status statusCode = 1; } struct PresetStruct { @@ -4960,23 +4969,23 @@ cluster Thermostat = 513 { readonly attribute nullable temperature localTemperature = 0; readonly attribute optional nullable temperature outdoorTemperature = 1; - readonly attribute optional bitmap8 occupancy = 2; + readonly attribute optional OccupancyBitmap occupancy = 2; 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; + attribute access(write: manage) optional HVACSystemTypeBitmap HVACSystemTypeConfiguration = 9; attribute access(write: manage) optional int8s localTemperatureCalibration = 16; - attribute optional int16s occupiedCoolingSetpoint = 17; - attribute optional int16s occupiedHeatingSetpoint = 18; - attribute optional int16s unoccupiedCoolingSetpoint = 19; - attribute optional int16s unoccupiedHeatingSetpoint = 20; - attribute access(write: manage) optional int16s minHeatSetpointLimit = 21; - attribute access(write: manage) optional int16s maxHeatSetpointLimit = 22; - attribute access(write: manage) optional int16s minCoolSetpointLimit = 23; - attribute access(write: manage) optional int16s maxCoolSetpointLimit = 24; + attribute optional temperature occupiedCoolingSetpoint = 17; + attribute optional temperature occupiedHeatingSetpoint = 18; + attribute optional temperature unoccupiedCoolingSetpoint = 19; + attribute optional temperature unoccupiedHeatingSetpoint = 20; + attribute access(write: manage) optional temperature minHeatSetpointLimit = 21; + attribute access(write: manage) optional temperature maxHeatSetpointLimit = 22; + attribute access(write: manage) optional temperature minCoolSetpointLimit = 23; + attribute access(write: manage) optional temperature maxCoolSetpointLimit = 24; attribute access(write: manage) optional int8s minSetpointDeadBand = 25; attribute access(write: manage) optional RemoteSensingBitmap remoteSensing = 26; attribute access(write: manage) ControlSequenceOfOperationEnum controlSequenceOfOperation = 27; @@ -5006,7 +5015,7 @@ cluster Thermostat = 513 { 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; + attribute access(write: manage) optional ACCapacityFormatEnum ACCapacityFormat = 71; readonly attribute optional PresetTypeStruct presetTypes[] = 72; readonly attribute optional ScheduleTypeStruct scheduleTypes[] = 73; readonly attribute optional int8u numberOfPresets = 74; @@ -5017,9 +5026,7 @@ cluster Thermostat = 513 { readonly attribute optional nullable octet_string<16> activeScheduleHandle = 79; 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 = 82; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -5059,39 +5066,37 @@ cluster Thermostat = 513 { octet_string<16> presetHandle = 0; } - request struct StartPresetsSchedulesEditRequestRequest { - int16u timeoutSeconds = 0; + response struct AtomicResponse = 253 { + status statusCode = 0; + AtomicAttributeStatusStruct attributeStatus[] = 1; + optional int16u timeout = 2; } - request struct SetTemperatureSetpointHoldPolicyRequest { - TemperatureSetpointHoldPolicyBitmap temperatureSetpointHoldPolicy = 0; + request struct AtomicRequestRequest { + AtomicRequestTypeEnum requestType = 0; + attrib_id attributeRequests[] = 1; + optional int16u timeout = 2; } - /** Command description for SetpointRaiseLower */ + /** Upon receipt, the attributes for the indicated setpoint(s) SHALL have the amount specified in the Amount field added to them. */ command SetpointRaiseLower(SetpointRaiseLowerRequest): DefaultSuccess = 0; - /** Command description for SetWeeklySchedule */ + /** Upon receipt, the weekly schedule for updating setpoints SHALL be stored in the */ command access(invoke: manage) SetWeeklySchedule(SetWeeklyScheduleRequest): DefaultSuccess = 1; - /** Command description for GetWeeklySchedule */ + /** Upon receipt, the unit SHOULD send in return the Get */ command GetWeeklySchedule(GetWeeklyScheduleRequest): GetWeeklyScheduleResponse = 2; - /** This command is used to clear the weekly schedule. The ClearWeeklySchedule command has no payload. */ + /** This command is used to clear the weekly schedule. */ command access(invoke: manage) ClearWeeklySchedule(): DefaultSuccess = 3; - /** This command is used to set the active schedule. */ + /** Upon receipt, if the */ command SetActiveScheduleRequest(SetActiveScheduleRequestRequest): DefaultSuccess = 5; - /** This command is used to set the active preset. */ + /** ID */ command SetActivePresetRequest(SetActivePresetRequestRequest): DefaultSuccess = 6; - /** This command is used to start editing the presets and schedules. */ - command access(invoke: manage) StartPresetsSchedulesEditRequest(StartPresetsSchedulesEditRequestRequest): DefaultSuccess = 7; - /** This command is used to cancel editing presets and schedules. */ - 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; + /** Begins, Commits or Cancels an atomic write */ + command access(invoke: manage) AtomicRequest(AtomicRequestRequest): AtomicResponse = 254; } /** An interface for configuring and controlling the functionality of a thermostat. */ cluster Thermostat = 513 { - revision 6; + revision 7; enum ACCapacityFormatEnum : enum8 { kBTUh = 0; @@ -5127,6 +5132,12 @@ cluster Thermostat = 513 { kHeatPumpInverter = 4; } + enum AtomicRequestTypeEnum : enum8 { + kBeginWrite = 0; + kCommitWrite = 1; + kRollbackWrite = 2; + } + enum ControlSequenceOfOperationEnum : enum8 { kCoolingOnly = 0; kCoolingWithReheat = 1; @@ -5137,13 +5148,13 @@ cluster Thermostat = 513 { } enum PresetScenarioEnum : enum8 { - kUnspecified = 0; kOccupied = 1; kUnoccupied = 2; kSleep = 3; kWake = 4; kVacation = 5; - kUserDefined = 6; + kGoingToSleep = 6; + kUserDefined = 254; } enum SetpointChangeSourceEnum : enum8 { @@ -5209,7 +5220,6 @@ cluster Thermostat = 513 { kLocalTemperatureNotExposed = 0x40; kMatterScheduleConfiguration = 0x80; kPresets = 0x100; - kSetpoints = 0x200; } bitmap HVACSystemTypeBitmap : bitmap8 { @@ -5219,6 +5229,10 @@ cluster Thermostat = 513 { kHeatingUsesFuel = 0x20; } + bitmap OccupancyBitmap : bitmap8 { + kOccupied = 0x1; + } + bitmap PresetTypeFeaturesBitmap : bitmap16 { kAutomatic = 0x1; kSupportsNames = 0x2; @@ -5269,11 +5283,6 @@ cluster Thermostat = 513 { kSupportsOff = 0x8; } - bitmap TemperatureSetpointHoldPolicyBitmap : bitmap8 { - kHoldDurationElapsed = 0x1; - kHoldDurationElapsedOrPresetChanged = 0x2; - } - struct ScheduleTransitionStruct { ScheduleDayOfWeekBitmap dayOfWeek = 0; int16u transitionTime = 1; @@ -5289,7 +5298,12 @@ cluster Thermostat = 513 { optional char_string<64> name = 2; optional octet_string<16> presetHandle = 3; ScheduleTransitionStruct transitions[] = 4; - optional nullable boolean builtIn = 5; + nullable boolean builtIn = 5; + } + + struct AtomicAttributeStatusStruct { + optional attrib_id attributeID = 0; + optional status statusCode = 1; } struct PresetStruct { @@ -5321,23 +5335,23 @@ cluster Thermostat = 513 { readonly attribute nullable temperature localTemperature = 0; readonly attribute optional nullable temperature outdoorTemperature = 1; - readonly attribute optional bitmap8 occupancy = 2; + readonly attribute optional OccupancyBitmap occupancy = 2; 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; + attribute access(write: manage) optional HVACSystemTypeBitmap HVACSystemTypeConfiguration = 9; attribute access(write: manage) optional int8s localTemperatureCalibration = 16; - attribute optional int16s occupiedCoolingSetpoint = 17; - attribute optional int16s occupiedHeatingSetpoint = 18; - attribute optional int16s unoccupiedCoolingSetpoint = 19; - attribute optional int16s unoccupiedHeatingSetpoint = 20; - attribute access(write: manage) optional int16s minHeatSetpointLimit = 21; - attribute access(write: manage) optional int16s maxHeatSetpointLimit = 22; - attribute access(write: manage) optional int16s minCoolSetpointLimit = 23; - attribute access(write: manage) optional int16s maxCoolSetpointLimit = 24; + attribute optional temperature occupiedCoolingSetpoint = 17; + attribute optional temperature occupiedHeatingSetpoint = 18; + attribute optional temperature unoccupiedCoolingSetpoint = 19; + attribute optional temperature unoccupiedHeatingSetpoint = 20; + attribute access(write: manage) optional temperature minHeatSetpointLimit = 21; + attribute access(write: manage) optional temperature maxHeatSetpointLimit = 22; + attribute access(write: manage) optional temperature minCoolSetpointLimit = 23; + attribute access(write: manage) optional temperature maxCoolSetpointLimit = 24; attribute access(write: manage) optional int8s minSetpointDeadBand = 25; attribute access(write: manage) optional RemoteSensingBitmap remoteSensing = 26; attribute access(write: manage) ControlSequenceOfOperationEnum controlSequenceOfOperation = 27; @@ -5367,7 +5381,7 @@ cluster Thermostat = 513 { 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; + attribute access(write: manage) optional ACCapacityFormatEnum ACCapacityFormat = 71; readonly attribute optional PresetTypeStruct presetTypes[] = 72; readonly attribute optional ScheduleTypeStruct scheduleTypes[] = 73; readonly attribute optional int8u numberOfPresets = 74; @@ -5378,9 +5392,7 @@ cluster Thermostat = 513 { readonly attribute optional nullable octet_string<16> activeScheduleHandle = 79; 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 = 82; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -5420,34 +5432,32 @@ cluster Thermostat = 513 { octet_string<16> presetHandle = 0; } - request struct StartPresetsSchedulesEditRequestRequest { - int16u timeoutSeconds = 0; + response struct AtomicResponse = 253 { + status statusCode = 0; + AtomicAttributeStatusStruct attributeStatus[] = 1; + optional int16u timeout = 2; } - request struct SetTemperatureSetpointHoldPolicyRequest { - TemperatureSetpointHoldPolicyBitmap temperatureSetpointHoldPolicy = 0; + request struct AtomicRequestRequest { + AtomicRequestTypeEnum requestType = 0; + attrib_id attributeRequests[] = 1; + optional int16u timeout = 2; } - /** Command description for SetpointRaiseLower */ + /** Upon receipt, the attributes for the indicated setpoint(s) SHALL have the amount specified in the Amount field added to them. */ command SetpointRaiseLower(SetpointRaiseLowerRequest): DefaultSuccess = 0; - /** Command description for SetWeeklySchedule */ + /** Upon receipt, the weekly schedule for updating setpoints SHALL be stored in the */ command access(invoke: manage) SetWeeklySchedule(SetWeeklyScheduleRequest): DefaultSuccess = 1; - /** Command description for GetWeeklySchedule */ + /** Upon receipt, the unit SHOULD send in return the Get */ command GetWeeklySchedule(GetWeeklyScheduleRequest): GetWeeklyScheduleResponse = 2; - /** This command is used to clear the weekly schedule. The ClearWeeklySchedule command has no payload. */ + /** This command is used to clear the weekly schedule. */ command access(invoke: manage) ClearWeeklySchedule(): DefaultSuccess = 3; - /** This command is used to set the active schedule. */ + /** Upon receipt, if the */ command SetActiveScheduleRequest(SetActiveScheduleRequestRequest): DefaultSuccess = 5; - /** This command is used to set the active preset. */ + /** ID */ command SetActivePresetRequest(SetActivePresetRequestRequest): DefaultSuccess = 6; - /** This command is used to start editing the presets and schedules. */ - command access(invoke: manage) StartPresetsSchedulesEditRequest(StartPresetsSchedulesEditRequestRequest): DefaultSuccess = 7; - /** This command is used to cancel editing presets and schedules. */ - 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; + /** Begins, Commits or Cancels an atomic write */ + command access(invoke: manage) AtomicRequest(AtomicRequestRequest): AtomicResponse = 254; } /** An interface for configuring the user interface of a thermostat (which may be remote from the thermostat). */ @@ -8784,7 +8794,7 @@ endpoint 0 { callback attribute ACCompressorType default = 0x00; callback attribute ACLouverPosition default = 0x00; callback attribute ACCoilTemperature; - callback attribute ACCapacityformat default = 0x00; + callback attribute ACCapacityFormat default = 0x00; ram attribute featureMap default = 0x000b; ram attribute clusterRevision default = 6; } diff --git a/examples/thermostat/nxp/zap/thermostat_matter_thread.matter b/examples/thermostat/nxp/zap/thermostat_matter_thread.matter index 00917f2d9a593e..ab65dbdee06882 100644 --- a/examples/thermostat/nxp/zap/thermostat_matter_thread.matter +++ b/examples/thermostat/nxp/zap/thermostat_matter_thread.matter @@ -1916,7 +1916,7 @@ provisional cluster ScenesManagement = 98 { /** An interface for configuring and controlling the functionality of a thermostat. */ cluster Thermostat = 513 { - revision 6; + revision 7; enum ACCapacityFormatEnum : enum8 { kBTUh = 0; @@ -1952,6 +1952,12 @@ cluster Thermostat = 513 { kHeatPumpInverter = 4; } + enum AtomicRequestTypeEnum : enum8 { + kBeginWrite = 0; + kCommitWrite = 1; + kRollbackWrite = 2; + } + enum ControlSequenceOfOperationEnum : enum8 { kCoolingOnly = 0; kCoolingWithReheat = 1; @@ -1962,13 +1968,13 @@ cluster Thermostat = 513 { } enum PresetScenarioEnum : enum8 { - kUnspecified = 0; kOccupied = 1; kUnoccupied = 2; kSleep = 3; kWake = 4; kVacation = 5; - kUserDefined = 6; + kGoingToSleep = 6; + kUserDefined = 254; } enum SetpointChangeSourceEnum : enum8 { @@ -2034,7 +2040,6 @@ cluster Thermostat = 513 { kLocalTemperatureNotExposed = 0x40; kMatterScheduleConfiguration = 0x80; kPresets = 0x100; - kSetpoints = 0x200; } bitmap HVACSystemTypeBitmap : bitmap8 { @@ -2044,6 +2049,10 @@ cluster Thermostat = 513 { kHeatingUsesFuel = 0x20; } + bitmap OccupancyBitmap : bitmap8 { + kOccupied = 0x1; + } + bitmap PresetTypeFeaturesBitmap : bitmap16 { kAutomatic = 0x1; kSupportsNames = 0x2; @@ -2094,11 +2103,6 @@ cluster Thermostat = 513 { kSupportsOff = 0x8; } - bitmap TemperatureSetpointHoldPolicyBitmap : bitmap8 { - kHoldDurationElapsed = 0x1; - kHoldDurationElapsedOrPresetChanged = 0x2; - } - struct ScheduleTransitionStruct { ScheduleDayOfWeekBitmap dayOfWeek = 0; int16u transitionTime = 1; @@ -2114,7 +2118,12 @@ cluster Thermostat = 513 { optional char_string<64> name = 2; optional octet_string<16> presetHandle = 3; ScheduleTransitionStruct transitions[] = 4; - optional nullable boolean builtIn = 5; + nullable boolean builtIn = 5; + } + + struct AtomicAttributeStatusStruct { + optional attrib_id attributeID = 0; + optional status statusCode = 1; } struct PresetStruct { @@ -2146,23 +2155,23 @@ cluster Thermostat = 513 { readonly attribute nullable temperature localTemperature = 0; readonly attribute optional nullable temperature outdoorTemperature = 1; - readonly attribute optional bitmap8 occupancy = 2; + readonly attribute optional OccupancyBitmap occupancy = 2; 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; + attribute access(write: manage) optional HVACSystemTypeBitmap HVACSystemTypeConfiguration = 9; attribute access(write: manage) optional int8s localTemperatureCalibration = 16; - attribute optional int16s occupiedCoolingSetpoint = 17; - attribute optional int16s occupiedHeatingSetpoint = 18; - attribute optional int16s unoccupiedCoolingSetpoint = 19; - attribute optional int16s unoccupiedHeatingSetpoint = 20; - attribute access(write: manage) optional int16s minHeatSetpointLimit = 21; - attribute access(write: manage) optional int16s maxHeatSetpointLimit = 22; - attribute access(write: manage) optional int16s minCoolSetpointLimit = 23; - attribute access(write: manage) optional int16s maxCoolSetpointLimit = 24; + attribute optional temperature occupiedCoolingSetpoint = 17; + attribute optional temperature occupiedHeatingSetpoint = 18; + attribute optional temperature unoccupiedCoolingSetpoint = 19; + attribute optional temperature unoccupiedHeatingSetpoint = 20; + attribute access(write: manage) optional temperature minHeatSetpointLimit = 21; + attribute access(write: manage) optional temperature maxHeatSetpointLimit = 22; + attribute access(write: manage) optional temperature minCoolSetpointLimit = 23; + attribute access(write: manage) optional temperature maxCoolSetpointLimit = 24; attribute access(write: manage) optional int8s minSetpointDeadBand = 25; attribute access(write: manage) optional RemoteSensingBitmap remoteSensing = 26; attribute access(write: manage) ControlSequenceOfOperationEnum controlSequenceOfOperation = 27; @@ -2192,7 +2201,7 @@ cluster Thermostat = 513 { 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; + attribute access(write: manage) optional ACCapacityFormatEnum ACCapacityFormat = 71; readonly attribute optional PresetTypeStruct presetTypes[] = 72; readonly attribute optional ScheduleTypeStruct scheduleTypes[] = 73; readonly attribute optional int8u numberOfPresets = 74; @@ -2203,9 +2212,7 @@ cluster Thermostat = 513 { readonly attribute optional nullable octet_string<16> activeScheduleHandle = 79; 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 = 82; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -2245,34 +2252,32 @@ cluster Thermostat = 513 { octet_string<16> presetHandle = 0; } - request struct StartPresetsSchedulesEditRequestRequest { - int16u timeoutSeconds = 0; + response struct AtomicResponse = 253 { + status statusCode = 0; + AtomicAttributeStatusStruct attributeStatus[] = 1; + optional int16u timeout = 2; } - request struct SetTemperatureSetpointHoldPolicyRequest { - TemperatureSetpointHoldPolicyBitmap temperatureSetpointHoldPolicy = 0; + request struct AtomicRequestRequest { + AtomicRequestTypeEnum requestType = 0; + attrib_id attributeRequests[] = 1; + optional int16u timeout = 2; } - /** Command description for SetpointRaiseLower */ + /** Upon receipt, the attributes for the indicated setpoint(s) SHALL have the amount specified in the Amount field added to them. */ command SetpointRaiseLower(SetpointRaiseLowerRequest): DefaultSuccess = 0; - /** Command description for SetWeeklySchedule */ + /** Upon receipt, the weekly schedule for updating setpoints SHALL be stored in the */ command access(invoke: manage) SetWeeklySchedule(SetWeeklyScheduleRequest): DefaultSuccess = 1; - /** Command description for GetWeeklySchedule */ + /** Upon receipt, the unit SHOULD send in return the Get */ command GetWeeklySchedule(GetWeeklyScheduleRequest): GetWeeklyScheduleResponse = 2; - /** This command is used to clear the weekly schedule. The ClearWeeklySchedule command has no payload. */ + /** This command is used to clear the weekly schedule. */ command access(invoke: manage) ClearWeeklySchedule(): DefaultSuccess = 3; - /** This command is used to set the active schedule. */ + /** Upon receipt, if the */ command SetActiveScheduleRequest(SetActiveScheduleRequestRequest): DefaultSuccess = 5; - /** This command is used to set the active preset. */ + /** ID */ command SetActivePresetRequest(SetActivePresetRequestRequest): DefaultSuccess = 6; - /** This command is used to start editing the presets and schedules. */ - command access(invoke: manage) StartPresetsSchedulesEditRequest(StartPresetsSchedulesEditRequestRequest): DefaultSuccess = 7; - /** This command is used to cancel editing presets and schedules. */ - 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; + /** Begins, Commits or Cancels an atomic write */ + command access(invoke: manage) AtomicRequest(AtomicRequestRequest): AtomicResponse = 254; } endpoint 0 { diff --git a/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter b/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter index a8a65c2c4ad611..0ea20d1af8de9c 100644 --- a/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter +++ b/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter @@ -1827,7 +1827,7 @@ provisional cluster ScenesManagement = 98 { /** An interface for configuring and controlling the functionality of a thermostat. */ cluster Thermostat = 513 { - revision 6; + revision 7; enum ACCapacityFormatEnum : enum8 { kBTUh = 0; @@ -1863,6 +1863,12 @@ cluster Thermostat = 513 { kHeatPumpInverter = 4; } + enum AtomicRequestTypeEnum : enum8 { + kBeginWrite = 0; + kCommitWrite = 1; + kRollbackWrite = 2; + } + enum ControlSequenceOfOperationEnum : enum8 { kCoolingOnly = 0; kCoolingWithReheat = 1; @@ -1873,13 +1879,13 @@ cluster Thermostat = 513 { } enum PresetScenarioEnum : enum8 { - kUnspecified = 0; kOccupied = 1; kUnoccupied = 2; kSleep = 3; kWake = 4; kVacation = 5; - kUserDefined = 6; + kGoingToSleep = 6; + kUserDefined = 254; } enum SetpointChangeSourceEnum : enum8 { @@ -1945,7 +1951,6 @@ cluster Thermostat = 513 { kLocalTemperatureNotExposed = 0x40; kMatterScheduleConfiguration = 0x80; kPresets = 0x100; - kSetpoints = 0x200; } bitmap HVACSystemTypeBitmap : bitmap8 { @@ -1955,6 +1960,10 @@ cluster Thermostat = 513 { kHeatingUsesFuel = 0x20; } + bitmap OccupancyBitmap : bitmap8 { + kOccupied = 0x1; + } + bitmap PresetTypeFeaturesBitmap : bitmap16 { kAutomatic = 0x1; kSupportsNames = 0x2; @@ -2005,11 +2014,6 @@ cluster Thermostat = 513 { kSupportsOff = 0x8; } - bitmap TemperatureSetpointHoldPolicyBitmap : bitmap8 { - kHoldDurationElapsed = 0x1; - kHoldDurationElapsedOrPresetChanged = 0x2; - } - struct ScheduleTransitionStruct { ScheduleDayOfWeekBitmap dayOfWeek = 0; int16u transitionTime = 1; @@ -2025,7 +2029,12 @@ cluster Thermostat = 513 { optional char_string<64> name = 2; optional octet_string<16> presetHandle = 3; ScheduleTransitionStruct transitions[] = 4; - optional nullable boolean builtIn = 5; + nullable boolean builtIn = 5; + } + + struct AtomicAttributeStatusStruct { + optional attrib_id attributeID = 0; + optional status statusCode = 1; } struct PresetStruct { @@ -2057,23 +2066,23 @@ cluster Thermostat = 513 { readonly attribute nullable temperature localTemperature = 0; readonly attribute optional nullable temperature outdoorTemperature = 1; - readonly attribute optional bitmap8 occupancy = 2; + readonly attribute optional OccupancyBitmap occupancy = 2; 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; + attribute access(write: manage) optional HVACSystemTypeBitmap HVACSystemTypeConfiguration = 9; attribute access(write: manage) optional int8s localTemperatureCalibration = 16; - attribute optional int16s occupiedCoolingSetpoint = 17; - attribute optional int16s occupiedHeatingSetpoint = 18; - attribute optional int16s unoccupiedCoolingSetpoint = 19; - attribute optional int16s unoccupiedHeatingSetpoint = 20; - attribute access(write: manage) optional int16s minHeatSetpointLimit = 21; - attribute access(write: manage) optional int16s maxHeatSetpointLimit = 22; - attribute access(write: manage) optional int16s minCoolSetpointLimit = 23; - attribute access(write: manage) optional int16s maxCoolSetpointLimit = 24; + attribute optional temperature occupiedCoolingSetpoint = 17; + attribute optional temperature occupiedHeatingSetpoint = 18; + attribute optional temperature unoccupiedCoolingSetpoint = 19; + attribute optional temperature unoccupiedHeatingSetpoint = 20; + attribute access(write: manage) optional temperature minHeatSetpointLimit = 21; + attribute access(write: manage) optional temperature maxHeatSetpointLimit = 22; + attribute access(write: manage) optional temperature minCoolSetpointLimit = 23; + attribute access(write: manage) optional temperature maxCoolSetpointLimit = 24; attribute access(write: manage) optional int8s minSetpointDeadBand = 25; attribute access(write: manage) optional RemoteSensingBitmap remoteSensing = 26; attribute access(write: manage) ControlSequenceOfOperationEnum controlSequenceOfOperation = 27; @@ -2103,7 +2112,7 @@ cluster Thermostat = 513 { 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; + attribute access(write: manage) optional ACCapacityFormatEnum ACCapacityFormat = 71; readonly attribute optional PresetTypeStruct presetTypes[] = 72; readonly attribute optional ScheduleTypeStruct scheduleTypes[] = 73; readonly attribute optional int8u numberOfPresets = 74; @@ -2114,9 +2123,7 @@ cluster Thermostat = 513 { readonly attribute optional nullable octet_string<16> activeScheduleHandle = 79; 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 = 82; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -2156,34 +2163,32 @@ cluster Thermostat = 513 { octet_string<16> presetHandle = 0; } - request struct StartPresetsSchedulesEditRequestRequest { - int16u timeoutSeconds = 0; + response struct AtomicResponse = 253 { + status statusCode = 0; + AtomicAttributeStatusStruct attributeStatus[] = 1; + optional int16u timeout = 2; } - request struct SetTemperatureSetpointHoldPolicyRequest { - TemperatureSetpointHoldPolicyBitmap temperatureSetpointHoldPolicy = 0; + request struct AtomicRequestRequest { + AtomicRequestTypeEnum requestType = 0; + attrib_id attributeRequests[] = 1; + optional int16u timeout = 2; } - /** Command description for SetpointRaiseLower */ + /** Upon receipt, the attributes for the indicated setpoint(s) SHALL have the amount specified in the Amount field added to them. */ command SetpointRaiseLower(SetpointRaiseLowerRequest): DefaultSuccess = 0; - /** Command description for SetWeeklySchedule */ + /** Upon receipt, the weekly schedule for updating setpoints SHALL be stored in the */ command access(invoke: manage) SetWeeklySchedule(SetWeeklyScheduleRequest): DefaultSuccess = 1; - /** Command description for GetWeeklySchedule */ + /** Upon receipt, the unit SHOULD send in return the Get */ command GetWeeklySchedule(GetWeeklyScheduleRequest): GetWeeklyScheduleResponse = 2; - /** This command is used to clear the weekly schedule. The ClearWeeklySchedule command has no payload. */ + /** This command is used to clear the weekly schedule. */ command access(invoke: manage) ClearWeeklySchedule(): DefaultSuccess = 3; - /** This command is used to set the active schedule. */ + /** Upon receipt, if the */ command SetActiveScheduleRequest(SetActiveScheduleRequestRequest): DefaultSuccess = 5; - /** This command is used to set the active preset. */ + /** ID */ command SetActivePresetRequest(SetActivePresetRequestRequest): DefaultSuccess = 6; - /** This command is used to start editing the presets and schedules. */ - command access(invoke: manage) StartPresetsSchedulesEditRequest(StartPresetsSchedulesEditRequestRequest): DefaultSuccess = 7; - /** This command is used to cancel editing presets and schedules. */ - 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; + /** Begins, Commits or Cancels an atomic write */ + command access(invoke: manage) AtomicRequest(AtomicRequestRequest): AtomicResponse = 254; } endpoint 0 { diff --git a/examples/thermostat/qpg/zap/thermostaticRadiatorValve.matter b/examples/thermostat/qpg/zap/thermostaticRadiatorValve.matter index a775e536ac841e..c2d323087d5fd9 100644 --- a/examples/thermostat/qpg/zap/thermostaticRadiatorValve.matter +++ b/examples/thermostat/qpg/zap/thermostaticRadiatorValve.matter @@ -1524,7 +1524,7 @@ cluster UserLabel = 65 { /** An interface for configuring and controlling the functionality of a thermostat. */ cluster Thermostat = 513 { - revision 6; + revision 7; enum ACCapacityFormatEnum : enum8 { kBTUh = 0; @@ -1560,6 +1560,12 @@ cluster Thermostat = 513 { kHeatPumpInverter = 4; } + enum AtomicRequestTypeEnum : enum8 { + kBeginWrite = 0; + kCommitWrite = 1; + kRollbackWrite = 2; + } + enum ControlSequenceOfOperationEnum : enum8 { kCoolingOnly = 0; kCoolingWithReheat = 1; @@ -1570,13 +1576,13 @@ cluster Thermostat = 513 { } enum PresetScenarioEnum : enum8 { - kUnspecified = 0; kOccupied = 1; kUnoccupied = 2; kSleep = 3; kWake = 4; kVacation = 5; - kUserDefined = 6; + kGoingToSleep = 6; + kUserDefined = 254; } enum SetpointChangeSourceEnum : enum8 { @@ -1642,7 +1648,6 @@ cluster Thermostat = 513 { kLocalTemperatureNotExposed = 0x40; kMatterScheduleConfiguration = 0x80; kPresets = 0x100; - kSetpoints = 0x200; } bitmap HVACSystemTypeBitmap : bitmap8 { @@ -1652,6 +1657,10 @@ cluster Thermostat = 513 { kHeatingUsesFuel = 0x20; } + bitmap OccupancyBitmap : bitmap8 { + kOccupied = 0x1; + } + bitmap PresetTypeFeaturesBitmap : bitmap16 { kAutomatic = 0x1; kSupportsNames = 0x2; @@ -1702,11 +1711,6 @@ cluster Thermostat = 513 { kSupportsOff = 0x8; } - bitmap TemperatureSetpointHoldPolicyBitmap : bitmap8 { - kHoldDurationElapsed = 0x1; - kHoldDurationElapsedOrPresetChanged = 0x2; - } - struct ScheduleTransitionStruct { ScheduleDayOfWeekBitmap dayOfWeek = 0; int16u transitionTime = 1; @@ -1722,7 +1726,12 @@ cluster Thermostat = 513 { optional char_string<64> name = 2; optional octet_string<16> presetHandle = 3; ScheduleTransitionStruct transitions[] = 4; - optional nullable boolean builtIn = 5; + nullable boolean builtIn = 5; + } + + struct AtomicAttributeStatusStruct { + optional attrib_id attributeID = 0; + optional status statusCode = 1; } struct PresetStruct { @@ -1754,23 +1763,23 @@ cluster Thermostat = 513 { readonly attribute nullable temperature localTemperature = 0; readonly attribute optional nullable temperature outdoorTemperature = 1; - readonly attribute optional bitmap8 occupancy = 2; + readonly attribute optional OccupancyBitmap occupancy = 2; 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; + attribute access(write: manage) optional HVACSystemTypeBitmap HVACSystemTypeConfiguration = 9; attribute access(write: manage) optional int8s localTemperatureCalibration = 16; - attribute optional int16s occupiedCoolingSetpoint = 17; - attribute optional int16s occupiedHeatingSetpoint = 18; - attribute optional int16s unoccupiedCoolingSetpoint = 19; - attribute optional int16s unoccupiedHeatingSetpoint = 20; - attribute access(write: manage) optional int16s minHeatSetpointLimit = 21; - attribute access(write: manage) optional int16s maxHeatSetpointLimit = 22; - attribute access(write: manage) optional int16s minCoolSetpointLimit = 23; - attribute access(write: manage) optional int16s maxCoolSetpointLimit = 24; + attribute optional temperature occupiedCoolingSetpoint = 17; + attribute optional temperature occupiedHeatingSetpoint = 18; + attribute optional temperature unoccupiedCoolingSetpoint = 19; + attribute optional temperature unoccupiedHeatingSetpoint = 20; + attribute access(write: manage) optional temperature minHeatSetpointLimit = 21; + attribute access(write: manage) optional temperature maxHeatSetpointLimit = 22; + attribute access(write: manage) optional temperature minCoolSetpointLimit = 23; + attribute access(write: manage) optional temperature maxCoolSetpointLimit = 24; attribute access(write: manage) optional int8s minSetpointDeadBand = 25; attribute access(write: manage) optional RemoteSensingBitmap remoteSensing = 26; attribute access(write: manage) ControlSequenceOfOperationEnum controlSequenceOfOperation = 27; @@ -1800,7 +1809,7 @@ cluster Thermostat = 513 { 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; + attribute access(write: manage) optional ACCapacityFormatEnum ACCapacityFormat = 71; readonly attribute optional PresetTypeStruct presetTypes[] = 72; readonly attribute optional ScheduleTypeStruct scheduleTypes[] = 73; readonly attribute optional int8u numberOfPresets = 74; @@ -1811,9 +1820,7 @@ cluster Thermostat = 513 { readonly attribute optional nullable octet_string<16> activeScheduleHandle = 79; 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 = 82; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1853,34 +1860,32 @@ cluster Thermostat = 513 { octet_string<16> presetHandle = 0; } - request struct StartPresetsSchedulesEditRequestRequest { - int16u timeoutSeconds = 0; + response struct AtomicResponse = 253 { + status statusCode = 0; + AtomicAttributeStatusStruct attributeStatus[] = 1; + optional int16u timeout = 2; } - request struct SetTemperatureSetpointHoldPolicyRequest { - TemperatureSetpointHoldPolicyBitmap temperatureSetpointHoldPolicy = 0; + request struct AtomicRequestRequest { + AtomicRequestTypeEnum requestType = 0; + attrib_id attributeRequests[] = 1; + optional int16u timeout = 2; } - /** Command description for SetpointRaiseLower */ + /** Upon receipt, the attributes for the indicated setpoint(s) SHALL have the amount specified in the Amount field added to them. */ command SetpointRaiseLower(SetpointRaiseLowerRequest): DefaultSuccess = 0; - /** Command description for SetWeeklySchedule */ + /** Upon receipt, the weekly schedule for updating setpoints SHALL be stored in the */ command access(invoke: manage) SetWeeklySchedule(SetWeeklyScheduleRequest): DefaultSuccess = 1; - /** Command description for GetWeeklySchedule */ + /** Upon receipt, the unit SHOULD send in return the Get */ command GetWeeklySchedule(GetWeeklyScheduleRequest): GetWeeklyScheduleResponse = 2; - /** This command is used to clear the weekly schedule. The ClearWeeklySchedule command has no payload. */ + /** This command is used to clear the weekly schedule. */ command access(invoke: manage) ClearWeeklySchedule(): DefaultSuccess = 3; - /** This command is used to set the active schedule. */ + /** Upon receipt, if the */ command SetActiveScheduleRequest(SetActiveScheduleRequestRequest): DefaultSuccess = 5; - /** This command is used to set the active preset. */ + /** ID */ command SetActivePresetRequest(SetActivePresetRequestRequest): DefaultSuccess = 6; - /** This command is used to start editing the presets and schedules. */ - command access(invoke: manage) StartPresetsSchedulesEditRequest(StartPresetsSchedulesEditRequestRequest): DefaultSuccess = 7; - /** This command is used to cancel editing presets and schedules. */ - 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; + /** Begins, Commits or Cancels an atomic write */ + command access(invoke: manage) AtomicRequest(AtomicRequestRequest): AtomicResponse = 254; } /** An interface for configuring the user interface of a thermostat (which may be remote from the thermostat). */ diff --git a/examples/thermostat/thermostat-common/src/thermostat-schedules-manager.cpp b/examples/thermostat/thermostat-common/src/thermostat-schedules-manager.cpp new file mode 100644 index 00000000000000..4b29853b7aa657 --- /dev/null +++ b/examples/thermostat/thermostat-common/src/thermostat-schedules-manager.cpp @@ -0,0 +1,408 @@ +#include <app/clusters/thermostat-server/thermostat-server.h> +#include <app/MessageDef/StatusIB.h> +#include <vector> + +using namespace chip; +using namespace chip::app; +using namespace chip::app::Clusters::Thermostat; +using namespace chip::app::Clusters::Thermostat::Structs; + +using Protocols::InteractionModel::Status; + +// built in presets will be prefixed with B +constexpr const char * kBuiltInPOneHandle = "BP1"; +constexpr const char * kOccupiedName = "Occupied Default"; + +constexpr const char * kBuiltinPTwoHandle = "BP2"; +constexpr const char * kUnoccupiedName = "Unoccupied Default"; + +constexpr const int kMaxPresets = 10; + +// user presets will be prefixed with UP +static const char * userPresetPrefix = "UP"; +static uint32_t nextNewPresetHandle = 0; + +// user schedules will be prefixed with US +static const char * userSchedulePrefix = "US"; +static uint32_t nextNewScheduleHandle = 0; + +static PresetStruct::Type BuiltInPresets[] = { + { .presetHandle = + DataModel::Nullable<chip::ByteSpan>(chip::ByteSpan(Uint8::from_const_char(kBuiltInPOneHandle), strlen(kBuiltInPOneHandle))), + .presetScenario = PresetScenarioEnum::kOccupied, + .name = Optional<DataModel::Nullable<chip::CharSpan>>( + DataModel::Nullable<chip::CharSpan>(chip::CharSpan(kOccupiedName, strlen(kOccupiedName)))), + .coolingSetpoint = Optional<int16_t>(2400), + .heatingSetpoint = Optional<int16_t>(1800), + .builtIn = DataModel::Nullable<bool>(true) }, + { .presetHandle = + DataModel::Nullable<chip::ByteSpan>(chip::ByteSpan(Uint8::from_const_char(kBuiltinPTwoHandle), strlen(kBuiltinPTwoHandle))), + .presetScenario = PresetScenarioEnum::kUnoccupied, + .name = Optional<DataModel::Nullable<chip::CharSpan>>( + DataModel::Nullable<chip::CharSpan>(chip::CharSpan(kUnoccupiedName, strlen(kUnoccupiedName)))), + .coolingSetpoint = Optional<int16_t>(3200), + .heatingSetpoint = Optional<int16_t>(1000), + .builtIn = DataModel::Nullable<bool>(true) } +}; + +// built in schedules will be prefixed with B +constexpr const char * kBuiltInSOneHandle = "BS1"; +constexpr const char * kBuildInScheduleOneName = "Schedule1"; +constexpr const char * kBuiltinSTwoHandle = "BS2"; +constexpr const char * kBuildInScheduleTwoName = "Schedule2"; +constexpr const int kMaxSchedules = 10; +constexpr const int kMaxTransitionsPerSchedule = 10; + +static ScheduleStruct::Type BuiltInSchedules[] = { + { + .scheduleHandle = DataModel::Nullable<chip::ByteSpan>(chip::ByteSpan(Uint8::from_const_char(kBuiltInSOneHandle), strlen(kBuiltInSOneHandle))), + .systemMode = SystemModeEnum::kAuto, + .name = Optional<chip::CharSpan>(chip::CharSpan(kBuildInScheduleOneName, strlen(kBuildInScheduleOneName))), + .presetHandle = Optional<chip::ByteSpan>(chip::ByteSpan(Uint8::from_const_char(kBuiltInPOneHandle), strlen(kBuiltInPOneHandle))), + .transitions = DataModel::List<const Structs::ScheduleTransitionStruct::Type>(), + .builtIn = DataModel::Nullable<bool>(true) + }, +}; + +template <typename T, std::size_t a, std::size_t b> +using array2d = std::array<std::array<T, a>, b>; + +static unsigned int gsActivePresetsEmptyIndex = 0; +static unsigned int gsEditingPresetsEmptyIndex = 0; +static unsigned int gsCurrentPresetsDataArrayIndex = 0; +static array2d<PresetStruct::Type, 2, kMaxPresets> gsPresets; + +static inline unsigned int GetActivePresetDataIndex() { return gsCurrentPresetsDataArrayIndex; } +static inline unsigned int GetEditPresetDataIndex() { return gsCurrentPresetsDataArrayIndex == 0 ? 1 : 0; } +static inline unsigned int ToggleActivePresetDataIndex() { return gsCurrentPresetsDataArrayIndex = GetEditPresetDataIndex(); } + +static unsigned int gsActiveSchedulesEmptyIndex = 0; +static unsigned int gsEditingSchedulesEmptyIndex = 0; +static unsigned int gsCurrentSchedulesDataArrayIndex = 0; +static array2d<ScheduleStruct::Type, 2, kMaxSchedules> gsSchedules; +static array2d<ScheduleTransitionStruct::Type, 2, kMaxSchedules * kMaxTransitionsPerSchedule> gsTransitions; + +static inline unsigned int GetActiveSchedulesDataIndex() { return gsCurrentSchedulesDataArrayIndex; } +static inline unsigned int GetEditSchedulesDataIndex() { return gsCurrentSchedulesDataArrayIndex == 0 ? 1 : 0; } +static inline unsigned int ToggleActiveSchedulesDataIndex() { return gsCurrentSchedulesDataArrayIndex = GetEditSchedulesDataIndex(); } + +struct ExampleThermostatScheduleManager : public ThermostatMatterScheduleManager +{ + ExampleThermostatScheduleManager() : ThermostatMatterScheduleManager() + { + for (gsActivePresetsEmptyIndex = 0; gsActivePresetsEmptyIndex < sizeof(BuiltInPresets) / sizeof(BuiltInPresets[0]); + ++gsActivePresetsEmptyIndex) + { + gsPresets[GetActivePresetDataIndex()][gsActivePresetsEmptyIndex] = BuiltInPresets[gsActivePresetsEmptyIndex]; + } + SetActiveInstance(this); + } + + virtual ~ExampleThermostatScheduleManager() {}; + + virtual bool IsEditing() { return IsEditing (1); }; + virtual bool IsEditing(chip::EndpointId aEndpoint) { return mEditing; }; + + virtual CHIP_ERROR StartEditing(chip::EndpointId aEndpoint, const chip::Access::SubjectDescriptor &inDescriptor); + virtual bool IsActiveSubjectDescriptor(chip::EndpointId aEndpoint, const chip::Access::SubjectDescriptor &inDescriptor); + + virtual CHIP_ERROR RollbackEdits(); + virtual CHIP_ERROR RollbackEdits(chip::EndpointId aEndpoint); + + virtual chip::Protocols::InteractionModel::Status CommitEdits(chip::EndpointId aEndpoint); + + // presets + virtual CHIP_ERROR GetPresetTypeAtIndex(chip::EndpointId aEndpoint, size_t aIndex, PresetTypeStruct::Type & outPresetType) const; + virtual CHIP_ERROR GetPresetAtIndex(chip::EndpointId aEndpoint, size_t aIndex, PresetStruct::Type & outPreset) const; + virtual CHIP_ERROR ClearPresets(chip::EndpointId aEndpoint); + virtual chip::Protocols::InteractionModel::Status AppendPreset(chip::EndpointId aEndpoint, const PresetStruct::DecodableType & preset); + + // schedules + virtual CHIP_ERROR GetScheduleTypeAtIndex(chip::EndpointId aEndpoint, size_t index, ScheduleTypeStruct::Type & scheduleType) const; + virtual CHIP_ERROR GetScheduleAtIndex(chip::EndpointId aEndpoint, size_t index, ScheduleStruct::Type & schedule) const; + virtual CHIP_ERROR ClearSchedules(chip::EndpointId aEndpoint); + virtual chip::Protocols::InteractionModel::Status AppendSchedule(chip::EndpointId aEndpoint, const Structs::ScheduleStruct::DecodableType & schedule); + +private: + // example app is only worrying about 1 endpoint. + bool mEditing = false; + Access::SubjectDescriptor mSubjectDescriptor; +}; + + +CHIP_ERROR ExampleThermostatScheduleManager::StartEditing(chip::EndpointId aEndpoint, const chip::Access::SubjectDescriptor &inDescriptor) +{ + ChipLogProgress(Zcl, "ExampleThermostatScheduleManager - StartEditing"); + if (mEditing == true) + return CHIP_ERROR_BUSY; + + mEditing = true; + mSubjectDescriptor = inDescriptor; + gsEditingPresetsEmptyIndex = 0; + gsEditingSchedulesEmptyIndex = 0; + + return CHIP_NO_ERROR; +} + +bool +ExampleThermostatScheduleManager::IsActiveSubjectDescriptor(chip::EndpointId aEndpoint, const chip::Access::SubjectDescriptor &inDescriptor) +{ + return areDescriptorsEqualAndValid(mSubjectDescriptor, inDescriptor); +} + +CHIP_ERROR ExampleThermostatScheduleManager::RollbackEdits() +{ + return RollbackEdits(1); +} + +CHIP_ERROR ExampleThermostatScheduleManager::RollbackEdits(chip::EndpointId aEndpoint) +{ + ChipLogProgress(Zcl, "ExampleThermostatScheduleManager - RollbackEdits"); + gsEditingPresetsEmptyIndex = 0; + gsEditingSchedulesEmptyIndex = 0; + mSubjectDescriptor.fabricIndex = kUndefinedFabricIndex; + mSubjectDescriptor.subject = kUndefinedNodeId; + return CHIP_NO_ERROR; +} + +Status ExampleThermostatScheduleManager::CommitEdits(chip::EndpointId aEndpoint) +{ + Status status = Status::Success; + + ChipLogProgress(Zcl, "ExampleThermostatScheduleManager - CommitEdits"); + + if (gsEditingPresetsEmptyIndex != 0) + { + Span<PresetStruct::Type> oldPresets = Span<PresetStruct::Type>(gsPresets[GetActivePresetDataIndex()]).SubSpan(0, gsActivePresetsEmptyIndex); + Span<PresetStruct::Type> newPresets = Span<PresetStruct::Type>(gsPresets[GetEditPresetDataIndex()]).SubSpan(0, gsEditingPresetsEmptyIndex); + + status = ValidatePresetsForCommitting(aEndpoint, oldPresets, newPresets); + { + StatusIB statusIB(status); + SuccessOrExit(statusIB.ToChipError()); + } + // New presets look good, lets generate some new ID's for the new presets. + for (unsigned int index = 0; index < gsEditingPresetsEmptyIndex; ++index) + { + if (gsPresets[GetEditPresetDataIndex()][index].presetHandle.IsNull() || gsPresets[GetEditPresetDataIndex()][index].presetHandle.Value().empty()) + { + char handle[16]; + snprintf(handle, 16, "%s%d", userPresetPrefix, nextNewPresetHandle++); + gsPresets[GetEditPresetDataIndex()][index].presetHandle.SetNonNull(ByteSpan((const unsigned char *) handle, strlen(handle))); + } + } + } + + if (gsEditingSchedulesEmptyIndex != 0) + { + Span<ScheduleStruct::Type> oldSchedules = Span<ScheduleStruct::Type>(gsSchedules[GetActiveSchedulesDataIndex()]).SubSpan(0, gsActiveSchedulesEmptyIndex); + Span<ScheduleStruct::Type> newSchedules = Span<ScheduleStruct::Type>(gsSchedules[GetEditSchedulesDataIndex()]).SubSpan(0, gsEditingSchedulesEmptyIndex); + Span<PresetStruct::Type> presets = gsEditingPresetsEmptyIndex > 0 ? Span<PresetStruct::Type>(gsPresets[GetEditPresetDataIndex()]).SubSpan(0, gsEditingPresetsEmptyIndex) : + Span<PresetStruct::Type>(gsPresets[GetActivePresetDataIndex()]).SubSpan(0, gsActivePresetsEmptyIndex); + + status = ValidateSchedulesForCommitting(aEndpoint, oldSchedules, newSchedules, presets); + { + StatusIB statusIB(status); + SuccessOrExit(statusIB.ToChipError()); + } + + // New schedules look good, lets generate some new ID's for the new schedules. + for (unsigned int index = 0; index < gsEditingSchedulesEmptyIndex; ++index) + { + if (gsSchedules[GetEditSchedulesDataIndex()][index].scheduleHandle.IsNull() || gsSchedules[GetEditSchedulesDataIndex()][index].scheduleHandle.Value().empty()) + { + char handle[16]; + snprintf(handle, 16, "%s%d", userSchedulePrefix, nextNewScheduleHandle++); + gsSchedules[GetEditSchedulesDataIndex()][index].scheduleHandle.SetNonNull(ByteSpan((const unsigned char *) handle, strlen(handle))); + } + } + } + + // make the edit arrays the active arrays. + if (gsEditingPresetsEmptyIndex != 0) + { + ToggleActivePresetDataIndex(); + gsActivePresetsEmptyIndex = gsEditingPresetsEmptyIndex; + gsEditingPresetsEmptyIndex = 0; + } + if (gsEditingSchedulesEmptyIndex != 0) + { + ToggleActiveSchedulesDataIndex(); + gsActiveSchedulesEmptyIndex = gsEditingSchedulesEmptyIndex; + gsEditingSchedulesEmptyIndex = 0; + } + + // TODO: update thermostat attributes for new presets. + + mSubjectDescriptor.fabricIndex = kUndefinedFabricIndex; + mSubjectDescriptor.subject = kUndefinedNodeId; + +exit: + return status; +} + +CHIP_ERROR ExampleThermostatScheduleManager::GetPresetTypeAtIndex(chip::EndpointId aEndpoint, size_t index, PresetTypeStruct::Type & presetType) const +{ + static PresetTypeStruct::Type presetTypes[] = { + { .presetScenario = PresetScenarioEnum::kOccupied, + .numberOfPresets = 4, + .presetTypeFeatures = + (to_underlying(PresetTypeFeaturesBitmap::kAutomatic) | to_underlying(PresetTypeFeaturesBitmap::kSupportsNames)) }, + { .presetScenario = PresetScenarioEnum::kUnoccupied, + .numberOfPresets = 2, + .presetTypeFeatures = + (to_underlying(PresetTypeFeaturesBitmap::kAutomatic) | to_underlying(PresetTypeFeaturesBitmap::kSupportsNames)) }, + { .presetScenario = PresetScenarioEnum::kSleep, + .numberOfPresets = 5, + .presetTypeFeatures = + (to_underlying(PresetTypeFeaturesBitmap::kAutomatic) | to_underlying(PresetTypeFeaturesBitmap::kSupportsNames)) }, + { .presetScenario = PresetScenarioEnum::kWake, + .numberOfPresets = 3, + .presetTypeFeatures = + (to_underlying(PresetTypeFeaturesBitmap::kAutomatic) | to_underlying(PresetTypeFeaturesBitmap::kSupportsNames)) }, + { .presetScenario = PresetScenarioEnum::kVacation, + .numberOfPresets = 1, + .presetTypeFeatures = + (to_underlying(PresetTypeFeaturesBitmap::kAutomatic) | to_underlying(PresetTypeFeaturesBitmap::kSupportsNames)) }, + }; + + if (index < 1) + { + presetType = presetTypes[index]; + return CHIP_NO_ERROR; + } + return CHIP_ERROR_NOT_FOUND; +} + +CHIP_ERROR ExampleThermostatScheduleManager::GetPresetAtIndex(chip::EndpointId aEndpoint, size_t index, PresetStruct::Type & preset) const +{ + if (index < gsPresets[GetActivePresetDataIndex()].size()) + { + preset = gsPresets[GetActivePresetDataIndex()][index]; + return CHIP_NO_ERROR; + } + return CHIP_ERROR_NOT_FOUND; +} + +CHIP_ERROR ExampleThermostatScheduleManager::ClearPresets(chip::EndpointId aEndpoint) +{ + gsEditingPresetsEmptyIndex = 0; + return CHIP_NO_ERROR; +} + +chip::Protocols::InteractionModel::Status ExampleThermostatScheduleManager::AppendPreset(chip::EndpointId aEndpoint, const PresetStruct::DecodableType & preset) +{ + if (gsEditingPresetsEmptyIndex >= gsPresets[GetEditPresetDataIndex()].size()) + return Status::ResourceExhausted; + + gsPresets[GetEditPresetDataIndex()][gsEditingPresetsEmptyIndex] = preset; + gsEditingPresetsEmptyIndex++; + + return Status::Success; +} + +CHIP_ERROR ExampleThermostatScheduleManager::GetScheduleTypeAtIndex(chip::EndpointId aEndpoint, size_t index, ScheduleTypeStruct::Type & scheduleType) const +{ + static ScheduleTypeStruct::Type scheduleTypes[] = { + { .systemMode = SystemModeEnum::kOff, + .numberOfSchedules = 1, + .scheduleTypeFeatures = + (to_underlying(ScheduleTypeFeaturesBitmap::kSupportsPresets) | + to_underlying(ScheduleTypeFeaturesBitmap::kSupportsSetpoints) | + to_underlying(ScheduleTypeFeaturesBitmap::kSupportsNames) | + to_underlying(ScheduleTypeFeaturesBitmap::kSupportsOff) + ) + }, + { .systemMode = SystemModeEnum::kHeat, + .numberOfSchedules = 1, + .scheduleTypeFeatures = + (to_underlying(ScheduleTypeFeaturesBitmap::kSupportsPresets) | + to_underlying(ScheduleTypeFeaturesBitmap::kSupportsSetpoints) | + to_underlying(ScheduleTypeFeaturesBitmap::kSupportsNames) | + to_underlying(ScheduleTypeFeaturesBitmap::kSupportsOff) + ) + }, + { .systemMode = SystemModeEnum::kCool, + .numberOfSchedules = 1, + .scheduleTypeFeatures = + (to_underlying(ScheduleTypeFeaturesBitmap::kSupportsPresets) | + to_underlying(ScheduleTypeFeaturesBitmap::kSupportsSetpoints) | + to_underlying(ScheduleTypeFeaturesBitmap::kSupportsNames) | + to_underlying(ScheduleTypeFeaturesBitmap::kSupportsOff) + ) + }, + { .systemMode = SystemModeEnum::kAuto, + .numberOfSchedules = 1, + .scheduleTypeFeatures = + (to_underlying(ScheduleTypeFeaturesBitmap::kSupportsPresets) | + to_underlying(ScheduleTypeFeaturesBitmap::kSupportsSetpoints) | + to_underlying(ScheduleTypeFeaturesBitmap::kSupportsNames) | + to_underlying(ScheduleTypeFeaturesBitmap::kSupportsOff) + ) + } + }; + + if (index < 1) + { + scheduleType = scheduleTypes[index]; + return CHIP_NO_ERROR; + } + + return CHIP_ERROR_NOT_FOUND; +} + +CHIP_ERROR ExampleThermostatScheduleManager::GetScheduleAtIndex(chip::EndpointId aEndpoint, size_t index, ScheduleStruct::Type & schedule) const +{ + if (index < gsSchedules[GetActiveSchedulesDataIndex()].size()) + { + schedule = gsSchedules[GetActiveSchedulesDataIndex()][index]; + return CHIP_NO_ERROR; + } + return CHIP_ERROR_NOT_FOUND; +} + +CHIP_ERROR ExampleThermostatScheduleManager::ClearSchedules(chip::EndpointId aEndpoint) +{ + gsEditingSchedulesEmptyIndex = 0; + return CHIP_NO_ERROR; +} + +chip::Protocols::InteractionModel::Status ExampleThermostatScheduleManager::AppendSchedule(chip::EndpointId aEndpoint, const ScheduleStruct::DecodableType & schedule) +{ + if (gsEditingSchedulesEmptyIndex >= gsSchedules[GetEditSchedulesDataIndex()].size()) + return Status::ResourceExhausted; + + // append the transitions, then apply to the schedule + auto iterator = schedule.transitions.begin(); + size_t transitionIdx = gsEditingSchedulesEmptyIndex * kMaxSchedules; + while (iterator.Next()) + { + if (transitionIdx > ((gsEditingSchedulesEmptyIndex * kMaxSchedules) + kMaxTransitionsPerSchedule)) + return Status::ResourceExhausted; + gsTransitions[GetEditSchedulesDataIndex()][transitionIdx].dayOfWeek = iterator.GetValue().dayOfWeek; + gsTransitions[GetEditSchedulesDataIndex()][transitionIdx].transitionTime = iterator.GetValue().transitionTime; + gsTransitions[GetEditSchedulesDataIndex()][transitionIdx].presetHandle = iterator.GetValue().presetHandle; + gsTransitions[GetEditSchedulesDataIndex()][transitionIdx].systemMode = iterator.GetValue().systemMode; + gsTransitions[GetEditSchedulesDataIndex()][transitionIdx].coolingSetpoint = iterator.GetValue().coolingSetpoint; + gsTransitions[GetEditSchedulesDataIndex()][transitionIdx].heatingSetpoint = iterator.GetValue().heatingSetpoint; + transitionIdx++; + } + + Span<const Structs::ScheduleTransitionStruct::Type> transitions(&(gsTransitions[GetEditSchedulesDataIndex()][gsEditingSchedulesEmptyIndex * kMaxSchedules]), + transitionIdx - (gsEditingSchedulesEmptyIndex * kMaxSchedules)); + + // DecodableType and Type are defined seperately + gsSchedules[GetEditSchedulesDataIndex()][gsEditingSchedulesEmptyIndex].scheduleHandle = schedule.scheduleHandle; + gsSchedules[GetEditSchedulesDataIndex()][gsEditingSchedulesEmptyIndex].systemMode = schedule.systemMode; + gsSchedules[GetEditSchedulesDataIndex()][gsEditingSchedulesEmptyIndex].name = schedule.name; + gsSchedules[GetEditSchedulesDataIndex()][gsEditingSchedulesEmptyIndex].presetHandle = schedule.presetHandle; + gsSchedules[GetEditSchedulesDataIndex()][gsEditingSchedulesEmptyIndex].transitions = DataModel::List<const ScheduleTransitionStruct::Type>(transitions) ; + gsSchedules[GetEditSchedulesDataIndex()][gsEditingSchedulesEmptyIndex].builtIn = schedule.builtIn; + + gsEditingSchedulesEmptyIndex++; + + return Status::Success; +} + +// Instantiate the manager for endpoint 1 +static ExampleThermostatScheduleManager gThermostatPresetManager; diff --git a/examples/thermostat/thermostat-common/thermostat.matter b/examples/thermostat/thermostat-common/thermostat.matter index 2312df8c61fdc1..5d5acb9de733b4 100644 --- a/examples/thermostat/thermostat-common/thermostat.matter +++ b/examples/thermostat/thermostat-common/thermostat.matter @@ -1704,7 +1704,7 @@ cluster UserLabel = 65 { /** An interface for configuring and controlling the functionality of a thermostat. */ cluster Thermostat = 513 { - revision 6; + revision 7; enum ACCapacityFormatEnum : enum8 { kBTUh = 0; @@ -1740,6 +1740,12 @@ cluster Thermostat = 513 { kHeatPumpInverter = 4; } + enum AtomicRequestTypeEnum : enum8 { + kBeginWrite = 0; + kCommitWrite = 1; + kRollbackWrite = 2; + } + enum ControlSequenceOfOperationEnum : enum8 { kCoolingOnly = 0; kCoolingWithReheat = 1; @@ -1750,13 +1756,13 @@ cluster Thermostat = 513 { } enum PresetScenarioEnum : enum8 { - kUnspecified = 0; kOccupied = 1; kUnoccupied = 2; kSleep = 3; kWake = 4; kVacation = 5; - kUserDefined = 6; + kGoingToSleep = 6; + kUserDefined = 254; } enum SetpointChangeSourceEnum : enum8 { @@ -1822,7 +1828,6 @@ cluster Thermostat = 513 { kLocalTemperatureNotExposed = 0x40; kMatterScheduleConfiguration = 0x80; kPresets = 0x100; - kSetpoints = 0x200; } bitmap HVACSystemTypeBitmap : bitmap8 { @@ -1832,6 +1837,10 @@ cluster Thermostat = 513 { kHeatingUsesFuel = 0x20; } + bitmap OccupancyBitmap : bitmap8 { + kOccupied = 0x1; + } + bitmap PresetTypeFeaturesBitmap : bitmap16 { kAutomatic = 0x1; kSupportsNames = 0x2; @@ -1882,11 +1891,6 @@ cluster Thermostat = 513 { kSupportsOff = 0x8; } - bitmap TemperatureSetpointHoldPolicyBitmap : bitmap8 { - kHoldDurationElapsed = 0x1; - kHoldDurationElapsedOrPresetChanged = 0x2; - } - struct ScheduleTransitionStruct { ScheduleDayOfWeekBitmap dayOfWeek = 0; int16u transitionTime = 1; @@ -1902,7 +1906,12 @@ cluster Thermostat = 513 { optional char_string<64> name = 2; optional octet_string<16> presetHandle = 3; ScheduleTransitionStruct transitions[] = 4; - optional nullable boolean builtIn = 5; + nullable boolean builtIn = 5; + } + + struct AtomicAttributeStatusStruct { + optional attrib_id attributeID = 0; + optional status statusCode = 1; } struct PresetStruct { @@ -1934,23 +1943,23 @@ cluster Thermostat = 513 { readonly attribute nullable temperature localTemperature = 0; readonly attribute optional nullable temperature outdoorTemperature = 1; - readonly attribute optional bitmap8 occupancy = 2; + readonly attribute optional OccupancyBitmap occupancy = 2; 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; + attribute access(write: manage) optional HVACSystemTypeBitmap HVACSystemTypeConfiguration = 9; attribute access(write: manage) optional int8s localTemperatureCalibration = 16; - attribute optional int16s occupiedCoolingSetpoint = 17; - attribute optional int16s occupiedHeatingSetpoint = 18; - attribute optional int16s unoccupiedCoolingSetpoint = 19; - attribute optional int16s unoccupiedHeatingSetpoint = 20; - attribute access(write: manage) optional int16s minHeatSetpointLimit = 21; - attribute access(write: manage) optional int16s maxHeatSetpointLimit = 22; - attribute access(write: manage) optional int16s minCoolSetpointLimit = 23; - attribute access(write: manage) optional int16s maxCoolSetpointLimit = 24; + attribute optional temperature occupiedCoolingSetpoint = 17; + attribute optional temperature occupiedHeatingSetpoint = 18; + attribute optional temperature unoccupiedCoolingSetpoint = 19; + attribute optional temperature unoccupiedHeatingSetpoint = 20; + attribute access(write: manage) optional temperature minHeatSetpointLimit = 21; + attribute access(write: manage) optional temperature maxHeatSetpointLimit = 22; + attribute access(write: manage) optional temperature minCoolSetpointLimit = 23; + attribute access(write: manage) optional temperature maxCoolSetpointLimit = 24; attribute access(write: manage) optional int8s minSetpointDeadBand = 25; attribute access(write: manage) optional RemoteSensingBitmap remoteSensing = 26; attribute access(write: manage) ControlSequenceOfOperationEnum controlSequenceOfOperation = 27; @@ -1980,7 +1989,7 @@ cluster Thermostat = 513 { 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; + attribute access(write: manage) optional ACCapacityFormatEnum ACCapacityFormat = 71; readonly attribute optional PresetTypeStruct presetTypes[] = 72; readonly attribute optional ScheduleTypeStruct scheduleTypes[] = 73; readonly attribute optional int8u numberOfPresets = 74; @@ -1991,9 +2000,7 @@ cluster Thermostat = 513 { readonly attribute optional nullable octet_string<16> activeScheduleHandle = 79; 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 = 82; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -2033,34 +2040,32 @@ cluster Thermostat = 513 { octet_string<16> presetHandle = 0; } - request struct StartPresetsSchedulesEditRequestRequest { - int16u timeoutSeconds = 0; + response struct AtomicResponse = 253 { + status statusCode = 0; + AtomicAttributeStatusStruct attributeStatus[] = 1; + optional int16u timeout = 2; } - request struct SetTemperatureSetpointHoldPolicyRequest { - TemperatureSetpointHoldPolicyBitmap temperatureSetpointHoldPolicy = 0; + request struct AtomicRequestRequest { + AtomicRequestTypeEnum requestType = 0; + attrib_id attributeRequests[] = 1; + optional int16u timeout = 2; } - /** Command description for SetpointRaiseLower */ + /** Upon receipt, the attributes for the indicated setpoint(s) SHALL have the amount specified in the Amount field added to them. */ command SetpointRaiseLower(SetpointRaiseLowerRequest): DefaultSuccess = 0; - /** Command description for SetWeeklySchedule */ + /** Upon receipt, the weekly schedule for updating setpoints SHALL be stored in the */ command access(invoke: manage) SetWeeklySchedule(SetWeeklyScheduleRequest): DefaultSuccess = 1; - /** Command description for GetWeeklySchedule */ + /** Upon receipt, the unit SHOULD send in return the Get */ command GetWeeklySchedule(GetWeeklyScheduleRequest): GetWeeklyScheduleResponse = 2; - /** This command is used to clear the weekly schedule. The ClearWeeklySchedule command has no payload. */ + /** This command is used to clear the weekly schedule. */ command access(invoke: manage) ClearWeeklySchedule(): DefaultSuccess = 3; - /** This command is used to set the active schedule. */ + /** Upon receipt, if the */ command SetActiveScheduleRequest(SetActiveScheduleRequestRequest): DefaultSuccess = 5; - /** This command is used to set the active preset. */ + /** ID */ command SetActivePresetRequest(SetActivePresetRequestRequest): DefaultSuccess = 6; - /** This command is used to start editing the presets and schedules. */ - command access(invoke: manage) StartPresetsSchedulesEditRequest(StartPresetsSchedulesEditRequestRequest): DefaultSuccess = 7; - /** This command is used to cancel editing presets and schedules. */ - 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; + /** Begins, Commits or Cancels an atomic write */ + command access(invoke: manage) AtomicRequest(AtomicRequestRequest): AtomicResponse = 254; } /** An interface for configuring the user interface of a thermostat (which may be remote from the thermostat). */ diff --git a/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/endpoint_config.h b/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/endpoint_config.h index f2c082b1d0d4a1..bbb415515375fb 100644 --- a/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/endpoint_config.h +++ b/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/endpoint_config.h @@ -355,7 +355,7 @@ } // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 1056 +#define GENERATED_ATTRIBUTE_COUNT 1054 #define GENERATED_ATTRIBUTES \ { \ \ @@ -1367,17 +1367,17 @@ { ZAP_SIMPLE_DEFAULT(0x0BB8), 0x00000004, 2, ZAP_TYPE(TEMPERATURE), 0 }, /* AbsMaxHeatSetpointLimit */ \ { ZAP_SIMPLE_DEFAULT(0x0640), 0x00000005, 2, ZAP_TYPE(TEMPERATURE), 0 }, /* AbsMinCoolSetpointLimit */ \ { ZAP_SIMPLE_DEFAULT(0x0C80), 0x00000006, 2, ZAP_TYPE(TEMPERATURE), 0 }, /* AbsMaxCoolSetpointLimit */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(13), 0x00000011, 2, ZAP_TYPE(INT16S), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(13), 0x00000011, 2, ZAP_TYPE(TEMPERATURE), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* OccupiedCoolingSetpoint */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(14), 0x00000012, 2, ZAP_TYPE(INT16S), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(14), 0x00000012, 2, ZAP_TYPE(TEMPERATURE), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* OccupiedHeatingSetpoint */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(15), 0x00000015, 2, ZAP_TYPE(INT16S), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(15), 0x00000015, 2, ZAP_TYPE(TEMPERATURE), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* MinHeatSetpointLimit */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(16), 0x00000016, 2, ZAP_TYPE(INT16S), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(16), 0x00000016, 2, ZAP_TYPE(TEMPERATURE), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* MaxHeatSetpointLimit */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(17), 0x00000017, 2, ZAP_TYPE(INT16S), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(17), 0x00000017, 2, ZAP_TYPE(TEMPERATURE), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* MinCoolSetpointLimit */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(18), 0x00000018, 2, ZAP_TYPE(INT16S), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(18), 0x00000018, 2, ZAP_TYPE(TEMPERATURE), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* MaxCoolSetpointLimit */ \ { ZAP_MIN_MAX_DEFAULTS_INDEX(19), 0x00000019, 1, ZAP_TYPE(INT8S), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* MinSetpointDeadBand */ \ @@ -1399,9 +1399,7 @@ ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* Presets */ \ { ZAP_EMPTY_DEFAULT(), 0x00000051, 0, ZAP_TYPE(ARRAY), \ ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* Schedules */ \ - { ZAP_EMPTY_DEFAULT(), 0x00000052, 1, ZAP_TYPE(BOOLEAN), 0 }, /* PresetsSchedulesEditable */ \ - { ZAP_SIMPLE_DEFAULT(0), 0x00000053, 1, ZAP_TYPE(BITMAP8), 0 }, /* TemperatureSetpointHoldPolicy */ \ - { ZAP_EMPTY_DEFAULT(), 0x00000054, 4, ZAP_TYPE(EPOCH_S), \ + { ZAP_EMPTY_DEFAULT(), 0x00000052, 4, ZAP_TYPE(EPOCH_S), \ ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* SetpointHoldExpiryTimestamp */ \ { ZAP_SIMPLE_DEFAULT(0x0023), 0x0000FFFC, 4, ZAP_TYPE(BITMAP32), 0 }, /* FeatureMap */ \ { ZAP_SIMPLE_DEFAULT(6), 0x0000FFFD, 2, ZAP_TYPE(INT16U), 0 }, /* ClusterRevision */ \ @@ -3749,8 +3747,8 @@ /* Endpoint: 1, Cluster: Thermostat (server) */ \ .clusterId = 0x00000201, \ .attributes = ZAP_ATTRIBUTE_INDEX(616), \ - .attributeCount = 28, \ - .clusterSize = 74, \ + .attributeCount = 26, \ + .clusterSize = 72, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ .functions = chipFuncArrayThermostatServer, \ .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 241 ), \ @@ -3761,7 +3759,7 @@ { \ /* Endpoint: 1, Cluster: Fan Control (server) */ \ .clusterId = 0x00000202, \ - .attributes = ZAP_ATTRIBUTE_INDEX(644), \ + .attributes = ZAP_ATTRIBUTE_INDEX(642), \ .attributeCount = 14, \ .clusterSize = 18, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ @@ -3774,7 +3772,7 @@ { \ /* Endpoint: 1, Cluster: Thermostat User Interface Configuration (server) */ \ .clusterId = 0x00000204, \ - .attributes = ZAP_ATTRIBUTE_INDEX(658), \ + .attributes = ZAP_ATTRIBUTE_INDEX(656), \ .attributeCount = 5, \ .clusterSize = 9, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ @@ -3787,7 +3785,7 @@ { \ /* Endpoint: 1, Cluster: Color Control (server) */ \ .clusterId = 0x00000300, \ - .attributes = ZAP_ATTRIBUTE_INDEX(663), \ + .attributes = ZAP_ATTRIBUTE_INDEX(661), \ .attributeCount = 54, \ .clusterSize = 345, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(SHUTDOWN_FUNCTION), \ @@ -3800,7 +3798,7 @@ { \ /* Endpoint: 1, Cluster: Ballast Configuration (server) */ \ .clusterId = 0x00000301, \ - .attributes = ZAP_ATTRIBUTE_INDEX(717), \ + .attributes = ZAP_ATTRIBUTE_INDEX(715), \ .attributeCount = 16, \ .clusterSize = 58, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3813,7 +3811,7 @@ { \ /* Endpoint: 1, Cluster: Illuminance Measurement (server) */ \ .clusterId = 0x00000400, \ - .attributes = ZAP_ATTRIBUTE_INDEX(733), \ + .attributes = ZAP_ATTRIBUTE_INDEX(731), \ .attributeCount = 7, \ .clusterSize = 15, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3826,7 +3824,7 @@ { \ /* Endpoint: 1, Cluster: Temperature Measurement (server) */ \ .clusterId = 0x00000402, \ - .attributes = ZAP_ATTRIBUTE_INDEX(740), \ + .attributes = ZAP_ATTRIBUTE_INDEX(738), \ .attributeCount = 6, \ .clusterSize = 14, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3839,7 +3837,7 @@ { \ /* Endpoint: 1, Cluster: Pressure Measurement (server) */ \ .clusterId = 0x00000403, \ - .attributes = ZAP_ATTRIBUTE_INDEX(746), \ + .attributes = ZAP_ATTRIBUTE_INDEX(744), \ .attributeCount = 5, \ .clusterSize = 12, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3852,7 +3850,7 @@ { \ /* Endpoint: 1, Cluster: Flow Measurement (server) */ \ .clusterId = 0x00000404, \ - .attributes = ZAP_ATTRIBUTE_INDEX(751), \ + .attributes = ZAP_ATTRIBUTE_INDEX(749), \ .attributeCount = 6, \ .clusterSize = 14, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3865,7 +3863,7 @@ { \ /* Endpoint: 1, Cluster: Relative Humidity Measurement (server) */ \ .clusterId = 0x00000405, \ - .attributes = ZAP_ATTRIBUTE_INDEX(757), \ + .attributes = ZAP_ATTRIBUTE_INDEX(755), \ .attributeCount = 6, \ .clusterSize = 14, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3878,7 +3876,7 @@ { \ /* Endpoint: 1, Cluster: Occupancy Sensing (server) */ \ .clusterId = 0x00000406, \ - .attributes = ZAP_ATTRIBUTE_INDEX(763), \ + .attributes = ZAP_ATTRIBUTE_INDEX(761), \ .attributeCount = 5, \ .clusterSize = 9, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -3891,7 +3889,7 @@ { \ /* Endpoint: 1, Cluster: Carbon Monoxide Concentration Measurement (server) */ \ .clusterId = 0x0000040C, \ - .attributes = ZAP_ATTRIBUTE_INDEX(768), \ + .attributes = ZAP_ATTRIBUTE_INDEX(766), \ .attributeCount = 13, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3904,7 +3902,7 @@ { \ /* Endpoint: 1, Cluster: Carbon Dioxide Concentration Measurement (server) */ \ .clusterId = 0x0000040D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(781), \ + .attributes = ZAP_ATTRIBUTE_INDEX(779), \ .attributeCount = 13, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3917,7 +3915,7 @@ { \ /* Endpoint: 1, Cluster: Nitrogen Dioxide Concentration Measurement (server) */ \ .clusterId = 0x00000413, \ - .attributes = ZAP_ATTRIBUTE_INDEX(794), \ + .attributes = ZAP_ATTRIBUTE_INDEX(792), \ .attributeCount = 13, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3930,7 +3928,7 @@ { \ /* Endpoint: 1, Cluster: Ozone Concentration Measurement (server) */ \ .clusterId = 0x00000415, \ - .attributes = ZAP_ATTRIBUTE_INDEX(807), \ + .attributes = ZAP_ATTRIBUTE_INDEX(805), \ .attributeCount = 13, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3943,7 +3941,7 @@ { \ /* Endpoint: 1, Cluster: PM2.5 Concentration Measurement (server) */ \ .clusterId = 0x0000042A, \ - .attributes = ZAP_ATTRIBUTE_INDEX(820), \ + .attributes = ZAP_ATTRIBUTE_INDEX(818), \ .attributeCount = 13, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3956,7 +3954,7 @@ { \ /* Endpoint: 1, Cluster: Formaldehyde Concentration Measurement (server) */ \ .clusterId = 0x0000042B, \ - .attributes = ZAP_ATTRIBUTE_INDEX(833), \ + .attributes = ZAP_ATTRIBUTE_INDEX(831), \ .attributeCount = 13, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3969,7 +3967,7 @@ { \ /* Endpoint: 1, Cluster: PM1 Concentration Measurement (server) */ \ .clusterId = 0x0000042C, \ - .attributes = ZAP_ATTRIBUTE_INDEX(846), \ + .attributes = ZAP_ATTRIBUTE_INDEX(844), \ .attributeCount = 13, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3982,7 +3980,7 @@ { \ /* Endpoint: 1, Cluster: PM10 Concentration Measurement (server) */ \ .clusterId = 0x0000042D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(859), \ + .attributes = ZAP_ATTRIBUTE_INDEX(857), \ .attributeCount = 13, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3995,7 +3993,7 @@ { \ /* Endpoint: 1, Cluster: Total Volatile Organic Compounds Concentration Measurement (server) */ \ .clusterId = 0x0000042E, \ - .attributes = ZAP_ATTRIBUTE_INDEX(872), \ + .attributes = ZAP_ATTRIBUTE_INDEX(870), \ .attributeCount = 13, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -4008,7 +4006,7 @@ { \ /* Endpoint: 1, Cluster: Radon Concentration Measurement (server) */ \ .clusterId = 0x0000042F, \ - .attributes = ZAP_ATTRIBUTE_INDEX(885), \ + .attributes = ZAP_ATTRIBUTE_INDEX(883), \ .attributeCount = 13, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -4021,7 +4019,7 @@ { \ /* Endpoint: 1, Cluster: Wake on LAN (server) */ \ .clusterId = 0x00000503, \ - .attributes = ZAP_ATTRIBUTE_INDEX(898), \ + .attributes = ZAP_ATTRIBUTE_INDEX(896), \ .attributeCount = 3, \ .clusterSize = 19, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -4034,7 +4032,7 @@ { \ /* Endpoint: 1, Cluster: Low Power (server) */ \ .clusterId = 0x00000508, \ - .attributes = ZAP_ATTRIBUTE_INDEX(901), \ + .attributes = ZAP_ATTRIBUTE_INDEX(899), \ .attributeCount = 2, \ .clusterSize = 6, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -4047,7 +4045,7 @@ { \ /* Endpoint: 1, Cluster: Electrical Measurement (server) */ \ .clusterId = 0x00000B04, \ - .attributes = ZAP_ATTRIBUTE_INDEX(903), \ + .attributes = ZAP_ATTRIBUTE_INDEX(901), \ .attributeCount = 13, \ .clusterSize = 32, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -4060,7 +4058,7 @@ { \ /* Endpoint: 1, Cluster: Unit Testing (server) */ \ .clusterId = 0xFFF1FC05, \ - .attributes = ZAP_ATTRIBUTE_INDEX(916), \ + .attributes = ZAP_ATTRIBUTE_INDEX(914), \ .attributeCount = 84, \ .clusterSize = 2290, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -4073,7 +4071,7 @@ { \ /* Endpoint: 2, Cluster: Identify (server) */ \ .clusterId = 0x00000003, \ - .attributes = ZAP_ATTRIBUTE_INDEX(1000), \ + .attributes = ZAP_ATTRIBUTE_INDEX(998), \ .attributeCount = 4, \ .clusterSize = 9, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ @@ -4086,7 +4084,7 @@ { \ /* Endpoint: 2, Cluster: Groups (server) */ \ .clusterId = 0x00000004, \ - .attributes = ZAP_ATTRIBUTE_INDEX(1004), \ + .attributes = ZAP_ATTRIBUTE_INDEX(1002), \ .attributeCount = 3, \ .clusterSize = 7, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -4099,7 +4097,7 @@ { \ /* Endpoint: 2, Cluster: On/Off (server) */ \ .clusterId = 0x00000006, \ - .attributes = ZAP_ATTRIBUTE_INDEX(1007), \ + .attributes = ZAP_ATTRIBUTE_INDEX(1005), \ .attributeCount = 7, \ .clusterSize = 13, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(SHUTDOWN_FUNCTION), \ @@ -4112,7 +4110,7 @@ { \ /* Endpoint: 2, Cluster: Descriptor (server) */ \ .clusterId = 0x0000001D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(1014), \ + .attributes = ZAP_ATTRIBUTE_INDEX(1012), \ .attributeCount = 7, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -4125,7 +4123,7 @@ { \ /* Endpoint: 2, Cluster: Power Source (server) */ \ .clusterId = 0x0000002F, \ - .attributes = ZAP_ATTRIBUTE_INDEX(1021), \ + .attributes = ZAP_ATTRIBUTE_INDEX(1019), \ .attributeCount = 9, \ .clusterSize = 72, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -4138,7 +4136,7 @@ { \ /* Endpoint: 2, Cluster: Scenes Management (server) */ \ .clusterId = 0x00000062, \ - .attributes = ZAP_ATTRIBUTE_INDEX(1030), \ + .attributes = ZAP_ATTRIBUTE_INDEX(1028), \ .attributeCount = 5, \ .clusterSize = 16, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(SHUTDOWN_FUNCTION), \ @@ -4151,7 +4149,7 @@ { \ /* Endpoint: 2, Cluster: Occupancy Sensing (server) */ \ .clusterId = 0x00000406, \ - .attributes = ZAP_ATTRIBUTE_INDEX(1035), \ + .attributes = ZAP_ATTRIBUTE_INDEX(1033), \ .attributeCount = 5, \ .clusterSize = 9, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -4164,7 +4162,7 @@ { \ /* Endpoint: 65534, Cluster: Descriptor (server) */ \ .clusterId = 0x0000001D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(1040), \ + .attributes = ZAP_ATTRIBUTE_INDEX(1038), \ .attributeCount = 6, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -4177,7 +4175,7 @@ { \ /* Endpoint: 65534, Cluster: Network Commissioning (server) */ \ .clusterId = 0x00000031, \ - .attributes = ZAP_ATTRIBUTE_INDEX(1046), \ + .attributes = ZAP_ATTRIBUTE_INDEX(1044), \ .attributeCount = 10, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -4196,7 +4194,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 29, 349 }, { ZAP_CLUSTER_INDEX(29), 74, 3523 }, { ZAP_CLUSTER_INDEX(103), 7, 126 }, \ + { ZAP_CLUSTER_INDEX(0), 29, 349 }, { ZAP_CLUSTER_INDEX(29), 74, 3521 }, { ZAP_CLUSTER_INDEX(103), 7, 126 }, \ { ZAP_CLUSTER_INDEX(110), 2, 0 }, \ } @@ -4209,7 +4207,7 @@ static_assert(ATTRIBUTE_LARGEST <= CHIP_CONFIG_MAX_ATTRIBUTE_STORE_ELEMENT_SIZE, #define ATTRIBUTE_SINGLETONS_SIZE (36) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (3998) +#define ATTRIBUTE_MAX_SIZE (3996) // Number of fixed endpoints #define FIXED_ENDPOINT_COUNT (4) diff --git a/src/app/chip_data_model.gni b/src/app/chip_data_model.gni index 7a439a4141ce49..1358caf15f9595 100644 --- a/src/app/chip_data_model.gni +++ b/src/app/chip_data_model.gni @@ -366,6 +366,14 @@ template("chip_data_model") { "${_app_root}/clusters/${cluster}/${cluster}.cpp", "${_app_root}/clusters/${cluster}/${cluster}.h", ] + } else if (cluster == "thermostat-server") { + sources += [ + "${_app_root}/clusters/${cluster}/${cluster}.cpp", + "${_app_root}/clusters/${cluster}/${cluster}.h", + "${_app_root}/clusters/${cluster}/thermostat-matter-schedule-manager.cpp", + "${_app_root}/clusters/${cluster}/thermostat-preset-commit-validation.cpp", + "${_app_root}/clusters/${cluster}/thermostat-schedule-commit-validation.cpp", + ] } else if (cluster == "energy-evse-server") { sources += [ "${_app_root}/clusters/${cluster}/${cluster}.cpp", diff --git a/src/app/clusters/thermostat-server/thermostat-matter-schedule-manager.cpp b/src/app/clusters/thermostat-server/thermostat-matter-schedule-manager.cpp new file mode 100644 index 00000000000000..a3a3fae9d10566 --- /dev/null +++ b/src/app/clusters/thermostat-server/thermostat-matter-schedule-manager.cpp @@ -0,0 +1,138 @@ +/** + * + * Copyright (c) 2024 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Default implmenetation details for the THermostatMatterScheduleManager. +// Note: ValidatePresetsForCommitting and ValidateSchedulesForCommitting are implemented +// in seperate .cpp files due to their complexity and for readability. All other methods +// that aren't pure virtual have default implementations either in +// this file or the header file. + +// ---------------------------------------------- +// - Schedules and Presets Manager object - +// ---------------------------------------------- + +#include "thermostat-server.h" +#include <app/util/attribute-storage.h> + +#include <app-common/zap-generated/attributes/Accessors.h> +#include <app-common/zap-generated/callback.h> +#include <app-common/zap-generated/cluster-objects.h> +#include <app-common/zap-generated/ids/Attributes.h> +#include <app/CommandHandler.h> +#include <app/ConcreteAttributePath.h> +#include <app/ConcreteCommandPath.h> +#include <lib/core/CHIPEncoding.h> + +#include <platform/CHIPDeviceLayer.h> + +using namespace chip; +using namespace chip::app; +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::Thermostat; +using namespace chip::app::Clusters::Thermostat::Attributes; +using namespace chip::app::Clusters::Thermostat::Structs; + +using imcode = Protocols::InteractionModel::Status; + +// Object Tracking +static ThermostatMatterScheduleManager * gsMatterScheduleEditor = nullptr; + +void +ThermostatMatterScheduleManager::SetActiveInstance(ThermostatMatterScheduleManager * inManager) +{ + if (gsMatterScheduleEditor != nullptr) + { + if (gsMatterScheduleEditor->IsEditing()) + { + ChipLogError(Zcl, "Warning: Active ThermostatMatterScheduleManager was editing when swapped out"); + gsMatterScheduleEditor->RollbackEdits(); + } + } + gsMatterScheduleEditor = inManager; +} + +ThermostatMatterScheduleManager * ThermostatMatterScheduleManager::GetActiveInstance() +{ + return gsMatterScheduleEditor; +} + +bool +ThermostatMatterScheduleManager::areDescriptorsEqualAndValid(const Access::SubjectDescriptor &desc1, const Access::SubjectDescriptor &desc2) +{ + if (desc1.fabricIndex == kUndefinedFabricIndex || desc1.subject == kUndefinedNodeId) + return false; + if (desc2.fabricIndex == kUndefinedFabricIndex || desc2.subject == kUndefinedNodeId) + return false; + return ((desc1.fabricIndex == desc2.fabricIndex) && (desc1.subject == desc2.subject)); +} + +CHIP_ERROR +ThermostatMatterScheduleManager::PresetHandleChanged(chip::EndpointId aEndpoint) +{ + CHIP_ERROR retVal = CHIP_NO_ERROR; +#if 0 + imcode imStatus = imcode::InvalidCommand; + + chip::ByteSpan presetHandle; + PresetStruct::Type preset; + + imStatus = ActivePresetHandle::Get(aEndpoint, presetHandle); + retVal = StatusIB(imStatus).ToChipError(); + SuccessOrExit(retVal); + + retVal = GetPresetStructByHandle(aEndpoint, presetHandle, preset); + SuccessOrExit(retVal); + + // I think we will need this logic in another method since editing the active preset would also need this: + switch (preset.presetScenario) + { + case PresetScenarioEnum::kOccupied: + if (preset.coolingSetpoint.HasValue()) + OccupiedCoolingSetpoint::Set(aEndpoint, preset.coolingSetpoint.GetValue()); + if (preset.heatingSetpoint.HasValue()) + OccupiedHeatingSetpoint::Set(aEndpoint, preset.heatingSetpoint.GetValue()); + break; + case PresetScenarioEnum::kUnoccupied: + if (preset.coolingSetpoint.HasValue()) + UnoccupiedCoolingSetpoint::Set(aEndpoint, preset.coolingSetpoint.GetValue()); + if (preset.heatingSetpoint.HasValue()) + UnoccupiedHeatingSetpoint::Set(aEndpoint, preset.heatingSetpoint.GetValue()); + break; + } + +exit: +#endif + return retVal; +} + +CHIP_ERROR +ThermostatMatterScheduleManager::ScheduleHandleChanged(chip::EndpointId aEndpoint) +{ + return CHIP_NO_ERROR; +} + +CHIP_ERROR +ThermostatMatterScheduleManager::GetPresetStructByHandle(chip::EndpointId aEndpoint, const chip::ByteSpan &inHandle, PresetStruct::Type & outPreset) const +{ + return CHIP_NO_ERROR; +} + +CHIP_ERROR +ThermostatMatterScheduleManager::GetScheduleStructByHandle(chip::EndpointId aEndpoint, const chip::ByteSpan &inHandle, ScheduleStruct::Type & outSchedule) const +{ + return CHIP_NO_ERROR; +} diff --git a/src/app/clusters/thermostat-server/thermostat-preset-commit-validation.cpp b/src/app/clusters/thermostat-server/thermostat-preset-commit-validation.cpp new file mode 100644 index 00000000000000..4f9fc11c5846db --- /dev/null +++ b/src/app/clusters/thermostat-server/thermostat-preset-commit-validation.cpp @@ -0,0 +1,189 @@ + +#include "thermostat-server.h" +#include <app/util/attribute-storage.h> +#include <app-common/zap-generated/attributes/Accessors.h> +#include <app-common/zap-generated/callback.h> +#include <app-common/zap-generated/cluster-objects.h> +#include <app-common/zap-generated/ids/Attributes.h> +#include <app/CommandHandler.h> +#include <app/ConcreteAttributePath.h> +#include <app/ConcreteCommandPath.h> +#include <lib/core/CHIPEncoding.h> + +using namespace chip; +using namespace chip::app; +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::Thermostat; +using namespace chip::app::Clusters::Thermostat::Attributes; +using namespace chip::app::Clusters::Thermostat::Structs; + +using imcode = Protocols::InteractionModel::Status; + +static imcode FindPresetByHandle(const chip::ByteSpan & handle, const Span<PresetStruct::Type> & list, + PresetStruct::Type & outPreset) +{ + for (auto & preset : list) + { + if ((preset.presetHandle.IsNull() == false) && handle.data_equal(preset.presetHandle.Value())) + { + outPreset = preset; + return imcode::Success; + } + } + + return imcode::NotFound; +} + +static imcode CheckPresetHandleUnique(const chip::ByteSpan & handle, Span<PresetStruct::Type> & list) +{ + int count = 0; + for (auto & preset : list) + { + if ((preset.presetHandle.IsNull() == false) && handle.data_equal(preset.presetHandle.Value())) + { + if (count == 0) + { + count++; + } + else + { + return imcode::ConstraintError; + } + } + } + + return imcode::Success; +} + +static bool IsPresetHandleReferenced(ThermostatMatterScheduleManager & mgr, chip::EndpointId endpointId, const chip::ByteSpan & handle) +{ + imcode status = imcode::Success; + uint32_t ourFeatureMap; + FeatureMap::Get(endpointId, &ourFeatureMap); + const bool enhancedSchedulesSupported = ourFeatureMap & to_underlying(Feature::kMatterScheduleConfiguration); + + // Check Active Preset Handle + DataModel::Nullable<chip::MutableByteSpan> activePresetHandle; + status = ActivePresetHandle::Get(endpointId, activePresetHandle); + VerifyOrDie(status == imcode::Success); + if ((activePresetHandle.IsNull() == false) && activePresetHandle.Value().data_equal(handle)) + return true; + + // Check for the preset on the Schedules + if (enhancedSchedulesSupported) + { + size_t index = 0; + ScheduleStruct::Type schedule; + while (mgr.GetScheduleAtIndex(endpointId, index, schedule) != CHIP_ERROR_NOT_FOUND) + { + if (schedule.presetHandle.HasValue() && schedule.presetHandle.Value().data_equal(handle)) + return true; + + for (auto transition : schedule.transitions) + { + if (transition.presetHandle.HasValue() && transition.presetHandle.Value().data_equal(handle)) + return true; + } + index++; + } + } + + return false; +} + +static imcode CheckPresetType(ThermostatMatterScheduleManager & mgr, chip::EndpointId endpointId, PresetStruct::Type & preset) +{ + imcode status = imcode::ConstraintError; + size_t index = 0; + PresetTypeStruct::Type presetType; + + while (mgr.GetPresetTypeAtIndex(endpointId, index, presetType) != CHIP_ERROR_NOT_FOUND) + { + // look for the preset type that supports this scenario + if (presetType.presetScenario == preset.presetScenario) + { + // we have one, check the name requirements + if ((preset.name.HasValue() == true) && (preset.name.Value().IsNull() == false) && + (preset.name.Value().Value().empty() == false)) + { + const bool nameSupported = presetType.presetTypeFeatures.Has(PresetTypeFeaturesBitmap::kSupportsNames); + VerifyOrReturnError(nameSupported == true, imcode::ConstraintError); + } + + return imcode::Success; + } + index++; + } + + return status; +} + +imcode ThermostatMatterScheduleManager::ValidatePresetsForCommitting(chip::EndpointId endpointId, Span<PresetStruct::Type> & oldlist, + Span<PresetStruct::Type> & newlist) +{ + imcode status = imcode::Success; + PresetStruct::Type queryPreset; // preset storage used for queries. + + // Check that new_list can fit. + uint8_t numPresets; + status = NumberOfPresets::Get(endpointId, &numPresets); + SuccessOrExit(StatusIB(status).ToChipError()); + VerifyOrExit(newlist.size() <= numPresets, status = imcode::ResourceExhausted); + + // For all exisiting presets -- Walk the old list + for (auto & old_preset : oldlist) + { + VerifyOrDie(old_preset.presetHandle.IsNull() == false); + + // Check 1. -- for each existing built in preset, make sure it's still in the new list + if (old_preset.builtIn.IsNull() == false && old_preset.builtIn.Value()) + { + status = FindPresetByHandle(old_preset.presetHandle.Value(), newlist, queryPreset); + VerifyOrExit(status == imcode::Success, status = imcode::ConstraintError); + VerifyOrExit(queryPreset.builtIn.IsNull() == false, status = imcode::UnsupportedAccess); + VerifyOrExit(queryPreset.builtIn.Value() == true, status = imcode::UnsupportedAccess); + } + + // Check 2 and 3 and 4. -- If the preset is currently being referenced but would be deleted. + // if its a builtin preset we don't need to search again, we know it's there from the above check. + if ((old_preset.builtIn.IsNull() || old_preset.builtIn.Value() == false) && + IsPresetHandleReferenced(*this, endpointId, old_preset.presetHandle.Value())) + { + status = FindPresetByHandle(old_preset.presetHandle.Value(), newlist, queryPreset); + VerifyOrExit(status == imcode::Success, status = imcode::InvalidInState); + } + } + + // Walk the new list + for (auto & new_preset : newlist) + { + if (new_preset.presetHandle.IsNull() == false && new_preset.presetHandle.Value().empty() == false) + { + // Existing Preset checks + + // Make sure it's unique to the list + status = CheckPresetHandleUnique(new_preset.presetHandle.Value(), newlist); + SuccessOrExit(StatusIB(status).ToChipError()); + + // Look for it in the old list + PresetStruct::Type existingPreset; + status = FindPresetByHandle(new_preset.presetHandle.Value(), oldlist, existingPreset); + SuccessOrExit(StatusIB(status).ToChipError()); + + // Check BuiltIn + VerifyOrExit(new_preset.builtIn == existingPreset.builtIn, status = imcode::UnsupportedAccess); + } + else + { + // new preset checks + VerifyOrExit(new_preset.builtIn == false, status = imcode::ConstraintError); + } + + // Check for Preset Scenario in Preset Types and that the Name support is valid (3 and 4) + status = CheckPresetType(*this, endpointId, new_preset); + SuccessOrExit(StatusIB(status).ToChipError()); + } + +exit: + return status; +} diff --git a/src/app/clusters/thermostat-server/thermostat-schedule-commit-validation.cpp b/src/app/clusters/thermostat-server/thermostat-schedule-commit-validation.cpp new file mode 100644 index 00000000000000..0a49d3e0f3ccc4 --- /dev/null +++ b/src/app/clusters/thermostat-server/thermostat-schedule-commit-validation.cpp @@ -0,0 +1,247 @@ +#include "thermostat-server.h" +#include <app/util/attribute-storage.h> +#include <app-common/zap-generated/attributes/Accessors.h> +#include <app-common/zap-generated/callback.h> +#include <app-common/zap-generated/cluster-objects.h> +#include <app-common/zap-generated/ids/Attributes.h> +#include <app/CommandHandler.h> +#include <app/ConcreteAttributePath.h> +#include <app/ConcreteCommandPath.h> +#include <lib/core/CHIPEncoding.h> + +using namespace chip; +using namespace chip::app; +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::Thermostat; +using namespace chip::app::Clusters::Thermostat::Attributes; +using namespace chip::app::Clusters::Thermostat::Structs; + +using imcode = Protocols::InteractionModel::Status; + +static imcode FindScheduleByHandle(const chip::ByteSpan & handle, const Span<ScheduleStruct::Type> & list, + ScheduleStruct::Type & outSchedule) +{ + for (auto & schedule : list) + { + if ((schedule.scheduleHandle.IsNull() == false) && handle.data_equal(schedule.scheduleHandle.Value())) + { + outSchedule = schedule; + return imcode::Success; + } + } + + return imcode::NotFound; +} + +static imcode CheckScheduleHandleUnique(const chip::ByteSpan & handle, Span<ScheduleStruct::Type> & list) +{ + int count = 0; + for (auto & schedule : list) + { + if ((schedule.scheduleHandle.IsNull() == false) && handle.data_equal(schedule.scheduleHandle.Value())) + { + if (count == 0) + { + count++; + } + else + { + return imcode::ConstraintError; + } + } + } + + return imcode::Success; +} + +static bool IsScheduleHandleReferenced(ThermostatMatterScheduleManager & mgr, chip::EndpointId endpointId, const chip::ByteSpan & handle) +{ + imcode status = imcode::Success; + + // Check Active Preset Handle + DataModel::Nullable<chip::MutableByteSpan> activeScheduleHandle; + status = ActiveScheduleHandle::Get(endpointId, activeScheduleHandle); + VerifyOrDie(status == imcode::Success); + if ((activeScheduleHandle.IsNull() == false) && activeScheduleHandle.Value().data_equal(handle)) + return true; + + return false; +} + +static imcode CheckScheduleTypes(ThermostatMatterScheduleManager & mgr, chip::EndpointId endpointId, ScheduleStruct::Type & schedule, Span<PresetStruct::Type> & presetList) +{ + imcode status = imcode::ConstraintError; + size_t index = 0; + ScheduleTypeStruct::Type scheduleType; + + while (mgr.GetScheduleTypeAtIndex(endpointId, index, scheduleType) != CHIP_ERROR_NOT_FOUND) + { + // look for the schedule type that supports this scenario (check 3) + if (scheduleType.systemMode == schedule.systemMode) + { + // we have one, check the preset requirements (check 6) + if (schedule.presetHandle.HasValue() && schedule.presetHandle.Value().empty() == false) + { + const bool presetsSupported = scheduleType.scheduleTypeFeatures.Has(ScheduleTypeFeaturesBitmap::kSupportsPresets); + VerifyOrReturnError(presetsSupported == true, imcode::ConstraintError); + + // make sure the preset exists (check 7) + { + size_t preset_index = 0; + bool presetFound = false; + while (preset_index < presetList.size()) + { + auto &preset = presetList[preset_index]; + VerifyOrDie(preset.presetHandle.IsNull() == false); + if (preset.presetHandle.Value().data_equal(schedule.presetHandle.Value())) + { + presetFound = true; + break; + } + preset_index++; + } + VerifyOrReturnError(presetFound == true, imcode::ConstraintError); + } + } + + // Check the name requirements (check 8) + if (schedule.name.HasValue() == false && schedule.name.Value().empty() == false) + { + const bool nameSupported = scheduleType.scheduleTypeFeatures.Has(ScheduleTypeFeaturesBitmap::kSupportsNames); + VerifyOrReturnError(nameSupported == true, imcode::ConstraintError); + } + + // Check the off requirements (check 9) + if (schedule.systemMode == SystemModeEnum::kOff) + { + const bool offSupported = scheduleType.scheduleTypeFeatures.Has(ScheduleTypeFeaturesBitmap::kSupportsOff); + VerifyOrReturnError(offSupported == true, imcode::ConstraintError); + } + + return imcode::Success; + } + index++; + } + + return status; +} + +static imcode CheckNumberOfTransitions(ThermostatMatterScheduleManager & mgr, chip::EndpointId endpointId, ScheduleStruct::Type & schedule) +{ + imcode status = imcode::ConstraintError; + + // Check 4 + uint8_t numberOfScheduleTransitions; + DataModel::Nullable<uint8_t> numberOfScheduleTransitionsPerDay; + + status = NumberOfScheduleTransitions::Get(endpointId, &numberOfScheduleTransitions); + VerifyOrDie(status == imcode::Success); + VerifyOrExit(schedule.transitions.size() <= numberOfScheduleTransitions, status = imcode::ResourceExhausted); + + status = NumberOfScheduleTransitionPerDay::Get(endpointId, numberOfScheduleTransitionsPerDay); + VerifyOrDie(status == imcode::Success); + + if (numberOfScheduleTransitionsPerDay.IsNull() == false) + { + int weekDayTransitionCounts[7] = { 0 }; + + for (auto const &transition : schedule.transitions) + { + weekDayTransitionCounts[0] += transition.dayOfWeek.Has(ScheduleDayOfWeekBitmap::kSunday) ? 1 : 0; + weekDayTransitionCounts[1] += transition.dayOfWeek.Has(ScheduleDayOfWeekBitmap::kMonday) ? 1 : 0; + weekDayTransitionCounts[2] += transition.dayOfWeek.Has(ScheduleDayOfWeekBitmap::kTuesday) ? 1 : 0; + weekDayTransitionCounts[3] += transition.dayOfWeek.Has(ScheduleDayOfWeekBitmap::kWednesday) ? 1 : 0; + weekDayTransitionCounts[4] += transition.dayOfWeek.Has(ScheduleDayOfWeekBitmap::kThursday) ? 1 : 0; + weekDayTransitionCounts[5] += transition.dayOfWeek.Has(ScheduleDayOfWeekBitmap::kFriday) ? 1 : 0; + weekDayTransitionCounts[6] += transition.dayOfWeek.Has(ScheduleDayOfWeekBitmap::kSaturday) ? 1 : 0; + } + + for (int weekDayIndex = 0; weekDayIndex < 7; weekDayIndex++) + { + VerifyOrExit(weekDayTransitionCounts[weekDayIndex] <= numberOfScheduleTransitionsPerDay.Value(), + status = imcode::ResourceExhausted); + } + } + +exit: + return status; +} + +imcode ThermostatMatterScheduleManager::ValidateSchedulesForCommitting(chip::EndpointId endpointId, Span<ScheduleStruct::Type> & oldlist, + Span<ScheduleStruct::Type> & newlist, + Span<PresetStruct::Type> & presetlist) +{ + imcode status = imcode::Success; + ScheduleStruct::Type querySchedule; // manager storage used for queries. + + // Check that new_list can fit. + uint8_t numSchedules; + status = NumberOfSchedules::Get(endpointId, &numSchedules); + SuccessOrExit(StatusIB(status).ToChipError()); + VerifyOrExit(newlist.size() <= numSchedules, status = imcode::ResourceExhausted); + + // For all exisiting schedules -- Walk the old list + for (auto & old_schedule : oldlist) + { + VerifyOrDie(old_schedule.scheduleHandle.IsNull() == false); + + // Check 1. -- for each existing built in schedule, make sure it's still in the new list + if ((old_schedule.builtIn.IsNull() == false) && (old_schedule.builtIn.Value() == true)) + { + status = FindScheduleByHandle(old_schedule.scheduleHandle.Value(), newlist, querySchedule); + VerifyOrExit(status == imcode::Success, status = imcode::ConstraintError); + VerifyOrExit(querySchedule.builtIn.IsNull() == false, status = imcode::UnsupportedAccess); + VerifyOrExit(querySchedule.builtIn.Value() == true, status = imcode::UnsupportedAccess); + } + + // Check 2 -- If the schedule is currently being referenced but would be deleted. + // if its a builtin schedule we don't need to search again, we know it's there from the above check. + if ((old_schedule.builtIn.IsNull() == true || old_schedule.builtIn.Value() == false) && IsScheduleHandleReferenced(*this, endpointId, old_schedule.scheduleHandle.Value())) + { + VerifyOrDie(old_schedule.scheduleHandle.IsNull() == false); + status = FindScheduleByHandle(old_schedule.scheduleHandle.Value(), newlist, querySchedule); + VerifyOrExit(status == imcode::Success, status = imcode::InvalidInState); + } + } + + // Walk the new list + for (auto & new_schedule : newlist) + { + if (new_schedule.scheduleHandle.IsNull() == false) + { + // Existing schedule checks + + // Make sure it's unique to the list + status = CheckScheduleHandleUnique(new_schedule.scheduleHandle.Value(), newlist); + SuccessOrExit(StatusIB(status).ToChipError()); + + // Look for it in the old list + ScheduleStruct::Type existingSchedule; + status = FindScheduleByHandle(new_schedule.scheduleHandle.Value(), oldlist, existingSchedule); + SuccessOrExit(StatusIB(status).ToChipError()); + + // Check BuiltIn + VerifyOrExit(new_schedule.builtIn.IsNull() == existingSchedule.builtIn.IsNull(), status = imcode::UnsupportedAccess); + if (new_schedule.builtIn.IsNull() == false) + { + VerifyOrExit(new_schedule.builtIn.Value() == existingSchedule.builtIn.Value(), status = imcode::UnsupportedAccess); + } + } + else + { + // new schedule checks + VerifyOrExit((new_schedule.builtIn.IsNull() == true) || (new_schedule.builtIn.Value() == false), status = imcode::ConstraintError); + } + + // Check for system mode in Schedule Types + status = CheckScheduleTypes(*this, endpointId, new_schedule, presetlist); + SuccessOrExit(StatusIB(status).ToChipError()); + + // Make sure the number of transitions does not exceed our limits + status = CheckNumberOfTransitions(*this, endpointId, new_schedule); + SuccessOrExit(StatusIB(status).ToChipError()); + } + +exit: + return status; +} diff --git a/src/app/clusters/thermostat-server/thermostat-server.cpp b/src/app/clusters/thermostat-server/thermostat-server.cpp index c650a30c871989..440334f11ece8d 100644 --- a/src/app/clusters/thermostat-server/thermostat-server.cpp +++ b/src/app/clusters/thermostat-server/thermostat-server.cpp @@ -15,6 +15,7 @@ * limitations under the License. */ +#include "thermostat-server.h" #include <app/AttributeAccessInterfaceRegistry.h> #include <app/util/attribute-storage.h> @@ -27,11 +28,14 @@ #include <app/ConcreteCommandPath.h> #include <lib/core/CHIPEncoding.h> +#include <platform/CHIPDeviceLayer.h> + using namespace chip; using namespace chip::app; using namespace chip::app::Clusters; using namespace chip::app::Clusters::Thermostat; using namespace chip::app::Clusters::Thermostat::Attributes; +using namespace chip::app::Clusters::Thermostat::Structs; using imcode = Protocols::InteractionModel::Status; @@ -83,6 +87,8 @@ CHIP_ERROR ThermostatAttrAccess::Read(const ConcreteReadAttributePath & aPath, A uint32_t ourFeatureMap; bool localTemperatureNotExposedSupported = (FeatureMap::Get(aPath.mEndpointId, &ourFeatureMap) == imcode::Success) && ((ourFeatureMap & to_underlying(Feature::kLocalTemperatureNotExposed)) != 0); + const bool presetsSupported = ourFeatureMap & to_underlying(Feature::kPresets); + const bool enhancedSchedulesSupported = ourFeatureMap & to_underlying(Feature::kMatterScheduleConfiguration); switch (aPath.mAttributeId) { @@ -102,26 +108,106 @@ CHIP_ERROR ThermostatAttrAccess::Read(const ConcreteReadAttributePath & aPath, A StatusIB statusIB(status); return statusIB.ToChipError(); } - valueRemoteSensing.Clear(RemoteSensingBitmap::kLocalTemperature); + valueRemoteSensing.Clear(RemoteSensingBitmap::kLocalTemperature); // clear bit 1 (LocalTemperature RemoteSensing bit) return aEncoder.Encode(valueRemoteSensing); } break; - case PresetTypes::Id: { - return aEncoder.EncodeList([](const auto & encoder) -> CHIP_ERROR { return CHIP_NO_ERROR; }); - } - break; - case Presets::Id: { - return aEncoder.EncodeList([](const auto & encoder) -> CHIP_ERROR { return CHIP_NO_ERROR; }); - } - break; - case ScheduleTypes::Id: { - return aEncoder.EncodeList([](const auto & encoder) -> CHIP_ERROR { return CHIP_NO_ERROR; }); - } - break; - case Schedules::Id: { - return aEncoder.EncodeList([](const auto & encoder) -> CHIP_ERROR { return CHIP_NO_ERROR; }); - } - break; + case PresetTypes::Id: + if (presetsSupported) + { + ThermostatMatterScheduleManager * manager = ThermostatMatterScheduleManager::GetActiveInstance(); + if (manager == nullptr) + return CHIP_ERROR_NOT_IMPLEMENTED; + + return aEncoder.EncodeList([manager, aPath](const auto & encoder) -> CHIP_ERROR { + PresetTypeStruct::Type presetType; + size_t index = 0; + CHIP_ERROR err = CHIP_NO_ERROR; + while ((err = manager->GetPresetTypeAtIndex(aPath.mEndpointId, index, presetType)) == CHIP_NO_ERROR) + { + ReturnErrorOnFailure(encoder.Encode(presetType)); + index++; + } + if (err == CHIP_ERROR_NOT_FOUND) + { + return CHIP_NO_ERROR; + } + return err; + }); + } + break; + case Presets::Id: + if (presetsSupported) + { + ThermostatMatterScheduleManager * manager = ThermostatMatterScheduleManager::GetActiveInstance(); + if (manager == nullptr) + return CHIP_ERROR_NOT_IMPLEMENTED; + + return aEncoder.EncodeList([manager, aPath](const auto & encoder) -> CHIP_ERROR { + PresetStruct::Type preset; + size_t index = 0; + CHIP_ERROR err = CHIP_NO_ERROR; + while ((err = manager->GetPresetAtIndex(aPath.mEndpointId, index, preset)) == CHIP_NO_ERROR) + { + ReturnErrorOnFailure(encoder.Encode(preset)); + index++; + } + if (err == CHIP_ERROR_NOT_FOUND) + { + return CHIP_NO_ERROR; + } + return err; + }); + } + break; + case ScheduleTypes::Id: + if (enhancedSchedulesSupported) + { + ThermostatMatterScheduleManager * manager = ThermostatMatterScheduleManager::GetActiveInstance(); + if (manager == nullptr) + return CHIP_ERROR_NOT_IMPLEMENTED; + + return aEncoder.EncodeList([manager, aPath](const auto & encoder) -> CHIP_ERROR { + ScheduleTypeStruct::Type scheduleType; + size_t index = 0; + CHIP_ERROR err = CHIP_NO_ERROR; + while ((err = manager->GetScheduleTypeAtIndex(aPath.mEndpointId, index, scheduleType)) == CHIP_NO_ERROR) + { + ReturnErrorOnFailure(encoder.Encode(scheduleType)); + index++; + } + if (err == CHIP_ERROR_NOT_FOUND) + { + return CHIP_NO_ERROR; + } + return err; + }); + } + break; + case Schedules::Id: + if (enhancedSchedulesSupported) + { + ThermostatMatterScheduleManager * manager = ThermostatMatterScheduleManager::GetActiveInstance(); + if (manager == nullptr) + return CHIP_ERROR_NOT_IMPLEMENTED; + + return aEncoder.EncodeList([manager, aPath](const auto & encoder) -> CHIP_ERROR { + ScheduleStruct::Type schedule; + size_t index = 0; + CHIP_ERROR err = CHIP_NO_ERROR; + while ((err = manager->GetScheduleAtIndex(aPath.mEndpointId, index, schedule)) == CHIP_NO_ERROR) + { + ReturnErrorOnFailure(encoder.Encode(schedule)); + index++; + } + if (err == CHIP_ERROR_NOT_FOUND) + { + return CHIP_NO_ERROR; + } + return err; + }); + } + break; default: // return CHIP_NO_ERROR and just read from the attribute store in default break; } @@ -136,6 +222,8 @@ CHIP_ERROR ThermostatAttrAccess::Write(const ConcreteDataAttributePath & aPath, uint32_t ourFeatureMap; bool localTemperatureNotExposedSupported = (FeatureMap::Get(aPath.mEndpointId, &ourFeatureMap) == imcode::Success) && ((ourFeatureMap & to_underlying(Feature::kLocalTemperatureNotExposed)) != 0); + const bool presetsSupported = ourFeatureMap & to_underlying(Feature::kPresets); + const bool enhancedSchedulesSupported = ourFeatureMap & to_underlying(Feature::kMatterScheduleConfiguration); switch (aPath.mAttributeId) { @@ -154,12 +242,100 @@ CHIP_ERROR ThermostatAttrAccess::Write(const ConcreteDataAttributePath & aPath, } break; case Presets::Id: { - return CHIP_ERROR_NOT_IMPLEMENTED; + if (presetsSupported == false) + { + StatusIB statusIB(imcode::UnsupportedAttribute); + return statusIB.ToChipError(); + } + + ThermostatMatterScheduleManager * manager = ThermostatMatterScheduleManager::GetActiveInstance(); + if (manager == nullptr) + return CHIP_ERROR_NOT_IMPLEMENTED; + + bool currentlyEditing = manager->IsEditing(); + if (currentlyEditing == false) + { + StatusIB statusIB(imcode::InvalidInState); + return statusIB.ToChipError(); + } + + if (!(manager->IsActiveSubjectDescriptor(aPath.mEndpointId, aDecoder.GetSubjectDescriptor()))) + { + StatusIB statusIB(imcode::InvalidInState); + return statusIB.ToChipError(); + } + + if (!aPath.IsListItemOperation()) + { + // Replacing the entire list + DataModel::DecodableList<PresetStruct::DecodableType> list; + ReturnErrorOnFailure(aDecoder.Decode(list)); + ReturnErrorOnFailure(manager->ClearPresets(aPath.mEndpointId)); + auto iterator = list.begin(); + while (iterator.Next()) + { + ReturnErrorOnFailure(StatusIB(manager->AppendPreset(aPath.mEndpointId, iterator.GetValue())).ToChipError()); + } + } + else if (aPath.mListOp == ConcreteDataAttributePath::ListOperation::AppendItem) + { + PresetStruct::DecodableType decodableType; + ReturnErrorOnFailure(aDecoder.Decode(decodableType)); + ReturnErrorOnFailure(StatusIB(manager->AppendPreset(aPath.mEndpointId, decodableType)).ToChipError()); + } + else + { + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; + } } break; case Schedules::Id: { - return CHIP_ERROR_NOT_IMPLEMENTED; + if (enhancedSchedulesSupported == false) + { + StatusIB statusIB(imcode::UnsupportedAttribute); + return statusIB.ToChipError(); + } + + ThermostatMatterScheduleManager * manager = ThermostatMatterScheduleManager::GetActiveInstance(); + if (manager == nullptr) + return CHIP_ERROR_NOT_IMPLEMENTED; + + bool currentlyEditing = manager->IsEditing(); + if (currentlyEditing == false) + { + StatusIB statusIB(imcode::InvalidInState); + return statusIB.ToChipError(); + } + + if (!(manager->IsActiveSubjectDescriptor(aPath.mEndpointId, aDecoder.GetSubjectDescriptor()))) + { + StatusIB statusIB(imcode::InvalidInState); + return statusIB.ToChipError(); + } + + if (!aPath.IsListItemOperation()) + { + // Replacing the entire list + DataModel::DecodableList<ScheduleStruct::DecodableType> list; + ReturnErrorOnFailure(aDecoder.Decode(list)); + ReturnErrorOnFailure(manager->ClearSchedules(aPath.mEndpointId)); + auto iterator = list.begin(); + while (iterator.Next()) + { + ReturnErrorOnFailure(StatusIB(manager->AppendSchedule(aPath.mEndpointId, iterator.GetValue())).ToChipError()); + } + } + else if (aPath.mListOp == ConcreteDataAttributePath::ListOperation::AppendItem) + { + ScheduleStruct::DecodableType decodableType; + ReturnErrorOnFailure(aDecoder.Decode(decodableType)); + ReturnErrorOnFailure(StatusIB(manager->AppendSchedule(aPath.mEndpointId, decodableType)).ToChipError()); + } + else + { + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; + } } break; default: // return CHIP_NO_ERROR and just write to the attribute store in default @@ -484,54 +660,6 @@ bool emberAfThermostatClusterSetWeeklyScheduleCallback(app::CommandHandler * com return false; } -bool emberAfThermostatClusterSetActiveScheduleRequestCallback( - chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::Thermostat::Commands::SetActiveScheduleRequest::DecodableType & commandData) -{ - // TODO - return false; -} - -bool emberAfThermostatClusterSetActivePresetRequestCallback( - chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::Thermostat::Commands::SetActivePresetRequest::DecodableType & commandData) -{ - // TODO - return false; -} - -bool emberAfThermostatClusterStartPresetsSchedulesEditRequestCallback( - chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::Thermostat::Commands::StartPresetsSchedulesEditRequest::DecodableType & commandData) -{ - // TODO - return false; -} - -bool emberAfThermostatClusterCancelPresetsSchedulesEditRequestCallback( - chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::Thermostat::Commands::CancelPresetsSchedulesEditRequest::DecodableType & commandData) -{ - // TODO - return false; -} - -bool emberAfThermostatClusterCommitPresetsSchedulesRequestCallback( - chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::Thermostat::Commands::CommitPresetsSchedulesRequest::DecodableType & commandData) -{ - // TODO - return false; -} - -bool emberAfThermostatClusterSetTemperatureSetpointHoldPolicyCallback( - chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::Thermostat::Commands::SetTemperatureSetpointHoldPolicy::DecodableType & commandData) -{ - // TODO - return false; -} - int16_t EnforceHeatingSetpointLimits(int16_t HeatingSetpoint, EndpointId endpoint) { // Optional Mfg supplied limits @@ -910,6 +1038,229 @@ bool emberAfThermostatClusterSetpointRaiseLowerCallback(app::CommandHandler * co return true; } +static void onThermostatEditorTick(chip::System::Layer * systemLayer, void * appState) +{ + ThermostatMatterScheduleManager * manager = ThermostatMatterScheduleManager::GetActiveInstance(); + + // Compiler requires some shenanigans to get an Endpoint out of an void pointer. + uintptr_t uintptr = reinterpret_cast<uintptr_t>(appState); + chip::EndpointId endpoint = (uintptr & 0xFFFF); + + if (nullptr != manager) + { + if (manager->IsEditing(endpoint)) + { + manager->RollbackEdits(endpoint); + } + } +} + +// Edit/Cancel/Commit logic + +static bool StartEditRequest(chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + uint16_t timeout) +{ + imcode status = imcode::InvalidCommand; + bool currentlyEditing = false; + // compiler requires some shenanigans to point an endpoint in as the app state for a timer. + uintptr_t endpointAsAppstate = commandPath.mEndpointId; + + ThermostatMatterScheduleManager * manager = ThermostatMatterScheduleManager::GetActiveInstance(); + VerifyOrExit(manager != nullptr, status = imcode::InvalidCommand); + + currentlyEditing = manager->IsEditing(commandPath.mEndpointId); + + if (currentlyEditing && !(manager->IsActiveSubjectDescriptor(commandPath.mEndpointId, commandObj->GetSubjectDescriptor()))) + { + DeviceLayer::SystemLayer().ExtendTimerTo(System::Clock::Milliseconds16(timeout), onThermostatEditorTick, reinterpret_cast<void *>(endpointAsAppstate)); + } + else + { + VerifyOrExit(currentlyEditing == false, status = imcode::Busy); + + manager->StartEditing(commandPath.mEndpointId, commandObj->GetSubjectDescriptor()); + DeviceLayer::SystemLayer().StartTimer(System::Clock::Milliseconds16(timeout), onThermostatEditorTick, reinterpret_cast<void *>(endpointAsAppstate)); + } + +exit: + commandObj->AddStatus(commandPath, status); + return true; +} + +static bool CancelEditRequest(chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath) +{ + imcode status = imcode::InvalidCommand; + bool currentlyEditing = false; + // compiler requires some shenanigans to point an endpoint in as the app state for a timer. + uintptr_t endpointAsAppstate = commandPath.mEndpointId; + + ThermostatMatterScheduleManager * manager = ThermostatMatterScheduleManager::GetActiveInstance(); + VerifyOrExit(manager != nullptr, status = imcode::InvalidCommand); + + currentlyEditing = manager->IsEditing(commandPath.mEndpointId); + + if (currentlyEditing && !(manager->IsActiveSubjectDescriptor(commandPath.mEndpointId, commandObj->GetSubjectDescriptor()))) + { + status = imcode::UnsupportedAccess; + } + else + { + VerifyOrExit(currentlyEditing == true, status = imcode::InvalidInState); + + (void) chip::DeviceLayer::SystemLayer().CancelTimer(onThermostatEditorTick, reinterpret_cast<void *>(endpointAsAppstate)); + } + +exit: + commandObj->AddStatus(commandPath, status); + return true; +} + +static bool CommitEditRequest(chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath) +{ + imcode status = imcode::InvalidCommand; + bool currentlyEditing = false; + // compiler requires some shenanigans to point an endpoint in as the app state for a timer. + uintptr_t endpointAsAppstate = commandPath.mEndpointId; + + ThermostatMatterScheduleManager * manager = ThermostatMatterScheduleManager::GetActiveInstance(); + VerifyOrExit(manager != nullptr, status = imcode::InvalidCommand); + + currentlyEditing = manager->IsEditing(commandPath.mEndpointId); + if (currentlyEditing && !(manager->IsActiveSubjectDescriptor(commandPath.mEndpointId, commandObj->GetSubjectDescriptor()))) + { + status = imcode::UnsupportedAccess; + } + else + { + VerifyOrExit(currentlyEditing == true, status = imcode::InvalidInState); + + status = manager->CommitEdits(commandPath.mEndpointId); + SuccessOrExit(StatusIB(status).ToChipError()); + + (void) chip::DeviceLayer::SystemLayer().CancelTimer(onThermostatEditorTick, reinterpret_cast<void *>(endpointAsAppstate)); + } + +exit: + commandObj->AddStatus(commandPath, status); + return true; +} + +// Matter Commands + +bool emberAfThermostatClusterSetActiveScheduleRequestCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::Thermostat::Commands::SetActiveScheduleRequest::DecodableType & commandData) +{ + imcode status = imcode::InvalidCommand; + uint32_t ourFeatureMap; + bool enhancedSchedulesSupported = (FeatureMap::Get(commandPath.mEndpointId, &ourFeatureMap) == imcode::Success) && + ((ourFeatureMap & to_underlying(Feature::kMatterScheduleConfiguration)) != 0); + + if (enhancedSchedulesSupported) + { + ThermostatMatterScheduleManager * manager = ThermostatMatterScheduleManager::GetActiveInstance(); + VerifyOrExit(manager != nullptr, status = imcode::InvalidCommand); + + const chip::ByteSpan & scheduleHandle = commandData.scheduleHandle; + ScheduleStruct::Type schedule; + bool found = false; + size_t index = 0; + + while (manager->GetScheduleAtIndex(commandPath.mEndpointId, index, schedule) != CHIP_ERROR_NOT_FOUND) + { + if ((schedule.scheduleHandle.IsNull() == false) && scheduleHandle.data_equal(schedule.scheduleHandle.Value())) + { + status = ActiveScheduleHandle::Set(commandPath.mEndpointId, scheduleHandle); + SuccessOrExit(StatusIB(status).ToChipError()); + found = true; + break; + } + index++; + } + + VerifyOrExit(found == true, status = imcode::InvalidCommand); + } + +exit: + commandObj->AddStatus(commandPath, status); + return true; +} + +bool emberAfThermostatClusterSetActivePresetRequestCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::Thermostat::Commands::SetActivePresetRequest::DecodableType & commandData) +{ + imcode status = imcode::InvalidCommand; + uint32_t ourFeatureMap; + bool presetsSupported = (FeatureMap::Get(commandPath.mEndpointId, &ourFeatureMap) == imcode::Success) && + ((ourFeatureMap & to_underlying(Feature::kPresets)) != 0); + + if (presetsSupported) + { + ThermostatMatterScheduleManager * manager = ThermostatMatterScheduleManager::GetActiveInstance(); + VerifyOrExit(manager != nullptr, status = imcode::InvalidCommand); + + const chip::ByteSpan & presetHandle = commandData.presetHandle; + + PresetStruct::Type preset; + bool found = false; + size_t index = 0; + + while (manager->GetPresetAtIndex(commandPath.mEndpointId, index, preset) != CHIP_ERROR_NOT_FOUND) + { + VerifyOrDie(preset.presetHandle.IsNull() == false); + if (presetHandle.data_equal(preset.presetHandle.Value())) + { + status = ActivePresetHandle::Set(commandPath.mEndpointId, presetHandle); + SuccessOrExit(StatusIB(status).ToChipError()); + found = true; + break; + } + index++; + } + + VerifyOrExit(found == true, status = imcode::InvalidCommand); + } + +exit: + commandObj->AddStatus(commandPath, status); + return true; +} + +bool emberAfThermostatClusterAtomicRequestCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::Thermostat::Commands::AtomicRequest::DecodableType & commandData) +{ + uint32_t ourFeatureMap; + bool enhancedSchedulesSupported = (FeatureMap::Get(commandPath.mEndpointId, &ourFeatureMap) == imcode::Success) && + ((ourFeatureMap & to_underlying(Feature::kMatterScheduleConfiguration)) != 0); + bool presetsSupported = ((ourFeatureMap & to_underlying(Feature::kPresets)) != 0); + + if(enhancedSchedulesSupported || presetsSupported) + { + switch (commandData.requestType) + { + case AtomicRequestTypeEnum::kBeginWrite: + if (commandData.timeout.HasValue() == true) + return StartEditRequest(commandObj, commandPath, commandData.timeout.Value()); + break; + case AtomicRequestTypeEnum::kCommitWrite: + return CommitEditRequest(commandObj, commandPath); + break; + case AtomicRequestTypeEnum::kRollbackWrite: + return CancelEditRequest(commandObj, commandPath); + break; + default: + commandObj->AddStatus(commandPath, imcode::InvalidInState); + return true; + break; + } + } + + commandObj->AddStatus(commandPath, imcode::InvalidCommand); + return true; +} + void MatterThermostatPluginServerInitCallback() { registerAttributeAccessOverride(&gThermostatAttrAccess); diff --git a/src/app/clusters/thermostat-server/thermostat-server.h b/src/app/clusters/thermostat-server/thermostat-server.h new file mode 100644 index 00000000000000..01ee4bd770d20e --- /dev/null +++ b/src/app/clusters/thermostat-server/thermostat-server.h @@ -0,0 +1,79 @@ +/** + * + * Copyright (c) 2021 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include <app-common/zap-generated/cluster-objects.h> +#include <app/util/basic-types.h> +#include <transport/Session.h> + +#include <protocols/interaction_model/StatusCode.h> + +struct ThermostatMatterScheduleManager +{ + /** + * @brief Construct a new ThermostatMatterScheduleManager object * + */ + + // If the endpoint supports both editable presets and editable schedules + ThermostatMatterScheduleManager() {}; + virtual ~ThermostatMatterScheduleManager() {}; + + virtual bool IsEditing() = 0; // is any endpoint currently being edited? + virtual bool IsEditing(chip::EndpointId aEndpoint) = 0; + virtual CHIP_ERROR StartEditing(chip::EndpointId aEndpoint, const chip::Access::SubjectDescriptor &inDescriptor) = 0; + virtual bool IsActiveSubjectDescriptor(chip::EndpointId aEndpoint, const chip::Access::SubjectDescriptor &inDescriptor) = 0; + + virtual CHIP_ERROR RollbackEdits() = 0; // rollback all edits + virtual CHIP_ERROR RollbackEdits(chip::EndpointId aEndpoint) = 0; + + virtual chip::Protocols::InteractionModel::Status CommitEdits(chip::EndpointId aEndpoint) = 0; + + // presets + virtual CHIP_ERROR GetPresetTypeAtIndex(chip::EndpointId aEndpoint, size_t aIndex, chip::app::Clusters::Thermostat::Structs::PresetTypeStruct::Type & outPresetType) const { return CHIP_ERROR_NOT_IMPLEMENTED; } + virtual CHIP_ERROR GetPresetAtIndex(chip::EndpointId aEndpoint, size_t aIndex, chip::app::Clusters::Thermostat::Structs::PresetStruct::Type & outPreset) const { return CHIP_ERROR_NOT_IMPLEMENTED; } + virtual CHIP_ERROR ClearPresets(chip::EndpointId aEndpoint) { return CHIP_ERROR_NOT_IMPLEMENTED; } + virtual chip::Protocols::InteractionModel::Status AppendPreset(chip::EndpointId aEndpoint, const chip::app::Clusters::Thermostat::Structs::PresetStruct::DecodableType & preset) { return chip::Protocols::InteractionModel::Status::UnsupportedWrite; } + + // schedules + virtual CHIP_ERROR GetScheduleTypeAtIndex(chip::EndpointId aEndpoint, size_t index, chip::app::Clusters::Thermostat::Structs::ScheduleTypeStruct::Type & scheduleType) const { return CHIP_ERROR_NOT_IMPLEMENTED; } + virtual CHIP_ERROR GetScheduleAtIndex(chip::EndpointId aEndpoint, size_t index, chip::app::Clusters::Thermostat::Structs::ScheduleStruct::Type & schedule) const { return CHIP_ERROR_NOT_IMPLEMENTED; } + virtual CHIP_ERROR ClearSchedules(chip::EndpointId aEndpoint) { return CHIP_ERROR_NOT_IMPLEMENTED; } + virtual chip::Protocols::InteractionModel::Status AppendSchedule(chip::EndpointId aEndpoint, const chip::app::Clusters::Thermostat::Structs::ScheduleStruct::DecodableType & schedule) { return chip::Protocols::InteractionModel::Status::UnsupportedWrite; } + + // Default implmenetation provided that will do attribute writes as required by the spec once tha handle has changed. + // Override this with your own implementation if these writes are not necessary or will cause issues in your implemenation. + // Note: these are called by the thermostat server implementation on every write to the ActviePresetHandle and + // ActiveScheduleHandle attriutes. + virtual CHIP_ERROR PresetHandleChanged(chip::EndpointId aEndpoint); + virtual CHIP_ERROR ScheduleHandleChanged(chip::EndpointId aEndpoint); + + virtual CHIP_ERROR GetPresetStructByHandle(chip::EndpointId aEndpoint, const chip::ByteSpan &inHandle, chip::app::Clusters::Thermostat::Structs::PresetStruct::Type & outPreset) const; + virtual CHIP_ERROR GetScheduleStructByHandle(chip::EndpointId aEndpoint, const chip::ByteSpan &inHandle, chip::app::Clusters::Thermostat::Structs::ScheduleStruct::Type & outSchedule) const; + + static void SetActiveInstance(ThermostatMatterScheduleManager * inManager); + static ThermostatMatterScheduleManager * GetActiveInstance(); + + +protected: + chip::Protocols::InteractionModel::Status ValidatePresetsForCommitting(chip::EndpointId aEndpoint, chip::Span<chip::app::Clusters::Thermostat::Structs::PresetStruct::Type> & oldList, chip::Span<chip::app::Clusters::Thermostat::Structs::PresetStruct::Type> & newList); + chip::Protocols::InteractionModel::Status ValidateSchedulesForCommitting(chip::EndpointId aEndpoint, chip::Span<chip::app::Clusters::Thermostat::Structs::ScheduleStruct::Type> & oldList, + chip::Span<chip::app::Clusters::Thermostat::Structs::ScheduleStruct::Type> & newList, + chip::Span<chip::app::Clusters::Thermostat::Structs::PresetStruct::Type> & presetList); + + bool areDescriptorsEqualAndValid(const chip::Access::SubjectDescriptor &desc1, const chip::Access::SubjectDescriptor &desc2); +}; diff --git a/src/app/zap-templates/zcl/data-model/chip/occupancy-sensing-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/occupancy-sensing-cluster.xml index 23d1e5bb3948d6..4e2fbca5991b10 100644 --- a/src/app/zap-templates/zcl/data-model/chip/occupancy-sensing-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/occupancy-sensing-cluster.xml @@ -19,6 +19,7 @@ limitations under the License. <bitmap name="OccupancyBitmap" type="bitmap8"> <cluster code="0x0406"/> + <cluster code="0x0201"/> <field name="Occupied" mask="0x1"/> </bitmap> diff --git a/src/app/zap-templates/zcl/data-model/chip/thermostat-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/thermostat-cluster.xml index 796209999f1121..ec7c1259fe28ee 100644 --- a/src/app/zap-templates/zcl/data-model/chip/thermostat-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/thermostat-cluster.xml @@ -92,11 +92,12 @@ limitations under the License. <field name="SupportsNames" mask="0x02"/> </bitmap> - <bitmap name="TemperatureSetpointHoldPolicyBitmap" type="bitmap8"> + <enum name="AtomicRequestTypeEnum" type="enum8"> <cluster code="0x0201"/> - <field name="HoldDurationElapsed" mask="0x01"/> - <field name="HoldDurationElapsedOrPresetChanged" mask="0x02"/> - </bitmap> + <item name="BeginWrite" value="0x00"/> + <item name="CommitWrite" value="0x01"/> + <item name="RollbackWrite" value="0x02"/> + </enum> <enum name="SystemModeEnum" type="enum8"> <cluster code="0x0201"/> @@ -200,19 +201,25 @@ limitations under the License. <enum name="PresetScenarioEnum" type="enum8"> <cluster code="0x0201"/> - <item name="Unspecified" value="0x00"/> <item name="Occupied" value="0x01"/> <item name="Unoccupied" value="0x02"/> <item name="Sleep" value="0x03"/> <item name="Wake" value="0x04"/> <item name="Vacation" value="0x05"/> - <item name="UserDefined" value="0x06"/> + <item name="GoingToSleep" value="0x06"/> + <item name="UserDefined" value="0xFE"/> </enum> + <struct name="AtomicAttributeStatusStruct" apiMaturity="provisional"> + <cluster code="0x0201"/> + <item fieldId="0" name="AttributeID" type="attrib_id" optional="true"/> + <item fieldId="1" name="StatusCode" type="status" optional="true"/> + </struct> + <struct name="WeeklyScheduleTransitionStruct"> <cluster code="0x0201"/> <!-- See https://github.com/CHIP-Specifications/connectedhomeip-spec/issues/6217 for HeatSetpoint and CoolSetpoint. They might end up being nullable. --> - <item fieldId="0" name="TransitionTime" type="int16u" min="0" max="1439"/> + <item fieldId="0" name="TransitionTime" type="int16u" max="1439"/> <item fieldId="1" name="HeatSetpoint" type="temperature" isNullable="true"/> <item fieldId="2" name="CoolSetpoint" type="temperature" isNullable="true"/> </struct> @@ -224,20 +231,19 @@ limitations under the License. <item fieldId="2" name="ScheduleTypeFeatures" type="ScheduleTypeFeaturesBitmap" min="0x0" max="0xF" default="0"/> </struct> - <struct name="PresetStruct" apiMaturity="provisional"> <cluster code="0x0201"/> <item fieldId="0" name="PresetHandle" type="octet_string" length="16" isNullable="true"/> - <item fieldId="1" name="PresetScenario" type="PresetScenarioEnum" min="0x0" max="0x6"/> + <item fieldId="1" name="PresetScenario" type="PresetScenarioEnum" min="0x0" max="0xFE"/> <item fieldId="2" name="Name" type="char_string" length="64" isNullable="true" optional="true"/> <item fieldId="3" name="CoolingSetpoint" type="temperature" optional="true" default="0x0A28"/> <item fieldId="4" name="HeatingSetpoint" type="temperature" optional="true" default="0x07D0"/> - <item fieldId="5" name="BuiltIn" type="boolean" isNullable="true"/> + <item fieldId="5" name="BuiltIn" type="boolean" isNullable="true" default="0"/> </struct> <struct name="PresetTypeStruct" apiMaturity="provisional"> <cluster code="0x0201"/> - <item fieldId="0" name="PresetScenario" type="PresetScenarioEnum" min="0x0" max="0x6"/> + <item fieldId="0" name="PresetScenario" type="PresetScenarioEnum" min="0x0" max="0xFE"/> <item fieldId="1" name="NumberOfPresets" type="int8u" default="0"/> <item fieldId="2" name="PresetTypeFeatures" type="PresetTypeFeaturesBitmap" min="0x0" max="0x3" default="0"/> </struct> @@ -249,7 +255,7 @@ limitations under the License. <item fieldId="2" name="Name" type="char_string" length="64" optional="true"/> <item fieldId="3" name="PresetHandle" type="octet_string" length="16" optional="true"/> <item fieldId="4" name="Transitions" array="true" type="ScheduleTransitionStruct" minLength="1"/> - <item fieldId="5" name="BuiltIn" type="boolean" isNullable="true" optional="true"/> + <item fieldId="5" name="BuiltIn" type="boolean" isNullable="true" default="0"/> </struct> <struct name="ScheduleTransitionStruct" apiMaturity="provisional"> @@ -270,15 +276,14 @@ limitations under the License. <define>THERMOSTAT_CLUSTER</define> <client tick="false" init="false">true</client> <server tick="false" init="false">true</server> - <globalAttribute side="either" code="0xFFFD" value="6"/> - + <globalAttribute side="either" code="0xFFFD" value="7"/> <features> <feature bit="0" code="HEAT" name="Heating" summary="Thermostat is capable of managing a heating device"> <otherwiseConform> <mandatoryConform> <feature name="AUTO"/> </mandatoryConform> - <optionalConform choice="a" more="true"/> + <optionalConform choice="a" more="true" min="1"/> </otherwiseConform> </feature> <feature bit="1" code="COOL" name="Cooling" summary="Thermostat is capable of managing a cooling device"> @@ -286,7 +291,7 @@ limitations under the License. <mandatoryConform> <feature name="AUTO"/> </mandatoryConform> - <optionalConform choice="a" more="true"/> + <optionalConform choice="a" more="true" min="1"/> </otherwiseConform> </feature> <feature bit="2" code="OCC" name="Occupancy" summary="Supports Occupied and Unoccupied setpoints"> @@ -309,55 +314,48 @@ limitations under the License. <feature bit="6" code="LTNE" name="LocalTemperatureNotExposed" summary="Thermostat does not expose the LocalTemperature Value in the LocalTemperature attribute"> <optionalConform/> </feature> - <feature bit="7" code="MSC" name="MatterScheduleConfiguration" summary="MatterScheduleConfiguration"> + <feature bit="7" code="MSCH" name="MatterScheduleConfiguration" summary="Supports enhanced schedules"> <optionalConform/> </feature> - <feature bit="8" code="P" name="Presets" summary="Presets"> - <optionalConform/> - </feature> - <feature bit="9" code="S" name="Setpoints" summary="Setpoints"> + <feature bit="8" code="PRES" name="Presets" summary="Thermostat supports setpoint presets"> <optionalConform/> </feature> </features> - <!-- Attributes --> - - <attribute side="server" code="0x0000" define="LOCAL_TEMPERATURE" type="temperature" writable="false" reportable="true" optional="false" isNullable="true">LocalTemperature</attribute> - <attribute side="server" code="0x0001" define="OUTDOOR_TEMPERATURE" type="temperature" writable="false" optional="true" isNullable="true">OutdoorTemperature</attribute> - <attribute side="server" code="0x0002" define="THERMOSTAT_OCCUPANCY" type="bitmap8" writable="false" default="1" optional="true">Occupancy</attribute> - - <attribute side="server" code="0x0003" define="ABS_MIN_HEAT_SETPOINT_LIMIT" type="temperature" writable="false" default="700" optional="true">AbsMinHeatSetpointLimit</attribute> - <attribute side="server" code="0x0004" define="ABS_MAX_HEAT_SETPOINT_LIMIT" type="temperature" writable="false" default="3000" optional="true">AbsMaxHeatSetpointLimit</attribute> - <attribute side="server" code="0x0005" define="ABS_MIN_COOL_SETPOINT_LIMIT" type="temperature" writable="false" default="1600" optional="true">AbsMinCoolSetpointLimit</attribute> - <attribute side="server" code="0x0006" define="ABS_MAX_COOL_SETPOINT_LIMIT" type="temperature" writable="false" default="3200" optional="true">AbsMaxCoolSetpointLimit</attribute> - <attribute side="server" code="0x0007" define="PI_COOLING_DEMAND" type="int8u" min="0" max="100" writable="false" reportable="true" optional="true">PICoolingDemand</attribute> - <attribute side="server" code="0x0008" define="PI_HEATING_DEMAND" type="int8u" min="0" max="100" writable="false" reportable="true" optional="true">PIHeatingDemand</attribute> - <attribute side="server" code="0x0009" define="HVAC_SYSTEM_TYPE_CONFIGURATION" type="bitmap8" min="0x00" max="0xFF" writable="true" optional="true"> + <attribute side="server" code="0x0000" define="LOCAL_TEMPERATURE" type="temperature" reportable="true" isNullable="true">LocalTemperature</attribute> + <attribute side="server" code="0x0001" define="OUTDOOR_TEMPERATURE" type="temperature" optional="true" isNullable="true">OutdoorTemperature</attribute> + <attribute side="server" code="0x0002" define="THERMOSTAT_OCCUPANCY" type="OccupancyBitmap" default="1" optional="true" min="0x00" max="0x01">Occupancy</attribute> + <attribute side="server" code="0x0003" define="ABS_MIN_HEAT_SETPOINT_LIMIT" type="temperature" default="700" optional="true">AbsMinHeatSetpointLimit</attribute> + <attribute side="server" code="0x0004" define="ABS_MAX_HEAT_SETPOINT_LIMIT" type="temperature" default="3000" optional="true">AbsMaxHeatSetpointLimit</attribute> + <attribute side="server" code="0x0005" define="ABS_MIN_COOL_SETPOINT_LIMIT" type="temperature" default="1600" optional="true">AbsMinCoolSetpointLimit</attribute> + <attribute side="server" code="0x0006" define="ABS_MAX_COOL_SETPOINT_LIMIT" type="temperature" default="3200" optional="true">AbsMaxCoolSetpointLimit</attribute> + <attribute side="server" code="0x0007" define="PI_COOLING_DEMAND" type="int8u" min="0" max="100" reportable="true" optional="true">PICoolingDemand</attribute> + <attribute side="server" code="0x0008" define="PI_HEATING_DEMAND" type="int8u" min="0" max="100" reportable="true" optional="true">PIHeatingDemand</attribute> + <attribute side="server" code="0x0009" define="HVAC_SYSTEM_TYPE_CONFIGURATION" type="HVACSystemTypeBitmap" min="0x00" max="0x3F" writable="true" optional="true" default="0x00"> <description>HVACSystemTypeConfiguration</description> - <access op="read" privilege="view"/> <access op="write" privilege="manage"/> </attribute> <attribute side="server" code="0x0010" define="LOCAL_TEMPERATURE_CALIBRATION" type="int8s" min="-127" max="127" writable="true" default="0x00" optional="true"> <description>LocalTemperatureCalibration</description> <access op="write" privilege="manage"/> </attribute> - <attribute side="server" code="0x0011" define="OCCUPIED_COOLING_SETPOINT" type="int16s" min="-27315" max="0x7FFF" writable="true" default="2600" optional="true">OccupiedCoolingSetpoint</attribute> - <attribute side="server" code="0x0012" define="OCCUPIED_HEATING_SETPOINT" type="int16s" min="-27315" max="0x7FFF" writable="true" default="2000" optional="true">OccupiedHeatingSetpoint</attribute> - <attribute side="server" code="0x0013" define="UNOCCUPIED_COOLING_SETPOINT" type="int16s" min="-27315" max="0x7FFF" writable="true" default="2600" optional="true">UnoccupiedCoolingSetpoint</attribute> - <attribute side="server" code="0x0014" define="UNOCCUPIED_HEATING_SETPOINT" type="int16s" min="-27315" max="0x7FFF" writable="true" default="2000" optional="true">UnoccupiedHeatingSetpoint</attribute> - <attribute side="server" code="0x0015" define="MIN_HEAT_SETPOINT_LIMIT" type="int16s" min="-27315" max="0x7FFF" writable="true" default="700" optional="true"> + <attribute side="server" code="0x0011" define="OCCUPIED_COOLING_SETPOINT" type="temperature" min="-27315" max="0x7FFF" writable="true" default="2600" optional="true">OccupiedCoolingSetpoint</attribute> + <attribute side="server" code="0x0012" define="OCCUPIED_HEATING_SETPOINT" type="temperature" min="-27315" max="0x7FFF" writable="true" default="2000" optional="true">OccupiedHeatingSetpoint</attribute> + <attribute side="server" code="0x0013" define="UNOCCUPIED_COOLING_SETPOINT" type="temperature" min="-27315" max="0x7FFF" writable="true" default="2600" optional="true">UnoccupiedCoolingSetpoint</attribute> + <attribute side="server" code="0x0014" define="UNOCCUPIED_HEATING_SETPOINT" type="temperature" min="-27315" max="0x7FFF" writable="true" default="2000" optional="true">UnoccupiedHeatingSetpoint</attribute> + <attribute side="server" code="0x0015" define="MIN_HEAT_SETPOINT_LIMIT" type="temperature" min="-27315" max="0x7FFF" writable="true" default="700" optional="true"> <description>MinHeatSetpointLimit</description> <access op="write" privilege="manage"/> </attribute> - <attribute side="server" code="0x0016" define="MAX_HEAT_SETPOINT_LIMIT" type="int16s" min="-27315" max="0x7FFF" writable="true" default="3000" optional="true"> + <attribute side="server" code="0x0016" define="MAX_HEAT_SETPOINT_LIMIT" type="temperature" min="-27315" max="0x7FFF" writable="true" default="3000" optional="true"> <description>MaxHeatSetpointLimit</description> <access op="write" privilege="manage"/> </attribute> - <attribute side="server" code="0x0017" define="MIN_COOL_SETPOINT_LIMIT" type="int16s" min="-27315" max="0x7FFF" writable="true" default="1600" optional="true"> + <attribute side="server" code="0x0017" define="MIN_COOL_SETPOINT_LIMIT" type="temperature" min="-27315" max="0x7FFF" writable="true" default="1600" optional="true"> <description>MinCoolSetpointLimit</description> <access op="write" privilege="manage"/> </attribute> - <attribute side="server" code="0x0018" define="MAX_COOL_SETPOINT_LIMIT" type="int16s" min="-27315" max="0x7FFF" writable="true" default="3200" optional="true"> + <attribute side="server" code="0x0018" define="MAX_COOL_SETPOINT_LIMIT" type="temperature" min="-27315" max="0x7FFF" writable="true" default="3200" optional="true"> <description>MaxCoolSetpointLimit</description> <access op="write" privilege="manage"/> </attribute> @@ -369,23 +367,23 @@ limitations under the License. <description>RemoteSensing</description> <access op="write" privilege="manage"/> </attribute> - <attribute side="server" code="0x001B" define="CONTROL_SEQUENCE_OF_OPERATION" type="ControlSequenceOfOperationEnum" min="0x0" max="0x5" writable="true" default="4" optional="false"> + <attribute side="server" code="0x001B" define="CONTROL_SEQUENCE_OF_OPERATION" type="ControlSequenceOfOperationEnum" min="0x0" max="0x5" writable="true" default="4"> <description>ControlSequenceOfOperation</description> <access op="write" privilege="manage"/> </attribute> - <attribute side="server" code="0x001C" define="SYSTEM_MODE" type="SystemModeEnum" min="0x0" max="0x9" writable="true" default="1" optional="false"> + <attribute side="server" code="0x001C" define="SYSTEM_MODE" type="SystemModeEnum" min="0x0" max="0x9" writable="true" default="1"> <description>SystemMode</description> <access op="write" privilege="manage"/> </attribute> - <attribute side="server" code="0x001E" define="THERMOSTAT_RUNNING_MODE" type="ThermostatRunningModeEnum" min="0x0" max="0x4" writable="false" optional="true" default="0">ThermostatRunningMode</attribute> - <attribute side="server" code="0x0020" define="START_OF_WEEK" type="StartOfWeekEnum" min="0x0" max="0x6" writable="false" optional="true">StartOfWeek</attribute> - <attribute side="server" code="0x0021" define="NUMBER_OF_WEEKLY_TRANSITIONS" type="int8u" writable="false" optional="true" default="0">NumberOfWeeklyTransitions</attribute> - <attribute side="server" code="0x0022" define="NUMBER_OF_DAILY_TRANSITIONS" type="int8u" writable="false" optional="true" default="0">NumberOfDailyTransitions</attribute> + <attribute side="server" code="0x001E" define="THERMOSTAT_RUNNING_MODE" type="ThermostatRunningModeEnum" min="0x0" max="0x4" optional="true" default="0">ThermostatRunningMode</attribute> + <attribute side="server" code="0x0020" define="START_OF_WEEK" type="StartOfWeekEnum" min="0x0" max="0x6" optional="true">StartOfWeek</attribute> + <attribute side="server" code="0x0021" define="NUMBER_OF_WEEKLY_TRANSITIONS" type="int8u" optional="true" default="0">NumberOfWeeklyTransitions</attribute> + <attribute side="server" code="0x0022" define="NUMBER_OF_DAILY_TRANSITIONS" type="int8u" optional="true" default="0">NumberOfDailyTransitions</attribute> <attribute side="server" code="0x0023" define="TEMPERATURE_SETPOINT_HOLD" type="TemperatureSetpointHoldEnum" min="0x0" max="0x1" writable="true" default="0" optional="true"> <description>TemperatureSetpointHold</description> <access op="write" privilege="manage"/> </attribute> - <attribute side="server" code="0x0024" define="TEMPERATURE_SETPOINT_HOLD_DURATION" type="int16u" min="0" max="1440" writable="true" default="0xFFFF" optional="true" isNullable="true"> + <attribute side="server" code="0x0024" define="TEMPERATURE_SETPOINT_HOLD_DURATION" type="int16u" max="1440" writable="true" optional="true" isNullable="true"> <description>TemperatureSetpointHoldDuration</description> <access op="write" privilege="manage"/> </attribute> @@ -393,23 +391,23 @@ limitations under the License. <description>ThermostatProgrammingOperationMode</description> <access op="write" privilege="manage"/> </attribute> - <attribute side="server" code="0x0029" define="THERMOSTAT_RUNNING_STATE" type="RelayStateBitmap" writable="false" optional="true" min="0x0" max="0x7F">ThermostatRunningState</attribute> - <attribute side="server" code="0x0030" define="SETPOINT_CHANGE_SOURCE" type="SetpointChangeSourceEnum" writable="false" optional="true" default="0" min="0x0" max="0x2">SetpointChangeSource</attribute> - <attribute side="server" code="0x0031" define="SETPOINT_CHANGE_AMOUNT" type="int16s" writable="false" default="0x8000" optional="true" isNullable="true">SetpointChangeAmount</attribute> - <attribute side="server" code="0x0032" define="SETPOINT_CHANGE_SOURCE_TIMESTAMP" type="epoch_s" writable="false" optional="true">SetpointChangeSourceTimestamp</attribute> - <attribute side="server" code="0x0034" define="OCCUPIED_SETBACK" type="int8u" writable="true" optional="true" isNullable="true"> + <attribute side="server" code="0x0029" define="THERMOSTAT_RUNNING_STATE" type="RelayStateBitmap" optional="true" min="0x0" max="0x7F">ThermostatRunningState</attribute> + <attribute side="server" code="0x0030" define="SETPOINT_CHANGE_SOURCE" type="SetpointChangeSourceEnum" optional="true" default="0" min="0x0" max="0x2">SetpointChangeSource</attribute> + <attribute side="server" code="0x0031" define="SETPOINT_CHANGE_AMOUNT" type="int16s" optional="true" isNullable="true">SetpointChangeAmount</attribute> + <attribute side="server" code="0x0032" define="SETPOINT_CHANGE_SOURCE_TIMESTAMP" type="epoch_s" optional="true" default="0">SetpointChangeSourceTimestamp</attribute> + <attribute side="server" code="0x0034" define="OCCUPIED_SETBACK" type="int8u" writable="true" optional="true" isNullable="true" max="254"> <description>OccupiedSetback</description> <access op="write" privilege="manage"/> </attribute> - <attribute side="server" code="0x0035" define="OCCUPIED_SETBACK_MIN" type="int8u" writable="false" optional="true" isNullable="true">OccupiedSetbackMin</attribute> - <attribute side="server" code="0x0036" define="OCCUPIED_SETBACK_MAX" type="int8u" writable="false" optional="true" isNullable="true">OccupiedSetbackMax</attribute> - <attribute side="server" code="0x0037" define="UNOCCUPIED_SETBACK" type="int8u" writable="true" optional="true" isNullable="true"> + <attribute side="server" code="0x0035" define="OCCUPIED_SETBACK_MIN" type="int8u" optional="true" isNullable="true" max="254">OccupiedSetbackMin</attribute> + <attribute side="server" code="0x0036" define="OCCUPIED_SETBACK_MAX" type="int8u" optional="true" isNullable="true" max="254">OccupiedSetbackMax</attribute> + <attribute side="server" code="0x0037" define="UNOCCUPIED_SETBACK" type="int8u" writable="true" optional="true" isNullable="true" max="254"> <description>UnoccupiedSetback</description> <access op="write" privilege="manage"/> </attribute> - <attribute side="server" code="0x0038" define="UNOCCUPIED_SETBACK_MIN" type="int8u" writable="false" optional="true" isNullable="true">UnoccupiedSetbackMin</attribute> - <attribute side="server" code="0x0039" define="UNOCCUPIED_SETBACK_MAX" type="int8u" writable="false" optional="true" isNullable="true">UnoccupiedSetbackMax</attribute> - <attribute side="server" code="0x003A" define="EMERGENCY_HEAT_DELTA" type="int8u" writable="true" optional="true" default="0xFF"> + <attribute side="server" code="0x0038" define="UNOCCUPIED_SETBACK_MIN" type="int8u" optional="true" isNullable="true" max="254">UnoccupiedSetbackMin</attribute> + <attribute side="server" code="0x0039" define="UNOCCUPIED_SETBACK_MAX" type="int8u" optional="true" isNullable="true" max="254">UnoccupiedSetbackMax</attribute> + <attribute side="server" code="0x003A" define="EMERGENCY_HEAT_DELTA" type="int8u" writable="true" optional="true" default="0xFF" min="0" max="255"> <description>EmergencyHeatDelta</description> <access op="write" privilege="manage"/> </attribute> @@ -417,7 +415,7 @@ limitations under the License. <description>ACType</description> <access op="write" privilege="manage"/> </attribute> - <attribute side="server" code="0x0041" define="AC_CAPACITY" type="int16u" writable="true" default="0" optional="true"> + <attribute side="server" code="0x0041" define="AC_CAPACITY" type="int16u" writable="true" default="0" optional="true" max="65535"> <description>ACCapacity</description> <access op="write" privilege="manage"/> </attribute> @@ -429,7 +427,7 @@ limitations under the License. <description>ACCompressorType</description> <access op="write" privilege="manage"/> </attribute> - <attribute side="server" code="0x0044" define="AC_ERROR_CODE" type="ACErrorCodeBitmap" min="0x0" max="0x1F" writable="true" default="0" optional="true"> + <attribute side="server" code="0x0044" define="AC_ERROR_CODE" type="ACErrorCodeBitmap" writable="true" default="0" optional="true"> <description>ACErrorCode</description> <access op="write" privilege="manage"/> </attribute> @@ -437,98 +435,88 @@ limitations under the License. <description>ACLouverPosition</description> <access op="write" privilege="manage"/> </attribute> - <attribute side="server" code="0x0046" define="AC_COIL_TEMPERATURE" type="temperature" writable="false" default="0x8000" optional="true" isNullable="true">ACCoilTemperature</attribute> - <attribute side="server" code="0x0047" define="AC_CAPACITY_FORMAT" type="ACCapacityFormatEnum" min="0x00" max="0xFF" writable="true" default="0" optional="true"> - <description>ACCapacityformat</description> + <attribute side="server" code="0x0046" define="AC_COIL_TEMPERATURE" type="temperature" optional="true" isNullable="true">ACCoilTemperature</attribute> + <attribute side="server" code="0x0047" define="AC_CAPACITY_FORMAT" type="ACCapacityFormatEnum" min="0x00" max="0x00" writable="true" default="0" optional="true"> + <description>ACCapacityFormat</description> <access op="write" privilege="manage"/> </attribute> - <attribute code="0x0048" side="server" type="ARRAY" entryType="PresetTypeStruct" define="PRESET_TYPES" writable="false" optional="true">PresetTypes</attribute> - <attribute code="0x0049" side="server" type="ARRAY" entryType="ScheduleTypeStruct" define="SCHEDULE_TYPES" writable="false" optional="true">ScheduleTypes</attribute> - <attribute code="0x004A" side="server" type="int8u" define="NUMBER_OF_PRESETS" default="0" writable="false" optional="true">NumberOfPresets</attribute> - <attribute code="0x004B" side="server" type="int8u" define="NUMBER_OF_SCHEDULES" default="0" writable="false" optional="true">NumberOfSchedules</attribute> - <attribute code="0x004C" side="server" type="int8u" define="NUMBER_OF_SCHEDULE_TRANSITIONS" default="0" writable="false" optional="true">NumberOfScheduleTransitions</attribute> - <attribute code="0x004D" side="server" type="int8u" define="NUMBER_OF_SCHEDULE_TRANSITION_PER_DAY" isNullable="true" writable="false" optional="true">NumberOfScheduleTransitionPerDay</attribute> - <attribute code="0x004E" side="server" type="octet_string" define="ACTIVE_PRESET_HANDLE" isNullable="true" length="16" writable="false" optional="true">ActivePresetHandle</attribute> - <attribute code="0x004F" side="server" type="octet_string" define="ACTIVE_SCHEDULE_HANDLE" isNullable="true" length="16" writable="false" optional="true">ActiveScheduleHandle</attribute> - <attribute code="0x0050" side="server" type="ARRAY" entryType="PresetStruct" define="PRESETS" writable="true" optional="true"> + <attribute code="0x0048" side="server" type="array" entryType="PresetTypeStruct" define="PRESET_TYPES" optional="true">PresetTypes</attribute> + <attribute code="0x0049" side="server" type="array" entryType="ScheduleTypeStruct" define="SCHEDULE_TYPES" optional="true">ScheduleTypes</attribute> + <attribute code="0x004A" side="server" type="int8u" define="NUMBER_OF_PRESETS" default="0" optional="true">NumberOfPresets</attribute> + <attribute code="0x004B" side="server" type="int8u" define="NUMBER_OF_SCHEDULES" default="0" optional="true">NumberOfSchedules</attribute> + <attribute code="0x004C" side="server" type="int8u" define="NUMBER_OF_SCHEDULE_TRANSITIONS" default="0" optional="true">NumberOfScheduleTransitions</attribute> + <attribute code="0x004D" side="server" type="int8u" define="NUMBER_OF_SCHEDULE_TRANSITION_PER_DAY" isNullable="true" optional="true">NumberOfScheduleTransitionPerDay</attribute> + <attribute code="0x004E" side="server" type="octet_string" define="ACTIVE_PRESET_HANDLE" isNullable="true" length="16" optional="true">ActivePresetHandle</attribute> + <attribute code="0x004F" side="server" type="octet_string" define="ACTIVE_SCHEDULE_HANDLE" isNullable="true" length="16" optional="true">ActiveScheduleHandle</attribute> + <attribute code="0x0050" side="server" type="array" entryType="PresetStruct" define="PRESETS" writable="true" optional="true" mustUseAtomicWrite="true"> <description>Presets</description> <access op="write" privilege="manage"/> </attribute> - <attribute code="0x0051" side="server" type="ARRAY" entryType="ScheduleStruct" define="SCHEDULES" writable="true" optional="true"> + <attribute code="0x0051" side="server" type="array" entryType="ScheduleStruct" define="SCHEDULES" writable="true" optional="true" mustUseAtomicWrite="true"> <description>Schedules</description> <access op="write" privilege="manage"/> </attribute> - <attribute code="0x0052" side="server" type="boolean" define="PRESETS_SCHEDULES_EDITABLE" writable="false" optional="true">PresetsSchedulesEditable</attribute> - <attribute code="0x0053" side="server" type="TemperatureSetpointHoldPolicyBitmap" define="TEMPERATURE_SETPOINT_HOLD_POLICY" default="0" writable="false" optional="true" min="0x0" max="0x3">TemperatureSetpointHoldPolicy</attribute> - <attribute code="0x0054" side="server" type="epoch_s" define="SETPOINT_HOLD_EXPIRY_TIMESTAMP" isNullable="true" writable="false" optional="true">SetpointHoldExpiryTimestamp</attribute> - + <attribute code="0x0052" side="server" type="epoch_s" define="PRESETS_SCHEDULES_EDITABLE" optional="true" isNullable="true">SetpointHoldExpiryTimestamp</attribute> <!-- Client Commands --> - <command source="client" code="0x00" name="SetpointRaiseLower" optional="false"> - <description> - Command description for SetpointRaiseLower - </description> - <arg name="Mode" type="SetpointRaiseLowerModeEnum" min="0x0" max="0x2"/> - <arg name="Amount" type="int8s"/> + <description>Upon receipt, the attributes for the indicated setpoint(s) SHALL have the amount specified in the Amount field added to them.</description> + <arg id="0" name="Mode" type="SetpointRaiseLowerModeEnum" min="0x0" max="0x2"/> + <arg id="1" name="Amount" type="int8s"/> </command> + <command source="client" code="0x01" name="SetWeeklySchedule" optional="true"> - <description> - Command description for SetWeeklySchedule - </description> + <description>Upon receipt, the weekly schedule for updating setpoints SHALL be stored in the</description> <access op="invoke" privilege="manage"/> - <arg name="NumberOfTransitionsForSequence" type="int8u"/> - <arg name="DayOfWeekForSequence" type="ScheduleDayOfWeekBitmap" min="0x0" max="0xFF"/> - <arg name="ModeForSequence" type="ScheduleModeBitmap" min="0x0" max="0x3"/> - <arg name="Transitions" type="WeeklyScheduleTransitionStruct" array="true" length="10"/> + <arg id="0" name="NumberOfTransitionsForSequence" type="int8u"/> + <arg id="1" name="DayOfWeekForSequence" type="ScheduleDayOfWeekBitmap" min="0x0" max="0xFF"/> + <arg id="2" name="ModeForSequence" type="ScheduleModeBitmap" min="0x0" max="0x3"/> + <arg id="3" name="Transitions" type="WeeklyScheduleTransitionStruct" array="true" length="10"/> </command> + <command source="client" code="0x02" name="GetWeeklySchedule" response="GetWeeklyScheduleResponse" optional="true"> - <description> - Command description for GetWeeklySchedule - </description> - <arg name="DaysToReturn" type="ScheduleDayOfWeekBitmap" min="0x0" max="0xFF"/> - <arg name="ModeToReturn" type="ScheduleModeBitmap" min="0x0" max="0x3"/> + <description>Upon receipt, the unit SHOULD send in return the Get</description> + <arg id="0" name="DaysToReturn" type="ScheduleDayOfWeekBitmap" min="0x0" max="0xFF"/> + <arg id="1" name="ModeToReturn" type="ScheduleModeBitmap" min="0x0" max="0x3"/> </command> + <command source="client" code="0x03" name="ClearWeeklySchedule" optional="true"> - <description>This command is used to clear the weekly schedule. The ClearWeeklySchedule command has no payload.</description> + <description>This command is used to clear the weekly schedule.</description> <access op="invoke" privilege="manage"/> - </command> + </command> + <command source="client" code="0x05" name="SetActiveScheduleRequest" optional="true"> - <description>This command is used to set the active schedule.</description> - <arg name="ScheduleHandle" type="octet_string" length="16"/> + <description>Upon receipt, if the </description> + <arg id="0" name="ScheduleHandle" type="octet_string" length="16"/> </command> + <command source="client" code="0x06" name="SetActivePresetRequest" optional="true"> - <description>This command is used to set the active preset.</description> - <arg name="PresetHandle" type="octet_string" length="16"/> - </command> - <command source="client" code="0x07" name="StartPresetsSchedulesEditRequest" optional="true"> - <description>This command is used to start editing the presets and schedules.</description> - <access op="invoke" privilege="manage"/> - <arg name="TimeoutSeconds" type="int16u" max="120"/> - </command> - <command source="client" code="0x08" name="CancelPresetsSchedulesEditRequest" optional="true"> - <description>This command is used to cancel editing presets and schedules.</description> - <access op="invoke" privilege="manage"/> - </command> - <command source="client" code="0x09" name="CommitPresetsSchedulesRequest" optional="true"> - <description>This command is used to notify the server that all edits are done and should be committed.</description> - <access op="invoke" privilege="manage"/> - </command> - <command source="client" code="0x0B" name="SetTemperatureSetpointHoldPolicy" optional="true"> - <description>This command sets the set point hold policy.</description> - <arg name="TemperatureSetpointHoldPolicy" type="TemperatureSetpointHoldPolicyBitmap" min="0x0" max="0x3"/> + <description>ID</description> + <arg id="0" name="PresetHandle" type="octet_string" length="16"/> </command> <!-- Server Commands/Responses --> + <command source="server" code="0x00" name="GetWeeklyScheduleResponse" optional="true" disableDefaultResponse="true"> + <description>This command has the same payload format as the Set Weekly Schedule.</description> + <arg id="0" name="NumberOfTransitionsForSequence" type="int8u"/> + <arg id="1" name="DayOfWeekForSequence" type="ScheduleDayOfWeekBitmap" min="0x0" max="0xFF"/> + <arg id="2" name="ModeForSequence" type="ScheduleModeBitmap" min="0x0" max="0x3"/> + <arg id="3" name="Transitions" type="WeeklyScheduleTransitionStruct" array="true" length="10"/> + </command> - <command source="server" code="0x00" name="GetWeeklyScheduleResponse" optional="true"> - <description> - The Current Weekly Schedule Command is sent from the server in response to the Get Weekly Schedule Command. - </description> - <arg name="NumberOfTransitionsForSequence" type="int8u"/> - <arg name="DayOfWeekForSequence" type="ScheduleDayOfWeekBitmap" min="0x0" max="0xFF"/> - <arg name="ModeForSequence" type="ScheduleModeBitmap" min="0x0" max="0x3"/> - <arg name="Transitions" type="WeeklyScheduleTransitionStruct" array="true" length="10"/> + <command code="0xFD" source="server" name="AtomicResponse" optional="true"> + <description>Returns the status of an atomic write</description> + <arg id="0" name="StatusCode" type="status"/> + <arg id="0" name="AttributeStatus" array="true" type="AtomicAttributeStatusStruct"/> + <arg id="0" name="Timeout" type="int16u" optional="true"/> + </command> + + <command code="0xFE" source="client" name="AtomicRequest" optional="true" response="AtomicResponse"> + <description>Begins, Commits or Cancels an atomic write</description> + <access op="invoke" privilege="manage"/> + <arg id="0" name="RequestType" type="AtomicRequestTypeEnum"/> + <arg id="0" name="AttributeRequests" array="true" type="attrib_id"/> + <arg id="0" name="Timeout" type="int16u" optional="true"/> </command> </cluster> -</configurator> \ No newline at end of file +</configurator> diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index dd93ed7fe2cc9b..81cb05f9cc0551 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -6565,7 +6565,7 @@ cluster PumpConfigurationAndControl = 512 { /** An interface for configuring and controlling the functionality of a thermostat. */ cluster Thermostat = 513 { - revision 6; + revision 7; enum ACCapacityFormatEnum : enum8 { kBTUh = 0; @@ -6601,6 +6601,12 @@ cluster Thermostat = 513 { kHeatPumpInverter = 4; } + enum AtomicRequestTypeEnum : enum8 { + kBeginWrite = 0; + kCommitWrite = 1; + kRollbackWrite = 2; + } + enum ControlSequenceOfOperationEnum : enum8 { kCoolingOnly = 0; kCoolingWithReheat = 1; @@ -6611,13 +6617,13 @@ cluster Thermostat = 513 { } enum PresetScenarioEnum : enum8 { - kUnspecified = 0; kOccupied = 1; kUnoccupied = 2; kSleep = 3; kWake = 4; kVacation = 5; - kUserDefined = 6; + kGoingToSleep = 6; + kUserDefined = 254; } enum SetpointChangeSourceEnum : enum8 { @@ -6683,7 +6689,6 @@ cluster Thermostat = 513 { kLocalTemperatureNotExposed = 0x40; kMatterScheduleConfiguration = 0x80; kPresets = 0x100; - kSetpoints = 0x200; } bitmap HVACSystemTypeBitmap : bitmap8 { @@ -6693,6 +6698,10 @@ cluster Thermostat = 513 { kHeatingUsesFuel = 0x20; } + bitmap OccupancyBitmap : bitmap8 { + kOccupied = 0x1; + } + bitmap PresetTypeFeaturesBitmap : bitmap16 { kAutomatic = 0x1; kSupportsNames = 0x2; @@ -6743,11 +6752,6 @@ cluster Thermostat = 513 { kSupportsOff = 0x8; } - bitmap TemperatureSetpointHoldPolicyBitmap : bitmap8 { - kHoldDurationElapsed = 0x1; - kHoldDurationElapsedOrPresetChanged = 0x2; - } - struct ScheduleTransitionStruct { ScheduleDayOfWeekBitmap dayOfWeek = 0; int16u transitionTime = 1; @@ -6763,7 +6767,12 @@ cluster Thermostat = 513 { optional char_string<64> name = 2; optional octet_string<16> presetHandle = 3; ScheduleTransitionStruct transitions[] = 4; - optional nullable boolean builtIn = 5; + nullable boolean builtIn = 5; + } + + struct AtomicAttributeStatusStruct { + optional attrib_id attributeID = 0; + optional status statusCode = 1; } struct PresetStruct { @@ -6795,23 +6804,23 @@ cluster Thermostat = 513 { readonly attribute nullable temperature localTemperature = 0; readonly attribute optional nullable temperature outdoorTemperature = 1; - readonly attribute optional bitmap8 occupancy = 2; + readonly attribute optional OccupancyBitmap occupancy = 2; 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; + attribute access(write: manage) optional HVACSystemTypeBitmap HVACSystemTypeConfiguration = 9; attribute access(write: manage) optional int8s localTemperatureCalibration = 16; - attribute optional int16s occupiedCoolingSetpoint = 17; - attribute optional int16s occupiedHeatingSetpoint = 18; - attribute optional int16s unoccupiedCoolingSetpoint = 19; - attribute optional int16s unoccupiedHeatingSetpoint = 20; - attribute access(write: manage) optional int16s minHeatSetpointLimit = 21; - attribute access(write: manage) optional int16s maxHeatSetpointLimit = 22; - attribute access(write: manage) optional int16s minCoolSetpointLimit = 23; - attribute access(write: manage) optional int16s maxCoolSetpointLimit = 24; + attribute optional temperature occupiedCoolingSetpoint = 17; + attribute optional temperature occupiedHeatingSetpoint = 18; + attribute optional temperature unoccupiedCoolingSetpoint = 19; + attribute optional temperature unoccupiedHeatingSetpoint = 20; + attribute access(write: manage) optional temperature minHeatSetpointLimit = 21; + attribute access(write: manage) optional temperature maxHeatSetpointLimit = 22; + attribute access(write: manage) optional temperature minCoolSetpointLimit = 23; + attribute access(write: manage) optional temperature maxCoolSetpointLimit = 24; attribute access(write: manage) optional int8s minSetpointDeadBand = 25; attribute access(write: manage) optional RemoteSensingBitmap remoteSensing = 26; attribute access(write: manage) ControlSequenceOfOperationEnum controlSequenceOfOperation = 27; @@ -6841,7 +6850,7 @@ cluster Thermostat = 513 { 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; + attribute access(write: manage) optional ACCapacityFormatEnum ACCapacityFormat = 71; readonly attribute optional PresetTypeStruct presetTypes[] = 72; readonly attribute optional ScheduleTypeStruct scheduleTypes[] = 73; readonly attribute optional int8u numberOfPresets = 74; @@ -6852,9 +6861,7 @@ cluster Thermostat = 513 { readonly attribute optional nullable octet_string<16> activeScheduleHandle = 79; 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 = 82; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -6894,34 +6901,32 @@ cluster Thermostat = 513 { octet_string<16> presetHandle = 0; } - request struct StartPresetsSchedulesEditRequestRequest { - int16u timeoutSeconds = 0; + response struct AtomicResponse = 253 { + status statusCode = 0; + AtomicAttributeStatusStruct attributeStatus[] = 1; + optional int16u timeout = 2; } - request struct SetTemperatureSetpointHoldPolicyRequest { - TemperatureSetpointHoldPolicyBitmap temperatureSetpointHoldPolicy = 0; + request struct AtomicRequestRequest { + AtomicRequestTypeEnum requestType = 0; + attrib_id attributeRequests[] = 1; + optional int16u timeout = 2; } - /** Command description for SetpointRaiseLower */ + /** Upon receipt, the attributes for the indicated setpoint(s) SHALL have the amount specified in the Amount field added to them. */ command SetpointRaiseLower(SetpointRaiseLowerRequest): DefaultSuccess = 0; - /** Command description for SetWeeklySchedule */ + /** Upon receipt, the weekly schedule for updating setpoints SHALL be stored in the */ command access(invoke: manage) SetWeeklySchedule(SetWeeklyScheduleRequest): DefaultSuccess = 1; - /** Command description for GetWeeklySchedule */ + /** Upon receipt, the unit SHOULD send in return the Get */ command GetWeeklySchedule(GetWeeklyScheduleRequest): GetWeeklyScheduleResponse = 2; - /** This command is used to clear the weekly schedule. The ClearWeeklySchedule command has no payload. */ + /** This command is used to clear the weekly schedule. */ command access(invoke: manage) ClearWeeklySchedule(): DefaultSuccess = 3; - /** This command is used to set the active schedule. */ + /** Upon receipt, if the */ command SetActiveScheduleRequest(SetActiveScheduleRequestRequest): DefaultSuccess = 5; - /** This command is used to set the active preset. */ + /** ID */ command SetActivePresetRequest(SetActivePresetRequestRequest): DefaultSuccess = 6; - /** This command is used to start editing the presets and schedules. */ - command access(invoke: manage) StartPresetsSchedulesEditRequest(StartPresetsSchedulesEditRequestRequest): DefaultSuccess = 7; - /** This command is used to cancel editing presets and schedules. */ - 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; + /** Begins, Commits or Cancels an atomic write */ + command access(invoke: manage) AtomicRequest(AtomicRequestRequest): AtomicResponse = 254; } /** An interface for controlling a fan in a heating/cooling system. */ diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java index e11a47a23a8c7c..fa90d3b7526abb 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java @@ -40213,7 +40213,7 @@ public static class ThermostatCluster extends BaseChipCluster { private static final long A_C_ERROR_CODE_ATTRIBUTE_ID = 68L; private static final long A_C_LOUVER_POSITION_ATTRIBUTE_ID = 69L; private static final long A_C_COIL_TEMPERATURE_ATTRIBUTE_ID = 70L; - private static final long A_C_CAPACITYFORMAT_ATTRIBUTE_ID = 71L; + private static final long A_C_CAPACITY_FORMAT_ATTRIBUTE_ID = 71L; private static final long PRESET_TYPES_ATTRIBUTE_ID = 72L; private static final long SCHEDULE_TYPES_ATTRIBUTE_ID = 73L; private static final long NUMBER_OF_PRESETS_ATTRIBUTE_ID = 74L; @@ -40224,9 +40224,7 @@ public static class ThermostatCluster extends BaseChipCluster { private static final long ACTIVE_SCHEDULE_HANDLE_ATTRIBUTE_ID = 79L; private static final long PRESETS_ATTRIBUTE_ID = 80L; private static final long SCHEDULES_ATTRIBUTE_ID = 81L; - private static final long PRESETS_SCHEDULES_EDITABLE_ATTRIBUTE_ID = 82L; - private static final long TEMPERATURE_SETPOINT_HOLD_POLICY_ATTRIBUTE_ID = 83L; - private static final long SETPOINT_HOLD_EXPIRY_TIMESTAMP_ATTRIBUTE_ID = 84L; + private static final long SETPOINT_HOLD_EXPIRY_TIMESTAMP_ATTRIBUTE_ID = 82L; private static final long GENERATED_COMMAND_LIST_ATTRIBUTE_ID = 65528L; private static final long ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID = 65529L; private static final long EVENT_LIST_ATTRIBUTE_ID = 65530L; @@ -40411,75 +40409,55 @@ public void onResponse(StructType invokeStructValue) { }}, commandId, commandArgs, timedInvokeTimeoutMs); } - public void startPresetsSchedulesEditRequest(DefaultClusterCallback callback, Integer timeoutSeconds) { - startPresetsSchedulesEditRequest(callback, timeoutSeconds, 0); + public void atomicRequest(AtomicResponseCallback callback, Integer requestType, ArrayList<Long> attributeRequests, Optional<Integer> timeout) { + atomicRequest(callback, requestType, attributeRequests, timeout, 0); } - public void startPresetsSchedulesEditRequest(DefaultClusterCallback callback, Integer timeoutSeconds, int timedInvokeTimeoutMs) { - final long commandId = 7L; - - ArrayList<StructElement> elements = new ArrayList<>(); - final long timeoutSecondsFieldID = 0L; - BaseTLVType timeoutSecondstlvValue = new UIntType(timeoutSeconds); - elements.add(new StructElement(timeoutSecondsFieldID, timeoutSecondstlvValue)); - - StructType commandArgs = new StructType(elements); - invoke(new InvokeCallbackImpl(callback) { - @Override - public void onResponse(StructType invokeStructValue) { - callback.onSuccess(); - }}, commandId, commandArgs, timedInvokeTimeoutMs); - } - - public void cancelPresetsSchedulesEditRequest(DefaultClusterCallback callback) { - cancelPresetsSchedulesEditRequest(callback, 0); - } - - public void cancelPresetsSchedulesEditRequest(DefaultClusterCallback callback, int timedInvokeTimeoutMs) { - final long commandId = 8L; - - ArrayList<StructElement> elements = new ArrayList<>(); - StructType commandArgs = new StructType(elements); - invoke(new InvokeCallbackImpl(callback) { - @Override - public void onResponse(StructType invokeStructValue) { - callback.onSuccess(); - }}, commandId, commandArgs, timedInvokeTimeoutMs); - } - - public void commitPresetsSchedulesRequest(DefaultClusterCallback callback) { - commitPresetsSchedulesRequest(callback, 0); - } - - public void commitPresetsSchedulesRequest(DefaultClusterCallback callback, int timedInvokeTimeoutMs) { - final long commandId = 9L; + public void atomicRequest(AtomicResponseCallback callback, Integer requestType, ArrayList<Long> attributeRequests, Optional<Integer> timeout, int timedInvokeTimeoutMs) { + final long commandId = 254L; ArrayList<StructElement> elements = new ArrayList<>(); - StructType commandArgs = new StructType(elements); - invoke(new InvokeCallbackImpl(callback) { - @Override - public void onResponse(StructType invokeStructValue) { - callback.onSuccess(); - }}, commandId, commandArgs, timedInvokeTimeoutMs); - } + final long requestTypeFieldID = 0L; + BaseTLVType requestTypetlvValue = new UIntType(requestType); + elements.add(new StructElement(requestTypeFieldID, requestTypetlvValue)); - public void setTemperatureSetpointHoldPolicy(DefaultClusterCallback callback, Integer temperatureSetpointHoldPolicy) { - setTemperatureSetpointHoldPolicy(callback, temperatureSetpointHoldPolicy, 0); - } - - public void setTemperatureSetpointHoldPolicy(DefaultClusterCallback callback, Integer temperatureSetpointHoldPolicy, int timedInvokeTimeoutMs) { - final long commandId = 11L; + final long attributeRequestsFieldID = 1L; + BaseTLVType attributeRequeststlvValue = ArrayType.generateArrayType(attributeRequests, (elementattributeRequests) -> new UIntType(elementattributeRequests)); + elements.add(new StructElement(attributeRequestsFieldID, attributeRequeststlvValue)); - ArrayList<StructElement> elements = new ArrayList<>(); - final long temperatureSetpointHoldPolicyFieldID = 0L; - BaseTLVType temperatureSetpointHoldPolicytlvValue = new UIntType(temperatureSetpointHoldPolicy); - elements.add(new StructElement(temperatureSetpointHoldPolicyFieldID, temperatureSetpointHoldPolicytlvValue)); + final long timeoutFieldID = 2L; + BaseTLVType timeouttlvValue = timeout.<BaseTLVType>map((nonOptionaltimeout) -> new UIntType(nonOptionaltimeout)).orElse(new EmptyType()); + elements.add(new StructElement(timeoutFieldID, timeouttlvValue)); StructType commandArgs = new StructType(elements); invoke(new InvokeCallbackImpl(callback) { @Override public void onResponse(StructType invokeStructValue) { - callback.onSuccess(); + final long statusCodeFieldID = 0L; + Integer statusCode = null; + final long attributeStatusFieldID = 1L; + ArrayList<ChipStructs.ThermostatClusterAtomicAttributeStatusStruct> attributeStatus = null; + final long timeoutFieldID = 2L; + Optional<Integer> timeout = Optional.empty(); + for (StructElement element: invokeStructValue.value()) { + if (element.contextTagNum() == statusCodeFieldID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + statusCode = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == attributeStatusFieldID) { + if (element.value(BaseTLVType.class).type() == TLVType.Array) { + ArrayType castingValue = element.value(ArrayType.class); + attributeStatus = castingValue.map((elementcastingValue) -> ChipStructs.ThermostatClusterAtomicAttributeStatusStruct.decodeTlv(elementcastingValue)); + } + } else if (element.contextTagNum() == timeoutFieldID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + timeout = Optional.of(castingValue.value(Integer.class)); + } + } + } + callback.onSuccess(statusCode, attributeStatus, timeout); }}, commandId, commandArgs, timedInvokeTimeoutMs); } @@ -40487,6 +40465,10 @@ public interface GetWeeklyScheduleResponseCallback extends BaseClusterCallback { void onSuccess(Integer numberOfTransitionsForSequence, Integer dayOfWeekForSequence, Integer modeForSequence, ArrayList<ChipStructs.ThermostatClusterWeeklyScheduleTransitionStruct> transitions); } + public interface AtomicResponseCallback extends BaseClusterCallback { + void onSuccess(Integer statusCode, ArrayList<ChipStructs.ThermostatClusterAtomicAttributeStatusStruct> attributeStatus, Optional<Integer> timeout); + } + public interface LocalTemperatureAttributeCallback extends BaseAttributeCallback { void onSuccess(@Nullable Integer value); } @@ -42061,9 +42043,9 @@ public void onSuccess(byte[] tlv) { }, A_C_COIL_TEMPERATURE_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readACCapacityformatAttribute( + public void readACCapacityFormatAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, A_C_CAPACITYFORMAT_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, A_C_CAPACITY_FORMAT_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -42071,21 +42053,21 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, A_C_CAPACITYFORMAT_ATTRIBUTE_ID, true); + }, A_C_CAPACITY_FORMAT_ATTRIBUTE_ID, true); } - public void writeACCapacityformatAttribute(DefaultClusterCallback callback, Integer value) { - writeACCapacityformatAttribute(callback, value, 0); + public void writeACCapacityFormatAttribute(DefaultClusterCallback callback, Integer value) { + writeACCapacityFormatAttribute(callback, value, 0); } - public void writeACCapacityformatAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + public void writeACCapacityFormatAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { BaseTLVType tlvValue = new UIntType(value); - writeAttribute(new WriteAttributesCallbackImpl(callback), A_C_CAPACITYFORMAT_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + writeAttribute(new WriteAttributesCallbackImpl(callback), A_C_CAPACITY_FORMAT_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); } - public void subscribeACCapacityformatAttribute( + public void subscribeACCapacityFormatAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, A_C_CAPACITYFORMAT_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, A_C_CAPACITY_FORMAT_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -42093,7 +42075,7 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, A_C_CAPACITYFORMAT_ATTRIBUTE_ID, minInterval, maxInterval); + }, A_C_CAPACITY_FORMAT_ATTRIBUTE_ID, minInterval, maxInterval); } public void readPresetTypesAttribute( @@ -42374,58 +42356,6 @@ public void onSuccess(byte[] tlv) { }, SCHEDULES_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readPresetsSchedulesEditableAttribute( - BooleanAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, PRESETS_SCHEDULES_EDITABLE_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, PRESETS_SCHEDULES_EDITABLE_ATTRIBUTE_ID, true); - } - - public void subscribePresetsSchedulesEditableAttribute( - BooleanAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, PRESETS_SCHEDULES_EDITABLE_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, PRESETS_SCHEDULES_EDITABLE_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readTemperatureSetpointHoldPolicyAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, TEMPERATURE_SETPOINT_HOLD_POLICY_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, TEMPERATURE_SETPOINT_HOLD_POLICY_ATTRIBUTE_ID, true); - } - - public void subscribeTemperatureSetpointHoldPolicyAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, TEMPERATURE_SETPOINT_HOLD_POLICY_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, TEMPERATURE_SETPOINT_HOLD_POLICY_ATTRIBUTE_ID, minInterval, maxInterval); - } - public void readSetpointHoldExpiryTimestampAttribute( SetpointHoldExpiryTimestampAttributeCallback callback) { ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SETPOINT_HOLD_EXPIRY_TIMESTAMP_ATTRIBUTE_ID); diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java b/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java index 90330bbdee3ae6..b1e3b36ceea696 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java @@ -9465,7 +9465,7 @@ public static class ThermostatClusterScheduleStruct { public Optional<String> name; public Optional<byte[]> presetHandle; public ArrayList<ChipStructs.ThermostatClusterScheduleTransitionStruct> transitions; - public @Nullable Optional<Boolean> builtIn; + public @Nullable Boolean builtIn; private static final long SCHEDULE_HANDLE_ID = 0L; private static final long SYSTEM_MODE_ID = 1L; private static final long NAME_ID = 2L; @@ -9479,7 +9479,7 @@ public ThermostatClusterScheduleStruct( Optional<String> name, Optional<byte[]> presetHandle, ArrayList<ChipStructs.ThermostatClusterScheduleTransitionStruct> transitions, - @Nullable Optional<Boolean> builtIn + @Nullable Boolean builtIn ) { this.scheduleHandle = scheduleHandle; this.systemMode = systemMode; @@ -9496,7 +9496,7 @@ public StructType encodeTlv() { values.add(new StructElement(NAME_ID, name.<BaseTLVType>map((nonOptionalname) -> new StringType(nonOptionalname)).orElse(new EmptyType()))); values.add(new StructElement(PRESET_HANDLE_ID, presetHandle.<BaseTLVType>map((nonOptionalpresetHandle) -> new ByteArrayType(nonOptionalpresetHandle)).orElse(new EmptyType()))); values.add(new StructElement(TRANSITIONS_ID, ArrayType.generateArrayType(transitions, (elementtransitions) -> elementtransitions.encodeTlv()))); - values.add(new StructElement(BUILT_IN_ID, builtIn != null ? builtIn.<BaseTLVType>map((nonOptionalbuiltIn) -> new BooleanType(nonOptionalbuiltIn)).orElse(new EmptyType()) : new NullType())); + values.add(new StructElement(BUILT_IN_ID, builtIn != null ? new BooleanType(builtIn) : new NullType())); return new StructType(values); } @@ -9510,7 +9510,7 @@ public static ThermostatClusterScheduleStruct decodeTlv(BaseTLVType tlvValue) { Optional<String> name = Optional.empty(); Optional<byte[]> presetHandle = Optional.empty(); ArrayList<ChipStructs.ThermostatClusterScheduleTransitionStruct> transitions = null; - @Nullable Optional<Boolean> builtIn = null; + @Nullable Boolean builtIn = null; for (StructElement element: ((StructType)tlvValue).value()) { if (element.contextTagNum() == SCHEDULE_HANDLE_ID) { if (element.value(BaseTLVType.class).type() == TLVType.ByteArray) { @@ -9540,7 +9540,7 @@ public static ThermostatClusterScheduleStruct decodeTlv(BaseTLVType tlvValue) { } else if (element.contextTagNum() == BUILT_IN_ID) { if (element.value(BaseTLVType.class).type() == TLVType.Boolean) { BooleanType castingValue = element.value(BooleanType.class); - builtIn = Optional.of(castingValue.value(Boolean.class)); + builtIn = castingValue.value(Boolean.class); } } } @@ -9580,6 +9580,67 @@ public String toString() { return output.toString(); } } +public static class ThermostatClusterAtomicAttributeStatusStruct { + public Optional<Long> attributeID; + public Optional<Integer> statusCode; + private static final long ATTRIBUTE_I_D_ID = 0L; + private static final long STATUS_CODE_ID = 1L; + + public ThermostatClusterAtomicAttributeStatusStruct( + Optional<Long> attributeID, + Optional<Integer> statusCode + ) { + this.attributeID = attributeID; + this.statusCode = statusCode; + } + + public StructType encodeTlv() { + ArrayList<StructElement> values = new ArrayList<>(); + values.add(new StructElement(ATTRIBUTE_I_D_ID, attributeID.<BaseTLVType>map((nonOptionalattributeID) -> new UIntType(nonOptionalattributeID)).orElse(new EmptyType()))); + values.add(new StructElement(STATUS_CODE_ID, statusCode.<BaseTLVType>map((nonOptionalstatusCode) -> new UIntType(nonOptionalstatusCode)).orElse(new EmptyType()))); + + return new StructType(values); + } + + public static ThermostatClusterAtomicAttributeStatusStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Optional<Long> attributeID = Optional.empty(); + Optional<Integer> statusCode = Optional.empty(); + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == ATTRIBUTE_I_D_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + attributeID = Optional.of(castingValue.value(Long.class)); + } + } else if (element.contextTagNum() == STATUS_CODE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + statusCode = Optional.of(castingValue.value(Integer.class)); + } + } + } + return new ThermostatClusterAtomicAttributeStatusStruct( + attributeID, + statusCode + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("ThermostatClusterAtomicAttributeStatusStruct {\n"); + output.append("\tattributeID: "); + output.append(attributeID); + output.append("\n"); + output.append("\tstatusCode: "); + output.append(statusCode); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} public static class ThermostatClusterPresetStruct { public @Nullable byte[] presetHandle; public Integer presetScenario; diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java index ab20bdcaa301e9..7dc00092e9585f 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java @@ -11885,7 +11885,7 @@ public enum Attribute { ACErrorCode(68L), ACLouverPosition(69L), ACCoilTemperature(70L), - ACCapacityformat(71L), + ACCapacityFormat(71L), PresetTypes(72L), ScheduleTypes(73L), NumberOfPresets(74L), @@ -11896,9 +11896,7 @@ public enum Attribute { ActiveScheduleHandle(79L), Presets(80L), Schedules(81L), - PresetsSchedulesEditable(82L), - TemperatureSetpointHoldPolicy(83L), - SetpointHoldExpiryTimestamp(84L), + SetpointHoldExpiryTimestamp(82L), GeneratedCommandList(65528L), AcceptedCommandList(65529L), EventList(65530L), @@ -11951,10 +11949,7 @@ public enum Command { ClearWeeklySchedule(3L), SetActiveScheduleRequest(5L), SetActivePresetRequest(6L), - StartPresetsSchedulesEditRequest(7L), - CancelPresetsSchedulesEditRequest(8L), - CommitPresetsSchedulesRequest(9L), - SetTemperatureSetpointHoldPolicy(11L),; + AtomicRequest(254L),; private final long id; Command(long id) { this.id = id; @@ -12057,34 +12052,17 @@ public static SetActivePresetRequestCommandField value(int id) throws NoSuchFiel } throw new NoSuchFieldError(); } - }public enum StartPresetsSchedulesEditRequestCommandField {TimeoutSeconds(0),; + }public enum AtomicRequestCommandField {RequestType(0),AttributeRequests(1),Timeout(2),; private final int id; - StartPresetsSchedulesEditRequestCommandField(int id) { + AtomicRequestCommandField(int id) { this.id = id; } public int getID() { return id; } - public static StartPresetsSchedulesEditRequestCommandField value(int id) throws NoSuchFieldError { - for (StartPresetsSchedulesEditRequestCommandField field : StartPresetsSchedulesEditRequestCommandField.values()) { - if (field.getID() == id) { - return field; - } - } - throw new NoSuchFieldError(); - } - }public enum SetTemperatureSetpointHoldPolicyCommandField {TemperatureSetpointHoldPolicy(0),; - private final int id; - SetTemperatureSetpointHoldPolicyCommandField(int id) { - this.id = id; - } - - public int getID() { - return id; - } - public static SetTemperatureSetpointHoldPolicyCommandField value(int id) throws NoSuchFieldError { - for (SetTemperatureSetpointHoldPolicyCommandField field : SetTemperatureSetpointHoldPolicyCommandField.values()) { + public static AtomicRequestCommandField value(int id) throws NoSuchFieldError { + for (AtomicRequestCommandField field : AtomicRequestCommandField.values()) { if (field.getID() == id) { return field; } diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java index ca3d74f1ac3797..f23d7f1e097b43 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java @@ -13801,6 +13801,33 @@ public void onError(Exception error) { callback.onFailure(error); } } + + public static class DelegatedThermostatClusterAtomicResponseCallback implements ChipClusters.ThermostatCluster.AtomicResponseCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(Integer statusCode, ArrayList<ChipStructs.ThermostatClusterAtomicAttributeStatusStruct> attributeStatus, Optional<Integer> timeout) { + Map<CommandResponseInfo, Object> responseValues = new LinkedHashMap<>(); + + CommandResponseInfo statusCodeResponseValue = new CommandResponseInfo("statusCode", "Integer"); + responseValues.put(statusCodeResponseValue, statusCode); + // attributeStatus: AtomicAttributeStatusStruct + // Conversion from this type to Java is not properly implemented yet + + CommandResponseInfo timeoutResponseValue = new CommandResponseInfo("timeout", "Optional<Integer>"); + responseValues.put(timeoutResponseValue, timeout); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception error) { + callback.onFailure(error); + } + } public static class DelegatedThermostatClusterLocalTemperatureAttributeCallback implements ChipClusters.ThermostatCluster.LocalTemperatureAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override @@ -26862,63 +26889,35 @@ public Map<String, Map<String, InteractionInfo>> getCommandMap() { ); thermostatClusterInteractionInfoMap.put("setActivePresetRequest", thermostatsetActivePresetRequestInteractionInfo); - Map<String, CommandParameterInfo> thermostatstartPresetsSchedulesEditRequestCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); + Map<String, CommandParameterInfo> thermostatatomicRequestCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); - CommandParameterInfo thermostatstartPresetsSchedulesEditRequesttimeoutSecondsCommandParameterInfo = new CommandParameterInfo("timeoutSeconds", Integer.class, Integer.class); - thermostatstartPresetsSchedulesEditRequestCommandParams.put("timeoutSeconds",thermostatstartPresetsSchedulesEditRequesttimeoutSecondsCommandParameterInfo); - InteractionInfo thermostatstartPresetsSchedulesEditRequestInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThermostatCluster) cluster) - .startPresetsSchedulesEditRequest((DefaultClusterCallback) callback - , (Integer) - commandArguments.get("timeoutSeconds") - ); - }, - () -> new DelegatedDefaultClusterCallback(), - thermostatstartPresetsSchedulesEditRequestCommandParams - ); - thermostatClusterInteractionInfoMap.put("startPresetsSchedulesEditRequest", thermostatstartPresetsSchedulesEditRequestInteractionInfo); + CommandParameterInfo thermostatatomicRequestrequestTypeCommandParameterInfo = new CommandParameterInfo("requestType", Integer.class, Integer.class); + thermostatatomicRequestCommandParams.put("requestType",thermostatatomicRequestrequestTypeCommandParameterInfo); - Map<String, CommandParameterInfo> thermostatcancelPresetsSchedulesEditRequestCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); - InteractionInfo thermostatcancelPresetsSchedulesEditRequestInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThermostatCluster) cluster) - .cancelPresetsSchedulesEditRequest((DefaultClusterCallback) callback - ); - }, - () -> new DelegatedDefaultClusterCallback(), - thermostatcancelPresetsSchedulesEditRequestCommandParams - ); - thermostatClusterInteractionInfoMap.put("cancelPresetsSchedulesEditRequest", thermostatcancelPresetsSchedulesEditRequestInteractionInfo); + CommandParameterInfo thermostatatomicRequestattributeRequestsCommandParameterInfo = new CommandParameterInfo("attributeRequests", ArrayList.class, ArrayList.class); + thermostatatomicRequestCommandParams.put("attributeRequests",thermostatatomicRequestattributeRequestsCommandParameterInfo); - Map<String, CommandParameterInfo> thermostatcommitPresetsSchedulesRequestCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); - InteractionInfo thermostatcommitPresetsSchedulesRequestInteractionInfo = new InteractionInfo( + CommandParameterInfo thermostatatomicRequesttimeoutCommandParameterInfo = new CommandParameterInfo("timeout", Optional.class, Integer.class); + thermostatatomicRequestCommandParams.put("timeout",thermostatatomicRequesttimeoutCommandParameterInfo); + InteractionInfo thermostatatomicRequestInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThermostatCluster) cluster) - .commitPresetsSchedulesRequest((DefaultClusterCallback) callback - ); - }, - () -> new DelegatedDefaultClusterCallback(), - thermostatcommitPresetsSchedulesRequestCommandParams - ); - thermostatClusterInteractionInfoMap.put("commitPresetsSchedulesRequest", thermostatcommitPresetsSchedulesRequestInteractionInfo); + .atomicRequest((ChipClusters.ThermostatCluster.AtomicResponseCallback) callback + , (Integer) + commandArguments.get("requestType") - Map<String, CommandParameterInfo> thermostatsetTemperatureSetpointHoldPolicyCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); + , (ArrayList<Long>) + commandArguments.get("attributeRequests") - CommandParameterInfo thermostatsetTemperatureSetpointHoldPolicytemperatureSetpointHoldPolicyCommandParameterInfo = new CommandParameterInfo("temperatureSetpointHoldPolicy", Integer.class, Integer.class); - thermostatsetTemperatureSetpointHoldPolicyCommandParams.put("temperatureSetpointHoldPolicy",thermostatsetTemperatureSetpointHoldPolicytemperatureSetpointHoldPolicyCommandParameterInfo); - InteractionInfo thermostatsetTemperatureSetpointHoldPolicyInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThermostatCluster) cluster) - .setTemperatureSetpointHoldPolicy((DefaultClusterCallback) callback - , (Integer) - commandArguments.get("temperatureSetpointHoldPolicy") - ); - }, - () -> new DelegatedDefaultClusterCallback(), - thermostatsetTemperatureSetpointHoldPolicyCommandParams - ); - thermostatClusterInteractionInfoMap.put("setTemperatureSetpointHoldPolicy", thermostatsetTemperatureSetpointHoldPolicyInteractionInfo); + , (Optional<Integer>) + commandArguments.get("timeout") + + ); + }, + () -> new DelegatedThermostatClusterAtomicResponseCallback(), + thermostatatomicRequestCommandParams + ); + thermostatClusterInteractionInfoMap.put("atomicRequest", thermostatatomicRequestInteractionInfo); commandMap.put("thermostat", thermostatClusterInteractionInfoMap); diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java index 45d0e3037631fb..d846b1244f7b3d 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java @@ -12773,17 +12773,17 @@ private static Map<String, InteractionInfo> readThermostatInteractionInfo() { readThermostatACCoilTemperatureCommandParams ); result.put("readACCoilTemperatureAttribute", readThermostatACCoilTemperatureAttributeInteractionInfo); - Map<String, CommandParameterInfo> readThermostatACCapacityformatCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); - InteractionInfo readThermostatACCapacityformatAttributeInteractionInfo = new InteractionInfo( + Map<String, CommandParameterInfo> readThermostatACCapacityFormatCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); + InteractionInfo readThermostatACCapacityFormatAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.ThermostatCluster) cluster).readACCapacityformatAttribute( + ((ChipClusters.ThermostatCluster) cluster).readACCapacityFormatAttribute( (ChipClusters.IntegerAttributeCallback) callback ); }, () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readThermostatACCapacityformatCommandParams + readThermostatACCapacityFormatCommandParams ); - result.put("readACCapacityformatAttribute", readThermostatACCapacityformatAttributeInteractionInfo); + result.put("readACCapacityFormatAttribute", readThermostatACCapacityFormatAttributeInteractionInfo); Map<String, CommandParameterInfo> readThermostatPresetTypesCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); InteractionInfo readThermostatPresetTypesAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { @@ -12894,28 +12894,6 @@ private static Map<String, InteractionInfo> readThermostatInteractionInfo() { readThermostatSchedulesCommandParams ); result.put("readSchedulesAttribute", readThermostatSchedulesAttributeInteractionInfo); - Map<String, CommandParameterInfo> readThermostatPresetsSchedulesEditableCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); - InteractionInfo readThermostatPresetsSchedulesEditableAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThermostatCluster) cluster).readPresetsSchedulesEditableAttribute( - (ChipClusters.BooleanAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), - readThermostatPresetsSchedulesEditableCommandParams - ); - result.put("readPresetsSchedulesEditableAttribute", readThermostatPresetsSchedulesEditableAttributeInteractionInfo); - Map<String, CommandParameterInfo> readThermostatTemperatureSetpointHoldPolicyCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); - InteractionInfo readThermostatTemperatureSetpointHoldPolicyAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThermostatCluster) cluster).readTemperatureSetpointHoldPolicyAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readThermostatTemperatureSetpointHoldPolicyCommandParams - ); - result.put("readTemperatureSetpointHoldPolicyAttribute", readThermostatTemperatureSetpointHoldPolicyAttributeInteractionInfo); Map<String, CommandParameterInfo> readThermostatSetpointHoldExpiryTimestampCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); InteractionInfo readThermostatSetpointHoldExpiryTimestampAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java index 32759bb97af64c..0dbfc44dda67d0 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java @@ -2721,28 +2721,28 @@ public Map<String, Map<String, InteractionInfo>> getWriteAttributeMap() { writeThermostatACLouverPositionCommandParams ); writeThermostatInteractionInfo.put("writeACLouverPositionAttribute", writeThermostatACLouverPositionAttributeInteractionInfo); - Map<String, CommandParameterInfo> writeThermostatACCapacityformatCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); - CommandParameterInfo thermostatACCapacityformatCommandParameterInfo = + Map<String, CommandParameterInfo> writeThermostatACCapacityFormatCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); + CommandParameterInfo thermostatACCapacityFormatCommandParameterInfo = new CommandParameterInfo( "value", Integer.class, Integer.class ); - writeThermostatACCapacityformatCommandParams.put( + writeThermostatACCapacityFormatCommandParams.put( "value", - thermostatACCapacityformatCommandParameterInfo + thermostatACCapacityFormatCommandParameterInfo ); - InteractionInfo writeThermostatACCapacityformatAttributeInteractionInfo = new InteractionInfo( + InteractionInfo writeThermostatACCapacityFormatAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.ThermostatCluster) cluster).writeACCapacityformatAttribute( + ((ChipClusters.ThermostatCluster) cluster).writeACCapacityFormatAttribute( (DefaultClusterCallback) callback, (Integer) commandArguments.get("value") ); }, () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), - writeThermostatACCapacityformatCommandParams + writeThermostatACCapacityFormatCommandParams ); - writeThermostatInteractionInfo.put("writeACCapacityformatAttribute", writeThermostatACCapacityformatAttributeInteractionInfo); + writeThermostatInteractionInfo.put("writeACCapacityFormatAttribute", writeThermostatACCapacityFormatAttributeInteractionInfo); writeAttributeMap.put("thermostat", writeThermostatInteractionInfo); Map<String, InteractionInfo> writeFanControlInteractionInfo = new LinkedHashMap<>(); Map<String, CommandParameterInfo> writeFanControlFanModeCommandParams = new LinkedHashMap<String, CommandParameterInfo>(); diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni b/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni index 35bec1ec2b451e..9cb39884914898 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni @@ -127,6 +127,7 @@ structs_sources = [ "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ServiceAreaClusterProgressStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/SoftwareDiagnosticsClusterThreadMetricsStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/TargetNavigatorClusterTargetInfoStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThermostatClusterAtomicAttributeStatusStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThermostatClusterPresetStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThermostatClusterPresetTypeStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThermostatClusterScheduleStruct.kt", diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThermostatClusterAtomicAttributeStatusStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThermostatClusterAtomicAttributeStatusStruct.kt new file mode 100644 index 00000000000000..165511aedae1aa --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThermostatClusterAtomicAttributeStatusStruct.kt @@ -0,0 +1,76 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package chip.devicecontroller.cluster.structs + +import chip.devicecontroller.cluster.* +import java.util.Optional +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ThermostatClusterAtomicAttributeStatusStruct( + val attributeID: Optional<ULong>, + val statusCode: Optional<UInt>, +) { + override fun toString(): String = buildString { + append("ThermostatClusterAtomicAttributeStatusStruct {\n") + append("\tattributeID : $attributeID\n") + append("\tstatusCode : $statusCode\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + if (attributeID.isPresent) { + val optattributeID = attributeID.get() + put(ContextSpecificTag(TAG_ATTRIBUTE_I_D), optattributeID) + } + if (statusCode.isPresent) { + val optstatusCode = statusCode.get() + put(ContextSpecificTag(TAG_STATUS_CODE), optstatusCode) + } + endStructure() + } + } + + companion object { + private const val TAG_ATTRIBUTE_I_D = 0 + private const val TAG_STATUS_CODE = 1 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ThermostatClusterAtomicAttributeStatusStruct { + tlvReader.enterStructure(tlvTag) + val attributeID = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_ATTRIBUTE_I_D))) { + Optional.of(tlvReader.getULong(ContextSpecificTag(TAG_ATTRIBUTE_I_D))) + } else { + Optional.empty() + } + val statusCode = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_STATUS_CODE))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_STATUS_CODE))) + } else { + Optional.empty() + } + + tlvReader.exitContainer() + + return ThermostatClusterAtomicAttributeStatusStruct(attributeID, statusCode) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThermostatClusterScheduleStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThermostatClusterScheduleStruct.kt index 6a3b8727c32860..e05123dd91f361 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThermostatClusterScheduleStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThermostatClusterScheduleStruct.kt @@ -30,7 +30,7 @@ class ThermostatClusterScheduleStruct( val name: Optional<String>, val presetHandle: Optional<ByteArray>, val transitions: List<ThermostatClusterScheduleTransitionStruct>, - val builtIn: Optional<Boolean>?, + val builtIn: Boolean?, ) { override fun toString(): String = buildString { append("ThermostatClusterScheduleStruct {\n") @@ -66,10 +66,7 @@ class ThermostatClusterScheduleStruct( } endArray() if (builtIn != null) { - if (builtIn.isPresent) { - val optbuiltIn = builtIn.get() - put(ContextSpecificTag(TAG_BUILT_IN), optbuiltIn) - } + put(ContextSpecificTag(TAG_BUILT_IN), builtIn) } else { putNull(ContextSpecificTag(TAG_BUILT_IN)) } @@ -117,11 +114,7 @@ class ThermostatClusterScheduleStruct( } val builtIn = if (!tlvReader.isNull()) { - if (tlvReader.isNextTag(ContextSpecificTag(TAG_BUILT_IN))) { - Optional.of(tlvReader.getBoolean(ContextSpecificTag(TAG_BUILT_IN))) - } else { - Optional.empty() - } + tlvReader.getBoolean(ContextSpecificTag(TAG_BUILT_IN)) } else { tlvReader.getNull(ContextSpecificTag(TAG_BUILT_IN)) null diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/ThermostatCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/ThermostatCluster.kt index ed9077402e96af..bd7dddda1c7cc9 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/ThermostatCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/ThermostatCluster.kt @@ -22,7 +22,6 @@ import java.util.logging.Level import java.util.logging.Logger import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.transform -import matter.controller.BooleanSubscriptionState import matter.controller.ByteSubscriptionState import matter.controller.InvokeRequest import matter.controller.InvokeResponse @@ -54,6 +53,12 @@ class ThermostatCluster(private val controller: MatterController, private val en val transitions: List<ThermostatClusterWeeklyScheduleTransitionStruct>, ) + class AtomicResponse( + val statusCode: UByte, + val attributeStatus: List<ThermostatClusterAtomicAttributeStatusStruct>, + val timeout: UShort?, + ) + class LocalTemperatureAttribute(val value: Short?) sealed class LocalTemperatureAttributeSubscriptionState { @@ -522,35 +527,29 @@ class ThermostatCluster(private val controller: MatterController, private val en logger.log(Level.FINE, "Invoke command succeeded: ${response}") } - suspend fun startPresetsSchedulesEditRequest( - timeoutSeconds: UShort, + suspend fun atomicRequest( + requestType: UByte, + attributeRequests: List<UInt>, + timeout: UShort?, timedInvokeTimeout: Duration? = null, - ) { - val commandId: UInt = 7u + ): AtomicResponse { + val commandId: UInt = 254u val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) - val TAG_TIMEOUT_SECONDS_REQ: Int = 0 - tlvWriter.put(ContextSpecificTag(TAG_TIMEOUT_SECONDS_REQ), timeoutSeconds) - tlvWriter.endStructure() - - val request: InvokeRequest = - InvokeRequest( - CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), - tlvPayload = tlvWriter.getEncoded(), - timedRequest = timedInvokeTimeout, - ) - - val response: InvokeResponse = controller.invoke(request) - logger.log(Level.FINE, "Invoke command succeeded: ${response}") - } + val TAG_REQUEST_TYPE_REQ: Int = 0 + tlvWriter.put(ContextSpecificTag(TAG_REQUEST_TYPE_REQ), requestType) - suspend fun cancelPresetsSchedulesEditRequest(timedInvokeTimeout: Duration? = null) { - val commandId: UInt = 8u + val TAG_ATTRIBUTE_REQUESTS_REQ: Int = 1 + tlvWriter.startArray(ContextSpecificTag(TAG_ATTRIBUTE_REQUESTS_REQ)) + for (item in attributeRequests.iterator()) { + tlvWriter.put(AnonymousTag, item) + } + tlvWriter.endArray() - val tlvWriter = TlvWriter() - tlvWriter.startStructure(AnonymousTag) + val TAG_TIMEOUT_REQ: Int = 2 + timeout?.let { tlvWriter.put(ContextSpecificTag(TAG_TIMEOUT_REQ), timeout) } tlvWriter.endStructure() val request: InvokeRequest = @@ -562,51 +561,64 @@ class ThermostatCluster(private val controller: MatterController, private val en val response: InvokeResponse = controller.invoke(request) logger.log(Level.FINE, "Invoke command succeeded: ${response}") - } - suspend fun commitPresetsSchedulesRequest(timedInvokeTimeout: Duration? = null) { - val commandId: UInt = 9u + val tlvReader = TlvReader(response.payload) + tlvReader.enterStructure(AnonymousTag) + val TAG_STATUS_CODE: Int = 0 + var statusCode_decoded: UByte? = null - val tlvWriter = TlvWriter() - tlvWriter.startStructure(AnonymousTag) - tlvWriter.endStructure() + val TAG_ATTRIBUTE_STATUS: Int = 1 + var attributeStatus_decoded: List<ThermostatClusterAtomicAttributeStatusStruct>? = null - val request: InvokeRequest = - InvokeRequest( - CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), - tlvPayload = tlvWriter.getEncoded(), - timedRequest = timedInvokeTimeout, - ) + val TAG_TIMEOUT: Int = 2 + var timeout_decoded: UShort? = null - val response: InvokeResponse = controller.invoke(request) - logger.log(Level.FINE, "Invoke command succeeded: ${response}") - } + while (!tlvReader.isEndOfContainer()) { + val tag = tlvReader.peekElement().tag - suspend fun setTemperatureSetpointHoldPolicy( - temperatureSetpointHoldPolicy: UByte, - timedInvokeTimeout: Duration? = null, - ) { - val commandId: UInt = 11u + if (tag == ContextSpecificTag(TAG_STATUS_CODE)) { + statusCode_decoded = tlvReader.getUByte(tag) + } - val tlvWriter = TlvWriter() - tlvWriter.startStructure(AnonymousTag) + if (tag == ContextSpecificTag(TAG_ATTRIBUTE_STATUS)) { + attributeStatus_decoded = + buildList<ThermostatClusterAtomicAttributeStatusStruct> { + tlvReader.enterArray(tag) + while (!tlvReader.isEndOfContainer()) { + add(ThermostatClusterAtomicAttributeStatusStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + } - val TAG_TEMPERATURE_SETPOINT_HOLD_POLICY_REQ: Int = 0 - tlvWriter.put( - ContextSpecificTag(TAG_TEMPERATURE_SETPOINT_HOLD_POLICY_REQ), - temperatureSetpointHoldPolicy, - ) - tlvWriter.endStructure() + if (tag == ContextSpecificTag(TAG_TIMEOUT)) { + timeout_decoded = + if (tlvReader.isNull()) { + tlvReader.getNull(tag) + null + } else { + if (tlvReader.isNextTag(tag)) { + tlvReader.getUShort(tag) + } else { + null + } + } + } else { + tlvReader.skipElement() + } + } - val request: InvokeRequest = - InvokeRequest( - CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), - tlvPayload = tlvWriter.getEncoded(), - timedRequest = timedInvokeTimeout, - ) + if (statusCode_decoded == null) { + throw IllegalStateException("statusCode not found in TLV") + } - val response: InvokeResponse = controller.invoke(request) - logger.log(Level.FINE, "Invoke command succeeded: ${response}") + if (attributeStatus_decoded == null) { + throw IllegalStateException("attributeStatus not found in TLV") + } + + tlvReader.exitContainer() + + return AtomicResponse(statusCode_decoded, attributeStatus_decoded, timeout_decoded) } suspend fun readLocalTemperatureAttribute(): LocalTemperatureAttribute { @@ -6232,7 +6244,7 @@ class ThermostatCluster(private val controller: MatterController, private val en } } - suspend fun readACCapacityformatAttribute(): UByte? { + suspend fun readACCapacityFormatAttribute(): UByte? { val ATTRIBUTE_ID: UInt = 71u val attributePath = @@ -6268,7 +6280,7 @@ class ThermostatCluster(private val controller: MatterController, private val en return decodedValue } - suspend fun writeACCapacityformatAttribute(value: UByte, timedWriteTimeout: Duration? = null) { + suspend fun writeACCapacityFormatAttribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 71u val tlvWriter = TlvWriter() @@ -6308,7 +6320,7 @@ class ThermostatCluster(private val controller: MatterController, private val en } } - suspend fun subscribeACCapacityformatAttribute( + suspend fun subscribeACCapacityFormatAttribute( minInterval: Int, maxInterval: Int, ): Flow<UByteSubscriptionState> { @@ -7464,196 +7476,8 @@ class ThermostatCluster(private val controller: MatterController, private val en } } - suspend fun readPresetsSchedulesEditableAttribute(): Boolean? { - val ATTRIBUTE_ID: UInt = 82u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance<ReadData.Attribute>().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Presetsscheduleseditable attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Boolean? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getBoolean(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribePresetsSchedulesEditableAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow<BooleanSubscriptionState> { - val ATTRIBUTE_ID: UInt = 82u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - BooleanSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance<ReadData.Attribute>() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Presetsscheduleseditable attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Boolean? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getBoolean(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(BooleanSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(BooleanSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readTemperatureSetpointHoldPolicyAttribute(): UByte? { - val ATTRIBUTE_ID: UInt = 83u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance<ReadData.Attribute>().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { - "Temperaturesetpointholdpolicy attribute not found in response" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UByte? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUByte(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeTemperatureSetpointHoldPolicyAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow<UByteSubscriptionState> { - val ATTRIBUTE_ID: UInt = 83u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UByteSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance<ReadData.Attribute>() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Temperaturesetpointholdpolicy attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UByte? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUByte(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UByteSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UByteSubscriptionState.SubscriptionEstablished) - } - } - } - } - suspend fun readSetpointHoldExpiryTimestampAttribute(): SetpointHoldExpiryTimestampAttribute { - val ATTRIBUTE_ID: UInt = 84u + val ATTRIBUTE_ID: UInt = 82u val attributePath = AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) @@ -7697,7 +7521,7 @@ class ThermostatCluster(private val controller: MatterController, private val en minInterval: Int, maxInterval: Int, ): Flow<SetpointHoldExpiryTimestampAttributeSubscriptionState> { - val ATTRIBUTE_ID: UInt = 84u + val ATTRIBUTE_ID: UInt = 82u val attributePaths = listOf( AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) diff --git a/src/controller/java/generated/java/matter/controller/cluster/files.gni b/src/controller/java/generated/java/matter/controller/cluster/files.gni index fd3fafa315b932..c2bf5dc678cb76 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/files.gni +++ b/src/controller/java/generated/java/matter/controller/cluster/files.gni @@ -127,6 +127,7 @@ matter_structs_sources = [ "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/ServiceAreaClusterProgressStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/SoftwareDiagnosticsClusterThreadMetricsStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/TargetNavigatorClusterTargetInfoStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/ThermostatClusterAtomicAttributeStatusStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/ThermostatClusterPresetStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/ThermostatClusterPresetTypeStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/ThermostatClusterScheduleStruct.kt", diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/ThermostatClusterAtomicAttributeStatusStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/ThermostatClusterAtomicAttributeStatusStruct.kt new file mode 100644 index 00000000000000..e3e27bc0e3dea1 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/ThermostatClusterAtomicAttributeStatusStruct.kt @@ -0,0 +1,76 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package matter.controller.cluster.structs + +import java.util.Optional +import matter.controller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ThermostatClusterAtomicAttributeStatusStruct( + val attributeID: Optional<UInt>, + val statusCode: Optional<UByte>, +) { + override fun toString(): String = buildString { + append("ThermostatClusterAtomicAttributeStatusStruct {\n") + append("\tattributeID : $attributeID\n") + append("\tstatusCode : $statusCode\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + if (attributeID.isPresent) { + val optattributeID = attributeID.get() + put(ContextSpecificTag(TAG_ATTRIBUTE_I_D), optattributeID) + } + if (statusCode.isPresent) { + val optstatusCode = statusCode.get() + put(ContextSpecificTag(TAG_STATUS_CODE), optstatusCode) + } + endStructure() + } + } + + companion object { + private const val TAG_ATTRIBUTE_I_D = 0 + private const val TAG_STATUS_CODE = 1 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ThermostatClusterAtomicAttributeStatusStruct { + tlvReader.enterStructure(tlvTag) + val attributeID = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_ATTRIBUTE_I_D))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_ATTRIBUTE_I_D))) + } else { + Optional.empty() + } + val statusCode = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_STATUS_CODE))) { + Optional.of(tlvReader.getUByte(ContextSpecificTag(TAG_STATUS_CODE))) + } else { + Optional.empty() + } + + tlvReader.exitContainer() + + return ThermostatClusterAtomicAttributeStatusStruct(attributeID, statusCode) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/ThermostatClusterScheduleStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/ThermostatClusterScheduleStruct.kt index 720dfaf37afadd..90ca5ab50b6514 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/structs/ThermostatClusterScheduleStruct.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/ThermostatClusterScheduleStruct.kt @@ -30,7 +30,7 @@ class ThermostatClusterScheduleStruct( val name: Optional<String>, val presetHandle: Optional<ByteArray>, val transitions: List<ThermostatClusterScheduleTransitionStruct>, - val builtIn: Optional<Boolean>?, + val builtIn: Boolean?, ) { override fun toString(): String = buildString { append("ThermostatClusterScheduleStruct {\n") @@ -66,10 +66,7 @@ class ThermostatClusterScheduleStruct( } endArray() if (builtIn != null) { - if (builtIn.isPresent) { - val optbuiltIn = builtIn.get() - put(ContextSpecificTag(TAG_BUILT_IN), optbuiltIn) - } + put(ContextSpecificTag(TAG_BUILT_IN), builtIn) } else { putNull(ContextSpecificTag(TAG_BUILT_IN)) } @@ -117,11 +114,7 @@ class ThermostatClusterScheduleStruct( } val builtIn = if (!tlvReader.isNull()) { - if (tlvReader.isNextTag(ContextSpecificTag(TAG_BUILT_IN))) { - Optional.of(tlvReader.getBoolean(ContextSpecificTag(TAG_BUILT_IN))) - } else { - Optional.empty() - } + tlvReader.getBoolean(ContextSpecificTag(TAG_BUILT_IN)) } else { tlvReader.getNull(ContextSpecificTag(TAG_BUILT_IN)) null diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index b6702569d994d9..fec486c070f4a6 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -29588,7 +29588,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jobject value; std::string valueClassName = "java/lang/Integer"; std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast<jint>(cppValue); + jint jnivalue = static_cast<jint>(cppValue.Raw()); chip::JniReferences::GetInstance().CreateBoxedObject<jint>(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, value); return value; @@ -29700,7 +29700,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jobject value; std::string valueClassName = "java/lang/Integer"; std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast<jint>(cppValue); + jint jnivalue = static_cast<jint>(cppValue.Raw()); chip::JniReferences::GetInstance().CreateBoxedObject<jint>(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, value); return value; @@ -30376,8 +30376,8 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } return value; } - case Attributes::ACCapacityformat::Id: { - using TypeInfo = Attributes::ACCapacityformat::TypeInfo; + case Attributes::ACCapacityFormat::Id: { + using TypeInfo = Attributes::ACCapacityFormat::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -30958,28 +30958,18 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR chip::JniReferences::GetInstance().AddToList(newElement_0_transitions, newElement_2); } jobject newElement_0_builtIn; - if (!entry_0.builtIn.HasValue()) + if (entry_0.builtIn.IsNull()) { - chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_builtIn); + newElement_0_builtIn = nullptr; } else { - jobject newElement_0_builtInInsideOptional; - if (entry_0.builtIn.Value().IsNull()) - { - newElement_0_builtInInsideOptional = nullptr; - } - else - { - std::string newElement_0_builtInInsideOptionalClassName = "java/lang/Boolean"; - std::string newElement_0_builtInInsideOptionalCtorSignature = "(Z)V"; - jboolean jninewElement_0_builtInInsideOptional = static_cast<jboolean>(entry_0.builtIn.Value().Value()); - chip::JniReferences::GetInstance().CreateBoxedObject<jboolean>( - newElement_0_builtInInsideOptionalClassName.c_str(), - newElement_0_builtInInsideOptionalCtorSignature.c_str(), jninewElement_0_builtInInsideOptional, - newElement_0_builtInInsideOptional); - } - chip::JniReferences::GetInstance().CreateOptional(newElement_0_builtInInsideOptional, newElement_0_builtIn); + std::string newElement_0_builtInClassName = "java/lang/Boolean"; + std::string newElement_0_builtInCtorSignature = "(Z)V"; + jboolean jninewElement_0_builtIn = static_cast<jboolean>(entry_0.builtIn.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject<jboolean>(newElement_0_builtInClassName.c_str(), + newElement_0_builtInCtorSignature.c_str(), + jninewElement_0_builtIn, newElement_0_builtIn); } jclass scheduleStructStructClass_1; @@ -30994,7 +30984,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jmethodID scheduleStructStructCtor_1; err = chip::JniReferences::GetInstance().FindMethod( env, scheduleStructStructClass_1, "<init>", - "([BLjava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/ArrayList;Ljava/util/Optional;)V", + "([BLjava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/ArrayList;Ljava/lang/Boolean;)V", &scheduleStructStructCtor_1); if (err != CHIP_NO_ERROR || scheduleStructStructCtor_1 == nullptr) { @@ -31009,38 +30999,6 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } return value; } - case Attributes::PresetsSchedulesEditable::Id: { - using TypeInfo = Attributes::PresetsSchedulesEditable::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Boolean"; - std::string valueCtorSignature = "(Z)V"; - jboolean jnivalue = static_cast<jboolean>(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject<jboolean>(valueClassName.c_str(), valueCtorSignature.c_str(), - jnivalue, value); - return value; - } - case Attributes::TemperatureSetpointHoldPolicy::Id: { - using TypeInfo = Attributes::TemperatureSetpointHoldPolicy::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast<jint>(cppValue.Raw()); - chip::JniReferences::GetInstance().CreateBoxedObject<jint>(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } case Attributes::SetpointHoldExpiryTimestamp::Id: { using TypeInfo = Attributes::SetpointHoldExpiryTimestamp::TypeInfo; TypeInfo::DecodableType cppValue; diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index 6621bbc4bea2a6..86eb43895430c3 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -8827,30 +8827,13 @@ class ChipClusters: "presetHandle": "bytes", }, }, - 0x00000007: { - "commandId": 0x00000007, - "commandName": "StartPresetsSchedulesEditRequest", - "args": { - "timeoutSeconds": "int", - }, - }, - 0x00000008: { - "commandId": 0x00000008, - "commandName": "CancelPresetsSchedulesEditRequest", - "args": { - }, - }, - 0x00000009: { - "commandId": 0x00000009, - "commandName": "CommitPresetsSchedulesRequest", - "args": { - }, - }, - 0x0000000B: { - "commandId": 0x0000000B, - "commandName": "SetTemperatureSetpointHoldPolicy", + 0x000000FE: { + "commandId": 0x000000FE, + "commandName": "AtomicRequest", "args": { - "temperatureSetpointHoldPolicy": "int", + "requestType": "int", + "attributeRequests": "int", + "timeout": "int", }, }, }, @@ -9170,7 +9153,7 @@ class ChipClusters: "reportable": True, }, 0x00000047: { - "attributeName": "ACCapacityformat", + "attributeName": "ACCapacityFormat", "attributeId": 0x00000047, "type": "int", "reportable": True, @@ -9239,20 +9222,8 @@ class ChipClusters: "writable": True, }, 0x00000052: { - "attributeName": "PresetsSchedulesEditable", - "attributeId": 0x00000052, - "type": "bool", - "reportable": True, - }, - 0x00000053: { - "attributeName": "TemperatureSetpointHoldPolicy", - "attributeId": 0x00000053, - "type": "int", - "reportable": True, - }, - 0x00000054: { "attributeName": "SetpointHoldExpiryTimestamp", - "attributeId": 0x00000054, + "attributeId": 0x00000052, "type": "int", "reportable": True, }, diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index fe9a008e11066e..6c76f3bcbc0708 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -32104,7 +32104,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="ACErrorCode", Tag=0x00000044, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="ACLouverPosition", Tag=0x00000045, Type=typing.Optional[Thermostat.Enums.ACLouverPositionEnum]), ClusterObjectFieldDescriptor(Label="ACCoilTemperature", Tag=0x00000046, Type=typing.Union[None, Nullable, int]), - ClusterObjectFieldDescriptor(Label="ACCapacityformat", Tag=0x00000047, Type=typing.Optional[Thermostat.Enums.ACCapacityFormatEnum]), + ClusterObjectFieldDescriptor(Label="ACCapacityFormat", Tag=0x00000047, Type=typing.Optional[Thermostat.Enums.ACCapacityFormatEnum]), ClusterObjectFieldDescriptor(Label="presetTypes", Tag=0x00000048, Type=typing.Optional[typing.List[Thermostat.Structs.PresetTypeStruct]]), ClusterObjectFieldDescriptor(Label="scheduleTypes", Tag=0x00000049, Type=typing.Optional[typing.List[Thermostat.Structs.ScheduleTypeStruct]]), ClusterObjectFieldDescriptor(Label="numberOfPresets", Tag=0x0000004A, Type=typing.Optional[uint]), @@ -32115,9 +32115,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="activeScheduleHandle", Tag=0x0000004F, Type=typing.Union[None, Nullable, bytes]), ClusterObjectFieldDescriptor(Label="presets", Tag=0x00000050, Type=typing.Optional[typing.List[Thermostat.Structs.PresetStruct]]), ClusterObjectFieldDescriptor(Label="schedules", Tag=0x00000051, Type=typing.Optional[typing.List[Thermostat.Structs.ScheduleStruct]]), - ClusterObjectFieldDescriptor(Label="presetsSchedulesEditable", Tag=0x00000052, Type=typing.Optional[bool]), - ClusterObjectFieldDescriptor(Label="temperatureSetpointHoldPolicy", Tag=0x00000053, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="setpointHoldExpiryTimestamp", Tag=0x00000054, Type=typing.Union[None, Nullable, uint]), + ClusterObjectFieldDescriptor(Label="setpointHoldExpiryTimestamp", Tag=0x00000052, Type=typing.Union[None, Nullable, uint]), ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="eventList", Tag=0x0000FFFA, Type=typing.List[uint]), @@ -32174,7 +32172,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: ACErrorCode: 'typing.Optional[uint]' = None ACLouverPosition: 'typing.Optional[Thermostat.Enums.ACLouverPositionEnum]' = None ACCoilTemperature: 'typing.Union[None, Nullable, int]' = None - ACCapacityformat: 'typing.Optional[Thermostat.Enums.ACCapacityFormatEnum]' = None + ACCapacityFormat: 'typing.Optional[Thermostat.Enums.ACCapacityFormatEnum]' = None presetTypes: 'typing.Optional[typing.List[Thermostat.Structs.PresetTypeStruct]]' = None scheduleTypes: 'typing.Optional[typing.List[Thermostat.Structs.ScheduleTypeStruct]]' = None numberOfPresets: 'typing.Optional[uint]' = None @@ -32185,8 +32183,6 @@ def descriptor(cls) -> ClusterObjectDescriptor: activeScheduleHandle: 'typing.Union[None, Nullable, bytes]' = None presets: 'typing.Optional[typing.List[Thermostat.Structs.PresetStruct]]' = None schedules: 'typing.Optional[typing.List[Thermostat.Structs.ScheduleStruct]]' = None - presetsSchedulesEditable: 'typing.Optional[bool]' = None - temperatureSetpointHoldPolicy: 'typing.Optional[uint]' = None setpointHoldExpiryTimestamp: 'typing.Union[None, Nullable, uint]' = None generatedCommandList: 'typing.List[uint]' = None acceptedCommandList: 'typing.List[uint]' = None @@ -32250,6 +32246,16 @@ class ACTypeEnum(MatterIntEnum): # enum value. This specific value should never be transmitted. kUnknownEnumValue = 5, + class AtomicRequestTypeEnum(MatterIntEnum): + kBeginWrite = 0x00 + kCommitWrite = 0x01 + kRollbackWrite = 0x02 + # All received enum values that are not listed above will be mapped + # to kUnknownEnumValue. This is a helper enum value that should only + # be used by code to process how it handles receiving and unknown + # enum value. This specific should never be transmitted. + kUnknownEnumValue = 3, + class ControlSequenceOfOperationEnum(MatterIntEnum): kCoolingOnly = 0x00 kCoolingWithReheat = 0x01 @@ -32264,17 +32270,17 @@ class ControlSequenceOfOperationEnum(MatterIntEnum): kUnknownEnumValue = 6, class PresetScenarioEnum(MatterIntEnum): - kUnspecified = 0x00 kOccupied = 0x01 kUnoccupied = 0x02 kSleep = 0x03 kWake = 0x04 kVacation = 0x05 - kUserDefined = 0x06 + kGoingToSleep = 0x06 + kUserDefined = 0xFE # All received enum values that are not listed above will be mapped # to kUnknownEnumValue. This is a helper enum value that should only - # be used by code to process how it handles receiving an unknown - # enum value. This specific value should never be transmitted. + # be used by code to process how it handles receiving and unknown + # enum value. This specific should never be transmitted. kUnknownEnumValue = 7, class SetpointChangeSourceEnum(MatterIntEnum): @@ -32364,7 +32370,6 @@ class Feature(IntFlag): kLocalTemperatureNotExposed = 0x40 kMatterScheduleConfiguration = 0x80 kPresets = 0x100 - kSetpoints = 0x200 class HVACSystemTypeBitmap(IntFlag): kCoolingStage = 0x3 @@ -32372,6 +32377,9 @@ class HVACSystemTypeBitmap(IntFlag): kHeatingIsHeatPump = 0x10 kHeatingUsesFuel = 0x20 + class OccupancyBitmap(IntFlag): + kOccupied = 0x1 + class PresetTypeFeaturesBitmap(IntFlag): kAutomatic = 0x1 kSupportsNames = 0x2 @@ -32415,10 +32423,6 @@ class ScheduleTypeFeaturesBitmap(IntFlag): kSupportsNames = 0x4 kSupportsOff = 0x8 - class TemperatureSetpointHoldPolicyBitmap(IntFlag): - kHoldDurationElapsed = 0x1 - kHoldDurationElapsedOrPresetChanged = 0x2 - class Structs: @dataclass class ScheduleTransitionStruct(ClusterObject): @@ -32452,7 +32456,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="name", Tag=2, Type=typing.Optional[str]), ClusterObjectFieldDescriptor(Label="presetHandle", Tag=3, Type=typing.Optional[bytes]), ClusterObjectFieldDescriptor(Label="transitions", Tag=4, Type=typing.List[Thermostat.Structs.ScheduleTransitionStruct]), - ClusterObjectFieldDescriptor(Label="builtIn", Tag=5, Type=typing.Union[None, Nullable, bool]), + ClusterObjectFieldDescriptor(Label="builtIn", Tag=5, Type=typing.Union[Nullable, bool]), ]) scheduleHandle: 'typing.Union[Nullable, bytes]' = NullValue @@ -32460,7 +32464,20 @@ def descriptor(cls) -> ClusterObjectDescriptor: name: 'typing.Optional[str]' = None presetHandle: 'typing.Optional[bytes]' = None transitions: 'typing.List[Thermostat.Structs.ScheduleTransitionStruct]' = field(default_factory=lambda: []) - builtIn: 'typing.Union[None, Nullable, bool]' = None + builtIn: 'typing.Union[Nullable, bool]' = NullValue + + @dataclass + class AtomicAttributeStatusStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="attributeID", Tag=0, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="statusCode", Tag=1, Type=typing.Optional[uint]), + ]) + + attributeID: 'typing.Optional[uint]' = None + statusCode: 'typing.Optional[uint]' = None @dataclass class PresetStruct(ClusterObject): @@ -32655,62 +32672,44 @@ def descriptor(cls) -> ClusterObjectDescriptor: presetHandle: 'bytes' = b"" @dataclass - class StartPresetsSchedulesEditRequest(ClusterCommand): + class AtomicResponse(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x00000201 - command_id: typing.ClassVar[int] = 0x00000007 - is_client: typing.ClassVar[bool] = True - response_type: typing.ClassVar[str] = None - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields=[ - ClusterObjectFieldDescriptor(Label="timeoutSeconds", Tag=0, Type=uint), - ]) - - timeoutSeconds: 'uint' = 0 - - @dataclass - class CancelPresetsSchedulesEditRequest(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x00000201 - command_id: typing.ClassVar[int] = 0x00000008 - is_client: typing.ClassVar[bool] = True + command_id: typing.ClassVar[int] = 0x000000FD + is_client: typing.ClassVar[bool] = False response_type: typing.ClassVar[str] = None @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ + ClusterObjectFieldDescriptor(Label="statusCode", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="attributeStatus", Tag=1, Type=typing.List[Thermostat.Structs.AtomicAttributeStatusStruct]), + ClusterObjectFieldDescriptor(Label="timeout", Tag=2, Type=typing.Optional[uint]), ]) - @dataclass - class CommitPresetsSchedulesRequest(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x00000201 - command_id: typing.ClassVar[int] = 0x00000009 - is_client: typing.ClassVar[bool] = True - response_type: typing.ClassVar[str] = None - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields=[ - ]) + statusCode: 'uint' = 0 + attributeStatus: 'typing.List[Thermostat.Structs.AtomicAttributeStatusStruct]' = field(default_factory=lambda: []) + timeout: 'typing.Optional[uint]' = None @dataclass - class SetTemperatureSetpointHoldPolicy(ClusterCommand): + class AtomicRequest(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x00000201 - command_id: typing.ClassVar[int] = 0x0000000B + command_id: typing.ClassVar[int] = 0x000000FE is_client: typing.ClassVar[bool] = True - response_type: typing.ClassVar[str] = None + response_type: typing.ClassVar[str] = 'AtomicResponse' @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="temperatureSetpointHoldPolicy", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="requestType", Tag=0, Type=Thermostat.Enums.AtomicRequestTypeEnum), + ClusterObjectFieldDescriptor(Label="attributeRequests", Tag=1, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="timeout", Tag=2, Type=typing.Optional[uint]), ]) - temperatureSetpointHoldPolicy: 'uint' = 0 + requestType: 'Thermostat.Enums.AtomicRequestTypeEnum' = 0 + attributeRequests: 'typing.List[uint]' = field(default_factory=lambda: []) + timeout: 'typing.Optional[uint]' = None class Attributes: @dataclass @@ -33482,7 +33481,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: value: 'typing.Union[None, Nullable, int]' = None @dataclass - class ACCapacityformat(ClusterAttributeDescriptor): + class ACCapacityFormat(ClusterAttributeDescriptor): @ChipUtility.classproperty def cluster_id(cls) -> int: return 0x00000201 @@ -33657,38 +33656,6 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: value: 'typing.Optional[typing.List[Thermostat.Structs.ScheduleStruct]]' = None - @dataclass - class PresetsSchedulesEditable(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000201 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000052 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[bool]) - - value: 'typing.Optional[bool]' = None - - @dataclass - class TemperatureSetpointHoldPolicy(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000201 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000053 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - @dataclass class SetpointHoldExpiryTimestamp(ClusterAttributeDescriptor): @ChipUtility.classproperty @@ -33697,7 +33664,7 @@ def cluster_id(cls) -> int: @ChipUtility.classproperty def attribute_id(cls) -> int: - return 0x00000054 + return 0x00000052 @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm index 204d15937b23ca..61a05300a054a5 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm @@ -4125,7 +4125,7 @@ static BOOL AttributeIsSpecifiedInThermostatCluster(AttributeId aAttributeId) case Attributes::ACCoilTemperature::Id: { return YES; } - case Attributes::ACCapacityformat::Id: { + case Attributes::ACCapacityFormat::Id: { return YES; } case Attributes::PresetTypes::Id: { @@ -4158,12 +4158,6 @@ static BOOL AttributeIsSpecifiedInThermostatCluster(AttributeId aAttributeId) case Attributes::Schedules::Id: { return YES; } - case Attributes::PresetsSchedulesEditable::Id: { - return YES; - } - case Attributes::TemperatureSetpointHoldPolicy::Id: { - return YES; - } case Attributes::SetpointHoldExpiryTimestamp::Id: { return YES; } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm index ca3cc6c5e620eb..517896208d03df 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -11623,7 +11623,7 @@ static id _Nullable DecodeAttributeValueForThermostatCluster(AttributeId aAttrib return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; return value; } case Attributes::AbsMinHeatSetpointLimit::Id: { @@ -11700,7 +11700,7 @@ static id _Nullable DecodeAttributeValueForThermostatCluster(AttributeId aAttrib return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; return value; } case Attributes::LocalTemperatureCalibration::Id: { @@ -12157,8 +12157,8 @@ static id _Nullable DecodeAttributeValueForThermostatCluster(AttributeId aAttrib } return value; } - case Attributes::ACCapacityformat::Id: { - using TypeInfo = Attributes::ACCapacityformat::TypeInfo; + case Attributes::ACCapacityFormat::Id: { + using TypeInfo = Attributes::ACCapacityFormat::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -12439,14 +12439,10 @@ static id _Nullable DecodeAttributeValueForThermostatCluster(AttributeId aAttrib } newElement_0.transitions = array_2; } - if (entry_0.builtIn.HasValue()) { - if (entry_0.builtIn.Value().IsNull()) { - newElement_0.builtIn = nil; - } else { - newElement_0.builtIn = [NSNumber numberWithBool:entry_0.builtIn.Value().Value()]; - } - } else { + if (entry_0.builtIn.IsNull()) { newElement_0.builtIn = nil; + } else { + newElement_0.builtIn = [NSNumber numberWithBool:entry_0.builtIn.Value()]; } [array_0 addObject:newElement_0]; } @@ -12459,28 +12455,6 @@ static id _Nullable DecodeAttributeValueForThermostatCluster(AttributeId aAttrib } return value; } - case Attributes::PresetsSchedulesEditable::Id: { - using TypeInfo = Attributes::PresetsSchedulesEditable::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithBool:cppValue]; - return value; - } - case Attributes::TemperatureSetpointHoldPolicy::Id: { - using TypeInfo = Attributes::TemperatureSetpointHoldPolicy::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; - return value; - } case Attributes::SetpointHoldExpiryTimestamp::Id: { using TypeInfo = Attributes::SetpointHoldExpiryTimestamp::TypeInfo; TypeInfo::DecodableType cppValue; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index 2bcdb3fbc3919e..88bd9d985685bc 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -9964,25 +9964,25 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) /** * Command SetpointRaiseLower * - * Command description for SetpointRaiseLower + * Upon receipt, the attributes for the indicated setpoint(s) SHALL have the amount specified in the Amount field added to them. */ - (void)setpointRaiseLowerWithParams:(MTRThermostatClusterSetpointRaiseLowerParams *)params completion:(MTRStatusCompletion)completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); /** * Command SetWeeklySchedule * - * Command description for SetWeeklySchedule + * Upon receipt, the weekly schedule for updating setpoints SHALL be stored in the */ - (void)setWeeklyScheduleWithParams:(MTRThermostatClusterSetWeeklyScheduleParams *)params completion:(MTRStatusCompletion)completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); /** * Command GetWeeklySchedule * - * Command description for GetWeeklySchedule + * Upon receipt, the unit SHOULD send in return the Get */ - (void)getWeeklyScheduleWithParams:(MTRThermostatClusterGetWeeklyScheduleParams *)params completion:(void (^)(MTRThermostatClusterGetWeeklyScheduleResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); /** * Command ClearWeeklySchedule * - * This command is used to clear the weekly schedule. The ClearWeeklySchedule command has no payload. + * This command is used to clear the weekly schedule. */ - (void)clearWeeklyScheduleWithParams:(MTRThermostatClusterClearWeeklyScheduleParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); - (void)clearWeeklyScheduleWithCompletion:(MTRStatusCompletion)completion @@ -9990,43 +9990,21 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) /** * Command SetActiveScheduleRequest * - * This command is used to set the active schedule. + * Upon receipt, if the */ - (void)setActiveScheduleRequestWithParams:(MTRThermostatClusterSetActiveScheduleRequestParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; /** * Command SetActivePresetRequest * - * This command is used to set the active preset. + * ID */ - (void)setActivePresetRequestWithParams:(MTRThermostatClusterSetActivePresetRequestParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; /** - * Command StartPresetsSchedulesEditRequest + * Command AtomicRequest * - * This command is used to start editing the presets and schedules. + * Begins, Commits or Cancels an atomic write */ -- (void)startPresetsSchedulesEditRequestWithParams:(MTRThermostatClusterStartPresetsSchedulesEditRequestParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; -/** - * Command CancelPresetsSchedulesEditRequest - * - * This command is used to cancel editing presets and schedules. - */ -- (void)cancelPresetsSchedulesEditRequestWithParams:(MTRThermostatClusterCancelPresetsSchedulesEditRequestParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; -- (void)cancelPresetsSchedulesEditRequestWithCompletion:(MTRStatusCompletion)completion - MTR_PROVISIONALLY_AVAILABLE; -/** - * Command CommitPresetsSchedulesRequest - * - * This command is used to notify the server that all edits are done and should be committed. - */ -- (void)commitPresetsSchedulesRequestWithParams:(MTRThermostatClusterCommitPresetsSchedulesRequestParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; -- (void)commitPresetsSchedulesRequestWithCompletion:(MTRStatusCompletion)completion - MTR_PROVISIONALLY_AVAILABLE; -/** - * Command SetTemperatureSetpointHoldPolicy - * - * This command sets the set point hold policy. - */ -- (void)setTemperatureSetpointHoldPolicyWithParams:(MTRThermostatClusterSetTemperatureSetpointHoldPolicyParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)atomicRequestWithParams:(MTRThermostatClusterAtomicRequestParams *)params completion:(void (^)(MTRThermostatClusterAtomicResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; - (void)readAttributeLocalTemperatureWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); - (void)subscribeAttributeLocalTemperatureWithParams:(MTRSubscribeParams *)params @@ -10368,13 +10346,13 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); + (void)readAttributeACCoilTemperatureWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); -- (void)readAttributeACCapacityformatWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); -- (void)writeAttributeACCapacityformatWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); -- (void)writeAttributeACCapacityformatWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); -- (void)subscribeAttributeACCapacityformatWithParams:(MTRSubscribeParams *)params +- (void)readAttributeACCapacityFormatWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeACCapacityFormatWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeACCapacityFormatWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeACCapacityFormatWithParams:(MTRSubscribeParams *)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); -+ (void)readAttributeACCapacityformatWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeACCapacityFormatWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; - (void)readAttributePresetTypesWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; - (void)subscribeAttributePresetTypesWithParams:(MTRSubscribeParams *)params @@ -10440,18 +10418,6 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; + (void)readAttributeSchedulesWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; -- (void)readAttributePresetsSchedulesEditableWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; -- (void)subscribeAttributePresetsSchedulesEditableWithParams:(MTRSubscribeParams *)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; -+ (void)readAttributePresetsSchedulesEditableWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; - -- (void)readAttributeTemperatureSetpointHoldPolicyWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; -- (void)subscribeAttributeTemperatureSetpointHoldPolicyWithParams:(MTRSubscribeParams *)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; -+ (void)readAttributeTemperatureSetpointHoldPolicyWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; - - (void)readAttributeSetpointHoldExpiryTimestampWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; - (void)subscribeAttributeSetpointHoldExpiryTimestampWithParams:(MTRSubscribeParams *)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished @@ -19827,6 +19793,12 @@ typedef NS_ENUM(uint8_t, MTRThermostatACType) { MTRThermostatACTypeHeatPumpInverter MTR_PROVISIONALLY_AVAILABLE = 0x04, } MTR_PROVISIONALLY_AVAILABLE; +typedef NS_ENUM(uint8_t, MTRThermostatAtomicRequestType) { + MTRThermostatAtomicRequestTypeBeginWrite MTR_PROVISIONALLY_AVAILABLE = 0x00, + MTRThermostatAtomicRequestTypeCommitWrite MTR_PROVISIONALLY_AVAILABLE = 0x01, + MTRThermostatAtomicRequestTypeRollbackWrite MTR_PROVISIONALLY_AVAILABLE = 0x02, +} MTR_PROVISIONALLY_AVAILABLE; + typedef NS_ENUM(uint8_t, MTRThermostatControlSequenceOfOperation) { MTRThermostatControlSequenceOfOperationCoolingOnly MTR_AVAILABLE(ios(17.4), macos(14.4), watchos(10.4), tvos(17.4)) = 0x00, MTRThermostatControlSequenceOfOperationCoolingWithReheat MTR_AVAILABLE(ios(17.4), macos(14.4), watchos(10.4), tvos(17.4)) = 0x01, @@ -19846,13 +19818,13 @@ typedef NS_ENUM(uint8_t, MTRThermostatControlSequence) { } MTR_DEPRECATED("Please use MTRThermostatControlSequenceOfOperation", ios(16.1, 17.4), macos(13.0, 14.4), watchos(9.1, 10.4), tvos(16.1, 17.4)); typedef NS_ENUM(uint8_t, MTRThermostatPresetScenario) { - MTRThermostatPresetScenarioUnspecified MTR_PROVISIONALLY_AVAILABLE = 0x00, MTRThermostatPresetScenarioOccupied MTR_PROVISIONALLY_AVAILABLE = 0x01, MTRThermostatPresetScenarioUnoccupied MTR_PROVISIONALLY_AVAILABLE = 0x02, MTRThermostatPresetScenarioSleep MTR_PROVISIONALLY_AVAILABLE = 0x03, MTRThermostatPresetScenarioWake MTR_PROVISIONALLY_AVAILABLE = 0x04, MTRThermostatPresetScenarioVacation MTR_PROVISIONALLY_AVAILABLE = 0x05, - MTRThermostatPresetScenarioUserDefined MTR_PROVISIONALLY_AVAILABLE = 0x06, + MTRThermostatPresetScenarioGoingToSleep MTR_PROVISIONALLY_AVAILABLE = 0x06, + MTRThermostatPresetScenarioUserDefined MTR_PROVISIONALLY_AVAILABLE = 0xFE, } MTR_PROVISIONALLY_AVAILABLE; typedef NS_ENUM(uint8_t, MTRThermostatSetpointChangeSource) { @@ -19930,7 +19902,6 @@ typedef NS_OPTIONS(uint32_t, MTRThermostatFeature) { MTRThermostatFeatureLocalTemperatureNotExposed MTR_AVAILABLE(ios(17.0), macos(14.0), watchos(10.0), tvos(17.0)) = 0x40, MTRThermostatFeatureMatterScheduleConfiguration MTR_PROVISIONALLY_AVAILABLE = 0x80, MTRThermostatFeaturePresets MTR_PROVISIONALLY_AVAILABLE = 0x100, - MTRThermostatFeatureSetpoints MTR_PROVISIONALLY_AVAILABLE = 0x200, } MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); typedef NS_OPTIONS(uint8_t, MTRThermostatHVACSystemTypeBitmap) { @@ -19940,6 +19911,10 @@ typedef NS_OPTIONS(uint8_t, MTRThermostatHVACSystemTypeBitmap) { MTRThermostatHVACSystemTypeBitmapHeatingUsesFuel MTR_PROVISIONALLY_AVAILABLE = 0x20, } MTR_PROVISIONALLY_AVAILABLE; +typedef NS_OPTIONS(uint8_t, MTRThermostatOccupancyBitmap) { + MTRThermostatOccupancyBitmapOccupied MTR_PROVISIONALLY_AVAILABLE = 0x1, +} MTR_PROVISIONALLY_AVAILABLE; + typedef NS_OPTIONS(uint16_t, MTRThermostatPresetTypeFeaturesBitmap) { MTRThermostatPresetTypeFeaturesBitmapAutomatic MTR_PROVISIONALLY_AVAILABLE = 0x1, MTRThermostatPresetTypeFeaturesBitmapSupportsNames MTR_PROVISIONALLY_AVAILABLE = 0x2, @@ -20009,11 +19984,6 @@ typedef NS_OPTIONS(uint16_t, MTRThermostatScheduleTypeFeaturesBitmap) { MTRThermostatScheduleTypeFeaturesBitmapSupportsOff MTR_PROVISIONALLY_AVAILABLE = 0x8, } MTR_PROVISIONALLY_AVAILABLE; -typedef NS_OPTIONS(uint8_t, MTRThermostatTemperatureSetpointHoldPolicyBitmap) { - MTRThermostatTemperatureSetpointHoldPolicyBitmapHoldDurationElapsed MTR_PROVISIONALLY_AVAILABLE = 0x1, - MTRThermostatTemperatureSetpointHoldPolicyBitmapHoldDurationElapsedOrPresetChanged MTR_PROVISIONALLY_AVAILABLE = 0x2, -} MTR_PROVISIONALLY_AVAILABLE; - typedef NS_ENUM(uint8_t, MTRFanControlAirflowDirection) { MTRFanControlAirflowDirectionForward MTR_AVAILABLE(ios(17.6), macos(14.6), watchos(10.6), tvos(17.6)) = 0x00, MTRFanControlAirflowDirectionReverse MTR_AVAILABLE(ios(17.6), macos(14.6), watchos(10.6), tvos(17.6)) = 0x01, @@ -26094,15 +26064,6 @@ typedef NS_OPTIONS(uint8_t, MTRTestClusterSimpleBitmap) { reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_DEPRECATED("Please use subscribeAttributeACCoilTemperatureWithParams:subscriptionEstablished:", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); + (void)readAttributeACCoilTemperatureWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler MTR_DEPRECATED("Please use readAttributeACCoilTemperatureWithAttributeCache:endpoint:queue:completion:", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); -- (void)readAttributeACCapacityformatWithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler MTR_DEPRECATED("Please use readAttributeACCapacityformatWithCompletion:", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); -- (void)writeAttributeACCapacityformatWithValue:(NSNumber * _Nonnull)value completionHandler:(MTRStatusCompletion)completionHandler MTR_DEPRECATED("Please use writeAttributeACCapacityformatWithValue:completion:", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); -- (void)writeAttributeACCapacityformatWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completionHandler:(MTRStatusCompletion)completionHandler MTR_DEPRECATED("Please use writeAttributeACCapacityformatWithValue:params:completion:", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); -- (void)subscribeAttributeACCapacityformatWithMinInterval:(NSNumber * _Nonnull)minInterval maxInterval:(NSNumber * _Nonnull)maxInterval - params:(MTRSubscribeParams * _Nullable)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_DEPRECATED("Please use subscribeAttributeACCapacityformatWithParams:subscriptionEstablished:", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); -+ (void)readAttributeACCapacityformatWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler MTR_DEPRECATED("Please use readAttributeACCapacityformatWithAttributeCache:endpoint:queue:completion:", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); - - (void)readAttributeGeneratedCommandListWithCompletionHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler MTR_DEPRECATED("Please use readAttributeGeneratedCommandListWithCompletion:", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnull)minInterval maxInterval:(NSNumber * _Nonnull)maxInterval params:(MTRSubscribeParams * _Nullable)params diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index 641fea65515da4..52333fd4fad3ef 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -67897,107 +67897,27 @@ - (void)setActivePresetRequestWithParams:(MTRThermostatClusterSetActivePresetReq queue:self.callbackQueue completion:responseHandler]; } -- (void)startPresetsSchedulesEditRequestWithParams:(MTRThermostatClusterStartPresetsSchedulesEditRequestParams *)params completion:(MTRStatusCompletion)completion +- (void)atomicRequestWithParams:(MTRThermostatClusterAtomicRequestParams *)params completion:(void (^)(MTRThermostatClusterAtomicResponseParams * _Nullable data, NSError * _Nullable error))completion { if (params == nil) { - params = [[MTRThermostatClusterStartPresetsSchedulesEditRequestParams + params = [[MTRThermostatClusterAtomicRequestParams alloc] init]; } auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { - completion(error); - }; - - auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; - - using RequestType = Thermostat::Commands::StartPresetsSchedulesEditRequest::Type; - [self.device _invokeKnownCommandWithEndpointID:self.endpointID - clusterID:@(RequestType::GetClusterId()) - commandID:@(RequestType::GetCommandId()) - commandPayload:params - timedInvokeTimeout:timedInvokeTimeoutMs - serverSideProcessingTimeout:params.serverSideProcessingTimeout - responseClass:nil - queue:self.callbackQueue - completion:responseHandler]; -} -- (void)cancelPresetsSchedulesEditRequestWithCompletion:(MTRStatusCompletion)completion -{ - [self cancelPresetsSchedulesEditRequestWithParams:nil completion:completion]; -} -- (void)cancelPresetsSchedulesEditRequestWithParams:(MTRThermostatClusterCancelPresetsSchedulesEditRequestParams * _Nullable)params completion:(MTRStatusCompletion)completion -{ - if (params == nil) { - params = [[MTRThermostatClusterCancelPresetsSchedulesEditRequestParams - alloc] init]; - } - - auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { - completion(error); - }; - - auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; - - using RequestType = Thermostat::Commands::CancelPresetsSchedulesEditRequest::Type; - [self.device _invokeKnownCommandWithEndpointID:self.endpointID - clusterID:@(RequestType::GetClusterId()) - commandID:@(RequestType::GetCommandId()) - commandPayload:params - timedInvokeTimeout:timedInvokeTimeoutMs - serverSideProcessingTimeout:params.serverSideProcessingTimeout - responseClass:nil - queue:self.callbackQueue - completion:responseHandler]; -} -- (void)commitPresetsSchedulesRequestWithCompletion:(MTRStatusCompletion)completion -{ - [self commitPresetsSchedulesRequestWithParams:nil completion:completion]; -} -- (void)commitPresetsSchedulesRequestWithParams:(MTRThermostatClusterCommitPresetsSchedulesRequestParams * _Nullable)params completion:(MTRStatusCompletion)completion -{ - if (params == nil) { - params = [[MTRThermostatClusterCommitPresetsSchedulesRequestParams - alloc] init]; - } - - auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { - completion(error); - }; - - auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; - - using RequestType = Thermostat::Commands::CommitPresetsSchedulesRequest::Type; - [self.device _invokeKnownCommandWithEndpointID:self.endpointID - clusterID:@(RequestType::GetClusterId()) - commandID:@(RequestType::GetCommandId()) - commandPayload:params - timedInvokeTimeout:timedInvokeTimeoutMs - serverSideProcessingTimeout:params.serverSideProcessingTimeout - responseClass:nil - queue:self.callbackQueue - completion:responseHandler]; -} -- (void)setTemperatureSetpointHoldPolicyWithParams:(MTRThermostatClusterSetTemperatureSetpointHoldPolicyParams *)params completion:(MTRStatusCompletion)completion -{ - if (params == nil) { - params = [[MTRThermostatClusterSetTemperatureSetpointHoldPolicyParams - alloc] init]; - } - - auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { - completion(error); + completion(response, error); }; auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; - using RequestType = Thermostat::Commands::SetTemperatureSetpointHoldPolicy::Type; + using RequestType = Thermostat::Commands::AtomicRequest::Type; [self.device _invokeKnownCommandWithEndpointID:self.endpointID clusterID:@(RequestType::GetClusterId()) commandID:@(RequestType::GetCommandId()) commandPayload:params timedInvokeTimeout:timedInvokeTimeoutMs serverSideProcessingTimeout:params.serverSideProcessingTimeout - responseClass:nil + responseClass:MTRThermostatClusterAtomicResponseParams.class queue:self.callbackQueue completion:responseHandler]; } @@ -68358,7 +68278,7 @@ - (void)writeAttributeHVACSystemTypeConfigurationWithValue:(NSNumber * _Nonnull) ListFreer listFreer; using TypeInfo = Thermostat::Attributes::HVACSystemTypeConfiguration::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = static_cast<std::remove_reference_t<decltype(cppValue)>>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute<TypeInfo>(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -70473,9 +70393,9 @@ + (void)readAttributeACCoilTemperatureWithClusterStateCache:(MTRClusterStateCach completion:completion]; } -- (void)readAttributeACCapacityformatWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +- (void)readAttributeACCapacityFormatWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { - using TypeInfo = Thermostat::Attributes::ACCapacityformat::TypeInfo; + using TypeInfo = Thermostat::Attributes::ACCapacityFormat::TypeInfo; [self.device _readKnownAttributeWithEndpointID:self.endpointID clusterID:@(TypeInfo::GetClusterId()) attributeID:@(TypeInfo::GetAttributeId()) @@ -70484,11 +70404,11 @@ - (void)readAttributeACCapacityformatWithCompletion:(void (^)(NSNumber * _Nullab completion:completion]; } -- (void)writeAttributeACCapacityformatWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion +- (void)writeAttributeACCapacityFormatWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion { - [self writeAttributeACCapacityformatWithValue:(NSNumber * _Nonnull) value params:nil completion:completion]; + [self writeAttributeACCapacityFormatWithValue:(NSNumber * _Nonnull) value params:nil completion:completion]; } -- (void)writeAttributeACCapacityformatWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +- (void)writeAttributeACCapacityFormatWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion { // Make a copy of params before we go async. params = [params copy]; @@ -70503,7 +70423,7 @@ - (void)writeAttributeACCapacityformatWithValue:(NSNumber * _Nonnull)value param } ListFreer listFreer; - using TypeInfo = Thermostat::Attributes::ACCapacityformat::TypeInfo; + using TypeInfo = Thermostat::Attributes::ACCapacityFormat::TypeInfo; TypeInfo::Type cppValue; cppValue = static_cast<std::remove_reference_t<decltype(cppValue)>>(value.unsignedCharValue); @@ -70512,11 +70432,11 @@ - (void)writeAttributeACCapacityformatWithValue:(NSNumber * _Nonnull)value param std::move(*bridge).DispatchAction(self.device); } -- (void)subscribeAttributeACCapacityformatWithParams:(MTRSubscribeParams * _Nonnull)params +- (void)subscribeAttributeACCapacityFormatWithParams:(MTRSubscribeParams * _Nonnull)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler { - using TypeInfo = Thermostat::Attributes::ACCapacityformat::TypeInfo; + using TypeInfo = Thermostat::Attributes::ACCapacityFormat::TypeInfo; [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID clusterID:@(TypeInfo::GetClusterId()) attributeID:@(TypeInfo::GetAttributeId()) @@ -70526,9 +70446,9 @@ - (void)subscribeAttributeACCapacityformatWithParams:(MTRSubscribeParams * _Nonn subscriptionEstablished:subscriptionEstablished]; } -+ (void)readAttributeACCapacityformatWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion ++ (void)readAttributeACCapacityFormatWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { - using TypeInfo = Thermostat::Attributes::ACCapacityformat::TypeInfo; + using TypeInfo = Thermostat::Attributes::ACCapacityFormat::TypeInfo; [clusterStateCacheContainer _readKnownCachedAttributeWithEndpointID:static_cast<chip::EndpointId>([endpoint unsignedShortValue]) clusterID:TypeInfo::GetClusterId() @@ -71040,15 +70960,12 @@ - (void)writeAttributeSchedulesWithValue:(NSArray * _Nonnull)value params:(MTRWr listHolder_0->mList[i_0].transitions = ListType_2(); } } - if (element_0.builtIn != nil) { - auto & definedValue_2 = listHolder_0->mList[i_0].builtIn.Emplace(); - if (element_0.builtIn == nil) { - definedValue_2.SetNull(); - } else { - auto & nonNullValue_3 = definedValue_2.SetNonNull(); - nonNullValue_3 = element_0.builtIn.boolValue; + if (element_0.builtIn == nil) { + listHolder_0->mList[i_0].builtIn.SetNull(); + } else { + auto & nonNullValue_2 = listHolder_0->mList[i_0].builtIn.SetNonNull(); + nonNullValue_2 = element_0.builtIn.boolValue; } - } } cppValue = ListType_0(listHolder_0->mList, value.count); } else { @@ -71086,78 +71003,6 @@ + (void)readAttributeSchedulesWithClusterStateCache:(MTRClusterStateCacheContain completion:completion]; } -- (void)readAttributePresetsSchedulesEditableWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = Thermostat::Attributes::PresetsSchedulesEditable::TypeInfo; - [self.device _readKnownAttributeWithEndpointID:self.endpointID - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:nil - queue:self.callbackQueue - completion:completion]; -} - -- (void)subscribeAttributePresetsSchedulesEditableWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = Thermostat::Attributes::PresetsSchedulesEditable::TypeInfo; - [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:params - queue:self.callbackQueue - reportHandler:reportHandler - subscriptionEstablished:subscriptionEstablished]; -} - -+ (void)readAttributePresetsSchedulesEditableWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = Thermostat::Attributes::PresetsSchedulesEditable::TypeInfo; - [clusterStateCacheContainer - _readKnownCachedAttributeWithEndpointID:static_cast<chip::EndpointId>([endpoint unsignedShortValue]) - clusterID:TypeInfo::GetClusterId() - attributeID:TypeInfo::GetAttributeId() - queue:queue - completion:completion]; -} - -- (void)readAttributeTemperatureSetpointHoldPolicyWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = Thermostat::Attributes::TemperatureSetpointHoldPolicy::TypeInfo; - [self.device _readKnownAttributeWithEndpointID:self.endpointID - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:nil - queue:self.callbackQueue - completion:completion]; -} - -- (void)subscribeAttributeTemperatureSetpointHoldPolicyWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = Thermostat::Attributes::TemperatureSetpointHoldPolicy::TypeInfo; - [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:params - queue:self.callbackQueue - reportHandler:reportHandler - subscriptionEstablished:subscriptionEstablished]; -} - -+ (void)readAttributeTemperatureSetpointHoldPolicyWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = Thermostat::Attributes::TemperatureSetpointHoldPolicy::TypeInfo; - [clusterStateCacheContainer - _readKnownCachedAttributeWithEndpointID:static_cast<chip::EndpointId>([endpoint unsignedShortValue]) - clusterID:TypeInfo::GetClusterId() - attributeID:TypeInfo::GetAttributeId() - queue:queue - completion:completion]; -} - - (void)readAttributeSetpointHoldExpiryTimestampWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { using TypeInfo = Thermostat::Attributes::SetpointHoldExpiryTimestamp::TypeInfo; @@ -73330,49 +73175,6 @@ + (void)readAttributeACCoilTemperatureWithAttributeCache:(MTRAttributeCacheConta }]; } -- (void)readAttributeACCapacityformatWithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler -{ - [self readAttributeACCapacityformatWithCompletion: - ^(NSNumber * _Nullable value, NSError * _Nullable error) { - // Cast is safe because subclass does not add any selectors. - completionHandler(static_cast<NSNumber *>(value), error); - }]; -} -- (void)writeAttributeACCapacityformatWithValue:(NSNumber * _Nonnull)value completionHandler:(MTRStatusCompletion)completionHandler -{ - [self writeAttributeACCapacityformatWithValue:value params:nil completion:completionHandler]; -} -- (void)writeAttributeACCapacityformatWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completionHandler:(MTRStatusCompletion)completionHandler -{ - [self writeAttributeACCapacityformatWithValue:value params:params completion:completionHandler]; -} -- (void)subscribeAttributeACCapacityformatWithMinInterval:(NSNumber * _Nonnull)minInterval maxInterval:(NSNumber * _Nonnull)maxInterval - params:(MTRSubscribeParams * _Nullable)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler -{ - MTRSubscribeParams * _Nullable subscribeParams = [params copy]; - if (subscribeParams == nil) { - subscribeParams = [[MTRSubscribeParams alloc] initWithMinInterval:minInterval maxInterval:maxInterval]; - } else { - subscribeParams.minInterval = minInterval; - subscribeParams.maxInterval = maxInterval; - } - [self subscribeAttributeACCapacityformatWithParams:subscribeParams subscriptionEstablished:subscriptionEstablishedHandler reportHandler: - ^(NSNumber * _Nullable value, NSError * _Nullable error) { - // Cast is safe because subclass does not add any selectors. - reportHandler(static_cast<NSNumber *>(value), error); - }]; -} -+ (void)readAttributeACCapacityformatWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler -{ - [self readAttributeACCapacityformatWithClusterStateCache:attributeCacheContainer.realContainer endpoint:endpoint queue:queue completion: - ^(NSNumber * _Nullable value, NSError * _Nullable error) { - // Cast is safe because subclass does not add any selectors. - completionHandler(static_cast<NSNumber *>(value), error); - }]; -} - - (void)readAttributeGeneratedCommandListWithCompletionHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler { [self readAttributeGeneratedCommandListWithCompletion: diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h index 2178edd403cfe4..b0f7fdf25cad65 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h @@ -3407,9 +3407,6 @@ typedef NS_ENUM(uint32_t, MTRAttributeIDType) { MTRClusterThermostatAttributeACCoilTemperatureID MTR_DEPRECATED("Please use MTRAttributeIDTypeClusterThermostatAttributeACCoilTemperatureID", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)) = 0x00000046, - MTRClusterThermostatAttributeACCapacityformatID - MTR_DEPRECATED("Please use MTRAttributeIDTypeClusterThermostatAttributeACCapacityformatID", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)) - = 0x00000047, MTRClusterThermostatAttributeGeneratedCommandListID MTR_DEPRECATED("Please use MTRAttributeIDTypeClusterThermostatAttributeGeneratedCommandListID", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)) = MTRClusterGlobalAttributeGeneratedCommandListID, @@ -3475,7 +3472,7 @@ typedef NS_ENUM(uint32_t, MTRAttributeIDType) { MTRAttributeIDTypeClusterThermostatAttributeACErrorCodeID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000044, MTRAttributeIDTypeClusterThermostatAttributeACLouverPositionID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000045, MTRAttributeIDTypeClusterThermostatAttributeACCoilTemperatureID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000046, - MTRAttributeIDTypeClusterThermostatAttributeACCapacityformatID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000047, + MTRAttributeIDTypeClusterThermostatAttributeACCapacityFormatID MTR_PROVISIONALLY_AVAILABLE = 0x00000047, MTRAttributeIDTypeClusterThermostatAttributePresetTypesID MTR_PROVISIONALLY_AVAILABLE = 0x00000048, MTRAttributeIDTypeClusterThermostatAttributeScheduleTypesID MTR_PROVISIONALLY_AVAILABLE = 0x00000049, MTRAttributeIDTypeClusterThermostatAttributeNumberOfPresetsID MTR_PROVISIONALLY_AVAILABLE = 0x0000004A, @@ -3486,9 +3483,7 @@ typedef NS_ENUM(uint32_t, MTRAttributeIDType) { MTRAttributeIDTypeClusterThermostatAttributeActiveScheduleHandleID MTR_PROVISIONALLY_AVAILABLE = 0x0000004F, MTRAttributeIDTypeClusterThermostatAttributePresetsID MTR_PROVISIONALLY_AVAILABLE = 0x00000050, MTRAttributeIDTypeClusterThermostatAttributeSchedulesID MTR_PROVISIONALLY_AVAILABLE = 0x00000051, - MTRAttributeIDTypeClusterThermostatAttributePresetsSchedulesEditableID MTR_PROVISIONALLY_AVAILABLE = 0x00000052, - MTRAttributeIDTypeClusterThermostatAttributeTemperatureSetpointHoldPolicyID MTR_PROVISIONALLY_AVAILABLE = 0x00000053, - MTRAttributeIDTypeClusterThermostatAttributeSetpointHoldExpiryTimestampID MTR_PROVISIONALLY_AVAILABLE = 0x00000054, + MTRAttributeIDTypeClusterThermostatAttributeSetpointHoldExpiryTimestampID MTR_PROVISIONALLY_AVAILABLE = 0x00000052, MTRAttributeIDTypeClusterThermostatAttributeGeneratedCommandListID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = MTRAttributeIDTypeGlobalAttributeGeneratedCommandListID, MTRAttributeIDTypeClusterThermostatAttributeAcceptedCommandListID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = MTRAttributeIDTypeGlobalAttributeAcceptedCommandListID, MTRAttributeIDTypeClusterThermostatAttributeEventListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeEventListID, @@ -6606,10 +6601,8 @@ typedef NS_ENUM(uint32_t, MTRCommandIDType) { MTRCommandIDTypeClusterThermostatCommandClearWeeklyScheduleID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000003, MTRCommandIDTypeClusterThermostatCommandSetActiveScheduleRequestID MTR_PROVISIONALLY_AVAILABLE = 0x00000005, MTRCommandIDTypeClusterThermostatCommandSetActivePresetRequestID MTR_PROVISIONALLY_AVAILABLE = 0x00000006, - MTRCommandIDTypeClusterThermostatCommandStartPresetsSchedulesEditRequestID MTR_PROVISIONALLY_AVAILABLE = 0x00000007, - MTRCommandIDTypeClusterThermostatCommandCancelPresetsSchedulesEditRequestID MTR_PROVISIONALLY_AVAILABLE = 0x00000008, - MTRCommandIDTypeClusterThermostatCommandCommitPresetsSchedulesRequestID MTR_PROVISIONALLY_AVAILABLE = 0x00000009, - MTRCommandIDTypeClusterThermostatCommandSetTemperatureSetpointHoldPolicyID MTR_PROVISIONALLY_AVAILABLE = 0x0000000B, + MTRCommandIDTypeClusterThermostatCommandAtomicResponseID MTR_PROVISIONALLY_AVAILABLE = 0x000000FD, + MTRCommandIDTypeClusterThermostatCommandAtomicRequestID MTR_PROVISIONALLY_AVAILABLE = 0x000000FE, // Cluster FanControl deprecated command id names diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm index 575661bfa078bd..464548edc35b7a 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm @@ -5721,8 +5721,8 @@ result = @"ACCoilTemperature"; break; - case MTRAttributeIDTypeClusterThermostatAttributeACCapacityformatID: - result = @"ACCapacityformat"; + case MTRAttributeIDTypeClusterThermostatAttributeACCapacityFormatID: + result = @"ACCapacityFormat"; break; case MTRAttributeIDTypeClusterThermostatAttributePresetTypesID: @@ -5765,14 +5765,6 @@ result = @"Schedules"; break; - case MTRAttributeIDTypeClusterThermostatAttributePresetsSchedulesEditableID: - result = @"PresetsSchedulesEditable"; - break; - - case MTRAttributeIDTypeClusterThermostatAttributeTemperatureSetpointHoldPolicyID: - result = @"TemperatureSetpointHoldPolicy"; - break; - case MTRAttributeIDTypeClusterThermostatAttributeSetpointHoldExpiryTimestampID: result = @"SetpointHoldExpiryTimestamp"; break; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h index cefb92935beab4..1b4ca5539c5cd1 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h @@ -4646,14 +4646,7 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); - (void)setActiveScheduleRequestWithParams:(MTRThermostatClusterSetActiveScheduleRequestParams *)params expectedValues:(NSArray<NSDictionary<NSString *, id> *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; - (void)setActivePresetRequestWithParams:(MTRThermostatClusterSetActivePresetRequestParams *)params expectedValues:(NSArray<NSDictionary<NSString *, id> *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; -- (void)startPresetsSchedulesEditRequestWithParams:(MTRThermostatClusterStartPresetsSchedulesEditRequestParams *)params expectedValues:(NSArray<NSDictionary<NSString *, id> *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; -- (void)cancelPresetsSchedulesEditRequestWithParams:(MTRThermostatClusterCancelPresetsSchedulesEditRequestParams * _Nullable)params expectedValues:(NSArray<NSDictionary<NSString *, id> *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; -- (void)cancelPresetsSchedulesEditRequestWithExpectedValues:(NSArray<NSDictionary<NSString *, id> *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion - MTR_PROVISIONALLY_AVAILABLE; -- (void)commitPresetsSchedulesRequestWithParams:(MTRThermostatClusterCommitPresetsSchedulesRequestParams * _Nullable)params expectedValues:(NSArray<NSDictionary<NSString *, id> *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; -- (void)commitPresetsSchedulesRequestWithExpectedValues:(NSArray<NSDictionary<NSString *, id> *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion - MTR_PROVISIONALLY_AVAILABLE; -- (void)setTemperatureSetpointHoldPolicyWithParams:(MTRThermostatClusterSetTemperatureSetpointHoldPolicyParams *)params expectedValues:(NSArray<NSDictionary<NSString *, id> *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)atomicRequestWithParams:(MTRThermostatClusterAtomicRequestParams *)params expectedValues:(NSArray<NSDictionary<NSString *, id> *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRThermostatClusterAtomicResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; - (NSDictionary<NSString *, id> * _Nullable)readAttributeLocalTemperatureWithParams:(MTRReadParams * _Nullable)params MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); @@ -4803,9 +4796,9 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) - (NSDictionary<NSString *, id> * _Nullable)readAttributeACCoilTemperatureWithParams:(MTRReadParams * _Nullable)params MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); -- (NSDictionary<NSString *, id> * _Nullable)readAttributeACCapacityformatWithParams:(MTRReadParams * _Nullable)params MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); -- (void)writeAttributeACCapacityformatWithValue:(NSDictionary<NSString *, id> *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); -- (void)writeAttributeACCapacityformatWithValue:(NSDictionary<NSString *, id> *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); +- (NSDictionary<NSString *, id> * _Nullable)readAttributeACCapacityFormatWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeACCapacityFormatWithValue:(NSDictionary<NSString *, id> *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeACCapacityFormatWithValue:(NSDictionary<NSString *, id> *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; - (NSDictionary<NSString *, id> * _Nullable)readAttributePresetTypesWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; @@ -4831,10 +4824,6 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) - (void)writeAttributeSchedulesWithValue:(NSDictionary<NSString *, id> *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; - (void)writeAttributeSchedulesWithValue:(NSDictionary<NSString *, id> *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; -- (NSDictionary<NSString *, id> * _Nullable)readAttributePresetsSchedulesEditableWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; - -- (NSDictionary<NSString *, id> * _Nullable)readAttributeTemperatureSetpointHoldPolicyWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; - - (NSDictionary<NSString *, id> * _Nullable)readAttributeSetpointHoldExpiryTimestampWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; - (NSDictionary<NSString *, id> * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm index 8c38a6c584b79e..29d50f73d04b7c 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm @@ -13242,109 +13242,20 @@ - (void)setActivePresetRequestWithParams:(MTRThermostatClusterSetActivePresetReq completion:responseHandler]; } -- (void)startPresetsSchedulesEditRequestWithParams:(MTRThermostatClusterStartPresetsSchedulesEditRequestParams *)params expectedValues:(NSArray<NSDictionary<NSString *, id> *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +- (void)atomicRequestWithParams:(MTRThermostatClusterAtomicRequestParams *)params expectedValues:(NSArray<NSDictionary<NSString *, id> *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRThermostatClusterAtomicResponseParams * _Nullable data, NSError * _Nullable error))completion { if (params == nil) { - params = [[MTRThermostatClusterStartPresetsSchedulesEditRequestParams + params = [[MTRThermostatClusterAtomicRequestParams alloc] init]; } auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { - completion(error); - }; - - auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; - - using RequestType = Thermostat::Commands::StartPresetsSchedulesEditRequest::Type; - [self.device _invokeKnownCommandWithEndpointID:self.endpointID - clusterID:@(RequestType::GetClusterId()) - commandID:@(RequestType::GetCommandId()) - commandPayload:params - expectedValues:expectedValues - expectedValueInterval:expectedValueIntervalMs - timedInvokeTimeout:timedInvokeTimeoutMs - serverSideProcessingTimeout:params.serverSideProcessingTimeout - responseClass:nil - queue:self.callbackQueue - completion:responseHandler]; -} - -- (void)cancelPresetsSchedulesEditRequestWithExpectedValues:(NSArray<NSDictionary<NSString *, id> *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs completion:(MTRStatusCompletion)completion -{ - [self cancelPresetsSchedulesEditRequestWithParams:nil expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs completion:completion]; -} -- (void)cancelPresetsSchedulesEditRequestWithParams:(MTRThermostatClusterCancelPresetsSchedulesEditRequestParams * _Nullable)params expectedValues:(NSArray<NSDictionary<NSString *, id> *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion -{ - if (params == nil) { - params = [[MTRThermostatClusterCancelPresetsSchedulesEditRequestParams - alloc] init]; - } - - auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { - completion(error); - }; - - auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; - - using RequestType = Thermostat::Commands::CancelPresetsSchedulesEditRequest::Type; - [self.device _invokeKnownCommandWithEndpointID:self.endpointID - clusterID:@(RequestType::GetClusterId()) - commandID:@(RequestType::GetCommandId()) - commandPayload:params - expectedValues:expectedValues - expectedValueInterval:expectedValueIntervalMs - timedInvokeTimeout:timedInvokeTimeoutMs - serverSideProcessingTimeout:params.serverSideProcessingTimeout - responseClass:nil - queue:self.callbackQueue - completion:responseHandler]; -} - -- (void)commitPresetsSchedulesRequestWithExpectedValues:(NSArray<NSDictionary<NSString *, id> *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs completion:(MTRStatusCompletion)completion -{ - [self commitPresetsSchedulesRequestWithParams:nil expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs completion:completion]; -} -- (void)commitPresetsSchedulesRequestWithParams:(MTRThermostatClusterCommitPresetsSchedulesRequestParams * _Nullable)params expectedValues:(NSArray<NSDictionary<NSString *, id> *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion -{ - if (params == nil) { - params = [[MTRThermostatClusterCommitPresetsSchedulesRequestParams - alloc] init]; - } - - auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { - completion(error); - }; - - auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; - - using RequestType = Thermostat::Commands::CommitPresetsSchedulesRequest::Type; - [self.device _invokeKnownCommandWithEndpointID:self.endpointID - clusterID:@(RequestType::GetClusterId()) - commandID:@(RequestType::GetCommandId()) - commandPayload:params - expectedValues:expectedValues - expectedValueInterval:expectedValueIntervalMs - timedInvokeTimeout:timedInvokeTimeoutMs - serverSideProcessingTimeout:params.serverSideProcessingTimeout - responseClass:nil - queue:self.callbackQueue - completion:responseHandler]; -} - -- (void)setTemperatureSetpointHoldPolicyWithParams:(MTRThermostatClusterSetTemperatureSetpointHoldPolicyParams *)params expectedValues:(NSArray<NSDictionary<NSString *, id> *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion -{ - if (params == nil) { - params = [[MTRThermostatClusterSetTemperatureSetpointHoldPolicyParams - alloc] init]; - } - - auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { - completion(error); + completion(response, error); }; auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; - using RequestType = Thermostat::Commands::SetTemperatureSetpointHoldPolicy::Type; + using RequestType = Thermostat::Commands::AtomicRequest::Type; [self.device _invokeKnownCommandWithEndpointID:self.endpointID clusterID:@(RequestType::GetClusterId()) commandID:@(RequestType::GetCommandId()) @@ -13353,7 +13264,7 @@ - (void)setTemperatureSetpointHoldPolicyWithParams:(MTRThermostatClusterSetTempe expectedValueInterval:expectedValueIntervalMs timedInvokeTimeout:timedInvokeTimeoutMs serverSideProcessingTimeout:params.serverSideProcessingTimeout - responseClass:nil + responseClass:MTRThermostatClusterAtomicResponseParams.class queue:self.callbackQueue completion:responseHandler]; } @@ -13884,20 +13795,20 @@ - (void)writeAttributeACLouverPositionWithValue:(NSDictionary<NSString *, id> *) return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeThermostatID) attributeID:@(MTRAttributeIDTypeClusterThermostatAttributeACCoilTemperatureID) params:params]; } -- (NSDictionary<NSString *, id> * _Nullable)readAttributeACCapacityformatWithParams:(MTRReadParams * _Nullable)params +- (NSDictionary<NSString *, id> * _Nullable)readAttributeACCapacityFormatWithParams:(MTRReadParams * _Nullable)params { - return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeThermostatID) attributeID:@(MTRAttributeIDTypeClusterThermostatAttributeACCapacityformatID) params:params]; + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeThermostatID) attributeID:@(MTRAttributeIDTypeClusterThermostatAttributeACCapacityFormatID) params:params]; } -- (void)writeAttributeACCapacityformatWithValue:(NSDictionary<NSString *, id> *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +- (void)writeAttributeACCapacityFormatWithValue:(NSDictionary<NSString *, id> *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs { - [self writeAttributeACCapacityformatWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; + [self writeAttributeACCapacityFormatWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; } -- (void)writeAttributeACCapacityformatWithValue:(NSDictionary<NSString *, id> *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +- (void)writeAttributeACCapacityFormatWithValue:(NSDictionary<NSString *, id> *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params { NSNumber * timedWriteTimeout = params.timedWriteTimeout; - [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeThermostatID) attributeID:@(MTRAttributeIDTypeClusterThermostatAttributeACCapacityformatID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; + [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeThermostatID) attributeID:@(MTRAttributeIDTypeClusterThermostatAttributeACCapacityFormatID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; } - (NSDictionary<NSString *, id> * _Nullable)readAttributePresetTypesWithParams:(MTRReadParams * _Nullable)params @@ -13972,16 +13883,6 @@ - (void)writeAttributeSchedulesWithValue:(NSDictionary<NSString *, id> *)dataVal [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeThermostatID) attributeID:@(MTRAttributeIDTypeClusterThermostatAttributeSchedulesID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; } -- (NSDictionary<NSString *, id> * _Nullable)readAttributePresetsSchedulesEditableWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeThermostatID) attributeID:@(MTRAttributeIDTypeClusterThermostatAttributePresetsSchedulesEditableID) params:params]; -} - -- (NSDictionary<NSString *, id> * _Nullable)readAttributeTemperatureSetpointHoldPolicyWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeThermostatID) attributeID:@(MTRAttributeIDTypeClusterThermostatAttributeTemperatureSetpointHoldPolicyID) params:params]; -} - - (NSDictionary<NSString *, id> * _Nullable)readAttributeSetpointHoldExpiryTimestampWithParams:(MTRReadParams * _Nullable)params { return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeThermostatID) attributeID:@(MTRAttributeIDTypeClusterThermostatAttributeSetpointHoldExpiryTimestampID) params:params]; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h index 3746227a4f9d21..977178243264b7 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h @@ -7863,95 +7863,36 @@ MTR_PROVISIONALLY_AVAILABLE @end MTR_PROVISIONALLY_AVAILABLE -@interface MTRThermostatClusterStartPresetsSchedulesEditRequestParams : NSObject <NSCopying> +@interface MTRThermostatClusterAtomicResponseParams : NSObject <NSCopying> -@property (nonatomic, copy) NSNumber * _Nonnull timeoutSeconds MTR_PROVISIONALLY_AVAILABLE; -/** - * Controls whether the command is a timed command (using Timed Invoke). - * - * If nil (the default value), a regular invoke is done for commands that do - * not require a timed invoke and a timed invoke with some default timed request - * timeout is done for commands that require a timed invoke. - * - * If not nil, a timed invoke is done, with the provided value used as the timed - * request timeout. The value should be chosen small enough to provide the - * desired security properties but large enough that it will allow a round-trip - * from the sever to the client (for the status response and actual invoke - * request) within the timeout window. - * - */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; +@property (nonatomic, copy) NSNumber * _Nonnull statusCode MTR_PROVISIONALLY_AVAILABLE; -/** - * Controls how much time, in seconds, we will allow for the server to process the command. - * - * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. - * - * If nil, the framework will try to select an appropriate timeout value itself. - */ -@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; -@end +@property (nonatomic, copy) NSArray * _Nonnull attributeStatus MTR_PROVISIONALLY_AVAILABLE; -MTR_PROVISIONALLY_AVAILABLE -@interface MTRThermostatClusterCancelPresetsSchedulesEditRequestParams : NSObject <NSCopying> -/** - * Controls whether the command is a timed command (using Timed Invoke). - * - * If nil (the default value), a regular invoke is done for commands that do - * not require a timed invoke and a timed invoke with some default timed request - * timeout is done for commands that require a timed invoke. - * - * If not nil, a timed invoke is done, with the provided value used as the timed - * request timeout. The value should be chosen small enough to provide the - * desired security properties but large enough that it will allow a round-trip - * from the sever to the client (for the status response and actual invoke - * request) within the timeout window. - * - */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; +@property (nonatomic, copy) NSNumber * _Nullable timeout MTR_PROVISIONALLY_AVAILABLE; /** - * Controls how much time, in seconds, we will allow for the server to process the command. + * Initialize an MTRThermostatClusterAtomicResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. * - * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. * - * If nil, the framework will try to select an appropriate timeout value itself. + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. */ -@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +- (nullable instancetype)initWithResponseValue:(NSDictionary<NSString *, id> *)responseValue + error:(NSError * __autoreleasing *)error MTR_PROVISIONALLY_AVAILABLE; @end MTR_PROVISIONALLY_AVAILABLE -@interface MTRThermostatClusterCommitPresetsSchedulesRequestParams : NSObject <NSCopying> -/** - * Controls whether the command is a timed command (using Timed Invoke). - * - * If nil (the default value), a regular invoke is done for commands that do - * not require a timed invoke and a timed invoke with some default timed request - * timeout is done for commands that require a timed invoke. - * - * If not nil, a timed invoke is done, with the provided value used as the timed - * request timeout. The value should be chosen small enough to provide the - * desired security properties but large enough that it will allow a round-trip - * from the sever to the client (for the status response and actual invoke - * request) within the timeout window. - * - */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; +@interface MTRThermostatClusterAtomicRequestParams : NSObject <NSCopying> -/** - * Controls how much time, in seconds, we will allow for the server to process the command. - * - * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. - * - * If nil, the framework will try to select an appropriate timeout value itself. - */ -@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; -@end +@property (nonatomic, copy) NSNumber * _Nonnull requestType MTR_PROVISIONALLY_AVAILABLE; -MTR_PROVISIONALLY_AVAILABLE -@interface MTRThermostatClusterSetTemperatureSetpointHoldPolicyParams : NSObject <NSCopying> +@property (nonatomic, copy) NSArray * _Nonnull attributeRequests MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nonnull temperatureSetpointHoldPolicy MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable timeout MTR_PROVISIONALLY_AVAILABLE; /** * Controls whether the command is a timed command (using Timed Invoke). * diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm index 8d18518670e808..539e1d30ce969e 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm @@ -22425,237 +22425,135 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader } @end -@implementation MTRThermostatClusterStartPresetsSchedulesEditRequestParams +@implementation MTRThermostatClusterAtomicResponseParams - (instancetype)init { if (self = [super init]) { - _timeoutSeconds = @(0); - _timedInvokeTimeoutMs = nil; - _serverSideProcessingTimeout = nil; + _statusCode = @(0); + + _attributeStatus = [NSArray array]; + + _timeout = nil; } return self; } - (id)copyWithZone:(NSZone * _Nullable)zone; { - auto other = [[MTRThermostatClusterStartPresetsSchedulesEditRequestParams alloc] init]; + auto other = [[MTRThermostatClusterAtomicResponseParams alloc] init]; - other.timeoutSeconds = self.timeoutSeconds; - other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; - other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + other.statusCode = self.statusCode; + other.attributeStatus = self.attributeStatus; + other.timeout = self.timeout; return other; } - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: timeoutSeconds:%@; >", NSStringFromClass([self class]), _timeoutSeconds]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: statusCode:%@; attributeStatus:%@; timeout:%@; >", NSStringFromClass([self class]), _statusCode, _attributeStatus, _timeout]; return descriptionString; } -@end - -@implementation MTRThermostatClusterStartPresetsSchedulesEditRequestParams (InternalMethods) - -- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +- (nullable instancetype)initWithResponseValue:(NSDictionary<NSString *, id> *)responseValue + error:(NSError * __autoreleasing *)error { - chip::app::Clusters::Thermostat::Commands::StartPresetsSchedulesEditRequest::Type encodableStruct; - ListFreer listFreer; - { - encodableStruct.timeoutSeconds = self.timeoutSeconds.unsignedShortValue; + if (!(self = [super init])) { + return nil; } - auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + using DecodableType = chip::app::Clusters::Thermostat::Commands::AtomicResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; if (buffer.IsNull()) { - return CHIP_ERROR_NO_MEMORY; - } - - chip::System::PacketBufferTLVWriter writer; - // Commands never need chained buffers, since they cannot be chunked. - writer.Init(std::move(buffer), /* useChainedBuffers = */ false); - - ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); - - ReturnErrorOnFailure(writer.Finalize(&buffer)); - - reader.Init(std::move(buffer)); - return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); -} - -- (NSDictionary<NSString *, id> * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error -{ - chip::System::PacketBufferTLVReader reader; - CHIP_ERROR err = [self _encodeToTLVReader:reader]; - if (err != CHIP_NO_ERROR) { - if (error) { - *error = [MTRError errorForCHIPErrorCode:err]; - } return nil; } - auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); - if (decodedObj == nil) { - if (error) { - *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } } } - return decodedObj; -} -@end -@implementation MTRThermostatClusterCancelPresetsSchedulesEditRequestParams -- (instancetype)init -{ - if (self = [super init]) { - _timedInvokeTimeoutMs = nil; - _serverSideProcessingTimeout = nil; + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; } - return self; -} - -- (id)copyWithZone:(NSZone * _Nullable)zone; -{ - auto other = [[MTRThermostatClusterCancelPresetsSchedulesEditRequestParams alloc] init]; - - other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; - other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; - - return other; -} - -- (NSString *)description -{ - NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; - return descriptionString; + return nil; } @end -@implementation MTRThermostatClusterCancelPresetsSchedulesEditRequestParams (InternalMethods) +@implementation MTRThermostatClusterAtomicResponseParams (InternalMethods) -- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::Thermostat::Commands::AtomicResponse::DecodableType &)decodableStruct { - chip::app::Clusters::Thermostat::Commands::CancelPresetsSchedulesEditRequest::Type encodableStruct; - ListFreer listFreer; - - auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); - if (buffer.IsNull()) { - return CHIP_ERROR_NO_MEMORY; + { + self.statusCode = [NSNumber numberWithUnsignedChar:decodableStruct.statusCode]; } - - chip::System::PacketBufferTLVWriter writer; - // Commands never need chained buffers, since they cannot be chunked. - writer.Init(std::move(buffer), /* useChainedBuffers = */ false); - - ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); - - ReturnErrorOnFailure(writer.Finalize(&buffer)); - - reader.Init(std::move(buffer)); - return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); -} - -- (NSDictionary<NSString *, id> * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error -{ - chip::System::PacketBufferTLVReader reader; - CHIP_ERROR err = [self _encodeToTLVReader:reader]; - if (err != CHIP_NO_ERROR) { - if (error) { - *error = [MTRError errorForCHIPErrorCode:err]; + { + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = decodableStruct.attributeStatus.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRThermostatClusterAtomicAttributeStatusStruct * newElement_0; + newElement_0 = [MTRThermostatClusterAtomicAttributeStatusStruct new]; + if (entry_0.attributeID.HasValue()) { + newElement_0.attributeID = [NSNumber numberWithUnsignedInt:entry_0.attributeID.Value()]; + } else { + newElement_0.attributeID = nil; + } + if (entry_0.statusCode.HasValue()) { + newElement_0.statusCode = [NSNumber numberWithUnsignedChar:entry_0.statusCode.Value()]; + } else { + newElement_0.statusCode = nil; + } + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + return err; + } + self.attributeStatus = array_0; } - return nil; } - - auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); - if (decodedObj == nil) { - if (error) { - *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + { + if (decodableStruct.timeout.HasValue()) { + self.timeout = [NSNumber numberWithUnsignedShort:decodableStruct.timeout.Value()]; + } else { + self.timeout = nil; } } - return decodedObj; + return CHIP_NO_ERROR; } + @end -@implementation MTRThermostatClusterCommitPresetsSchedulesRequestParams +@implementation MTRThermostatClusterAtomicRequestParams - (instancetype)init { if (self = [super init]) { - _timedInvokeTimeoutMs = nil; - _serverSideProcessingTimeout = nil; - } - return self; -} - -- (id)copyWithZone:(NSZone * _Nullable)zone; -{ - auto other = [[MTRThermostatClusterCommitPresetsSchedulesRequestParams alloc] init]; - - other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; - other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; - - return other; -} - -- (NSString *)description -{ - NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; - return descriptionString; -} - -@end - -@implementation MTRThermostatClusterCommitPresetsSchedulesRequestParams (InternalMethods) - -- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader -{ - chip::app::Clusters::Thermostat::Commands::CommitPresetsSchedulesRequest::Type encodableStruct; - ListFreer listFreer; - - auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); - if (buffer.IsNull()) { - return CHIP_ERROR_NO_MEMORY; - } - - chip::System::PacketBufferTLVWriter writer; - // Commands never need chained buffers, since they cannot be chunked. - writer.Init(std::move(buffer), /* useChainedBuffers = */ false); - ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); - - ReturnErrorOnFailure(writer.Finalize(&buffer)); - - reader.Init(std::move(buffer)); - return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); -} - -- (NSDictionary<NSString *, id> * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error -{ - chip::System::PacketBufferTLVReader reader; - CHIP_ERROR err = [self _encodeToTLVReader:reader]; - if (err != CHIP_NO_ERROR) { - if (error) { - *error = [MTRError errorForCHIPErrorCode:err]; - } - return nil; - } - - auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); - if (decodedObj == nil) { - if (error) { - *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; - } - } - return decodedObj; -} -@end + _requestType = @(0); -@implementation MTRThermostatClusterSetTemperatureSetpointHoldPolicyParams -- (instancetype)init -{ - if (self = [super init]) { + _attributeRequests = [NSArray array]; - _temperatureSetpointHoldPolicy = @(0); + _timeout = nil; _timedInvokeTimeoutMs = nil; _serverSideProcessingTimeout = nil; } @@ -22664,9 +22562,11 @@ - (instancetype)init - (id)copyWithZone:(NSZone * _Nullable)zone; { - auto other = [[MTRThermostatClusterSetTemperatureSetpointHoldPolicyParams alloc] init]; + auto other = [[MTRThermostatClusterAtomicRequestParams alloc] init]; - other.temperatureSetpointHoldPolicy = self.temperatureSetpointHoldPolicy; + other.requestType = self.requestType; + other.attributeRequests = self.attributeRequests; + other.timeout = self.timeout; other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; @@ -22675,20 +22575,50 @@ - (id)copyWithZone:(NSZone * _Nullable)zone; - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: temperatureSetpointHoldPolicy:%@; >", NSStringFromClass([self class]), _temperatureSetpointHoldPolicy]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: requestType:%@; attributeRequests:%@; timeout:%@; >", NSStringFromClass([self class]), _requestType, _attributeRequests, _timeout]; return descriptionString; } @end -@implementation MTRThermostatClusterSetTemperatureSetpointHoldPolicyParams (InternalMethods) +@implementation MTRThermostatClusterAtomicRequestParams (InternalMethods) - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader { - chip::app::Clusters::Thermostat::Commands::SetTemperatureSetpointHoldPolicy::Type encodableStruct; + chip::app::Clusters::Thermostat::Commands::AtomicRequest::Type encodableStruct; ListFreer listFreer; { - encodableStruct.temperatureSetpointHoldPolicy = static_cast<std::remove_reference_t<decltype(encodableStruct.temperatureSetpointHoldPolicy)>>(self.temperatureSetpointHoldPolicy.unsignedCharValue); + encodableStruct.requestType = static_cast<std::remove_reference_t<decltype(encodableStruct.requestType)>>(self.requestType.unsignedCharValue); + } + { + { + using ListType_0 = std::remove_reference_t<decltype(encodableStruct.attributeRequests)>; + using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type; + if (self.attributeRequests.count != 0) { + auto * listHolder_0 = new ListHolder<ListMemberType_0>(self.attributeRequests.count); + if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_0); + for (size_t i_0 = 0; i_0 < self.attributeRequests.count; ++i_0) { + if (![self.attributeRequests[i_0] isKindOfClass:[NSNumber class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_0 = (NSNumber *) self.attributeRequests[i_0]; + listHolder_0->mList[i_0] = element_0.unsignedIntValue; + } + encodableStruct.attributeRequests = ListType_0(listHolder_0->mList, self.attributeRequests.count); + } else { + encodableStruct.attributeRequests = ListType_0(); + } + } + } + { + if (self.timeout != nil) { + auto & definedValue_0 = encodableStruct.timeout.Emplace(); + definedValue_0 = self.timeout.unsignedShortValue; + } } auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h index 67c37229a00dcc..9069160ba49265 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h @@ -1474,25 +1474,13 @@ NS_ASSUME_NONNULL_BEGIN @end -@interface MTRThermostatClusterStartPresetsSchedulesEditRequestParams (InternalMethods) +@interface MTRThermostatClusterAtomicResponseParams (InternalMethods) -- (NSDictionary<NSString *, id> * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; - -@end - -@interface MTRThermostatClusterCancelPresetsSchedulesEditRequestParams (InternalMethods) - -- (NSDictionary<NSString *, id> * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; - -@end - -@interface MTRThermostatClusterCommitPresetsSchedulesRequestParams (InternalMethods) - -- (NSDictionary<NSString *, id> * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; +- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::Thermostat::Commands::AtomicResponse::DecodableType &)decodableStruct; @end -@interface MTRThermostatClusterSetTemperatureSetpointHoldPolicyParams (InternalMethods) +@interface MTRThermostatClusterAtomicRequestParams (InternalMethods) - (NSDictionary<NSString *, id> * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h index 2ce1e1707d2987..002c8c0471c336 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h @@ -1670,6 +1670,12 @@ MTR_PROVISIONALLY_AVAILABLE @property (nonatomic, copy) NSNumber * _Nullable builtIn MTR_PROVISIONALLY_AVAILABLE; @end +MTR_PROVISIONALLY_AVAILABLE +@interface MTRThermostatClusterAtomicAttributeStatusStruct : NSObject <NSCopying> +@property (nonatomic, copy) NSNumber * _Nullable attributeID MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable statusCode MTR_PROVISIONALLY_AVAILABLE; +@end + MTR_PROVISIONALLY_AVAILABLE @interface MTRThermostatClusterPresetStruct : NSObject <NSCopying> @property (nonatomic, copy) NSData * _Nullable presetHandle MTR_PROVISIONALLY_AVAILABLE; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm index 5b0eacb0ff3edb..dda4a999ee7d99 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm @@ -7058,6 +7058,36 @@ - (NSString *)description @end +@implementation MTRThermostatClusterAtomicAttributeStatusStruct +- (instancetype)init +{ + if (self = [super init]) { + + _attributeID = nil; + + _statusCode = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRThermostatClusterAtomicAttributeStatusStruct alloc] init]; + + other.attributeID = self.attributeID; + other.statusCode = self.statusCode; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: attributeID:%@; statusCode:%@; >", NSStringFromClass([self class]), _attributeID, _statusCode]; + return descriptionString; +} + +@end + @implementation MTRThermostatClusterPresetStruct - (instancetype)init { diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp index 0c974b62593860..a0b3629d16b0e3 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp @@ -23192,9 +23192,10 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, const chip::a namespace Occupancy { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint8_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, + chip::BitMask<chip::app::Clusters::Thermostat::OccupancyBitmap> * value) { - using Traits = NumericAttributeTraits<uint8_t>; + using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::Thermostat::OccupancyBitmap>>; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -23208,9 +23209,10 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint8_t * val return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status +Set(chip::EndpointId endpoint, chip::BitMask<chip::app::Clusters::Thermostat::OccupancyBitmap> value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits<uint8_t>; + using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::Thermostat::OccupancyBitmap>>; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -23221,9 +23223,10 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, + chip::BitMask<chip::app::Clusters::Thermostat::OccupancyBitmap> value) { - using Traits = NumericAttributeTraits<uint8_t>; + using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::Thermostat::OccupancyBitmap>>; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -23514,9 +23517,10 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value namespace HVACSystemTypeConfiguration { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint8_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, + chip::BitMask<chip::app::Clusters::Thermostat::HVACSystemTypeBitmap> * value) { - using Traits = NumericAttributeTraits<uint8_t>; + using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::Thermostat::HVACSystemTypeBitmap>>; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -23530,9 +23534,11 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint8_t * val return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, + chip::BitMask<chip::app::Clusters::Thermostat::HVACSystemTypeBitmap> value, + MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits<uint8_t>; + using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::Thermostat::HVACSystemTypeBitmap>>; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -23543,9 +23549,10 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, + chip::BitMask<chip::app::Clusters::Thermostat::HVACSystemTypeBitmap> value) { - using Traits = NumericAttributeTraits<uint8_t>; + using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::Thermostat::HVACSystemTypeBitmap>>; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -23632,7 +23639,7 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE, markDirty); } Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) @@ -23645,7 +23652,7 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE); } } // namespace OccupiedCoolingSetpoint @@ -23678,7 +23685,7 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE, markDirty); } Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) @@ -23691,7 +23698,7 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE); } } // namespace OccupiedHeatingSetpoint @@ -23724,7 +23731,7 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE, markDirty); } Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) @@ -23737,7 +23744,7 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE); } } // namespace UnoccupiedCoolingSetpoint @@ -23770,7 +23777,7 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE, markDirty); } Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) @@ -23783,7 +23790,7 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE); } } // namespace UnoccupiedHeatingSetpoint @@ -23816,7 +23823,7 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE, markDirty); } Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) @@ -23829,7 +23836,7 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE); } } // namespace MinHeatSetpointLimit @@ -23862,7 +23869,7 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE, markDirty); } Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) @@ -23875,7 +23882,7 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE); } } // namespace MaxHeatSetpointLimit @@ -23908,7 +23915,7 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE, markDirty); } Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) @@ -23921,7 +23928,7 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE); } } // namespace MinCoolSetpointLimit @@ -23954,7 +23961,7 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE, markDirty); } Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) @@ -23967,7 +23974,7 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE); } } // namespace MaxCoolSetpointLimit @@ -25715,7 +25722,7 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, const chip::a } // namespace ACCoilTemperature -namespace ACCapacityformat { +namespace ACCapacityFormat { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, chip::app::Clusters::Thermostat::ACCapacityFormatEnum * value) { @@ -25760,7 +25767,7 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::app::Cl return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } -} // namespace ACCapacityformat +} // namespace ACCapacityFormat namespace NumberOfPresets { @@ -26162,102 +26169,6 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, const chip::a } // namespace ActiveScheduleHandle -namespace PresetsSchedulesEditable { - -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, bool * value) -{ - using Traits = NumericAttributeTraits<bool>; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, bool value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits<bool>; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE, markDirty); -} - -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, bool value) -{ - using Traits = NumericAttributeTraits<bool>; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); -} - -} // namespace PresetsSchedulesEditable - -namespace TemperatureSetpointHoldPolicy { - -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, - chip::BitMask<chip::app::Clusters::Thermostat::TemperatureSetpointHoldPolicyBitmap> * value) -{ - using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::Thermostat::TemperatureSetpointHoldPolicyBitmap>>; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, - chip::BitMask<chip::app::Clusters::Thermostat::TemperatureSetpointHoldPolicyBitmap> value, - MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::Thermostat::TemperatureSetpointHoldPolicyBitmap>>; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE, markDirty); -} - -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, - chip::BitMask<chip::app::Clusters::Thermostat::TemperatureSetpointHoldPolicyBitmap> value) -{ - using Traits = NumericAttributeTraits<chip::BitMask<chip::app::Clusters::Thermostat::TemperatureSetpointHoldPolicyBitmap>>; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); -} - -} // namespace TemperatureSetpointHoldPolicy - namespace SetpointHoldExpiryTimestamp { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, DataModel::Nullable<uint32_t> & value) diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h index 45b29d719e47eb..57a98d6f0bbe7e 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h @@ -3665,9 +3665,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, const chip::a } // namespace OutdoorTemperature namespace Occupancy { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint8_t * value); // bitmap8 -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value); -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty); +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, + chip::BitMask<chip::app::Clusters::Thermostat::OccupancyBitmap> * value); // OccupancyBitmap +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, + chip::BitMask<chip::app::Clusters::Thermostat::OccupancyBitmap> value); +Protocols::InteractionModel::Status +Set(chip::EndpointId endpoint, chip::BitMask<chip::app::Clusters::Thermostat::OccupancyBitmap> value, MarkAttributeDirty markDirty); } // namespace Occupancy namespace AbsMinHeatSetpointLimit { @@ -3707,9 +3710,14 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value } // namespace PIHeatingDemand namespace HVACSystemTypeConfiguration { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint8_t * value); // bitmap8 -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value); -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty); +Protocols::InteractionModel::Status +Get(chip::EndpointId endpoint, + chip::BitMask<chip::app::Clusters::Thermostat::HVACSystemTypeBitmap> * value); // HVACSystemTypeBitmap +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, + chip::BitMask<chip::app::Clusters::Thermostat::HVACSystemTypeBitmap> value); +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, + chip::BitMask<chip::app::Clusters::Thermostat::HVACSystemTypeBitmap> value, + MarkAttributeDirty markDirty); } // namespace HVACSystemTypeConfiguration namespace LocalTemperatureCalibration { @@ -3719,49 +3727,49 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int8_t value, } // namespace LocalTemperatureCalibration namespace OccupiedCoolingSetpoint { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value); // int16s +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value); // temperature Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value); Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); } // namespace OccupiedCoolingSetpoint namespace OccupiedHeatingSetpoint { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value); // int16s +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value); // temperature Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value); Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); } // namespace OccupiedHeatingSetpoint namespace UnoccupiedCoolingSetpoint { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value); // int16s +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value); // temperature Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value); Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); } // namespace UnoccupiedCoolingSetpoint namespace UnoccupiedHeatingSetpoint { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value); // int16s +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value); // temperature Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value); Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); } // namespace UnoccupiedHeatingSetpoint namespace MinHeatSetpointLimit { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value); // int16s +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value); // temperature Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value); Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); } // namespace MinHeatSetpointLimit namespace MaxHeatSetpointLimit { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value); // int16s +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value); // temperature Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value); Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); } // namespace MaxHeatSetpointLimit namespace MinCoolSetpointLimit { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value); // int16s +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value); // temperature Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value); Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); } // namespace MinCoolSetpointLimit namespace MaxCoolSetpointLimit { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value); // int16s +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value); // temperature Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value); Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); } // namespace MaxCoolSetpointLimit @@ -4026,13 +4034,13 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, const chip::a MarkAttributeDirty markDirty); } // namespace ACCoilTemperature -namespace ACCapacityformat { +namespace ACCapacityFormat { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, chip::app::Clusters::Thermostat::ACCapacityFormatEnum * value); // ACCapacityFormatEnum Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::app::Clusters::Thermostat::ACCapacityFormatEnum value); Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::app::Clusters::Thermostat::ACCapacityFormatEnum value, MarkAttributeDirty markDirty); -} // namespace ACCapacityformat +} // namespace ACCapacityFormat namespace NumberOfPresets { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint8_t * value); // int8u @@ -4087,23 +4095,6 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, const chip::a MarkAttributeDirty markDirty); } // namespace ActiveScheduleHandle -namespace PresetsSchedulesEditable { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, bool * value); // boolean -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, bool value); -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, bool value, MarkAttributeDirty markDirty); -} // namespace PresetsSchedulesEditable - -namespace TemperatureSetpointHoldPolicy { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, - chip::BitMask<chip::app::Clusters::Thermostat::TemperatureSetpointHoldPolicyBitmap> * - value); // TemperatureSetpointHoldPolicyBitmap -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, - chip::BitMask<chip::app::Clusters::Thermostat::TemperatureSetpointHoldPolicyBitmap> value); -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, - chip::BitMask<chip::app::Clusters::Thermostat::TemperatureSetpointHoldPolicyBitmap> value, - MarkAttributeDirty markDirty); -} // namespace TemperatureSetpointHoldPolicy - namespace SetpointHoldExpiryTimestamp { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, DataModel::Nullable<uint32_t> & value); // epoch_s Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value); diff --git a/zzz_generated/app-common/app-common/zap-generated/callback.h b/zzz_generated/app-common/app-common/zap-generated/callback.h index f1aa9705d7c8c3..7095622e698e75 100644 --- a/zzz_generated/app-common/app-common/zap-generated/callback.h +++ b/zzz_generated/app-common/app-common/zap-generated/callback.h @@ -6343,29 +6343,11 @@ bool emberAfThermostatClusterSetActivePresetRequestCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, const chip::app::Clusters::Thermostat::Commands::SetActivePresetRequest::DecodableType & commandData); /** - * @brief Thermostat Cluster StartPresetsSchedulesEditRequest Command callback (from client) + * @brief Thermostat Cluster AtomicRequest Command callback (from client) */ -bool emberAfThermostatClusterStartPresetsSchedulesEditRequestCallback( +bool emberAfThermostatClusterAtomicRequestCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::Thermostat::Commands::StartPresetsSchedulesEditRequest::DecodableType & commandData); -/** - * @brief Thermostat Cluster CancelPresetsSchedulesEditRequest Command callback (from client) - */ -bool emberAfThermostatClusterCancelPresetsSchedulesEditRequestCallback( - chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::Thermostat::Commands::CancelPresetsSchedulesEditRequest::DecodableType & commandData); -/** - * @brief Thermostat Cluster CommitPresetsSchedulesRequest Command callback (from client) - */ -bool emberAfThermostatClusterCommitPresetsSchedulesRequestCallback( - chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::Thermostat::Commands::CommitPresetsSchedulesRequest::DecodableType & commandData); -/** - * @brief Thermostat Cluster SetTemperatureSetpointHoldPolicy Command callback (from client) - */ -bool emberAfThermostatClusterSetTemperatureSetpointHoldPolicyCallback( - chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::Thermostat::Commands::SetTemperatureSetpointHoldPolicy::DecodableType & commandData); + const chip::app::Clusters::Thermostat::Commands::AtomicRequest::DecodableType & commandData); /** * @brief Fan Control Cluster Step Command callback (from client) */ diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h index af96e92e1dc3a7..d183450ff74606 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h @@ -2674,6 +2674,19 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(Thermostat::ACTypeEnum return EnumType::kUnknownEnumValue; } } +static auto __attribute__((unused)) EnsureKnownEnumValue(Thermostat::AtomicRequestTypeEnum val) +{ + using EnumType = Thermostat::AtomicRequestTypeEnum; + switch (val) + { + case EnumType::kBeginWrite: + case EnumType::kCommitWrite: + case EnumType::kRollbackWrite: + return val; + default: + return EnumType::kUnknownEnumValue; + } +} static auto __attribute__((unused)) EnsureKnownEnumValue(Thermostat::ControlSequenceOfOperationEnum val) { using EnumType = Thermostat::ControlSequenceOfOperationEnum; @@ -2695,12 +2708,12 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(Thermostat::PresetScena using EnumType = Thermostat::PresetScenarioEnum; switch (val) { - case EnumType::kUnspecified: case EnumType::kOccupied: case EnumType::kUnoccupied: case EnumType::kSleep: case EnumType::kWake: case EnumType::kVacation: + case EnumType::kGoingToSleep: case EnumType::kUserDefined: return val; default: diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h index 8a15f1f0b1bac1..3fd97ba6aeb0f8 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h @@ -274,6 +274,12 @@ enum class ProductIdentifierTypeEnum : uint8_t // Bitmaps shared across multiple clusters. +// Bitmap for OccupancyBitmap +enum class OccupancyBitmap : uint8_t +{ + kOccupied = 0x1, +}; + } // namespace detail namespace Globals { @@ -3945,6 +3951,19 @@ enum class ACTypeEnum : uint8_t kUnknownEnumValue = 5, }; +// Enum for AtomicRequestTypeEnum +enum class AtomicRequestTypeEnum : uint8_t +{ + kBeginWrite = 0x00, + kCommitWrite = 0x01, + kRollbackWrite = 0x02, + // All received enum values that are not listed above will be mapped + // to kUnknownEnumValue. This is a helper enum value that should only + // be used by code to process how it handles receiving and unknown + // enum value. This specific should never be transmitted. + kUnknownEnumValue = 3, +}; + // Enum for ControlSequenceOfOperationEnum enum class ControlSequenceOfOperationEnum : uint8_t { @@ -3964,18 +3983,18 @@ enum class ControlSequenceOfOperationEnum : uint8_t // Enum for PresetScenarioEnum enum class PresetScenarioEnum : uint8_t { - kUnspecified = 0x00, - kOccupied = 0x01, - kUnoccupied = 0x02, - kSleep = 0x03, - kWake = 0x04, - kVacation = 0x05, - kUserDefined = 0x06, + kOccupied = 0x01, + kUnoccupied = 0x02, + kSleep = 0x03, + kWake = 0x04, + kVacation = 0x05, + kGoingToSleep = 0x06, + kUserDefined = 0xFE, // All received enum values that are not listed above will be mapped // to kUnknownEnumValue. This is a helper enum value that should only // be used by code to process how it handles receiving and unknown // enum value. This specific should never be transmitted. - kUnknownEnumValue = 7, + kUnknownEnumValue = 0, }; // Enum for SetpointChangeSourceEnum @@ -4087,7 +4106,6 @@ enum class Feature : uint32_t kLocalTemperatureNotExposed = 0x40, kMatterScheduleConfiguration = 0x80, kPresets = 0x100, - kSetpoints = 0x200, }; // Bitmap for HVACSystemTypeBitmap @@ -4099,6 +4117,8 @@ enum class HVACSystemTypeBitmap : uint8_t kHeatingUsesFuel = 0x20, }; +using OccupancyBitmap = Clusters::detail::OccupancyBitmap; + // Bitmap for PresetTypeFeaturesBitmap enum class PresetTypeFeaturesBitmap : uint16_t { @@ -4162,13 +4182,6 @@ enum class ScheduleTypeFeaturesBitmap : uint16_t kSupportsNames = 0x4, kSupportsOff = 0x8, }; - -// Bitmap for TemperatureSetpointHoldPolicyBitmap -enum class TemperatureSetpointHoldPolicyBitmap : uint8_t -{ - kHoldDurationElapsed = 0x1, - kHoldDurationElapsedOrPresetChanged = 0x2, -}; } // namespace Thermostat namespace FanControl { @@ -4509,11 +4522,7 @@ enum class Feature : uint32_t kVision = 0x80, }; -// Bitmap for OccupancyBitmap -enum class OccupancyBitmap : uint8_t -{ - kOccupied = 0x1, -}; +using OccupancyBitmap = Clusters::detail::OccupancyBitmap; // Bitmap for OccupancySensorTypeBitmap enum class OccupancySensorTypeBitmap : uint8_t diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp index 2a3e9856803f68..69545df3ca5e4a 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp @@ -20819,6 +20819,47 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } // namespace ScheduleStruct +namespace AtomicAttributeStatusStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kAttributeID), attributeID); + encoder.Encode(to_underlying(Fields::kStatusCode), statusCode); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative<CHIP_ERROR>(__element)) + { + return std::get<CHIP_ERROR>(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get<uint8_t>(__element); + + if (__context_tag == to_underlying(Fields::kAttributeID)) + { + err = DataModel::Decode(reader, attributeID); + } + else if (__context_tag == to_underlying(Fields::kStatusCode)) + { + err = DataModel::Decode(reader, statusCode); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} + +} // namespace AtomicAttributeStatusStruct + namespace PresetStruct { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { @@ -21284,11 +21325,13 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } } } // namespace SetActivePresetRequest. -namespace StartPresetsSchedulesEditRequest { +namespace AtomicResponse { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - encoder.Encode(to_underlying(Fields::kTimeoutSeconds), timeoutSeconds); + encoder.Encode(to_underlying(Fields::kStatusCode), statusCode); + encoder.Encode(to_underlying(Fields::kAttributeStatus), attributeStatus); + encoder.Encode(to_underlying(Fields::kTimeout), timeout); return encoder.Finalize(); } @@ -21306,63 +21349,33 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; const uint8_t __context_tag = std::get<uint8_t>(__element); - if (__context_tag == to_underlying(Fields::kTimeoutSeconds)) + if (__context_tag == to_underlying(Fields::kStatusCode)) { - err = DataModel::Decode(reader, timeoutSeconds); + err = DataModel::Decode(reader, statusCode); } - else + else if (__context_tag == to_underlying(Fields::kAttributeStatus)) { + err = DataModel::Decode(reader, attributeStatus); } - - ReturnErrorOnFailure(err); - } -} -} // namespace StartPresetsSchedulesEditRequest. -namespace CancelPresetsSchedulesEditRequest { -CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const -{ - DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - return encoder.Finalize(); -} - -CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) -{ - detail::StructDecodeIterator __iterator(reader); - while (true) - { - auto __element = __iterator.Next(); - if (std::holds_alternative<CHIP_ERROR>(__element)) + else if (__context_tag == to_underlying(Fields::kTimeout)) { - return std::get<CHIP_ERROR>(__element); + err = DataModel::Decode(reader, timeout); } - } -} -} // namespace CancelPresetsSchedulesEditRequest. -namespace CommitPresetsSchedulesRequest { -CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const -{ - DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - return encoder.Finalize(); -} - -CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) -{ - detail::StructDecodeIterator __iterator(reader); - while (true) - { - auto __element = __iterator.Next(); - if (std::holds_alternative<CHIP_ERROR>(__element)) + else { - return std::get<CHIP_ERROR>(__element); } + + ReturnErrorOnFailure(err); } } -} // namespace CommitPresetsSchedulesRequest. -namespace SetTemperatureSetpointHoldPolicy { +} // namespace AtomicResponse. +namespace AtomicRequest { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - encoder.Encode(to_underlying(Fields::kTemperatureSetpointHoldPolicy), temperatureSetpointHoldPolicy); + encoder.Encode(to_underlying(Fields::kRequestType), requestType); + encoder.Encode(to_underlying(Fields::kAttributeRequests), attributeRequests); + encoder.Encode(to_underlying(Fields::kTimeout), timeout); return encoder.Finalize(); } @@ -21380,9 +21393,17 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; const uint8_t __context_tag = std::get<uint8_t>(__element); - if (__context_tag == to_underlying(Fields::kTemperatureSetpointHoldPolicy)) + if (__context_tag == to_underlying(Fields::kRequestType)) { - err = DataModel::Decode(reader, temperatureSetpointHoldPolicy); + err = DataModel::Decode(reader, requestType); + } + else if (__context_tag == to_underlying(Fields::kAttributeRequests)) + { + err = DataModel::Decode(reader, attributeRequests); + } + else if (__context_tag == to_underlying(Fields::kTimeout)) + { + err = DataModel::Decode(reader, timeout); } else { @@ -21391,7 +21412,7 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); } } -} // namespace SetTemperatureSetpointHoldPolicy. +} // namespace AtomicRequest. } // namespace Commands namespace Attributes { @@ -21495,8 +21516,8 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre return DataModel::Decode(reader, ACLouverPosition); case Attributes::ACCoilTemperature::TypeInfo::GetAttributeId(): return DataModel::Decode(reader, ACCoilTemperature); - case Attributes::ACCapacityformat::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, ACCapacityformat); + case Attributes::ACCapacityFormat::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, ACCapacityFormat); case Attributes::PresetTypes::TypeInfo::GetAttributeId(): return DataModel::Decode(reader, presetTypes); case Attributes::ScheduleTypes::TypeInfo::GetAttributeId(): @@ -21517,10 +21538,6 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre return DataModel::Decode(reader, presets); case Attributes::Schedules::TypeInfo::GetAttributeId(): return DataModel::Decode(reader, schedules); - case Attributes::PresetsSchedulesEditable::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, presetsSchedulesEditable); - case Attributes::TemperatureSetpointHoldPolicy::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, temperatureSetpointHoldPolicy); case Attributes::SetpointHoldExpiryTimestamp::TypeInfo::GetAttributeId(): return DataModel::Decode(reader, setpointHoldExpiryTimestamp); case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index 81be5e1224e81d..b563b7bf80cad5 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h @@ -29176,7 +29176,7 @@ struct Type Optional<chip::CharSpan> name; Optional<chip::ByteSpan> presetHandle; DataModel::List<const Structs::ScheduleTransitionStruct::Type> transitions; - Optional<DataModel::Nullable<bool>> builtIn; + DataModel::Nullable<bool> builtIn; static constexpr bool kIsFabricScoped = false; @@ -29191,7 +29191,7 @@ struct DecodableType Optional<chip::CharSpan> name; Optional<chip::ByteSpan> presetHandle; DataModel::DecodableList<Structs::ScheduleTransitionStruct::DecodableType> transitions; - Optional<DataModel::Nullable<bool>> builtIn; + DataModel::Nullable<bool> builtIn; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -29199,6 +29199,29 @@ struct DecodableType }; } // namespace ScheduleStruct +namespace AtomicAttributeStatusStruct { +enum class Fields : uint8_t +{ + kAttributeID = 0, + kStatusCode = 1, +}; + +struct Type +{ +public: + Optional<chip::AttributeId> attributeID; + Optional<uint8_t> statusCode; + + CHIP_ERROR Decode(TLV::TLVReader & reader); + + static constexpr bool kIsFabricScoped = false; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +using DecodableType = Type; + +} // namespace AtomicAttributeStatusStruct namespace PresetStruct { enum class Fields : uint8_t { @@ -29345,25 +29368,15 @@ struct Type; struct DecodableType; } // namespace SetActivePresetRequest -namespace StartPresetsSchedulesEditRequest { -struct Type; -struct DecodableType; -} // namespace StartPresetsSchedulesEditRequest - -namespace CancelPresetsSchedulesEditRequest { -struct Type; -struct DecodableType; -} // namespace CancelPresetsSchedulesEditRequest - -namespace CommitPresetsSchedulesRequest { +namespace AtomicResponse { struct Type; struct DecodableType; -} // namespace CommitPresetsSchedulesRequest +} // namespace AtomicResponse -namespace SetTemperatureSetpointHoldPolicy { +namespace AtomicRequest { struct Type; struct DecodableType; -} // namespace SetTemperatureSetpointHoldPolicy +} // namespace AtomicRequest } // namespace Commands @@ -29612,77 +29625,24 @@ struct DecodableType CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace SetActivePresetRequest -namespace StartPresetsSchedulesEditRequest { -enum class Fields : uint8_t -{ - kTimeoutSeconds = 0, -}; - -struct Type -{ -public: - // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::StartPresetsSchedulesEditRequest::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } - - uint16_t timeoutSeconds = static_cast<uint16_t>(0); - - CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; - - using ResponseType = DataModel::NullObjectType; - - static constexpr bool MustUseTimedInvoke() { return false; } -}; - -struct DecodableType -{ -public: - static constexpr CommandId GetCommandId() { return Commands::StartPresetsSchedulesEditRequest::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } - - uint16_t timeoutSeconds = static_cast<uint16_t>(0); - CHIP_ERROR Decode(TLV::TLVReader & reader); -}; -}; // namespace StartPresetsSchedulesEditRequest -namespace CancelPresetsSchedulesEditRequest { +namespace AtomicResponse { enum class Fields : uint8_t { + kStatusCode = 0, + kAttributeStatus = 1, + kTimeout = 2, }; struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::CancelPresetsSchedulesEditRequest::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } - - CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; - - using ResponseType = DataModel::NullObjectType; - - static constexpr bool MustUseTimedInvoke() { return false; } -}; - -struct DecodableType -{ -public: - static constexpr CommandId GetCommandId() { return Commands::CancelPresetsSchedulesEditRequest::Id; } + static constexpr CommandId GetCommandId() { return Commands::AtomicResponse::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } - CHIP_ERROR Decode(TLV::TLVReader & reader); -}; -}; // namespace CancelPresetsSchedulesEditRequest -namespace CommitPresetsSchedulesRequest { -enum class Fields : uint8_t -{ -}; - -struct Type -{ -public: - // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::CommitPresetsSchedulesRequest::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } + uint8_t statusCode = static_cast<uint8_t>(0); + DataModel::List<const Structs::AtomicAttributeStatusStruct::Type> attributeStatus; + Optional<uint16_t> timeout; CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; @@ -29694,31 +29654,37 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Commands::CommitPresetsSchedulesRequest::Id; } + static constexpr CommandId GetCommandId() { return Commands::AtomicResponse::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } + uint8_t statusCode = static_cast<uint8_t>(0); + DataModel::DecodableList<Structs::AtomicAttributeStatusStruct::DecodableType> attributeStatus; + Optional<uint16_t> timeout; CHIP_ERROR Decode(TLV::TLVReader & reader); }; -}; // namespace CommitPresetsSchedulesRequest -namespace SetTemperatureSetpointHoldPolicy { +}; // namespace AtomicResponse +namespace AtomicRequest { enum class Fields : uint8_t { - kTemperatureSetpointHoldPolicy = 0, + kRequestType = 0, + kAttributeRequests = 1, + kTimeout = 2, }; struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::SetTemperatureSetpointHoldPolicy::Id; } + static constexpr CommandId GetCommandId() { return Commands::AtomicRequest::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } - chip::BitMask<TemperatureSetpointHoldPolicyBitmap> temperatureSetpointHoldPolicy = - static_cast<chip::BitMask<TemperatureSetpointHoldPolicyBitmap>>(0); + AtomicRequestTypeEnum requestType = static_cast<AtomicRequestTypeEnum>(0); + DataModel::List<const chip::AttributeId> attributeRequests; + Optional<uint16_t> timeout; CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; - using ResponseType = DataModel::NullObjectType; + using ResponseType = Clusters::Thermostat::Commands::AtomicResponse::DecodableType; static constexpr bool MustUseTimedInvoke() { return false; } }; @@ -29726,14 +29692,15 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Commands::SetTemperatureSetpointHoldPolicy::Id; } + static constexpr CommandId GetCommandId() { return Commands::AtomicRequest::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } - chip::BitMask<TemperatureSetpointHoldPolicyBitmap> temperatureSetpointHoldPolicy = - static_cast<chip::BitMask<TemperatureSetpointHoldPolicyBitmap>>(0); + AtomicRequestTypeEnum requestType = static_cast<AtomicRequestTypeEnum>(0); + DataModel::DecodableList<chip::AttributeId> attributeRequests; + Optional<uint16_t> timeout; CHIP_ERROR Decode(TLV::TLVReader & reader); }; -}; // namespace SetTemperatureSetpointHoldPolicy +}; // namespace AtomicRequest } // namespace Commands namespace Attributes { @@ -29765,9 +29732,9 @@ struct TypeInfo namespace Occupancy { struct TypeInfo { - using Type = uint8_t; - using DecodableType = uint8_t; - using DecodableArgType = uint8_t; + using Type = chip::BitMask<chip::app::Clusters::Thermostat::OccupancyBitmap>; + using DecodableType = chip::BitMask<chip::app::Clusters::Thermostat::OccupancyBitmap>; + using DecodableArgType = chip::BitMask<chip::app::Clusters::Thermostat::OccupancyBitmap>; static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::Occupancy::Id; } @@ -29849,9 +29816,9 @@ struct TypeInfo namespace HVACSystemTypeConfiguration { struct TypeInfo { - using Type = uint8_t; - using DecodableType = uint8_t; - using DecodableArgType = uint8_t; + using Type = chip::BitMask<chip::app::Clusters::Thermostat::HVACSystemTypeBitmap>; + using DecodableType = chip::BitMask<chip::app::Clusters::Thermostat::HVACSystemTypeBitmap>; + using DecodableArgType = chip::BitMask<chip::app::Clusters::Thermostat::HVACSystemTypeBitmap>; static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::HVACSystemTypeConfiguration::Id; } @@ -30314,7 +30281,7 @@ struct TypeInfo static constexpr bool MustUseTimedWrite() { return false; } }; } // namespace ACCoilTemperature -namespace ACCapacityformat { +namespace ACCapacityFormat { struct TypeInfo { using Type = chip::app::Clusters::Thermostat::ACCapacityFormatEnum; @@ -30322,10 +30289,10 @@ struct TypeInfo using DecodableArgType = chip::app::Clusters::Thermostat::ACCapacityFormatEnum; static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::ACCapacityformat::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::ACCapacityFormat::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; -} // namespace ACCapacityformat +} // namespace ACCapacityFormat namespace PresetTypes { struct TypeInfo { @@ -30456,30 +30423,6 @@ struct TypeInfo static constexpr bool MustUseTimedWrite() { return false; } }; } // namespace Schedules -namespace PresetsSchedulesEditable { -struct TypeInfo -{ - using Type = bool; - using DecodableType = bool; - using DecodableArgType = bool; - - static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::PresetsSchedulesEditable::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace PresetsSchedulesEditable -namespace TemperatureSetpointHoldPolicy { -struct TypeInfo -{ - using Type = chip::BitMask<chip::app::Clusters::Thermostat::TemperatureSetpointHoldPolicyBitmap>; - using DecodableType = chip::BitMask<chip::app::Clusters::Thermostat::TemperatureSetpointHoldPolicyBitmap>; - using DecodableArgType = chip::BitMask<chip::app::Clusters::Thermostat::TemperatureSetpointHoldPolicyBitmap>; - - static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::TemperatureSetpointHoldPolicy::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace TemperatureSetpointHoldPolicy namespace SetpointHoldExpiryTimestamp { struct TypeInfo { @@ -30539,14 +30482,16 @@ struct TypeInfo Attributes::LocalTemperature::TypeInfo::DecodableType localTemperature; Attributes::OutdoorTemperature::TypeInfo::DecodableType outdoorTemperature; - Attributes::Occupancy::TypeInfo::DecodableType occupancy = static_cast<uint8_t>(0); - Attributes::AbsMinHeatSetpointLimit::TypeInfo::DecodableType absMinHeatSetpointLimit = static_cast<int16_t>(0); - Attributes::AbsMaxHeatSetpointLimit::TypeInfo::DecodableType absMaxHeatSetpointLimit = static_cast<int16_t>(0); - Attributes::AbsMinCoolSetpointLimit::TypeInfo::DecodableType absMinCoolSetpointLimit = static_cast<int16_t>(0); - Attributes::AbsMaxCoolSetpointLimit::TypeInfo::DecodableType absMaxCoolSetpointLimit = static_cast<int16_t>(0); - Attributes::PICoolingDemand::TypeInfo::DecodableType PICoolingDemand = static_cast<uint8_t>(0); - Attributes::PIHeatingDemand::TypeInfo::DecodableType PIHeatingDemand = static_cast<uint8_t>(0); - Attributes::HVACSystemTypeConfiguration::TypeInfo::DecodableType HVACSystemTypeConfiguration = static_cast<uint8_t>(0); + Attributes::Occupancy::TypeInfo::DecodableType occupancy = + static_cast<chip::BitMask<chip::app::Clusters::Thermostat::OccupancyBitmap>>(0); + Attributes::AbsMinHeatSetpointLimit::TypeInfo::DecodableType absMinHeatSetpointLimit = static_cast<int16_t>(0); + Attributes::AbsMaxHeatSetpointLimit::TypeInfo::DecodableType absMaxHeatSetpointLimit = static_cast<int16_t>(0); + Attributes::AbsMinCoolSetpointLimit::TypeInfo::DecodableType absMinCoolSetpointLimit = static_cast<int16_t>(0); + Attributes::AbsMaxCoolSetpointLimit::TypeInfo::DecodableType absMaxCoolSetpointLimit = static_cast<int16_t>(0); + Attributes::PICoolingDemand::TypeInfo::DecodableType PICoolingDemand = static_cast<uint8_t>(0); + Attributes::PIHeatingDemand::TypeInfo::DecodableType PIHeatingDemand = static_cast<uint8_t>(0); + Attributes::HVACSystemTypeConfiguration::TypeInfo::DecodableType HVACSystemTypeConfiguration = + static_cast<chip::BitMask<chip::app::Clusters::Thermostat::HVACSystemTypeBitmap>>(0); Attributes::LocalTemperatureCalibration::TypeInfo::DecodableType localTemperatureCalibration = static_cast<int8_t>(0); Attributes::OccupiedCoolingSetpoint::TypeInfo::DecodableType occupiedCoolingSetpoint = static_cast<int16_t>(0); Attributes::OccupiedHeatingSetpoint::TypeInfo::DecodableType occupiedHeatingSetpoint = static_cast<int16_t>(0); @@ -30598,7 +30543,7 @@ struct TypeInfo Attributes::ACLouverPosition::TypeInfo::DecodableType ACLouverPosition = static_cast<chip::app::Clusters::Thermostat::ACLouverPositionEnum>(0); Attributes::ACCoilTemperature::TypeInfo::DecodableType ACCoilTemperature; - Attributes::ACCapacityformat::TypeInfo::DecodableType ACCapacityformat = + Attributes::ACCapacityFormat::TypeInfo::DecodableType ACCapacityFormat = static_cast<chip::app::Clusters::Thermostat::ACCapacityFormatEnum>(0); Attributes::PresetTypes::TypeInfo::DecodableType presetTypes; Attributes::ScheduleTypes::TypeInfo::DecodableType scheduleTypes; @@ -30610,9 +30555,6 @@ struct TypeInfo Attributes::ActiveScheduleHandle::TypeInfo::DecodableType activeScheduleHandle; Attributes::Presets::TypeInfo::DecodableType presets; Attributes::Schedules::TypeInfo::DecodableType schedules; - Attributes::PresetsSchedulesEditable::TypeInfo::DecodableType presetsSchedulesEditable = static_cast<bool>(0); - Attributes::TemperatureSetpointHoldPolicy::TypeInfo::DecodableType temperatureSetpointHoldPolicy = - static_cast<chip::BitMask<chip::app::Clusters::Thermostat::TemperatureSetpointHoldPolicyBitmap>>(0); Attributes::SetpointHoldExpiryTimestamp::TypeInfo::DecodableType setpointHoldExpiryTimestamp; Attributes::GeneratedCommandList::TypeInfo::DecodableType generatedCommandList; Attributes::AcceptedCommandList::TypeInfo::DecodableType acceptedCommandList; diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h index c1d26d64c5d27b..87b5f6a145a35f 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h @@ -5138,9 +5138,9 @@ namespace ACCoilTemperature { static constexpr AttributeId Id = 0x00000046; } // namespace ACCoilTemperature -namespace ACCapacityformat { +namespace ACCapacityFormat { static constexpr AttributeId Id = 0x00000047; -} // namespace ACCapacityformat +} // namespace ACCapacityFormat namespace PresetTypes { static constexpr AttributeId Id = 0x00000048; @@ -5182,16 +5182,8 @@ namespace Schedules { static constexpr AttributeId Id = 0x00000051; } // namespace Schedules -namespace PresetsSchedulesEditable { -static constexpr AttributeId Id = 0x00000052; -} // namespace PresetsSchedulesEditable - -namespace TemperatureSetpointHoldPolicy { -static constexpr AttributeId Id = 0x00000053; -} // namespace TemperatureSetpointHoldPolicy - namespace SetpointHoldExpiryTimestamp { -static constexpr AttributeId Id = 0x00000054; +static constexpr AttributeId Id = 0x00000052; } // namespace SetpointHoldExpiryTimestamp namespace GeneratedCommandList { diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h index 926df4190a620e..5476f33cd2de84 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h @@ -1326,21 +1326,13 @@ namespace SetActivePresetRequest { static constexpr CommandId Id = 0x00000006; } // namespace SetActivePresetRequest -namespace StartPresetsSchedulesEditRequest { -static constexpr CommandId Id = 0x00000007; -} // namespace StartPresetsSchedulesEditRequest - -namespace CancelPresetsSchedulesEditRequest { -static constexpr CommandId Id = 0x00000008; -} // namespace CancelPresetsSchedulesEditRequest +namespace AtomicResponse { +static constexpr CommandId Id = 0x000000FD; +} // namespace AtomicResponse -namespace CommitPresetsSchedulesRequest { -static constexpr CommandId Id = 0x00000009; -} // namespace CommitPresetsSchedulesRequest - -namespace SetTemperatureSetpointHoldPolicy { -static constexpr CommandId Id = 0x0000000B; -} // namespace SetTemperatureSetpointHoldPolicy +namespace AtomicRequest { +static constexpr CommandId Id = 0x000000FE; +} // namespace AtomicRequest } // namespace Commands } // namespace Thermostat diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index 273f743a19cf00..e794640c326731 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -9432,10 +9432,7 @@ class ServiceAreaSkipCurrentLocation : public ClusterCommand | * ClearWeeklySchedule | 0x03 | | * SetActiveScheduleRequest | 0x05 | | * SetActivePresetRequest | 0x06 | -| * StartPresetsSchedulesEditRequest | 0x07 | -| * CancelPresetsSchedulesEditRequest | 0x08 | -| * CommitPresetsSchedulesRequest | 0x09 | -| * SetTemperatureSetpointHoldPolicy | 0x0B | +| * AtomicRequest | 0xFE | |------------------------------------------------------------------------------| | Attributes: | | | * LocalTemperature | 0x0000 | @@ -9486,7 +9483,7 @@ class ServiceAreaSkipCurrentLocation : public ClusterCommand | * ACErrorCode | 0x0044 | | * ACLouverPosition | 0x0045 | | * ACCoilTemperature | 0x0046 | -| * ACCapacityformat | 0x0047 | +| * ACCapacityFormat | 0x0047 | | * PresetTypes | 0x0048 | | * ScheduleTypes | 0x0049 | | * NumberOfPresets | 0x004A | @@ -9497,9 +9494,7 @@ class ServiceAreaSkipCurrentLocation : public ClusterCommand | * ActiveScheduleHandle | 0x004F | | * Presets | 0x0050 | | * Schedules | 0x0051 | -| * PresetsSchedulesEditable | 0x0052 | -| * TemperatureSetpointHoldPolicy | 0x0053 | -| * SetpointHoldExpiryTimestamp | 0x0054 | +| * SetpointHoldExpiryTimestamp | 0x0052 | | * GeneratedCommandList | 0xFFF8 | | * AcceptedCommandList | 0xFFF9 | | * EventList | 0xFFFA | @@ -9746,134 +9741,24 @@ class ThermostatSetActivePresetRequest : public ClusterCommand }; /* - * Command StartPresetsSchedulesEditRequest + * Command AtomicRequest */ -class ThermostatStartPresetsSchedulesEditRequest : public ClusterCommand +class ThermostatAtomicRequest : public ClusterCommand { public: - ThermostatStartPresetsSchedulesEditRequest(CredentialIssuerCommands * credsIssuerConfig) : - ClusterCommand("start-presets-schedules-edit-request", credsIssuerConfig) + ThermostatAtomicRequest(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("atomic-request", credsIssuerConfig), mComplex_AttributeRequests(&mRequest.attributeRequests) { - AddArgument("TimeoutSeconds", 0, UINT16_MAX, &mRequest.timeoutSeconds); - ClusterCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector<chip::EndpointId> endpointIds) override - { - constexpr chip::ClusterId clusterId = chip::app::Clusters::Thermostat::Id; - constexpr chip::CommandId commandId = chip::app::Clusters::Thermostat::Commands::StartPresetsSchedulesEditRequest::Id; - - ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, - commandId, endpointIds.at(0)); - return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); - } - - CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override - { - constexpr chip::ClusterId clusterId = chip::app::Clusters::Thermostat::Id; - constexpr chip::CommandId commandId = chip::app::Clusters::Thermostat::Commands::StartPresetsSchedulesEditRequest::Id; - - ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, - groupId); - - return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); - } - -private: - chip::app::Clusters::Thermostat::Commands::StartPresetsSchedulesEditRequest::Type mRequest; -}; - -/* - * Command CancelPresetsSchedulesEditRequest - */ -class ThermostatCancelPresetsSchedulesEditRequest : public ClusterCommand -{ -public: - ThermostatCancelPresetsSchedulesEditRequest(CredentialIssuerCommands * credsIssuerConfig) : - ClusterCommand("cancel-presets-schedules-edit-request", credsIssuerConfig) - { - ClusterCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector<chip::EndpointId> endpointIds) override - { - constexpr chip::ClusterId clusterId = chip::app::Clusters::Thermostat::Id; - constexpr chip::CommandId commandId = chip::app::Clusters::Thermostat::Commands::CancelPresetsSchedulesEditRequest::Id; - - ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, - commandId, endpointIds.at(0)); - return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); - } - - CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override - { - constexpr chip::ClusterId clusterId = chip::app::Clusters::Thermostat::Id; - constexpr chip::CommandId commandId = chip::app::Clusters::Thermostat::Commands::CancelPresetsSchedulesEditRequest::Id; - - ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, - groupId); - - return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); - } - -private: - chip::app::Clusters::Thermostat::Commands::CancelPresetsSchedulesEditRequest::Type mRequest; -}; - -/* - * Command CommitPresetsSchedulesRequest - */ -class ThermostatCommitPresetsSchedulesRequest : public ClusterCommand -{ -public: - ThermostatCommitPresetsSchedulesRequest(CredentialIssuerCommands * credsIssuerConfig) : - ClusterCommand("commit-presets-schedules-request", credsIssuerConfig) - { - ClusterCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector<chip::EndpointId> endpointIds) override - { - constexpr chip::ClusterId clusterId = chip::app::Clusters::Thermostat::Id; - constexpr chip::CommandId commandId = chip::app::Clusters::Thermostat::Commands::CommitPresetsSchedulesRequest::Id; - - ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, - commandId, endpointIds.at(0)); - return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); - } - - CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override - { - constexpr chip::ClusterId clusterId = chip::app::Clusters::Thermostat::Id; - constexpr chip::CommandId commandId = chip::app::Clusters::Thermostat::Commands::CommitPresetsSchedulesRequest::Id; - - ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, - groupId); - - return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); - } - -private: - chip::app::Clusters::Thermostat::Commands::CommitPresetsSchedulesRequest::Type mRequest; -}; - -/* - * Command SetTemperatureSetpointHoldPolicy - */ -class ThermostatSetTemperatureSetpointHoldPolicy : public ClusterCommand -{ -public: - ThermostatSetTemperatureSetpointHoldPolicy(CredentialIssuerCommands * credsIssuerConfig) : - ClusterCommand("set-temperature-setpoint-hold-policy", credsIssuerConfig) - { - AddArgument("TemperatureSetpointHoldPolicy", 0, UINT8_MAX, &mRequest.temperatureSetpointHoldPolicy); + AddArgument("RequestType", 0, UINT8_MAX, &mRequest.requestType); + AddArgument("AttributeRequests", &mComplex_AttributeRequests); + AddArgument("Timeout", 0, UINT16_MAX, &mRequest.timeout); ClusterCommand::AddArguments(); } CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector<chip::EndpointId> endpointIds) override { constexpr chip::ClusterId clusterId = chip::app::Clusters::Thermostat::Id; - constexpr chip::CommandId commandId = chip::app::Clusters::Thermostat::Commands::SetTemperatureSetpointHoldPolicy::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::Thermostat::Commands::AtomicRequest::Id; ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointIds.at(0)); @@ -9883,7 +9768,7 @@ class ThermostatSetTemperatureSetpointHoldPolicy : public ClusterCommand CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override { constexpr chip::ClusterId clusterId = chip::app::Clusters::Thermostat::Id; - constexpr chip::CommandId commandId = chip::app::Clusters::Thermostat::Commands::SetTemperatureSetpointHoldPolicy::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::Thermostat::Commands::AtomicRequest::Id; ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, groupId); @@ -9892,7 +9777,8 @@ class ThermostatSetTemperatureSetpointHoldPolicy : public ClusterCommand } private: - chip::app::Clusters::Thermostat::Commands::SetTemperatureSetpointHoldPolicy::Type mRequest; + chip::app::Clusters::Thermostat::Commands::AtomicRequest::Type mRequest; + TypedComplexArgument<chip::app::DataModel::List<const chip::AttributeId>> mComplex_AttributeRequests; }; /*----------------------------------------------------------------------------*\ @@ -22981,17 +22867,14 @@ void registerClusterThermostat(Commands & commands, CredentialIssuerCommands * c // // Commands // - make_unique<ClusterCommand>(Id, credsIssuerConfig), // - make_unique<ThermostatSetpointRaiseLower>(credsIssuerConfig), // - make_unique<ThermostatSetWeeklySchedule>(credsIssuerConfig), // - make_unique<ThermostatGetWeeklySchedule>(credsIssuerConfig), // - make_unique<ThermostatClearWeeklySchedule>(credsIssuerConfig), // - make_unique<ThermostatSetActiveScheduleRequest>(credsIssuerConfig), // - make_unique<ThermostatSetActivePresetRequest>(credsIssuerConfig), // - make_unique<ThermostatStartPresetsSchedulesEditRequest>(credsIssuerConfig), // - make_unique<ThermostatCancelPresetsSchedulesEditRequest>(credsIssuerConfig), // - make_unique<ThermostatCommitPresetsSchedulesRequest>(credsIssuerConfig), // - make_unique<ThermostatSetTemperatureSetpointHoldPolicy>(credsIssuerConfig), // + make_unique<ClusterCommand>(Id, credsIssuerConfig), // + make_unique<ThermostatSetpointRaiseLower>(credsIssuerConfig), // + make_unique<ThermostatSetWeeklySchedule>(credsIssuerConfig), // + make_unique<ThermostatGetWeeklySchedule>(credsIssuerConfig), // + make_unique<ThermostatClearWeeklySchedule>(credsIssuerConfig), // + make_unique<ThermostatSetActiveScheduleRequest>(credsIssuerConfig), // + make_unique<ThermostatSetActivePresetRequest>(credsIssuerConfig), // + make_unique<ThermostatAtomicRequest>(credsIssuerConfig), // // // Attributes // @@ -23058,7 +22941,7 @@ void registerClusterThermostat(Commands & commands, CredentialIssuerCommands * c make_unique<ReadAttribute>(Id, "acerror-code", Attributes::ACErrorCode::Id, credsIssuerConfig), // make_unique<ReadAttribute>(Id, "aclouver-position", Attributes::ACLouverPosition::Id, credsIssuerConfig), // make_unique<ReadAttribute>(Id, "accoil-temperature", Attributes::ACCoilTemperature::Id, credsIssuerConfig), // - make_unique<ReadAttribute>(Id, "accapacityformat", Attributes::ACCapacityformat::Id, credsIssuerConfig), // + make_unique<ReadAttribute>(Id, "accapacity-format", Attributes::ACCapacityFormat::Id, credsIssuerConfig), // make_unique<ReadAttribute>(Id, "preset-types", Attributes::PresetTypes::Id, credsIssuerConfig), // make_unique<ReadAttribute>(Id, "schedule-types", Attributes::ScheduleTypes::Id, credsIssuerConfig), // make_unique<ReadAttribute>(Id, "number-of-presets", Attributes::NumberOfPresets::Id, credsIssuerConfig), // @@ -23071,10 +22954,6 @@ void registerClusterThermostat(Commands & commands, CredentialIssuerCommands * c make_unique<ReadAttribute>(Id, "active-schedule-handle", Attributes::ActiveScheduleHandle::Id, credsIssuerConfig), // make_unique<ReadAttribute>(Id, "presets", Attributes::Presets::Id, credsIssuerConfig), // make_unique<ReadAttribute>(Id, "schedules", Attributes::Schedules::Id, credsIssuerConfig), // - make_unique<ReadAttribute>(Id, "presets-schedules-editable", Attributes::PresetsSchedulesEditable::Id, - credsIssuerConfig), // - make_unique<ReadAttribute>(Id, "temperature-setpoint-hold-policy", Attributes::TemperatureSetpointHoldPolicy::Id, - credsIssuerConfig), // make_unique<ReadAttribute>(Id, "setpoint-hold-expiry-timestamp", Attributes::SetpointHoldExpiryTimestamp::Id, credsIssuerConfig), // make_unique<ReadAttribute>(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // @@ -23090,8 +22969,8 @@ void registerClusterThermostat(Commands & commands, CredentialIssuerCommands * c make_unique<WriteAttribute<chip::app::DataModel::Nullable<int16_t>>>(Id, "outdoor-temperature", INT16_MIN, INT16_MAX, Attributes::OutdoorTemperature::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique<WriteAttribute<uint8_t>>(Id, "occupancy", 0, UINT8_MAX, Attributes::Occupancy::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique<WriteAttribute<chip::BitMask<chip::app::Clusters::Thermostat::OccupancyBitmap>>>( + Id, "occupancy", 0, UINT8_MAX, Attributes::Occupancy::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique<WriteAttribute<int16_t>>(Id, "abs-min-heat-setpoint-limit", INT16_MIN, INT16_MAX, Attributes::AbsMinHeatSetpointLimit::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // @@ -23108,9 +22987,9 @@ void registerClusterThermostat(Commands & commands, CredentialIssuerCommands * c WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique<WriteAttribute<uint8_t>>(Id, "piheating-demand", 0, UINT8_MAX, Attributes::PIHeatingDemand::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique<WriteAttribute<uint8_t>>(Id, "hvacsystem-type-configuration", 0, UINT8_MAX, - Attributes::HVACSystemTypeConfiguration::Id, WriteCommandType::kWrite, - credsIssuerConfig), // + make_unique<WriteAttribute<chip::BitMask<chip::app::Clusters::Thermostat::HVACSystemTypeBitmap>>>( + Id, "hvacsystem-type-configuration", 0, UINT8_MAX, Attributes::HVACSystemTypeConfiguration::Id, + WriteCommandType::kWrite, credsIssuerConfig), // make_unique<WriteAttribute<int8_t>>(Id, "local-temperature-calibration", INT8_MIN, INT8_MAX, Attributes::LocalTemperatureCalibration::Id, WriteCommandType::kWrite, credsIssuerConfig), // @@ -23213,7 +23092,8 @@ void registerClusterThermostat(Commands & commands, CredentialIssuerCommands * c Attributes::ACCoilTemperature::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique<WriteAttribute<chip::app::Clusters::Thermostat::ACCapacityFormatEnum>>( - Id, "accapacityformat", 0, UINT8_MAX, Attributes::ACCapacityformat::Id, WriteCommandType::kWrite, credsIssuerConfig), // + Id, "accapacity-format", 0, UINT8_MAX, Attributes::ACCapacityFormat::Id, WriteCommandType::kWrite, + credsIssuerConfig), // make_unique<WriteAttributeAsComplex< chip::app::DataModel::List<const chip::app::Clusters::Thermostat::Structs::PresetTypeStruct::Type>>>( Id, "preset-types", Attributes::PresetTypes::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // @@ -23241,11 +23121,6 @@ void registerClusterThermostat(Commands & commands, CredentialIssuerCommands * c make_unique<WriteAttributeAsComplex< chip::app::DataModel::List<const chip::app::Clusters::Thermostat::Structs::ScheduleStruct::Type>>>( Id, "schedules", Attributes::Schedules::Id, WriteCommandType::kWrite, credsIssuerConfig), // - make_unique<WriteAttribute<bool>>(Id, "presets-schedules-editable", 0, 1, Attributes::PresetsSchedulesEditable::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique<WriteAttribute<chip::BitMask<chip::app::Clusters::Thermostat::TemperatureSetpointHoldPolicyBitmap>>>( - Id, "temperature-setpoint-hold-policy", 0, UINT8_MAX, Attributes::TemperatureSetpointHoldPolicy::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique<WriteAttribute<chip::app::DataModel::Nullable<uint32_t>>>(Id, "setpoint-hold-expiry-timestamp", 0, UINT32_MAX, Attributes::SetpointHoldExpiryTimestamp::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // @@ -23329,7 +23204,7 @@ void registerClusterThermostat(Commands & commands, CredentialIssuerCommands * c make_unique<SubscribeAttribute>(Id, "acerror-code", Attributes::ACErrorCode::Id, credsIssuerConfig), // make_unique<SubscribeAttribute>(Id, "aclouver-position", Attributes::ACLouverPosition::Id, credsIssuerConfig), // make_unique<SubscribeAttribute>(Id, "accoil-temperature", Attributes::ACCoilTemperature::Id, credsIssuerConfig), // - make_unique<SubscribeAttribute>(Id, "accapacityformat", Attributes::ACCapacityformat::Id, credsIssuerConfig), // + make_unique<SubscribeAttribute>(Id, "accapacity-format", Attributes::ACCapacityFormat::Id, credsIssuerConfig), // make_unique<SubscribeAttribute>(Id, "preset-types", Attributes::PresetTypes::Id, credsIssuerConfig), // make_unique<SubscribeAttribute>(Id, "schedule-types", Attributes::ScheduleTypes::Id, credsIssuerConfig), // make_unique<SubscribeAttribute>(Id, "number-of-presets", Attributes::NumberOfPresets::Id, credsIssuerConfig), // @@ -23342,10 +23217,6 @@ void registerClusterThermostat(Commands & commands, CredentialIssuerCommands * c make_unique<SubscribeAttribute>(Id, "active-schedule-handle", Attributes::ActiveScheduleHandle::Id, credsIssuerConfig), // make_unique<SubscribeAttribute>(Id, "presets", Attributes::Presets::Id, credsIssuerConfig), // make_unique<SubscribeAttribute>(Id, "schedules", Attributes::Schedules::Id, credsIssuerConfig), // - make_unique<SubscribeAttribute>(Id, "presets-schedules-editable", Attributes::PresetsSchedulesEditable::Id, - credsIssuerConfig), // - make_unique<SubscribeAttribute>(Id, "temperature-setpoint-hold-policy", Attributes::TemperatureSetpointHoldPolicy::Id, - credsIssuerConfig), // make_unique<SubscribeAttribute>(Id, "setpoint-hold-expiry-timestamp", Attributes::SetpointHoldExpiryTimestamp::Id, credsIssuerConfig), // make_unique<SubscribeAttribute>(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // diff --git a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp index c93045a49de528..8f80fe9a2418e0 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp @@ -4064,6 +4064,7 @@ CHIP_ERROR ComplexArgumentParser::Setup(const char * label, ComplexArgumentParser::EnsureMemberExist("ScheduleStruct.systemMode", "systemMode", value.isMember("systemMode"))); ReturnErrorOnFailure( ComplexArgumentParser::EnsureMemberExist("ScheduleStruct.transitions", "transitions", value.isMember("transitions"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ScheduleStruct.builtIn", "builtIn", value.isMember("builtIn"))); char labelWithMember[kMaxLabelLength]; snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "scheduleHandle"); @@ -4092,11 +4093,8 @@ CHIP_ERROR ComplexArgumentParser::Setup(const char * label, ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.transitions, value["transitions"])); valueCopy.removeMember("transitions"); - if (value.isMember("builtIn")) - { - snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "builtIn"); - ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.builtIn, value["builtIn"])); - } + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "builtIn"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.builtIn, value["builtIn"])); valueCopy.removeMember("builtIn"); return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); @@ -4112,6 +4110,39 @@ void ComplexArgumentParser::Finalize(chip::app::Clusters::Thermostat::Structs::S ComplexArgumentParser::Finalize(request.builtIn); } +CHIP_ERROR ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::Thermostat::Structs::AtomicAttributeStatusStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + char labelWithMember[kMaxLabelLength]; + if (value.isMember("attributeID")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "attributeID"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.attributeID, value["attributeID"])); + } + valueCopy.removeMember("attributeID"); + + if (value.isMember("statusCode")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "statusCode"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.statusCode, value["statusCode"])); + } + valueCopy.removeMember("statusCode"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::Thermostat::Structs::AtomicAttributeStatusStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.attributeID); + ComplexArgumentParser::Finalize(request.statusCode); +} + CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::Thermostat::Structs::PresetStruct::Type & request, Json::Value & value) { diff --git a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h index a72e57e690d024..722b2ebac06d1f 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h @@ -466,6 +466,11 @@ static CHIP_ERROR Setup(const char * label, chip::app::Clusters::Thermostat::Str static void Finalize(chip::app::Clusters::Thermostat::Structs::ScheduleStruct::Type & request); +static CHIP_ERROR Setup(const char * label, chip::app::Clusters::Thermostat::Structs::AtomicAttributeStatusStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::Thermostat::Structs::AtomicAttributeStatusStruct::Type & request); + static CHIP_ERROR Setup(const char * label, chip::app::Clusters::Thermostat::Structs::PresetStruct::Type & request, Json::Value & value); diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp index c6c1231bab95d1..570e9b7b9b81a3 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -3642,6 +3642,32 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } +CHIP_ERROR +DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::Thermostat::Structs::AtomicAttributeStatusStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("AttributeID", indent + 1, value.attributeID); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'AttributeID'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("StatusCode", indent + 1, value.statusCode); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'StatusCode'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const chip::app::Clusters::Thermostat::Structs::PresetStruct::DecodableType & value) { @@ -8281,6 +8307,16 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, DataModelLogger::LogString(indent, "}"); return CHIP_NO_ERROR; } +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const Thermostat::Commands::AtomicResponse::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + ReturnErrorOnFailure(DataModelLogger::LogValue("statusCode", indent + 1, value.statusCode)); + ReturnErrorOnFailure(DataModelLogger::LogValue("attributeStatus", indent + 1, value.attributeStatus)); + ReturnErrorOnFailure(DataModelLogger::LogValue("timeout", indent + 1, value.timeout)); + DataModelLogger::LogString(indent, "}"); + return CHIP_NO_ERROR; +} CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const WiFiNetworkManagement::Commands::NetworkPassphraseResponse::DecodableType & value) { @@ -14691,7 +14727,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP return DataModelLogger::LogValue("OutdoorTemperature", 1, value); } case Thermostat::Attributes::Occupancy::Id: { - uint8_t value; + chip::BitMask<chip::app::Clusters::Thermostat::OccupancyBitmap> value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("Occupancy", 1, value); } @@ -14726,7 +14762,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP return DataModelLogger::LogValue("PIHeatingDemand", 1, value); } case Thermostat::Attributes::HVACSystemTypeConfiguration::Id: { - uint8_t value; + chip::BitMask<chip::app::Clusters::Thermostat::HVACSystemTypeBitmap> value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("HVACSystemTypeConfiguration", 1, value); } @@ -14920,10 +14956,10 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ACCoilTemperature", 1, value); } - case Thermostat::Attributes::ACCapacityformat::Id: { + case Thermostat::Attributes::ACCapacityFormat::Id: { chip::app::Clusters::Thermostat::ACCapacityFormatEnum value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ACCapacityformat", 1, value); + return DataModelLogger::LogValue("ACCapacityFormat", 1, value); } case Thermostat::Attributes::PresetTypes::Id: { chip::app::DataModel::DecodableList<chip::app::Clusters::Thermostat::Structs::PresetTypeStruct::DecodableType> value; @@ -14975,16 +15011,6 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("Schedules", 1, value); } - case Thermostat::Attributes::PresetsSchedulesEditable::Id: { - bool value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("PresetsSchedulesEditable", 1, value); - } - case Thermostat::Attributes::TemperatureSetpointHoldPolicy::Id: { - chip::BitMask<chip::app::Clusters::Thermostat::TemperatureSetpointHoldPolicyBitmap> value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("TemperatureSetpointHoldPolicy", 1, value); - } case Thermostat::Attributes::SetpointHoldExpiryTimestamp::Id: { chip::app::DataModel::Nullable<uint32_t> value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); @@ -19522,6 +19548,11 @@ CHIP_ERROR DataModelLogger::LogCommand(const chip::app::ConcreteCommandPath & pa ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("GetWeeklyScheduleResponse", 1, value); } + case Thermostat::Commands::AtomicResponse::Id: { + Thermostat::Commands::AtomicResponse::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("AtomicResponse", 1, value); + } } break; } diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h index 4cfb8d31d2098c..ae306d38b614a9 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h @@ -291,6 +291,9 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::Thermostat::Structs::ScheduleStruct::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::Thermostat::Structs::AtomicAttributeStatusStruct::DecodableType & value); + static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::Thermostat::Structs::PresetStruct::DecodableType & value); @@ -778,6 +781,8 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::ServiceArea::Commands::SkipCurrentLocationResponse::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::Thermostat::Commands::GetWeeklyScheduleResponse::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::Thermostat::Commands::AtomicResponse::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::WiFiNetworkManagement::Commands::NetworkPassphraseResponse::DecodableType & value); diff --git a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h index 8ebe6735d29dd0..aad2d4008452b1 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -106870,10 +106870,7 @@ class SubscribeAttributePumpConfigurationAndControlClusterRevision : public Subs | * ClearWeeklySchedule | 0x03 | | * SetActiveScheduleRequest | 0x05 | | * SetActivePresetRequest | 0x06 | -| * StartPresetsSchedulesEditRequest | 0x07 | -| * CancelPresetsSchedulesEditRequest | 0x08 | -| * CommitPresetsSchedulesRequest | 0x09 | -| * SetTemperatureSetpointHoldPolicy | 0x0B | +| * AtomicRequest | 0xFE | |------------------------------------------------------------------------------| | Attributes: | | | * LocalTemperature | 0x0000 | @@ -106924,7 +106921,7 @@ class SubscribeAttributePumpConfigurationAndControlClusterRevision : public Subs | * ACErrorCode | 0x0044 | | * ACLouverPosition | 0x0045 | | * ACCoilTemperature | 0x0046 | -| * ACCapacityformat | 0x0047 | +| * ACCapacityFormat | 0x0047 | | * PresetTypes | 0x0048 | | * ScheduleTypes | 0x0049 | | * NumberOfPresets | 0x004A | @@ -106935,9 +106932,7 @@ class SubscribeAttributePumpConfigurationAndControlClusterRevision : public Subs | * ActiveScheduleHandle | 0x004F | | * Presets | 0x0050 | | * Schedules | 0x0051 | -| * PresetsSchedulesEditable | 0x0052 | -| * TemperatureSetpointHoldPolicy | 0x0053 | -| * SetpointHoldExpiryTimestamp | 0x0054 | +| * SetpointHoldExpiryTimestamp | 0x0052 | | * GeneratedCommandList | 0xFFF8 | | * AcceptedCommandList | 0xFFF9 | | * EventList | 0xFFFA | @@ -107278,199 +107273,86 @@ class ThermostatSetActivePresetRequest : public ClusterCommand { #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL /* - * Command StartPresetsSchedulesEditRequest + * Command AtomicRequest */ -class ThermostatStartPresetsSchedulesEditRequest : public ClusterCommand { +class ThermostatAtomicRequest : public ClusterCommand { public: - ThermostatStartPresetsSchedulesEditRequest() - : ClusterCommand("start-presets-schedules-edit-request") + ThermostatAtomicRequest() + : ClusterCommand("atomic-request") + , mComplex_AttributeRequests(&mRequest.attributeRequests) { #if MTR_ENABLE_PROVISIONAL - AddArgument("TimeoutSeconds", 0, UINT16_MAX, &mRequest.timeoutSeconds); + AddArgument("RequestType", 0, UINT8_MAX, &mRequest.requestType); #endif // MTR_ENABLE_PROVISIONAL - ClusterCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - constexpr chip::ClusterId clusterId = chip::app::Clusters::Thermostat::Id; - constexpr chip::CommandId commandId = chip::app::Clusters::Thermostat::Commands::StartPresetsSchedulesEditRequest::Id; - - ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; - __auto_type * params = [[MTRThermostatClusterStartPresetsSchedulesEditRequestParams alloc] init]; - params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; #if MTR_ENABLE_PROVISIONAL - params.timeoutSeconds = [NSNumber numberWithUnsignedShort:mRequest.timeoutSeconds]; -#endif // MTR_ENABLE_PROVISIONAL - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster startPresetsSchedulesEditRequestWithParams:params completion: - ^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return CHIP_NO_ERROR; - } - -private: - chip::app::Clusters::Thermostat::Commands::StartPresetsSchedulesEditRequest::Type mRequest; -}; - + AddArgument("AttributeRequests", &mComplex_AttributeRequests); #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL -/* - * Command CancelPresetsSchedulesEditRequest - */ -class ThermostatCancelPresetsSchedulesEditRequest : public ClusterCommand { -public: - ThermostatCancelPresetsSchedulesEditRequest() - : ClusterCommand("cancel-presets-schedules-edit-request") - { - ClusterCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - constexpr chip::ClusterId clusterId = chip::app::Clusters::Thermostat::Id; - constexpr chip::CommandId commandId = chip::app::Clusters::Thermostat::Commands::CancelPresetsSchedulesEditRequest::Id; - - ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; - __auto_type * params = [[MTRThermostatClusterCancelPresetsSchedulesEditRequestParams alloc] init]; - params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster cancelPresetsSchedulesEditRequestWithParams:params completion: - ^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return CHIP_NO_ERROR; - } - -private: -}; - + AddArgument("Timeout", 0, UINT16_MAX, &mRequest.timeout); #endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL -/* - * Command CommitPresetsSchedulesRequest - */ -class ThermostatCommitPresetsSchedulesRequest : public ClusterCommand { -public: - ThermostatCommitPresetsSchedulesRequest() - : ClusterCommand("commit-presets-schedules-request") - { ClusterCommand::AddArguments(); } CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override { constexpr chip::ClusterId clusterId = chip::app::Clusters::Thermostat::Id; - constexpr chip::CommandId commandId = chip::app::Clusters::Thermostat::Commands::CommitPresetsSchedulesRequest::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::Thermostat::Commands::AtomicRequest::Id; ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); __auto_type * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; - __auto_type * params = [[MTRThermostatClusterCommitPresetsSchedulesRequestParams alloc] init]; + __auto_type * params = [[MTRThermostatClusterAtomicRequestParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster commitPresetsSchedulesRequestWithParams:params completion: - ^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return CHIP_NO_ERROR; - } - -private: -}; - -#endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL -/* - * Command SetTemperatureSetpointHoldPolicy - */ -class ThermostatSetTemperatureSetpointHoldPolicy : public ClusterCommand { -public: - ThermostatSetTemperatureSetpointHoldPolicy() - : ClusterCommand("set-temperature-setpoint-hold-policy") - { + params.requestType = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.requestType)]; +#endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - AddArgument("TemperatureSetpointHoldPolicy", 0, UINT8_MAX, &mRequest.temperatureSetpointHoldPolicy); + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + for (auto & entry_0 : mRequest.attributeRequests) { + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + [array_0 addObject:newElement_0]; + } + params.attributeRequests = array_0; + } #endif // MTR_ENABLE_PROVISIONAL - ClusterCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - constexpr chip::ClusterId clusterId = chip::app::Clusters::Thermostat::Id; - constexpr chip::CommandId commandId = chip::app::Clusters::Thermostat::Commands::SetTemperatureSetpointHoldPolicy::Id; - - ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; - __auto_type * params = [[MTRThermostatClusterSetTemperatureSetpointHoldPolicyParams alloc] init]; - params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; #if MTR_ENABLE_PROVISIONAL - params.temperatureSetpointHoldPolicy = [NSNumber numberWithUnsignedChar:mRequest.temperatureSetpointHoldPolicy.Raw()]; + if (mRequest.timeout.HasValue()) { + params.timeout = [NSNumber numberWithUnsignedShort:mRequest.timeout.Value()]; + } else { + params.timeout = nil; + } #endif // MTR_ENABLE_PROVISIONAL uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster setTemperatureSetpointHoldPolicyWithParams:params completion: - ^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster atomicRequestWithParams:params completion: + ^(MTRThermostatClusterAtomicResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId = chip::app::Clusters::Thermostat::Commands::AtomicResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId = chip::app::Clusters::Thermostat::Commands::AtomicResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } private: - chip::app::Clusters::Thermostat::Commands::SetTemperatureSetpointHoldPolicy::Type mRequest; + chip::app::Clusters::Thermostat::Commands::AtomicRequest::Type mRequest; + TypedComplexArgument<chip::app::DataModel::List<const chip::AttributeId>> mComplex_AttributeRequests; }; #endif // MTR_ENABLE_PROVISIONAL @@ -112486,35 +112368,37 @@ class SubscribeAttributeThermostatACCoilTemperature : public SubscribeAttribute } }; +#if MTR_ENABLE_PROVISIONAL + /* - * Attribute ACCapacityformat + * Attribute ACCapacityFormat */ -class ReadThermostatACCapacityformat : public ReadAttribute { +class ReadThermostatACCapacityFormat : public ReadAttribute { public: - ReadThermostatACCapacityformat() - : ReadAttribute("accapacityformat") + ReadThermostatACCapacityFormat() + : ReadAttribute("accapacity-format") { } - ~ReadThermostatACCapacityformat() + ~ReadThermostatACCapacityFormat() { } CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override { constexpr chip::ClusterId clusterId = chip::app::Clusters::Thermostat::Id; - constexpr chip::AttributeId attributeId = chip::app::Clusters::Thermostat::Attributes::ACCapacityformat::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::Thermostat::Attributes::ACCapacityFormat::Id; ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); __auto_type * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; - [cluster readAttributeACCapacityformatWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Thermostat.ACCapacityformat response %@", [value description]); + [cluster readAttributeACCapacityFormatWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.ACCapacityFormat response %@", [value description]); if (error == nil) { RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); } else { - LogNSError("Thermostat ACCapacityformat read Error", error); + LogNSError("Thermostat ACCapacityFormat read Error", error); RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); @@ -112523,24 +112407,24 @@ class ReadThermostatACCapacityformat : public ReadAttribute { } }; -class WriteThermostatACCapacityformat : public WriteAttribute { +class WriteThermostatACCapacityFormat : public WriteAttribute { public: - WriteThermostatACCapacityformat() - : WriteAttribute("accapacityformat") + WriteThermostatACCapacityFormat() + : WriteAttribute("accapacity-format") { - AddArgument("attr-name", "accapacityformat"); + AddArgument("attr-name", "accapacity-format"); AddArgument("attr-value", 0, UINT8_MAX, &mValue); WriteAttribute::AddArguments(); } - ~WriteThermostatACCapacityformat() + ~WriteThermostatACCapacityFormat() { } CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override { constexpr chip::ClusterId clusterId = chip::app::Clusters::Thermostat::Id; - constexpr chip::AttributeId attributeId = chip::app::Clusters::Thermostat::Attributes::ACCapacityformat::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::Thermostat::Attributes::ACCapacityFormat::Id; ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); @@ -112550,9 +112434,9 @@ class WriteThermostatACCapacityformat : public WriteAttribute { params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; - [cluster writeAttributeACCapacityformatWithValue:value params:params completion:^(NSError * _Nullable error) { + [cluster writeAttributeACCapacityFormatWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { - LogNSError("Thermostat ACCapacityformat write Error", error); + LogNSError("Thermostat ACCapacityFormat write Error", error); RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); @@ -112564,21 +112448,21 @@ class WriteThermostatACCapacityformat : public WriteAttribute { uint8_t mValue; }; -class SubscribeAttributeThermostatACCapacityformat : public SubscribeAttribute { +class SubscribeAttributeThermostatACCapacityFormat : public SubscribeAttribute { public: - SubscribeAttributeThermostatACCapacityformat() - : SubscribeAttribute("accapacityformat") + SubscribeAttributeThermostatACCapacityFormat() + : SubscribeAttribute("accapacity-format") { } - ~SubscribeAttributeThermostatACCapacityformat() + ~SubscribeAttributeThermostatACCapacityFormat() { } CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override { constexpr chip::ClusterId clusterId = chip::app::Clusters::Thermostat::Id; - constexpr chip::CommandId attributeId = chip::app::Clusters::Thermostat::Attributes::ACCapacityformat::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::Thermostat::Attributes::ACCapacityFormat::Id; ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); @@ -112593,10 +112477,10 @@ class SubscribeAttributeThermostatACCapacityformat : public SubscribeAttribute { if (mAutoResubscribe.HasValue()) { params.resubscribeAutomatically = mAutoResubscribe.Value(); } - [cluster subscribeAttributeACCapacityformatWithParams:params + [cluster subscribeAttributeACCapacityFormatWithParams:params subscriptionEstablished:^() { mSubscriptionEstablished = YES; } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Thermostat.ACCapacityformat response %@", [value description]); + NSLog(@"Thermostat.ACCapacityFormat response %@", [value description]); if (error == nil) { RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); } else { @@ -112609,6 +112493,7 @@ class SubscribeAttributeThermostatACCapacityformat : public SubscribeAttribute { } }; +#endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL /* @@ -113574,14 +113459,10 @@ class WriteThermostatSchedules : public WriteAttribute { } newElement_0.transitions = array_2; } - if (entry_0.builtIn.HasValue()) { - if (entry_0.builtIn.Value().IsNull()) { - newElement_0.builtIn = nil; - } else { - newElement_0.builtIn = [NSNumber numberWithBool:entry_0.builtIn.Value().Value()]; - } - } else { + if (entry_0.builtIn.IsNull()) { newElement_0.builtIn = nil; + } else { + newElement_0.builtIn = [NSNumber numberWithBool:entry_0.builtIn.Value()]; } [array_0 addObject:newElement_0]; } @@ -113651,176 +113532,6 @@ class SubscribeAttributeThermostatSchedules : public SubscribeAttribute { #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL -/* - * Attribute PresetsSchedulesEditable - */ -class ReadThermostatPresetsSchedulesEditable : public ReadAttribute { -public: - ReadThermostatPresetsSchedulesEditable() - : ReadAttribute("presets-schedules-editable") - { - } - - ~ReadThermostatPresetsSchedulesEditable() - { - } - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - constexpr chip::ClusterId clusterId = chip::app::Clusters::Thermostat::Id; - constexpr chip::AttributeId attributeId = chip::app::Clusters::Thermostat::Attributes::PresetsSchedulesEditable::Id; - - ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; - [cluster readAttributePresetsSchedulesEditableWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Thermostat.PresetsSchedulesEditable response %@", [value description]); - if (error == nil) { - RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); - } else { - LogNSError("Thermostat PresetsSchedulesEditable read Error", error); - RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); - } - SetCommandExitStatus(error); - }]; - return CHIP_NO_ERROR; - } -}; - -class SubscribeAttributeThermostatPresetsSchedulesEditable : public SubscribeAttribute { -public: - SubscribeAttributeThermostatPresetsSchedulesEditable() - : SubscribeAttribute("presets-schedules-editable") - { - } - - ~SubscribeAttributeThermostatPresetsSchedulesEditable() - { - } - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - constexpr chip::ClusterId clusterId = chip::app::Clusters::Thermostat::Id; - constexpr chip::CommandId attributeId = chip::app::Clusters::Thermostat::Attributes::PresetsSchedulesEditable::Id; - - ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; - __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; - if (mKeepSubscriptions.HasValue()) { - params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); - } - if (mFabricFiltered.HasValue()) { - params.filterByFabric = mFabricFiltered.Value(); - } - if (mAutoResubscribe.HasValue()) { - params.resubscribeAutomatically = mAutoResubscribe.Value(); - } - [cluster subscribeAttributePresetsSchedulesEditableWithParams:params - subscriptionEstablished:^() { mSubscriptionEstablished = YES; } - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Thermostat.PresetsSchedulesEditable response %@", [value description]); - if (error == nil) { - RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); - } else { - RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); - } - SetCommandExitStatus(error); - }]; - - return CHIP_NO_ERROR; - } -}; - -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - -/* - * Attribute TemperatureSetpointHoldPolicy - */ -class ReadThermostatTemperatureSetpointHoldPolicy : public ReadAttribute { -public: - ReadThermostatTemperatureSetpointHoldPolicy() - : ReadAttribute("temperature-setpoint-hold-policy") - { - } - - ~ReadThermostatTemperatureSetpointHoldPolicy() - { - } - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - constexpr chip::ClusterId clusterId = chip::app::Clusters::Thermostat::Id; - constexpr chip::AttributeId attributeId = chip::app::Clusters::Thermostat::Attributes::TemperatureSetpointHoldPolicy::Id; - - ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; - [cluster readAttributeTemperatureSetpointHoldPolicyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Thermostat.TemperatureSetpointHoldPolicy response %@", [value description]); - if (error == nil) { - RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); - } else { - LogNSError("Thermostat TemperatureSetpointHoldPolicy read Error", error); - RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); - } - SetCommandExitStatus(error); - }]; - return CHIP_NO_ERROR; - } -}; - -class SubscribeAttributeThermostatTemperatureSetpointHoldPolicy : public SubscribeAttribute { -public: - SubscribeAttributeThermostatTemperatureSetpointHoldPolicy() - : SubscribeAttribute("temperature-setpoint-hold-policy") - { - } - - ~SubscribeAttributeThermostatTemperatureSetpointHoldPolicy() - { - } - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - constexpr chip::ClusterId clusterId = chip::app::Clusters::Thermostat::Id; - constexpr chip::CommandId attributeId = chip::app::Clusters::Thermostat::Attributes::TemperatureSetpointHoldPolicy::Id; - - ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; - __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; - if (mKeepSubscriptions.HasValue()) { - params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); - } - if (mFabricFiltered.HasValue()) { - params.filterByFabric = mFabricFiltered.Value(); - } - if (mAutoResubscribe.HasValue()) { - params.resubscribeAutomatically = mAutoResubscribe.Value(); - } - [cluster subscribeAttributeTemperatureSetpointHoldPolicyWithParams:params - subscriptionEstablished:^() { mSubscriptionEstablished = YES; } - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Thermostat.TemperatureSetpointHoldPolicy response %@", [value description]); - if (error == nil) { - RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); - } else { - RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); - } - SetCommandExitStatus(error); - }]; - - return CHIP_NO_ERROR; - } -}; - -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - /* * Attribute SetpointHoldExpiryTimestamp */ @@ -194919,16 +194630,7 @@ void registerClusterThermostat(Commands & commands) make_unique<ThermostatSetActivePresetRequest>(), // #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - make_unique<ThermostatStartPresetsSchedulesEditRequest>(), // -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - make_unique<ThermostatCancelPresetsSchedulesEditRequest>(), // -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - make_unique<ThermostatCommitPresetsSchedulesRequest>(), // -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - make_unique<ThermostatSetTemperatureSetpointHoldPolicy>(), // + make_unique<ThermostatAtomicRequest>(), // #endif // MTR_ENABLE_PROVISIONAL make_unique<ReadAttribute>(Id), // make_unique<WriteAttribute>(Id), // @@ -195055,9 +194757,11 @@ void registerClusterThermostat(Commands & commands) make_unique<SubscribeAttributeThermostatACLouverPosition>(), // make_unique<ReadThermostatACCoilTemperature>(), // make_unique<SubscribeAttributeThermostatACCoilTemperature>(), // - make_unique<ReadThermostatACCapacityformat>(), // - make_unique<WriteThermostatACCapacityformat>(), // - make_unique<SubscribeAttributeThermostatACCapacityformat>(), // +#if MTR_ENABLE_PROVISIONAL + make_unique<ReadThermostatACCapacityFormat>(), // + make_unique<WriteThermostatACCapacityFormat>(), // + make_unique<SubscribeAttributeThermostatACCapacityFormat>(), // +#endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL make_unique<ReadThermostatPresetTypes>(), // make_unique<SubscribeAttributeThermostatPresetTypes>(), // @@ -195100,14 +194804,6 @@ void registerClusterThermostat(Commands & commands) make_unique<WriteThermostatSchedules>(), // make_unique<SubscribeAttributeThermostatSchedules>(), // #endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - make_unique<ReadThermostatPresetsSchedulesEditable>(), // - make_unique<SubscribeAttributeThermostatPresetsSchedulesEditable>(), // -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - make_unique<ReadThermostatTemperatureSetpointHoldPolicy>(), // - make_unique<SubscribeAttributeThermostatTemperatureSetpointHoldPolicy>(), // -#endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL make_unique<ReadThermostatSetpointHoldExpiryTimestamp>(), // make_unique<SubscribeAttributeThermostatSetpointHoldExpiryTimestamp>(), //