From 4efcd8ca69589f3a2167d370c52c94ca088a2eb7 Mon Sep 17 00:00:00 2001 From: David Rempel <63119829+drempelg@users.noreply.github.com> Date: Tue, 16 Jan 2024 10:22:03 -0800 Subject: [PATCH] XML only commit for 1.3 Thermostat spec changes. Cluster xml file (#30672) * XML only commit for 1.3 Thermostat spec changes. Cluster xml file generated using Hasty's tool, as a result some of the stuff that didn't follow our normal standards and norms for matter have also been corrected (renaming types for example). * Fixed Types (going blind here since I'm not sure how to compile these) * Restyled by whitespace * Restyled by clang-format * manually adjust to the two's compliment since bad code gen was happening for some of the builds. * fixed copypaste typo * fixing esp build * didn't fix the build after all, reverted, and fixed another typo. * Think last commit fixed telink build, lets see if this fixes the rest * more blind changes using pull requests as a compiler... * switch is probably better * would help if I used the right variable... * more type safety to make it build (not doing all of it, since I can't actually build locally or test locally) * more type fixes * and some more * and more * last one? * on to minimal... * regenerated with a new JRE, hopefully will pass the codegen check * Restyled by clang-format * new xml, new regen. * apparently we need a reg after this merge :) * Lets see if this is good enough to get through the chip-repl tests * Added the queued preset encoding * Set a sane minimum value for LocalTemperatureCalibration * Restyled by clang-format * turned off the new commands for now since the test suite can't handle them yet and is getting upset that there are commands it isn't expecting there (why that's a necessary check, I'm really not sure...) * passing all the TSTAT unit tests now locally, lets see if the remote tests like it. * Fixing ameba target * missed these in the merge * After inspecting the bits of the xml that didn't conflict, found some bad merges and reverted them back to master * Revert this change back since it was decided in the great renaming to not do it. * This should get us past the backward incompat test * Fix the bad merge I did using github directly * XML changes as requested * Blew away the zap generated dirs and regenerated again. Some files stayed deleted. * missed changing the default response field here * Update src/app/clusters/thermostat-server/thermostat-server.cpp Co-authored-by: Boris Zbarsky * Update src/app/zap-templates/zcl/data-model/chip/thermostat-cluster.xml Co-authored-by: Boris Zbarsky * Fixed up the order of the commands and improved the comments. * ran regen --------- Co-authored-by: Restyled.io Co-authored-by: Boris Zbarsky --- .../all-clusters-app.matter | 142 +- .../all-clusters-common/all-clusters-app.zap | 280 +++ .../all-clusters-minimal-app.matter | 122 +- ...umiditysensor_thermostat_56de3d5f45.matter | 122 +- ...tnode_heatingcoolingunit_ncdGai1E5a.matter | 122 +- ...tnode_roomairconditioner_9cf3607804.matter | 122 +- .../rootnode_thermostat_bm3fb8dhYi.matter | 122 +- .../placeholder/linux/apps/app1/config.matter | 244 ++- .../placeholder/linux/apps/app2/config.matter | 244 ++- .../thermostat/asr/src/TemperatureManager.cpp | 1 + .../nxp/zap/thermostat_matter_thread.matter | 122 +- .../nxp/zap/thermostat_matter_wifi.matter | 122 +- .../thermostat-common/thermostat.matter | 122 +- .../thermostat-server/thermostat-server.cpp | 90 + .../data-model/chip/thermostat-cluster.xml | 153 +- .../zcl/zcl-with-test-extensions.json | 1 + src/app/zap-templates/zcl/zcl.json | 1 + .../data_model/controller-clusters.matter | 122 +- .../chip/devicecontroller/ChipClusters.java | 550 +++++ .../chip/devicecontroller/ChipStructs.java | 576 ++++++ .../devicecontroller/ClusterIDMapping.java | 91 +- .../devicecontroller/ClusterInfoMapping.java | 298 +++ .../devicecontroller/ClusterReadMapping.java | 143 ++ .../chip/devicecontroller/cluster/files.gni | 6 + .../structs/ThermostatClusterPresetStruct.kt | 140 ++ .../ThermostatClusterPresetTypeStruct.kt | 64 + .../ThermostatClusterQueuedPresetStruct.kt | 79 + .../ThermostatClusterScheduleStruct.kt | 142 ++ ...ermostatClusterScheduleTransitionStruct.kt | 119 ++ .../ThermostatClusterScheduleTypeStruct.kt | 68 + .../cluster/clusters/ThermostatCluster.kt | 1749 ++++++++++++++++ .../java/matter/controller/cluster/files.gni | 6 + .../structs/ThermostatClusterPresetStruct.kt | 140 ++ .../ThermostatClusterPresetTypeStruct.kt | 64 + .../ThermostatClusterQueuedPresetStruct.kt | 79 + .../ThermostatClusterScheduleStruct.kt | 142 ++ ...ermostatClusterScheduleTransitionStruct.kt | 119 ++ .../ThermostatClusterScheduleTypeStruct.kt | 68 + .../CHIPAttributeTLVValueDecoder.cpp | 739 +++++++ .../java/zap-generated/CHIPClientCallbacks.h | 12 + .../zap-generated/CHIPClustersWrite-JNI.cpp | 393 ++++ .../java/zap-generated/CHIPReadCallbacks.cpp | 946 +++++++++ .../python/chip/clusters/CHIPClusters.py | 133 ++ .../python/chip/clusters/Objects.py | 495 +++++ .../MTRAttributeSpecifiedCheck.mm | 42 + .../MTRAttributeTLVValueDecoder.mm | 353 ++++ .../CHIP/zap-generated/MTRBaseClusters.h | 169 +- .../CHIP/zap-generated/MTRBaseClusters.mm | 873 ++++++++ .../CHIP/zap-generated/MTRClusterConstants.h | 21 + .../CHIP/zap-generated/MTRClusters.h | 45 + .../CHIP/zap-generated/MTRClusters.mm | 293 +++ .../zap-generated/MTRCommandPayloadsObjc.h | 206 ++ .../zap-generated/MTRCommandPayloadsObjc.mm | 544 +++++ .../MTRCommandPayloads_Internal.h | 42 + .../CHIP/zap-generated/MTRStructsObjc.h | 50 + .../CHIP/zap-generated/MTRStructsObjc.mm | 222 ++ .../zap-generated/attributes/Accessors.cpp | 361 ++++ .../zap-generated/attributes/Accessors.h | 56 + .../app-common/zap-generated/callback.h | 42 + .../zap-generated/cluster-enums-check.h | 17 + .../app-common/zap-generated/cluster-enums.h | 58 +- .../zap-generated/cluster-objects.cpp | 545 +++++ .../zap-generated/cluster-objects.h | 624 ++++++ .../app-common/zap-generated/ids/Attributes.h | 56 + .../app-common/zap-generated/ids/Commands.h | 28 + .../zap-generated/cluster/Commands.h | 378 +++- .../cluster/ComplexArgumentParser.cpp | 299 +++ .../cluster/ComplexArgumentParser.h | 30 + .../cluster/logging/DataModelLogger.cpp | 333 +++ .../cluster/logging/DataModelLogger.h | 18 + .../zap-generated/cluster/Commands.h | 1842 +++++++++++++++++ 71 files changed, 17128 insertions(+), 34 deletions(-) create mode 100644 src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThermostatClusterPresetStruct.kt create mode 100644 src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThermostatClusterPresetTypeStruct.kt create mode 100644 src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThermostatClusterQueuedPresetStruct.kt create mode 100644 src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThermostatClusterScheduleStruct.kt create mode 100644 src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThermostatClusterScheduleTransitionStruct.kt create mode 100644 src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThermostatClusterScheduleTypeStruct.kt create mode 100644 src/controller/java/generated/java/matter/controller/cluster/structs/ThermostatClusterPresetStruct.kt create mode 100644 src/controller/java/generated/java/matter/controller/cluster/structs/ThermostatClusterPresetTypeStruct.kt create mode 100644 src/controller/java/generated/java/matter/controller/cluster/structs/ThermostatClusterQueuedPresetStruct.kt create mode 100644 src/controller/java/generated/java/matter/controller/cluster/structs/ThermostatClusterScheduleStruct.kt create mode 100644 src/controller/java/generated/java/matter/controller/cluster/structs/ThermostatClusterScheduleTransitionStruct.kt create mode 100644 src/controller/java/generated/java/matter/controller/cluster/structs/ThermostatClusterScheduleTypeStruct.kt 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 aa4e2f6e5ad2ba..bf17de9820366e 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 @@ -4467,6 +4467,16 @@ cluster Thermostat = 513 { kCoolingAndHeatingWithReheat = 5; } + enum PresetScenarioEnum : enum8 { + kUnspecified = 0; + kOccupied = 1; + kUnoccupied = 2; + kSleep = 3; + kWake = 4; + kVacation = 5; + kUserDefined = 6; + } + enum SetpointChangeSourceEnum : enum8 { kManual = 0; kSchedule = 1; @@ -4528,6 +4538,10 @@ cluster Thermostat = 513 { kSetback = 0x10; kAutoMode = 0x20; kLocalTemperatureNotExposed = 0x40; + kMatterScheduleConfiguration = 0x80; + kPresets = 0x100; + kSetpoints = 0x200; + kQueuedPresetsSupported = 0x400; } bitmap HVACSystemTypeBitmap : bitmap8 { @@ -4537,6 +4551,11 @@ cluster Thermostat = 513 { kHeatingUsesFuel = 0x20; } + bitmap PresetTypeFeaturesBitmap : bitmap16 { + kAutomatic = 0x1; + kSupportsNames = 0x2; + } + bitmap ProgrammingOperationModeBitmap : bitmap8 { kScheduleActive = 0x1; kAutoRecovery = 0x2; @@ -4575,6 +4594,62 @@ cluster Thermostat = 513 { kCoolSetpointPresent = 0x2; } + bitmap ScheduleTypeFeaturesBitmap : bitmap16 { + kSupportsPresets = 0x1; + kSupportsSetpoints = 0x2; + kSupportsNames = 0x4; + kSupportsOff = 0x8; + } + + bitmap TemperatureSetpointHoldPolicyBitmap : bitmap8 { + kHoldDurationElapsed = 0x1; + kHoldDurationElapsedOrPresetChanged = 0x2; + } + + struct ScheduleTransitionStruct { + ScheduleDayOfWeekBitmap dayOfWeek = 0; + int16u transitionTime = 1; + optional octet_string<16> presetHandle = 2; + optional SystemModeEnum systemMode = 3; + optional temperature coolingSetpoint = 4; + optional temperature heatingSetpoint = 5; + } + + struct ScheduleStruct { + nullable octet_string<16> scheduleHandle = 0; + SystemModeEnum systemMode = 1; + optional char_string<64> name = 2; + optional octet_string<16> presetHandle = 3; + ScheduleTransitionStruct transitions[] = 4; + optional nullable boolean builtIn = 5; + } + + struct PresetStruct { + nullable octet_string<16> presetHandle = 0; + PresetScenarioEnum presetScenario = 1; + optional nullable char_string<64> name = 2; + optional temperature coolingSetpoint = 3; + optional temperature heatingSetpoint = 4; + nullable boolean builtIn = 5; + } + + struct PresetTypeStruct { + PresetScenarioEnum presetScenario = 0; + int8u numberOfPresets = 1; + PresetTypeFeaturesBitmap presetTypeFeatures = 2; + } + + struct QueuedPresetStruct { + nullable octet_string<16> presetHandle = 0; + nullable epoch_s transitionTimestamp = 1; + } + + struct ScheduleTypeStruct { + SystemModeEnum systemMode = 0; + int8u numberOfSchedules = 1; + ScheduleTypeFeaturesBitmap scheduleTypeFeatures = 2; + } + struct WeeklyScheduleTransitionStruct { int16u transitionTime = 0; nullable temperature heatSetpoint = 1; @@ -4630,6 +4705,20 @@ cluster Thermostat = 513 { attribute access(write: manage) optional ACLouverPositionEnum ACLouverPosition = 69; readonly attribute optional nullable temperature ACCoilTemperature = 70; attribute access(write: manage) optional ACCapacityFormatEnum ACCapacityformat = 71; + readonly attribute optional PresetTypeStruct presetTypes[] = 72; + readonly attribute optional ScheduleTypeStruct scheduleTypes[] = 73; + readonly attribute optional int8u numberOfPresets = 74; + readonly attribute optional int8u numberOfSchedules = 75; + readonly attribute optional int8u numberOfScheduleTransitions = 76; + readonly attribute optional nullable int8u numberOfScheduleTransitionPerDay = 77; + readonly attribute optional nullable octet_string<16> activePresetHandle = 78; + 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 QueuedPresetStruct queuedPreset = 85; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -4661,14 +4750,45 @@ cluster Thermostat = 513 { ScheduleModeBitmap modeToReturn = 1; } + request struct SetActiveScheduleRequestRequest { + octet_string<16> scheduleHandle = 0; + } + + request struct SetActivePresetRequestRequest { + octet_string<16> presetHandle = 0; + optional int16u delayMinutes = 1; + } + + request struct StartPresetsSchedulesEditRequestRequest { + int16u timeoutSeconds = 0; + } + + request struct SetTemperatureSetpointHoldPolicyRequest { + TemperatureSetpointHoldPolicyBitmap temperatureSetpointHoldPolicy = 0; + } + /** Command description for SetpointRaiseLower */ command SetpointRaiseLower(SetpointRaiseLowerRequest): DefaultSuccess = 0; /** Command description for SetWeeklySchedule */ command access(invoke: manage) SetWeeklySchedule(SetWeeklyScheduleRequest): DefaultSuccess = 1; /** Command description for GetWeeklySchedule */ command GetWeeklySchedule(GetWeeklyScheduleRequest): GetWeeklyScheduleResponse = 2; - /** The Clear Weekly Schedule command is used to clear the weekly schedule. */ + /** This command is used to clear the weekly schedule. The ClearWeeklySchedule command has no payload. */ command access(invoke: manage) ClearWeeklySchedule(): DefaultSuccess = 3; + /** This command is used to set the active schedule. */ + command SetActiveScheduleRequest(SetActiveScheduleRequestRequest): DefaultSuccess = 5; + /** This command is used to set the active preset. */ + 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 is sent to cancel a queued preset. */ + command access(invoke: manage) CancelSetActivePresetRequest(): DefaultSuccess = 10; + /** This command sets the set point hold policy. */ + command SetTemperatureSetpointHoldPolicy(SetTemperatureSetpointHoldPolicyRequest): DefaultSuccess = 11; } /** An interface for controlling a fan in a heating/cooling system. */ @@ -7750,6 +7870,19 @@ endpoint 1 { ram attribute minSetpointDeadBand default = 0x19; ram attribute controlSequenceOfOperation default = 0x04; ram attribute systemMode default = 0x01; + callback attribute presetTypes; + callback attribute scheduleTypes; + ram attribute numberOfPresets default = 0; + ram attribute numberOfSchedules default = 0; + ram attribute numberOfScheduleTransitionPerDay default = 0xFF; + ram attribute activePresetHandle; + ram attribute activeScheduleHandle; + callback attribute presets; + callback attribute schedules; + ram attribute presetsSchedulesEditable; + ram attribute temperatureSetpointHoldPolicy default = 0; + ram attribute setpointHoldExpiryTimestamp; + callback attribute queuedPreset; callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute eventList; @@ -7758,6 +7891,13 @@ endpoint 1 { ram attribute clusterRevision default = 6; handle command SetpointRaiseLower; + handle command SetActiveScheduleRequest; + handle command SetActivePresetRequest; + handle command StartPresetsSchedulesEditRequest; + handle command CancelPresetsSchedulesEditRequest; + handle command CommitPresetsSchedulesRequest; + handle command CancelSetActivePresetRequest; + handle command SetTemperatureSetpointHoldPolicy; } 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 fabe40ca88f598..589fccf290f084 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 @@ -14215,6 +14215,78 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "GetRelayStatusLogResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 0 + }, + { + "name": "GetRelayStatusLog", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 0 + }, + { + "name": "SetActiveScheduleRequest", + "code": 5, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 0 + }, + { + "name": "SetActivePresetRequest", + "code": 6, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 0 + }, + { + "name": "StartPresetsSchedulesEditRequest", + "code": 7, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 0 + }, + { + "name": "CancelPresetsSchedulesEditRequest", + "code": 8, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 0 + }, + { + "name": "CommitPresetsSchedulesRequest", + "code": 9, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 0 + }, + { + "name": "CancelSetActivePresetRequest", + "code": 10, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 0 + }, + { + "name": "SetTemperatureSetpointHoldPolicy", + "code": 11, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 0 } ], "attributes": [ @@ -14442,6 +14514,214 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "PresetTypes", + "code": 72, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ScheduleTypes", + "code": 73, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "NumberOfPresets", + "code": 74, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "NumberOfSchedules", + "code": 75, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "NumberOfScheduleTransitionPerDay", + "code": 77, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0xFF", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActivePresetHandle", + "code": 78, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveScheduleHandle", + "code": 79, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Presets", + "code": 80, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Schedules", + "code": 81, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PresetsSchedulesEditable", + "code": 82, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TemperatureSetpointHoldPolicy", + "code": 83, + "mfgCode": null, + "side": "server", + "type": "TemperatureSetpointHoldPolicyBitmap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SetpointHoldExpiryTimestamp", + "code": 84, + "mfgCode": null, + "side": "server", + "type": "epoch_s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "QueuedPreset", + "code": 85, + "mfgCode": null, + "side": "server", + "type": "QueuedPresetStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "GeneratedCommandList", "code": 65528, 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 22ca859b26a104..d97c29e2da342b 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 @@ -3564,6 +3564,16 @@ cluster Thermostat = 513 { kCoolingAndHeatingWithReheat = 5; } + enum PresetScenarioEnum : enum8 { + kUnspecified = 0; + kOccupied = 1; + kUnoccupied = 2; + kSleep = 3; + kWake = 4; + kVacation = 5; + kUserDefined = 6; + } + enum SetpointChangeSourceEnum : enum8 { kManual = 0; kSchedule = 1; @@ -3625,6 +3635,10 @@ cluster Thermostat = 513 { kSetback = 0x10; kAutoMode = 0x20; kLocalTemperatureNotExposed = 0x40; + kMatterScheduleConfiguration = 0x80; + kPresets = 0x100; + kSetpoints = 0x200; + kQueuedPresetsSupported = 0x400; } bitmap HVACSystemTypeBitmap : bitmap8 { @@ -3634,6 +3648,11 @@ cluster Thermostat = 513 { kHeatingUsesFuel = 0x20; } + bitmap PresetTypeFeaturesBitmap : bitmap16 { + kAutomatic = 0x1; + kSupportsNames = 0x2; + } + bitmap ProgrammingOperationModeBitmap : bitmap8 { kScheduleActive = 0x1; kAutoRecovery = 0x2; @@ -3672,6 +3691,62 @@ cluster Thermostat = 513 { kCoolSetpointPresent = 0x2; } + bitmap ScheduleTypeFeaturesBitmap : bitmap16 { + kSupportsPresets = 0x1; + kSupportsSetpoints = 0x2; + kSupportsNames = 0x4; + kSupportsOff = 0x8; + } + + bitmap TemperatureSetpointHoldPolicyBitmap : bitmap8 { + kHoldDurationElapsed = 0x1; + kHoldDurationElapsedOrPresetChanged = 0x2; + } + + struct ScheduleTransitionStruct { + ScheduleDayOfWeekBitmap dayOfWeek = 0; + int16u transitionTime = 1; + optional octet_string<16> presetHandle = 2; + optional SystemModeEnum systemMode = 3; + optional temperature coolingSetpoint = 4; + optional temperature heatingSetpoint = 5; + } + + struct ScheduleStruct { + nullable octet_string<16> scheduleHandle = 0; + SystemModeEnum systemMode = 1; + optional char_string<64> name = 2; + optional octet_string<16> presetHandle = 3; + ScheduleTransitionStruct transitions[] = 4; + optional nullable boolean builtIn = 5; + } + + struct PresetStruct { + nullable octet_string<16> presetHandle = 0; + PresetScenarioEnum presetScenario = 1; + optional nullable char_string<64> name = 2; + optional temperature coolingSetpoint = 3; + optional temperature heatingSetpoint = 4; + nullable boolean builtIn = 5; + } + + struct PresetTypeStruct { + PresetScenarioEnum presetScenario = 0; + int8u numberOfPresets = 1; + PresetTypeFeaturesBitmap presetTypeFeatures = 2; + } + + struct QueuedPresetStruct { + nullable octet_string<16> presetHandle = 0; + nullable epoch_s transitionTimestamp = 1; + } + + struct ScheduleTypeStruct { + SystemModeEnum systemMode = 0; + int8u numberOfSchedules = 1; + ScheduleTypeFeaturesBitmap scheduleTypeFeatures = 2; + } + struct WeeklyScheduleTransitionStruct { int16u transitionTime = 0; nullable temperature heatSetpoint = 1; @@ -3727,6 +3802,20 @@ cluster Thermostat = 513 { attribute access(write: manage) optional ACLouverPositionEnum ACLouverPosition = 69; readonly attribute optional nullable temperature ACCoilTemperature = 70; attribute access(write: manage) optional ACCapacityFormatEnum ACCapacityformat = 71; + readonly attribute optional PresetTypeStruct presetTypes[] = 72; + readonly attribute optional ScheduleTypeStruct scheduleTypes[] = 73; + readonly attribute optional int8u numberOfPresets = 74; + readonly attribute optional int8u numberOfSchedules = 75; + readonly attribute optional int8u numberOfScheduleTransitions = 76; + readonly attribute optional nullable int8u numberOfScheduleTransitionPerDay = 77; + readonly attribute optional nullable octet_string<16> activePresetHandle = 78; + 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 QueuedPresetStruct queuedPreset = 85; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -3758,14 +3847,45 @@ cluster Thermostat = 513 { ScheduleModeBitmap modeToReturn = 1; } + request struct SetActiveScheduleRequestRequest { + octet_string<16> scheduleHandle = 0; + } + + request struct SetActivePresetRequestRequest { + octet_string<16> presetHandle = 0; + optional int16u delayMinutes = 1; + } + + request struct StartPresetsSchedulesEditRequestRequest { + int16u timeoutSeconds = 0; + } + + request struct SetTemperatureSetpointHoldPolicyRequest { + TemperatureSetpointHoldPolicyBitmap temperatureSetpointHoldPolicy = 0; + } + /** Command description for SetpointRaiseLower */ command SetpointRaiseLower(SetpointRaiseLowerRequest): DefaultSuccess = 0; /** Command description for SetWeeklySchedule */ command access(invoke: manage) SetWeeklySchedule(SetWeeklyScheduleRequest): DefaultSuccess = 1; /** Command description for GetWeeklySchedule */ command GetWeeklySchedule(GetWeeklyScheduleRequest): GetWeeklyScheduleResponse = 2; - /** The Clear Weekly Schedule command is used to clear the weekly schedule. */ + /** This command is used to clear the weekly schedule. The ClearWeeklySchedule command has no payload. */ command access(invoke: manage) ClearWeeklySchedule(): DefaultSuccess = 3; + /** This command is used to set the active schedule. */ + command SetActiveScheduleRequest(SetActiveScheduleRequestRequest): DefaultSuccess = 5; + /** This command is used to set the active preset. */ + 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 is sent to cancel a queued preset. */ + command access(invoke: manage) CancelSetActivePresetRequest(): DefaultSuccess = 10; + /** This command sets the set point hold policy. */ + command SetTemperatureSetpointHoldPolicy(SetTemperatureSetpointHoldPolicyRequest): DefaultSuccess = 11; } /** 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 6066dc34eedb2e..df276f6ab3fce3 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 @@ -1177,6 +1177,16 @@ cluster Thermostat = 513 { kCoolingAndHeatingWithReheat = 5; } + enum PresetScenarioEnum : enum8 { + kUnspecified = 0; + kOccupied = 1; + kUnoccupied = 2; + kSleep = 3; + kWake = 4; + kVacation = 5; + kUserDefined = 6; + } + enum SetpointChangeSourceEnum : enum8 { kManual = 0; kSchedule = 1; @@ -1238,6 +1248,10 @@ cluster Thermostat = 513 { kSetback = 0x10; kAutoMode = 0x20; kLocalTemperatureNotExposed = 0x40; + kMatterScheduleConfiguration = 0x80; + kPresets = 0x100; + kSetpoints = 0x200; + kQueuedPresetsSupported = 0x400; } bitmap HVACSystemTypeBitmap : bitmap8 { @@ -1247,6 +1261,11 @@ cluster Thermostat = 513 { kHeatingUsesFuel = 0x20; } + bitmap PresetTypeFeaturesBitmap : bitmap16 { + kAutomatic = 0x1; + kSupportsNames = 0x2; + } + bitmap ProgrammingOperationModeBitmap : bitmap8 { kScheduleActive = 0x1; kAutoRecovery = 0x2; @@ -1285,6 +1304,62 @@ cluster Thermostat = 513 { kCoolSetpointPresent = 0x2; } + bitmap ScheduleTypeFeaturesBitmap : bitmap16 { + kSupportsPresets = 0x1; + kSupportsSetpoints = 0x2; + kSupportsNames = 0x4; + kSupportsOff = 0x8; + } + + bitmap TemperatureSetpointHoldPolicyBitmap : bitmap8 { + kHoldDurationElapsed = 0x1; + kHoldDurationElapsedOrPresetChanged = 0x2; + } + + struct ScheduleTransitionStruct { + ScheduleDayOfWeekBitmap dayOfWeek = 0; + int16u transitionTime = 1; + optional octet_string<16> presetHandle = 2; + optional SystemModeEnum systemMode = 3; + optional temperature coolingSetpoint = 4; + optional temperature heatingSetpoint = 5; + } + + struct ScheduleStruct { + nullable octet_string<16> scheduleHandle = 0; + SystemModeEnum systemMode = 1; + optional char_string<64> name = 2; + optional octet_string<16> presetHandle = 3; + ScheduleTransitionStruct transitions[] = 4; + optional nullable boolean builtIn = 5; + } + + struct PresetStruct { + nullable octet_string<16> presetHandle = 0; + PresetScenarioEnum presetScenario = 1; + optional nullable char_string<64> name = 2; + optional temperature coolingSetpoint = 3; + optional temperature heatingSetpoint = 4; + nullable boolean builtIn = 5; + } + + struct PresetTypeStruct { + PresetScenarioEnum presetScenario = 0; + int8u numberOfPresets = 1; + PresetTypeFeaturesBitmap presetTypeFeatures = 2; + } + + struct QueuedPresetStruct { + nullable octet_string<16> presetHandle = 0; + nullable epoch_s transitionTimestamp = 1; + } + + struct ScheduleTypeStruct { + SystemModeEnum systemMode = 0; + int8u numberOfSchedules = 1; + ScheduleTypeFeaturesBitmap scheduleTypeFeatures = 2; + } + struct WeeklyScheduleTransitionStruct { int16u transitionTime = 0; nullable temperature heatSetpoint = 1; @@ -1340,6 +1415,20 @@ cluster Thermostat = 513 { attribute access(write: manage) optional ACLouverPositionEnum ACLouverPosition = 69; readonly attribute optional nullable temperature ACCoilTemperature = 70; attribute access(write: manage) optional ACCapacityFormatEnum ACCapacityformat = 71; + readonly attribute optional PresetTypeStruct presetTypes[] = 72; + readonly attribute optional ScheduleTypeStruct scheduleTypes[] = 73; + readonly attribute optional int8u numberOfPresets = 74; + readonly attribute optional int8u numberOfSchedules = 75; + readonly attribute optional int8u numberOfScheduleTransitions = 76; + readonly attribute optional nullable int8u numberOfScheduleTransitionPerDay = 77; + readonly attribute optional nullable octet_string<16> activePresetHandle = 78; + 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 QueuedPresetStruct queuedPreset = 85; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1371,14 +1460,45 @@ cluster Thermostat = 513 { ScheduleModeBitmap modeToReturn = 1; } + request struct SetActiveScheduleRequestRequest { + octet_string<16> scheduleHandle = 0; + } + + request struct SetActivePresetRequestRequest { + octet_string<16> presetHandle = 0; + optional int16u delayMinutes = 1; + } + + request struct StartPresetsSchedulesEditRequestRequest { + int16u timeoutSeconds = 0; + } + + request struct SetTemperatureSetpointHoldPolicyRequest { + TemperatureSetpointHoldPolicyBitmap temperatureSetpointHoldPolicy = 0; + } + /** Command description for SetpointRaiseLower */ command SetpointRaiseLower(SetpointRaiseLowerRequest): DefaultSuccess = 0; /** Command description for SetWeeklySchedule */ command access(invoke: manage) SetWeeklySchedule(SetWeeklyScheduleRequest): DefaultSuccess = 1; /** Command description for GetWeeklySchedule */ command GetWeeklySchedule(GetWeeklyScheduleRequest): GetWeeklyScheduleResponse = 2; - /** The Clear Weekly Schedule command is used to clear the weekly schedule. */ + /** This command is used to clear the weekly schedule. The ClearWeeklySchedule command has no payload. */ command access(invoke: manage) ClearWeeklySchedule(): DefaultSuccess = 3; + /** This command is used to set the active schedule. */ + command SetActiveScheduleRequest(SetActiveScheduleRequestRequest): DefaultSuccess = 5; + /** This command is used to set the active preset. */ + 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 is sent to cancel a queued preset. */ + command access(invoke: manage) CancelSetActivePresetRequest(): DefaultSuccess = 10; + /** This command sets the set point hold policy. */ + command SetTemperatureSetpointHoldPolicy(SetTemperatureSetpointHoldPolicyRequest): DefaultSuccess = 11; } /** 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 741d7b25fef7db..ed16842ca4a281 100644 --- a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter +++ b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter @@ -1534,6 +1534,16 @@ cluster Thermostat = 513 { kCoolingAndHeatingWithReheat = 5; } + enum PresetScenarioEnum : enum8 { + kUnspecified = 0; + kOccupied = 1; + kUnoccupied = 2; + kSleep = 3; + kWake = 4; + kVacation = 5; + kUserDefined = 6; + } + enum SetpointChangeSourceEnum : enum8 { kManual = 0; kSchedule = 1; @@ -1595,6 +1605,10 @@ cluster Thermostat = 513 { kSetback = 0x10; kAutoMode = 0x20; kLocalTemperatureNotExposed = 0x40; + kMatterScheduleConfiguration = 0x80; + kPresets = 0x100; + kSetpoints = 0x200; + kQueuedPresetsSupported = 0x400; } bitmap HVACSystemTypeBitmap : bitmap8 { @@ -1604,6 +1618,11 @@ cluster Thermostat = 513 { kHeatingUsesFuel = 0x20; } + bitmap PresetTypeFeaturesBitmap : bitmap16 { + kAutomatic = 0x1; + kSupportsNames = 0x2; + } + bitmap ProgrammingOperationModeBitmap : bitmap8 { kScheduleActive = 0x1; kAutoRecovery = 0x2; @@ -1642,6 +1661,62 @@ cluster Thermostat = 513 { kCoolSetpointPresent = 0x2; } + bitmap ScheduleTypeFeaturesBitmap : bitmap16 { + kSupportsPresets = 0x1; + kSupportsSetpoints = 0x2; + kSupportsNames = 0x4; + kSupportsOff = 0x8; + } + + bitmap TemperatureSetpointHoldPolicyBitmap : bitmap8 { + kHoldDurationElapsed = 0x1; + kHoldDurationElapsedOrPresetChanged = 0x2; + } + + struct ScheduleTransitionStruct { + ScheduleDayOfWeekBitmap dayOfWeek = 0; + int16u transitionTime = 1; + optional octet_string<16> presetHandle = 2; + optional SystemModeEnum systemMode = 3; + optional temperature coolingSetpoint = 4; + optional temperature heatingSetpoint = 5; + } + + struct ScheduleStruct { + nullable octet_string<16> scheduleHandle = 0; + SystemModeEnum systemMode = 1; + optional char_string<64> name = 2; + optional octet_string<16> presetHandle = 3; + ScheduleTransitionStruct transitions[] = 4; + optional nullable boolean builtIn = 5; + } + + struct PresetStruct { + nullable octet_string<16> presetHandle = 0; + PresetScenarioEnum presetScenario = 1; + optional nullable char_string<64> name = 2; + optional temperature coolingSetpoint = 3; + optional temperature heatingSetpoint = 4; + nullable boolean builtIn = 5; + } + + struct PresetTypeStruct { + PresetScenarioEnum presetScenario = 0; + int8u numberOfPresets = 1; + PresetTypeFeaturesBitmap presetTypeFeatures = 2; + } + + struct QueuedPresetStruct { + nullable octet_string<16> presetHandle = 0; + nullable epoch_s transitionTimestamp = 1; + } + + struct ScheduleTypeStruct { + SystemModeEnum systemMode = 0; + int8u numberOfSchedules = 1; + ScheduleTypeFeaturesBitmap scheduleTypeFeatures = 2; + } + struct WeeklyScheduleTransitionStruct { int16u transitionTime = 0; nullable temperature heatSetpoint = 1; @@ -1697,6 +1772,20 @@ cluster Thermostat = 513 { attribute access(write: manage) optional ACLouverPositionEnum ACLouverPosition = 69; readonly attribute optional nullable temperature ACCoilTemperature = 70; attribute access(write: manage) optional ACCapacityFormatEnum ACCapacityformat = 71; + readonly attribute optional PresetTypeStruct presetTypes[] = 72; + readonly attribute optional ScheduleTypeStruct scheduleTypes[] = 73; + readonly attribute optional int8u numberOfPresets = 74; + readonly attribute optional int8u numberOfSchedules = 75; + readonly attribute optional int8u numberOfScheduleTransitions = 76; + readonly attribute optional nullable int8u numberOfScheduleTransitionPerDay = 77; + readonly attribute optional nullable octet_string<16> activePresetHandle = 78; + 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 QueuedPresetStruct queuedPreset = 85; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1728,14 +1817,45 @@ cluster Thermostat = 513 { ScheduleModeBitmap modeToReturn = 1; } + request struct SetActiveScheduleRequestRequest { + octet_string<16> scheduleHandle = 0; + } + + request struct SetActivePresetRequestRequest { + octet_string<16> presetHandle = 0; + optional int16u delayMinutes = 1; + } + + request struct StartPresetsSchedulesEditRequestRequest { + int16u timeoutSeconds = 0; + } + + request struct SetTemperatureSetpointHoldPolicyRequest { + TemperatureSetpointHoldPolicyBitmap temperatureSetpointHoldPolicy = 0; + } + /** Command description for SetpointRaiseLower */ command SetpointRaiseLower(SetpointRaiseLowerRequest): DefaultSuccess = 0; /** Command description for SetWeeklySchedule */ command access(invoke: manage) SetWeeklySchedule(SetWeeklyScheduleRequest): DefaultSuccess = 1; /** Command description for GetWeeklySchedule */ command GetWeeklySchedule(GetWeeklyScheduleRequest): GetWeeklyScheduleResponse = 2; - /** The Clear Weekly Schedule command is used to clear the weekly schedule. */ + /** This command is used to clear the weekly schedule. The ClearWeeklySchedule command has no payload. */ command access(invoke: manage) ClearWeeklySchedule(): DefaultSuccess = 3; + /** This command is used to set the active schedule. */ + command SetActiveScheduleRequest(SetActiveScheduleRequestRequest): DefaultSuccess = 5; + /** This command is used to set the active preset. */ + 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 is sent to cancel a queued preset. */ + command access(invoke: manage) CancelSetActivePresetRequest(): DefaultSuccess = 10; + /** This command sets the set point hold policy. */ + command SetTemperatureSetpointHoldPolicy(SetTemperatureSetpointHoldPolicyRequest): DefaultSuccess = 11; } /** 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 af70a8875073c9..6797456a6b6091 100644 --- a/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter +++ b/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter @@ -1117,6 +1117,16 @@ cluster Thermostat = 513 { kCoolingAndHeatingWithReheat = 5; } + enum PresetScenarioEnum : enum8 { + kUnspecified = 0; + kOccupied = 1; + kUnoccupied = 2; + kSleep = 3; + kWake = 4; + kVacation = 5; + kUserDefined = 6; + } + enum SetpointChangeSourceEnum : enum8 { kManual = 0; kSchedule = 1; @@ -1178,6 +1188,10 @@ cluster Thermostat = 513 { kSetback = 0x10; kAutoMode = 0x20; kLocalTemperatureNotExposed = 0x40; + kMatterScheduleConfiguration = 0x80; + kPresets = 0x100; + kSetpoints = 0x200; + kQueuedPresetsSupported = 0x400; } bitmap HVACSystemTypeBitmap : bitmap8 { @@ -1187,6 +1201,11 @@ cluster Thermostat = 513 { kHeatingUsesFuel = 0x20; } + bitmap PresetTypeFeaturesBitmap : bitmap16 { + kAutomatic = 0x1; + kSupportsNames = 0x2; + } + bitmap ProgrammingOperationModeBitmap : bitmap8 { kScheduleActive = 0x1; kAutoRecovery = 0x2; @@ -1225,6 +1244,62 @@ cluster Thermostat = 513 { kCoolSetpointPresent = 0x2; } + bitmap ScheduleTypeFeaturesBitmap : bitmap16 { + kSupportsPresets = 0x1; + kSupportsSetpoints = 0x2; + kSupportsNames = 0x4; + kSupportsOff = 0x8; + } + + bitmap TemperatureSetpointHoldPolicyBitmap : bitmap8 { + kHoldDurationElapsed = 0x1; + kHoldDurationElapsedOrPresetChanged = 0x2; + } + + struct ScheduleTransitionStruct { + ScheduleDayOfWeekBitmap dayOfWeek = 0; + int16u transitionTime = 1; + optional octet_string<16> presetHandle = 2; + optional SystemModeEnum systemMode = 3; + optional temperature coolingSetpoint = 4; + optional temperature heatingSetpoint = 5; + } + + struct ScheduleStruct { + nullable octet_string<16> scheduleHandle = 0; + SystemModeEnum systemMode = 1; + optional char_string<64> name = 2; + optional octet_string<16> presetHandle = 3; + ScheduleTransitionStruct transitions[] = 4; + optional nullable boolean builtIn = 5; + } + + struct PresetStruct { + nullable octet_string<16> presetHandle = 0; + PresetScenarioEnum presetScenario = 1; + optional nullable char_string<64> name = 2; + optional temperature coolingSetpoint = 3; + optional temperature heatingSetpoint = 4; + nullable boolean builtIn = 5; + } + + struct PresetTypeStruct { + PresetScenarioEnum presetScenario = 0; + int8u numberOfPresets = 1; + PresetTypeFeaturesBitmap presetTypeFeatures = 2; + } + + struct QueuedPresetStruct { + nullable octet_string<16> presetHandle = 0; + nullable epoch_s transitionTimestamp = 1; + } + + struct ScheduleTypeStruct { + SystemModeEnum systemMode = 0; + int8u numberOfSchedules = 1; + ScheduleTypeFeaturesBitmap scheduleTypeFeatures = 2; + } + struct WeeklyScheduleTransitionStruct { int16u transitionTime = 0; nullable temperature heatSetpoint = 1; @@ -1280,6 +1355,20 @@ cluster Thermostat = 513 { attribute access(write: manage) optional ACLouverPositionEnum ACLouverPosition = 69; readonly attribute optional nullable temperature ACCoilTemperature = 70; attribute access(write: manage) optional ACCapacityFormatEnum ACCapacityformat = 71; + readonly attribute optional PresetTypeStruct presetTypes[] = 72; + readonly attribute optional ScheduleTypeStruct scheduleTypes[] = 73; + readonly attribute optional int8u numberOfPresets = 74; + readonly attribute optional int8u numberOfSchedules = 75; + readonly attribute optional int8u numberOfScheduleTransitions = 76; + readonly attribute optional nullable int8u numberOfScheduleTransitionPerDay = 77; + readonly attribute optional nullable octet_string<16> activePresetHandle = 78; + 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 QueuedPresetStruct queuedPreset = 85; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1311,14 +1400,45 @@ cluster Thermostat = 513 { ScheduleModeBitmap modeToReturn = 1; } + request struct SetActiveScheduleRequestRequest { + octet_string<16> scheduleHandle = 0; + } + + request struct SetActivePresetRequestRequest { + octet_string<16> presetHandle = 0; + optional int16u delayMinutes = 1; + } + + request struct StartPresetsSchedulesEditRequestRequest { + int16u timeoutSeconds = 0; + } + + request struct SetTemperatureSetpointHoldPolicyRequest { + TemperatureSetpointHoldPolicyBitmap temperatureSetpointHoldPolicy = 0; + } + /** Command description for SetpointRaiseLower */ command SetpointRaiseLower(SetpointRaiseLowerRequest): DefaultSuccess = 0; /** Command description for SetWeeklySchedule */ command access(invoke: manage) SetWeeklySchedule(SetWeeklyScheduleRequest): DefaultSuccess = 1; /** Command description for GetWeeklySchedule */ command GetWeeklySchedule(GetWeeklyScheduleRequest): GetWeeklyScheduleResponse = 2; - /** The Clear Weekly Schedule command is used to clear the weekly schedule. */ + /** This command is used to clear the weekly schedule. The ClearWeeklySchedule command has no payload. */ command access(invoke: manage) ClearWeeklySchedule(): DefaultSuccess = 3; + /** This command is used to set the active schedule. */ + command SetActiveScheduleRequest(SetActiveScheduleRequestRequest): DefaultSuccess = 5; + /** This command is used to set the active preset. */ + 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 is sent to cancel a queued preset. */ + command access(invoke: manage) CancelSetActivePresetRequest(): DefaultSuccess = 10; + /** This command sets the set point hold policy. */ + command SetTemperatureSetpointHoldPolicy(SetTemperatureSetpointHoldPolicyRequest): DefaultSuccess = 11; } /** 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 26bd437442d209..30163a05f14a9a 100644 --- a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter +++ b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter @@ -1337,6 +1337,16 @@ cluster Thermostat = 513 { kCoolingAndHeatingWithReheat = 5; } + enum PresetScenarioEnum : enum8 { + kUnspecified = 0; + kOccupied = 1; + kUnoccupied = 2; + kSleep = 3; + kWake = 4; + kVacation = 5; + kUserDefined = 6; + } + enum SetpointChangeSourceEnum : enum8 { kManual = 0; kSchedule = 1; @@ -1398,6 +1408,10 @@ cluster Thermostat = 513 { kSetback = 0x10; kAutoMode = 0x20; kLocalTemperatureNotExposed = 0x40; + kMatterScheduleConfiguration = 0x80; + kPresets = 0x100; + kSetpoints = 0x200; + kQueuedPresetsSupported = 0x400; } bitmap HVACSystemTypeBitmap : bitmap8 { @@ -1407,6 +1421,11 @@ cluster Thermostat = 513 { kHeatingUsesFuel = 0x20; } + bitmap PresetTypeFeaturesBitmap : bitmap16 { + kAutomatic = 0x1; + kSupportsNames = 0x2; + } + bitmap ProgrammingOperationModeBitmap : bitmap8 { kScheduleActive = 0x1; kAutoRecovery = 0x2; @@ -1445,6 +1464,62 @@ cluster Thermostat = 513 { kCoolSetpointPresent = 0x2; } + bitmap ScheduleTypeFeaturesBitmap : bitmap16 { + kSupportsPresets = 0x1; + kSupportsSetpoints = 0x2; + kSupportsNames = 0x4; + kSupportsOff = 0x8; + } + + bitmap TemperatureSetpointHoldPolicyBitmap : bitmap8 { + kHoldDurationElapsed = 0x1; + kHoldDurationElapsedOrPresetChanged = 0x2; + } + + struct ScheduleTransitionStruct { + ScheduleDayOfWeekBitmap dayOfWeek = 0; + int16u transitionTime = 1; + optional octet_string<16> presetHandle = 2; + optional SystemModeEnum systemMode = 3; + optional temperature coolingSetpoint = 4; + optional temperature heatingSetpoint = 5; + } + + struct ScheduleStruct { + nullable octet_string<16> scheduleHandle = 0; + SystemModeEnum systemMode = 1; + optional char_string<64> name = 2; + optional octet_string<16> presetHandle = 3; + ScheduleTransitionStruct transitions[] = 4; + optional nullable boolean builtIn = 5; + } + + struct PresetStruct { + nullable octet_string<16> presetHandle = 0; + PresetScenarioEnum presetScenario = 1; + optional nullable char_string<64> name = 2; + optional temperature coolingSetpoint = 3; + optional temperature heatingSetpoint = 4; + nullable boolean builtIn = 5; + } + + struct PresetTypeStruct { + PresetScenarioEnum presetScenario = 0; + int8u numberOfPresets = 1; + PresetTypeFeaturesBitmap presetTypeFeatures = 2; + } + + struct QueuedPresetStruct { + nullable octet_string<16> presetHandle = 0; + nullable epoch_s transitionTimestamp = 1; + } + + struct ScheduleTypeStruct { + SystemModeEnum systemMode = 0; + int8u numberOfSchedules = 1; + ScheduleTypeFeaturesBitmap scheduleTypeFeatures = 2; + } + struct WeeklyScheduleTransitionStruct { int16u transitionTime = 0; nullable temperature heatSetpoint = 1; @@ -1500,6 +1575,20 @@ cluster Thermostat = 513 { attribute access(write: manage) optional ACLouverPositionEnum ACLouverPosition = 69; readonly attribute optional nullable temperature ACCoilTemperature = 70; attribute access(write: manage) optional ACCapacityFormatEnum ACCapacityformat = 71; + readonly attribute optional PresetTypeStruct presetTypes[] = 72; + readonly attribute optional ScheduleTypeStruct scheduleTypes[] = 73; + readonly attribute optional int8u numberOfPresets = 74; + readonly attribute optional int8u numberOfSchedules = 75; + readonly attribute optional int8u numberOfScheduleTransitions = 76; + readonly attribute optional nullable int8u numberOfScheduleTransitionPerDay = 77; + readonly attribute optional nullable octet_string<16> activePresetHandle = 78; + 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 QueuedPresetStruct queuedPreset = 85; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1531,14 +1620,45 @@ cluster Thermostat = 513 { ScheduleModeBitmap modeToReturn = 1; } + request struct SetActiveScheduleRequestRequest { + octet_string<16> scheduleHandle = 0; + } + + request struct SetActivePresetRequestRequest { + octet_string<16> presetHandle = 0; + optional int16u delayMinutes = 1; + } + + request struct StartPresetsSchedulesEditRequestRequest { + int16u timeoutSeconds = 0; + } + + request struct SetTemperatureSetpointHoldPolicyRequest { + TemperatureSetpointHoldPolicyBitmap temperatureSetpointHoldPolicy = 0; + } + /** Command description for SetpointRaiseLower */ command SetpointRaiseLower(SetpointRaiseLowerRequest): DefaultSuccess = 0; /** Command description for SetWeeklySchedule */ command access(invoke: manage) SetWeeklySchedule(SetWeeklyScheduleRequest): DefaultSuccess = 1; /** Command description for GetWeeklySchedule */ command GetWeeklySchedule(GetWeeklyScheduleRequest): GetWeeklyScheduleResponse = 2; - /** The Clear Weekly Schedule command is used to clear the weekly schedule. */ + /** This command is used to clear the weekly schedule. The ClearWeeklySchedule command has no payload. */ command access(invoke: manage) ClearWeeklySchedule(): DefaultSuccess = 3; + /** This command is used to set the active schedule. */ + command SetActiveScheduleRequest(SetActiveScheduleRequestRequest): DefaultSuccess = 5; + /** This command is used to set the active preset. */ + 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 is sent to cancel a queued preset. */ + command access(invoke: manage) CancelSetActivePresetRequest(): DefaultSuccess = 10; + /** This command sets the set point hold policy. */ + command SetTemperatureSetpointHoldPolicy(SetTemperatureSetpointHoldPolicyRequest): DefaultSuccess = 11; } /** 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 63d8ce3b2975a9..f3c47883ad1b06 100644 --- a/examples/placeholder/linux/apps/app1/config.matter +++ b/examples/placeholder/linux/apps/app1/config.matter @@ -4809,6 +4809,16 @@ cluster Thermostat = 513 { kCoolingAndHeatingWithReheat = 5; } + enum PresetScenarioEnum : enum8 { + kUnspecified = 0; + kOccupied = 1; + kUnoccupied = 2; + kSleep = 3; + kWake = 4; + kVacation = 5; + kUserDefined = 6; + } + enum SetpointChangeSourceEnum : enum8 { kManual = 0; kSchedule = 1; @@ -4870,6 +4880,10 @@ cluster Thermostat = 513 { kSetback = 0x10; kAutoMode = 0x20; kLocalTemperatureNotExposed = 0x40; + kMatterScheduleConfiguration = 0x80; + kPresets = 0x100; + kSetpoints = 0x200; + kQueuedPresetsSupported = 0x400; } bitmap HVACSystemTypeBitmap : bitmap8 { @@ -4879,6 +4893,11 @@ cluster Thermostat = 513 { kHeatingUsesFuel = 0x20; } + bitmap PresetTypeFeaturesBitmap : bitmap16 { + kAutomatic = 0x1; + kSupportsNames = 0x2; + } + bitmap ProgrammingOperationModeBitmap : bitmap8 { kScheduleActive = 0x1; kAutoRecovery = 0x2; @@ -4917,6 +4936,62 @@ cluster Thermostat = 513 { kCoolSetpointPresent = 0x2; } + bitmap ScheduleTypeFeaturesBitmap : bitmap16 { + kSupportsPresets = 0x1; + kSupportsSetpoints = 0x2; + kSupportsNames = 0x4; + kSupportsOff = 0x8; + } + + bitmap TemperatureSetpointHoldPolicyBitmap : bitmap8 { + kHoldDurationElapsed = 0x1; + kHoldDurationElapsedOrPresetChanged = 0x2; + } + + struct ScheduleTransitionStruct { + ScheduleDayOfWeekBitmap dayOfWeek = 0; + int16u transitionTime = 1; + optional octet_string<16> presetHandle = 2; + optional SystemModeEnum systemMode = 3; + optional temperature coolingSetpoint = 4; + optional temperature heatingSetpoint = 5; + } + + struct ScheduleStruct { + nullable octet_string<16> scheduleHandle = 0; + SystemModeEnum systemMode = 1; + optional char_string<64> name = 2; + optional octet_string<16> presetHandle = 3; + ScheduleTransitionStruct transitions[] = 4; + optional nullable boolean builtIn = 5; + } + + struct PresetStruct { + nullable octet_string<16> presetHandle = 0; + PresetScenarioEnum presetScenario = 1; + optional nullable char_string<64> name = 2; + optional temperature coolingSetpoint = 3; + optional temperature heatingSetpoint = 4; + nullable boolean builtIn = 5; + } + + struct PresetTypeStruct { + PresetScenarioEnum presetScenario = 0; + int8u numberOfPresets = 1; + PresetTypeFeaturesBitmap presetTypeFeatures = 2; + } + + struct QueuedPresetStruct { + nullable octet_string<16> presetHandle = 0; + nullable epoch_s transitionTimestamp = 1; + } + + struct ScheduleTypeStruct { + SystemModeEnum systemMode = 0; + int8u numberOfSchedules = 1; + ScheduleTypeFeaturesBitmap scheduleTypeFeatures = 2; + } + struct WeeklyScheduleTransitionStruct { int16u transitionTime = 0; nullable temperature heatSetpoint = 1; @@ -4972,6 +5047,20 @@ cluster Thermostat = 513 { attribute access(write: manage) optional ACLouverPositionEnum ACLouverPosition = 69; readonly attribute optional nullable temperature ACCoilTemperature = 70; attribute access(write: manage) optional ACCapacityFormatEnum ACCapacityformat = 71; + readonly attribute optional PresetTypeStruct presetTypes[] = 72; + readonly attribute optional ScheduleTypeStruct scheduleTypes[] = 73; + readonly attribute optional int8u numberOfPresets = 74; + readonly attribute optional int8u numberOfSchedules = 75; + readonly attribute optional int8u numberOfScheduleTransitions = 76; + readonly attribute optional nullable int8u numberOfScheduleTransitionPerDay = 77; + readonly attribute optional nullable octet_string<16> activePresetHandle = 78; + 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 QueuedPresetStruct queuedPreset = 85; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -5003,14 +5092,45 @@ cluster Thermostat = 513 { ScheduleModeBitmap modeToReturn = 1; } + request struct SetActiveScheduleRequestRequest { + octet_string<16> scheduleHandle = 0; + } + + request struct SetActivePresetRequestRequest { + octet_string<16> presetHandle = 0; + optional int16u delayMinutes = 1; + } + + request struct StartPresetsSchedulesEditRequestRequest { + int16u timeoutSeconds = 0; + } + + request struct SetTemperatureSetpointHoldPolicyRequest { + TemperatureSetpointHoldPolicyBitmap temperatureSetpointHoldPolicy = 0; + } + /** Command description for SetpointRaiseLower */ command SetpointRaiseLower(SetpointRaiseLowerRequest): DefaultSuccess = 0; /** Command description for SetWeeklySchedule */ command access(invoke: manage) SetWeeklySchedule(SetWeeklyScheduleRequest): DefaultSuccess = 1; /** Command description for GetWeeklySchedule */ command GetWeeklySchedule(GetWeeklyScheduleRequest): GetWeeklyScheduleResponse = 2; - /** The Clear Weekly Schedule command is used to clear the weekly schedule. */ + /** This command is used to clear the weekly schedule. The ClearWeeklySchedule command has no payload. */ command access(invoke: manage) ClearWeeklySchedule(): DefaultSuccess = 3; + /** This command is used to set the active schedule. */ + command SetActiveScheduleRequest(SetActiveScheduleRequestRequest): DefaultSuccess = 5; + /** This command is used to set the active preset. */ + 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 is sent to cancel a queued preset. */ + command access(invoke: manage) CancelSetActivePresetRequest(): DefaultSuccess = 10; + /** This command sets the set point hold policy. */ + command SetTemperatureSetpointHoldPolicy(SetTemperatureSetpointHoldPolicyRequest): DefaultSuccess = 11; } /** An interface for configuring and controlling the functionality of a thermostat. */ @@ -5060,6 +5180,16 @@ cluster Thermostat = 513 { kCoolingAndHeatingWithReheat = 5; } + enum PresetScenarioEnum : enum8 { + kUnspecified = 0; + kOccupied = 1; + kUnoccupied = 2; + kSleep = 3; + kWake = 4; + kVacation = 5; + kUserDefined = 6; + } + enum SetpointChangeSourceEnum : enum8 { kManual = 0; kSchedule = 1; @@ -5121,6 +5251,10 @@ cluster Thermostat = 513 { kSetback = 0x10; kAutoMode = 0x20; kLocalTemperatureNotExposed = 0x40; + kMatterScheduleConfiguration = 0x80; + kPresets = 0x100; + kSetpoints = 0x200; + kQueuedPresetsSupported = 0x400; } bitmap HVACSystemTypeBitmap : bitmap8 { @@ -5130,6 +5264,11 @@ cluster Thermostat = 513 { kHeatingUsesFuel = 0x20; } + bitmap PresetTypeFeaturesBitmap : bitmap16 { + kAutomatic = 0x1; + kSupportsNames = 0x2; + } + bitmap ProgrammingOperationModeBitmap : bitmap8 { kScheduleActive = 0x1; kAutoRecovery = 0x2; @@ -5168,6 +5307,62 @@ cluster Thermostat = 513 { kCoolSetpointPresent = 0x2; } + bitmap ScheduleTypeFeaturesBitmap : bitmap16 { + kSupportsPresets = 0x1; + kSupportsSetpoints = 0x2; + kSupportsNames = 0x4; + kSupportsOff = 0x8; + } + + bitmap TemperatureSetpointHoldPolicyBitmap : bitmap8 { + kHoldDurationElapsed = 0x1; + kHoldDurationElapsedOrPresetChanged = 0x2; + } + + struct ScheduleTransitionStruct { + ScheduleDayOfWeekBitmap dayOfWeek = 0; + int16u transitionTime = 1; + optional octet_string<16> presetHandle = 2; + optional SystemModeEnum systemMode = 3; + optional temperature coolingSetpoint = 4; + optional temperature heatingSetpoint = 5; + } + + struct ScheduleStruct { + nullable octet_string<16> scheduleHandle = 0; + SystemModeEnum systemMode = 1; + optional char_string<64> name = 2; + optional octet_string<16> presetHandle = 3; + ScheduleTransitionStruct transitions[] = 4; + optional nullable boolean builtIn = 5; + } + + struct PresetStruct { + nullable octet_string<16> presetHandle = 0; + PresetScenarioEnum presetScenario = 1; + optional nullable char_string<64> name = 2; + optional temperature coolingSetpoint = 3; + optional temperature heatingSetpoint = 4; + nullable boolean builtIn = 5; + } + + struct PresetTypeStruct { + PresetScenarioEnum presetScenario = 0; + int8u numberOfPresets = 1; + PresetTypeFeaturesBitmap presetTypeFeatures = 2; + } + + struct QueuedPresetStruct { + nullable octet_string<16> presetHandle = 0; + nullable epoch_s transitionTimestamp = 1; + } + + struct ScheduleTypeStruct { + SystemModeEnum systemMode = 0; + int8u numberOfSchedules = 1; + ScheduleTypeFeaturesBitmap scheduleTypeFeatures = 2; + } + struct WeeklyScheduleTransitionStruct { int16u transitionTime = 0; nullable temperature heatSetpoint = 1; @@ -5223,6 +5418,20 @@ cluster Thermostat = 513 { attribute access(write: manage) optional ACLouverPositionEnum ACLouverPosition = 69; readonly attribute optional nullable temperature ACCoilTemperature = 70; attribute access(write: manage) optional ACCapacityFormatEnum ACCapacityformat = 71; + readonly attribute optional PresetTypeStruct presetTypes[] = 72; + readonly attribute optional ScheduleTypeStruct scheduleTypes[] = 73; + readonly attribute optional int8u numberOfPresets = 74; + readonly attribute optional int8u numberOfSchedules = 75; + readonly attribute optional int8u numberOfScheduleTransitions = 76; + readonly attribute optional nullable int8u numberOfScheduleTransitionPerDay = 77; + readonly attribute optional nullable octet_string<16> activePresetHandle = 78; + 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 QueuedPresetStruct queuedPreset = 85; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -5254,14 +5463,45 @@ cluster Thermostat = 513 { ScheduleModeBitmap modeToReturn = 1; } + request struct SetActiveScheduleRequestRequest { + octet_string<16> scheduleHandle = 0; + } + + request struct SetActivePresetRequestRequest { + octet_string<16> presetHandle = 0; + optional int16u delayMinutes = 1; + } + + request struct StartPresetsSchedulesEditRequestRequest { + int16u timeoutSeconds = 0; + } + + request struct SetTemperatureSetpointHoldPolicyRequest { + TemperatureSetpointHoldPolicyBitmap temperatureSetpointHoldPolicy = 0; + } + /** Command description for SetpointRaiseLower */ command SetpointRaiseLower(SetpointRaiseLowerRequest): DefaultSuccess = 0; /** Command description for SetWeeklySchedule */ command access(invoke: manage) SetWeeklySchedule(SetWeeklyScheduleRequest): DefaultSuccess = 1; /** Command description for GetWeeklySchedule */ command GetWeeklySchedule(GetWeeklyScheduleRequest): GetWeeklyScheduleResponse = 2; - /** The Clear Weekly Schedule command is used to clear the weekly schedule. */ + /** This command is used to clear the weekly schedule. The ClearWeeklySchedule command has no payload. */ command access(invoke: manage) ClearWeeklySchedule(): DefaultSuccess = 3; + /** This command is used to set the active schedule. */ + command SetActiveScheduleRequest(SetActiveScheduleRequestRequest): DefaultSuccess = 5; + /** This command is used to set the active preset. */ + 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 is sent to cancel a queued preset. */ + command access(invoke: manage) CancelSetActivePresetRequest(): DefaultSuccess = 10; + /** This command sets the set point hold policy. */ + command SetTemperatureSetpointHoldPolicy(SetTemperatureSetpointHoldPolicyRequest): DefaultSuccess = 11; } /** An interface for configuring the user interface of a thermostat (which may be remote from the thermostat). */ diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter index fe9b811c1bea1d..55d45919983da8 100644 --- a/examples/placeholder/linux/apps/app2/config.matter +++ b/examples/placeholder/linux/apps/app2/config.matter @@ -4766,6 +4766,16 @@ cluster Thermostat = 513 { kCoolingAndHeatingWithReheat = 5; } + enum PresetScenarioEnum : enum8 { + kUnspecified = 0; + kOccupied = 1; + kUnoccupied = 2; + kSleep = 3; + kWake = 4; + kVacation = 5; + kUserDefined = 6; + } + enum SetpointChangeSourceEnum : enum8 { kManual = 0; kSchedule = 1; @@ -4827,6 +4837,10 @@ cluster Thermostat = 513 { kSetback = 0x10; kAutoMode = 0x20; kLocalTemperatureNotExposed = 0x40; + kMatterScheduleConfiguration = 0x80; + kPresets = 0x100; + kSetpoints = 0x200; + kQueuedPresetsSupported = 0x400; } bitmap HVACSystemTypeBitmap : bitmap8 { @@ -4836,6 +4850,11 @@ cluster Thermostat = 513 { kHeatingUsesFuel = 0x20; } + bitmap PresetTypeFeaturesBitmap : bitmap16 { + kAutomatic = 0x1; + kSupportsNames = 0x2; + } + bitmap ProgrammingOperationModeBitmap : bitmap8 { kScheduleActive = 0x1; kAutoRecovery = 0x2; @@ -4874,6 +4893,62 @@ cluster Thermostat = 513 { kCoolSetpointPresent = 0x2; } + bitmap ScheduleTypeFeaturesBitmap : bitmap16 { + kSupportsPresets = 0x1; + kSupportsSetpoints = 0x2; + kSupportsNames = 0x4; + kSupportsOff = 0x8; + } + + bitmap TemperatureSetpointHoldPolicyBitmap : bitmap8 { + kHoldDurationElapsed = 0x1; + kHoldDurationElapsedOrPresetChanged = 0x2; + } + + struct ScheduleTransitionStruct { + ScheduleDayOfWeekBitmap dayOfWeek = 0; + int16u transitionTime = 1; + optional octet_string<16> presetHandle = 2; + optional SystemModeEnum systemMode = 3; + optional temperature coolingSetpoint = 4; + optional temperature heatingSetpoint = 5; + } + + struct ScheduleStruct { + nullable octet_string<16> scheduleHandle = 0; + SystemModeEnum systemMode = 1; + optional char_string<64> name = 2; + optional octet_string<16> presetHandle = 3; + ScheduleTransitionStruct transitions[] = 4; + optional nullable boolean builtIn = 5; + } + + struct PresetStruct { + nullable octet_string<16> presetHandle = 0; + PresetScenarioEnum presetScenario = 1; + optional nullable char_string<64> name = 2; + optional temperature coolingSetpoint = 3; + optional temperature heatingSetpoint = 4; + nullable boolean builtIn = 5; + } + + struct PresetTypeStruct { + PresetScenarioEnum presetScenario = 0; + int8u numberOfPresets = 1; + PresetTypeFeaturesBitmap presetTypeFeatures = 2; + } + + struct QueuedPresetStruct { + nullable octet_string<16> presetHandle = 0; + nullable epoch_s transitionTimestamp = 1; + } + + struct ScheduleTypeStruct { + SystemModeEnum systemMode = 0; + int8u numberOfSchedules = 1; + ScheduleTypeFeaturesBitmap scheduleTypeFeatures = 2; + } + struct WeeklyScheduleTransitionStruct { int16u transitionTime = 0; nullable temperature heatSetpoint = 1; @@ -4929,6 +5004,20 @@ cluster Thermostat = 513 { attribute access(write: manage) optional ACLouverPositionEnum ACLouverPosition = 69; readonly attribute optional nullable temperature ACCoilTemperature = 70; attribute access(write: manage) optional ACCapacityFormatEnum ACCapacityformat = 71; + readonly attribute optional PresetTypeStruct presetTypes[] = 72; + readonly attribute optional ScheduleTypeStruct scheduleTypes[] = 73; + readonly attribute optional int8u numberOfPresets = 74; + readonly attribute optional int8u numberOfSchedules = 75; + readonly attribute optional int8u numberOfScheduleTransitions = 76; + readonly attribute optional nullable int8u numberOfScheduleTransitionPerDay = 77; + readonly attribute optional nullable octet_string<16> activePresetHandle = 78; + 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 QueuedPresetStruct queuedPreset = 85; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -4960,14 +5049,45 @@ cluster Thermostat = 513 { ScheduleModeBitmap modeToReturn = 1; } + request struct SetActiveScheduleRequestRequest { + octet_string<16> scheduleHandle = 0; + } + + request struct SetActivePresetRequestRequest { + octet_string<16> presetHandle = 0; + optional int16u delayMinutes = 1; + } + + request struct StartPresetsSchedulesEditRequestRequest { + int16u timeoutSeconds = 0; + } + + request struct SetTemperatureSetpointHoldPolicyRequest { + TemperatureSetpointHoldPolicyBitmap temperatureSetpointHoldPolicy = 0; + } + /** Command description for SetpointRaiseLower */ command SetpointRaiseLower(SetpointRaiseLowerRequest): DefaultSuccess = 0; /** Command description for SetWeeklySchedule */ command access(invoke: manage) SetWeeklySchedule(SetWeeklyScheduleRequest): DefaultSuccess = 1; /** Command description for GetWeeklySchedule */ command GetWeeklySchedule(GetWeeklyScheduleRequest): GetWeeklyScheduleResponse = 2; - /** The Clear Weekly Schedule command is used to clear the weekly schedule. */ + /** This command is used to clear the weekly schedule. The ClearWeeklySchedule command has no payload. */ command access(invoke: manage) ClearWeeklySchedule(): DefaultSuccess = 3; + /** This command is used to set the active schedule. */ + command SetActiveScheduleRequest(SetActiveScheduleRequestRequest): DefaultSuccess = 5; + /** This command is used to set the active preset. */ + 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 is sent to cancel a queued preset. */ + command access(invoke: manage) CancelSetActivePresetRequest(): DefaultSuccess = 10; + /** This command sets the set point hold policy. */ + command SetTemperatureSetpointHoldPolicy(SetTemperatureSetpointHoldPolicyRequest): DefaultSuccess = 11; } /** An interface for configuring and controlling the functionality of a thermostat. */ @@ -5017,6 +5137,16 @@ cluster Thermostat = 513 { kCoolingAndHeatingWithReheat = 5; } + enum PresetScenarioEnum : enum8 { + kUnspecified = 0; + kOccupied = 1; + kUnoccupied = 2; + kSleep = 3; + kWake = 4; + kVacation = 5; + kUserDefined = 6; + } + enum SetpointChangeSourceEnum : enum8 { kManual = 0; kSchedule = 1; @@ -5078,6 +5208,10 @@ cluster Thermostat = 513 { kSetback = 0x10; kAutoMode = 0x20; kLocalTemperatureNotExposed = 0x40; + kMatterScheduleConfiguration = 0x80; + kPresets = 0x100; + kSetpoints = 0x200; + kQueuedPresetsSupported = 0x400; } bitmap HVACSystemTypeBitmap : bitmap8 { @@ -5087,6 +5221,11 @@ cluster Thermostat = 513 { kHeatingUsesFuel = 0x20; } + bitmap PresetTypeFeaturesBitmap : bitmap16 { + kAutomatic = 0x1; + kSupportsNames = 0x2; + } + bitmap ProgrammingOperationModeBitmap : bitmap8 { kScheduleActive = 0x1; kAutoRecovery = 0x2; @@ -5125,6 +5264,62 @@ cluster Thermostat = 513 { kCoolSetpointPresent = 0x2; } + bitmap ScheduleTypeFeaturesBitmap : bitmap16 { + kSupportsPresets = 0x1; + kSupportsSetpoints = 0x2; + kSupportsNames = 0x4; + kSupportsOff = 0x8; + } + + bitmap TemperatureSetpointHoldPolicyBitmap : bitmap8 { + kHoldDurationElapsed = 0x1; + kHoldDurationElapsedOrPresetChanged = 0x2; + } + + struct ScheduleTransitionStruct { + ScheduleDayOfWeekBitmap dayOfWeek = 0; + int16u transitionTime = 1; + optional octet_string<16> presetHandle = 2; + optional SystemModeEnum systemMode = 3; + optional temperature coolingSetpoint = 4; + optional temperature heatingSetpoint = 5; + } + + struct ScheduleStruct { + nullable octet_string<16> scheduleHandle = 0; + SystemModeEnum systemMode = 1; + optional char_string<64> name = 2; + optional octet_string<16> presetHandle = 3; + ScheduleTransitionStruct transitions[] = 4; + optional nullable boolean builtIn = 5; + } + + struct PresetStruct { + nullable octet_string<16> presetHandle = 0; + PresetScenarioEnum presetScenario = 1; + optional nullable char_string<64> name = 2; + optional temperature coolingSetpoint = 3; + optional temperature heatingSetpoint = 4; + nullable boolean builtIn = 5; + } + + struct PresetTypeStruct { + PresetScenarioEnum presetScenario = 0; + int8u numberOfPresets = 1; + PresetTypeFeaturesBitmap presetTypeFeatures = 2; + } + + struct QueuedPresetStruct { + nullable octet_string<16> presetHandle = 0; + nullable epoch_s transitionTimestamp = 1; + } + + struct ScheduleTypeStruct { + SystemModeEnum systemMode = 0; + int8u numberOfSchedules = 1; + ScheduleTypeFeaturesBitmap scheduleTypeFeatures = 2; + } + struct WeeklyScheduleTransitionStruct { int16u transitionTime = 0; nullable temperature heatSetpoint = 1; @@ -5180,6 +5375,20 @@ cluster Thermostat = 513 { attribute access(write: manage) optional ACLouverPositionEnum ACLouverPosition = 69; readonly attribute optional nullable temperature ACCoilTemperature = 70; attribute access(write: manage) optional ACCapacityFormatEnum ACCapacityformat = 71; + readonly attribute optional PresetTypeStruct presetTypes[] = 72; + readonly attribute optional ScheduleTypeStruct scheduleTypes[] = 73; + readonly attribute optional int8u numberOfPresets = 74; + readonly attribute optional int8u numberOfSchedules = 75; + readonly attribute optional int8u numberOfScheduleTransitions = 76; + readonly attribute optional nullable int8u numberOfScheduleTransitionPerDay = 77; + readonly attribute optional nullable octet_string<16> activePresetHandle = 78; + 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 QueuedPresetStruct queuedPreset = 85; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -5211,14 +5420,45 @@ cluster Thermostat = 513 { ScheduleModeBitmap modeToReturn = 1; } + request struct SetActiveScheduleRequestRequest { + octet_string<16> scheduleHandle = 0; + } + + request struct SetActivePresetRequestRequest { + octet_string<16> presetHandle = 0; + optional int16u delayMinutes = 1; + } + + request struct StartPresetsSchedulesEditRequestRequest { + int16u timeoutSeconds = 0; + } + + request struct SetTemperatureSetpointHoldPolicyRequest { + TemperatureSetpointHoldPolicyBitmap temperatureSetpointHoldPolicy = 0; + } + /** Command description for SetpointRaiseLower */ command SetpointRaiseLower(SetpointRaiseLowerRequest): DefaultSuccess = 0; /** Command description for SetWeeklySchedule */ command access(invoke: manage) SetWeeklySchedule(SetWeeklyScheduleRequest): DefaultSuccess = 1; /** Command description for GetWeeklySchedule */ command GetWeeklySchedule(GetWeeklyScheduleRequest): GetWeeklyScheduleResponse = 2; - /** The Clear Weekly Schedule command is used to clear the weekly schedule. */ + /** This command is used to clear the weekly schedule. The ClearWeeklySchedule command has no payload. */ command access(invoke: manage) ClearWeeklySchedule(): DefaultSuccess = 3; + /** This command is used to set the active schedule. */ + command SetActiveScheduleRequest(SetActiveScheduleRequestRequest): DefaultSuccess = 5; + /** This command is used to set the active preset. */ + 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 is sent to cancel a queued preset. */ + command access(invoke: manage) CancelSetActivePresetRequest(): DefaultSuccess = 10; + /** This command sets the set point hold policy. */ + command SetTemperatureSetpointHoldPolicy(SetTemperatureSetpointHoldPolicyRequest): DefaultSuccess = 11; } /** An interface for configuring the user interface of a thermostat (which may be remote from the thermostat). */ diff --git a/examples/thermostat/asr/src/TemperatureManager.cpp b/examples/thermostat/asr/src/TemperatureManager.cpp index b560e5c22970f7..fd90fb7541a29c 100644 --- a/examples/thermostat/asr/src/TemperatureManager.cpp +++ b/examples/thermostat/asr/src/TemperatureManager.cpp @@ -26,6 +26,7 @@ using namespace ::chip::DeviceLayer; constexpr EndpointId kThermostatEndpoint = 1; using namespace ::chip::app::Clusters::Thermostat; +using namespace ::chip::app::Clusters::Thermostat; namespace ThermAttr = chip::app::Clusters::Thermostat::Attributes; TemperatureManager TemperatureManager::sTempMgr; diff --git a/examples/thermostat/nxp/zap/thermostat_matter_thread.matter b/examples/thermostat/nxp/zap/thermostat_matter_thread.matter index 01267c685050b1..7ac33292457064 100644 --- a/examples/thermostat/nxp/zap/thermostat_matter_thread.matter +++ b/examples/thermostat/nxp/zap/thermostat_matter_thread.matter @@ -1965,6 +1965,16 @@ cluster Thermostat = 513 { kCoolingAndHeatingWithReheat = 5; } + enum PresetScenarioEnum : enum8 { + kUnspecified = 0; + kOccupied = 1; + kUnoccupied = 2; + kSleep = 3; + kWake = 4; + kVacation = 5; + kUserDefined = 6; + } + enum SetpointChangeSourceEnum : enum8 { kManual = 0; kSchedule = 1; @@ -2026,6 +2036,10 @@ cluster Thermostat = 513 { kSetback = 0x10; kAutoMode = 0x20; kLocalTemperatureNotExposed = 0x40; + kMatterScheduleConfiguration = 0x80; + kPresets = 0x100; + kSetpoints = 0x200; + kQueuedPresetsSupported = 0x400; } bitmap HVACSystemTypeBitmap : bitmap8 { @@ -2035,6 +2049,11 @@ cluster Thermostat = 513 { kHeatingUsesFuel = 0x20; } + bitmap PresetTypeFeaturesBitmap : bitmap16 { + kAutomatic = 0x1; + kSupportsNames = 0x2; + } + bitmap ProgrammingOperationModeBitmap : bitmap8 { kScheduleActive = 0x1; kAutoRecovery = 0x2; @@ -2073,6 +2092,62 @@ cluster Thermostat = 513 { kCoolSetpointPresent = 0x2; } + bitmap ScheduleTypeFeaturesBitmap : bitmap16 { + kSupportsPresets = 0x1; + kSupportsSetpoints = 0x2; + kSupportsNames = 0x4; + kSupportsOff = 0x8; + } + + bitmap TemperatureSetpointHoldPolicyBitmap : bitmap8 { + kHoldDurationElapsed = 0x1; + kHoldDurationElapsedOrPresetChanged = 0x2; + } + + struct ScheduleTransitionStruct { + ScheduleDayOfWeekBitmap dayOfWeek = 0; + int16u transitionTime = 1; + optional octet_string<16> presetHandle = 2; + optional SystemModeEnum systemMode = 3; + optional temperature coolingSetpoint = 4; + optional temperature heatingSetpoint = 5; + } + + struct ScheduleStruct { + nullable octet_string<16> scheduleHandle = 0; + SystemModeEnum systemMode = 1; + optional char_string<64> name = 2; + optional octet_string<16> presetHandle = 3; + ScheduleTransitionStruct transitions[] = 4; + optional nullable boolean builtIn = 5; + } + + struct PresetStruct { + nullable octet_string<16> presetHandle = 0; + PresetScenarioEnum presetScenario = 1; + optional nullable char_string<64> name = 2; + optional temperature coolingSetpoint = 3; + optional temperature heatingSetpoint = 4; + nullable boolean builtIn = 5; + } + + struct PresetTypeStruct { + PresetScenarioEnum presetScenario = 0; + int8u numberOfPresets = 1; + PresetTypeFeaturesBitmap presetTypeFeatures = 2; + } + + struct QueuedPresetStruct { + nullable octet_string<16> presetHandle = 0; + nullable epoch_s transitionTimestamp = 1; + } + + struct ScheduleTypeStruct { + SystemModeEnum systemMode = 0; + int8u numberOfSchedules = 1; + ScheduleTypeFeaturesBitmap scheduleTypeFeatures = 2; + } + struct WeeklyScheduleTransitionStruct { int16u transitionTime = 0; nullable temperature heatSetpoint = 1; @@ -2128,6 +2203,20 @@ cluster Thermostat = 513 { attribute access(write: manage) optional ACLouverPositionEnum ACLouverPosition = 69; readonly attribute optional nullable temperature ACCoilTemperature = 70; attribute access(write: manage) optional ACCapacityFormatEnum ACCapacityformat = 71; + readonly attribute optional PresetTypeStruct presetTypes[] = 72; + readonly attribute optional ScheduleTypeStruct scheduleTypes[] = 73; + readonly attribute optional int8u numberOfPresets = 74; + readonly attribute optional int8u numberOfSchedules = 75; + readonly attribute optional int8u numberOfScheduleTransitions = 76; + readonly attribute optional nullable int8u numberOfScheduleTransitionPerDay = 77; + readonly attribute optional nullable octet_string<16> activePresetHandle = 78; + 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 QueuedPresetStruct queuedPreset = 85; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -2159,14 +2248,45 @@ cluster Thermostat = 513 { ScheduleModeBitmap modeToReturn = 1; } + request struct SetActiveScheduleRequestRequest { + octet_string<16> scheduleHandle = 0; + } + + request struct SetActivePresetRequestRequest { + octet_string<16> presetHandle = 0; + optional int16u delayMinutes = 1; + } + + request struct StartPresetsSchedulesEditRequestRequest { + int16u timeoutSeconds = 0; + } + + request struct SetTemperatureSetpointHoldPolicyRequest { + TemperatureSetpointHoldPolicyBitmap temperatureSetpointHoldPolicy = 0; + } + /** Command description for SetpointRaiseLower */ command SetpointRaiseLower(SetpointRaiseLowerRequest): DefaultSuccess = 0; /** Command description for SetWeeklySchedule */ command access(invoke: manage) SetWeeklySchedule(SetWeeklyScheduleRequest): DefaultSuccess = 1; /** Command description for GetWeeklySchedule */ command GetWeeklySchedule(GetWeeklyScheduleRequest): GetWeeklyScheduleResponse = 2; - /** The Clear Weekly Schedule command is used to clear the weekly schedule. */ + /** This command is used to clear the weekly schedule. The ClearWeeklySchedule command has no payload. */ command access(invoke: manage) ClearWeeklySchedule(): DefaultSuccess = 3; + /** This command is used to set the active schedule. */ + command SetActiveScheduleRequest(SetActiveScheduleRequestRequest): DefaultSuccess = 5; + /** This command is used to set the active preset. */ + 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 is sent to cancel a queued preset. */ + command access(invoke: manage) CancelSetActivePresetRequest(): DefaultSuccess = 10; + /** This command sets the set point hold policy. */ + command SetTemperatureSetpointHoldPolicy(SetTemperatureSetpointHoldPolicyRequest): DefaultSuccess = 11; } endpoint 0 { diff --git a/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter b/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter index 8c75a3585d8f4c..a3b80ba9c59146 100644 --- a/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter +++ b/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter @@ -1876,6 +1876,16 @@ cluster Thermostat = 513 { kCoolingAndHeatingWithReheat = 5; } + enum PresetScenarioEnum : enum8 { + kUnspecified = 0; + kOccupied = 1; + kUnoccupied = 2; + kSleep = 3; + kWake = 4; + kVacation = 5; + kUserDefined = 6; + } + enum SetpointChangeSourceEnum : enum8 { kManual = 0; kSchedule = 1; @@ -1937,6 +1947,10 @@ cluster Thermostat = 513 { kSetback = 0x10; kAutoMode = 0x20; kLocalTemperatureNotExposed = 0x40; + kMatterScheduleConfiguration = 0x80; + kPresets = 0x100; + kSetpoints = 0x200; + kQueuedPresetsSupported = 0x400; } bitmap HVACSystemTypeBitmap : bitmap8 { @@ -1946,6 +1960,11 @@ cluster Thermostat = 513 { kHeatingUsesFuel = 0x20; } + bitmap PresetTypeFeaturesBitmap : bitmap16 { + kAutomatic = 0x1; + kSupportsNames = 0x2; + } + bitmap ProgrammingOperationModeBitmap : bitmap8 { kScheduleActive = 0x1; kAutoRecovery = 0x2; @@ -1984,6 +2003,62 @@ cluster Thermostat = 513 { kCoolSetpointPresent = 0x2; } + bitmap ScheduleTypeFeaturesBitmap : bitmap16 { + kSupportsPresets = 0x1; + kSupportsSetpoints = 0x2; + kSupportsNames = 0x4; + kSupportsOff = 0x8; + } + + bitmap TemperatureSetpointHoldPolicyBitmap : bitmap8 { + kHoldDurationElapsed = 0x1; + kHoldDurationElapsedOrPresetChanged = 0x2; + } + + struct ScheduleTransitionStruct { + ScheduleDayOfWeekBitmap dayOfWeek = 0; + int16u transitionTime = 1; + optional octet_string<16> presetHandle = 2; + optional SystemModeEnum systemMode = 3; + optional temperature coolingSetpoint = 4; + optional temperature heatingSetpoint = 5; + } + + struct ScheduleStruct { + nullable octet_string<16> scheduleHandle = 0; + SystemModeEnum systemMode = 1; + optional char_string<64> name = 2; + optional octet_string<16> presetHandle = 3; + ScheduleTransitionStruct transitions[] = 4; + optional nullable boolean builtIn = 5; + } + + struct PresetStruct { + nullable octet_string<16> presetHandle = 0; + PresetScenarioEnum presetScenario = 1; + optional nullable char_string<64> name = 2; + optional temperature coolingSetpoint = 3; + optional temperature heatingSetpoint = 4; + nullable boolean builtIn = 5; + } + + struct PresetTypeStruct { + PresetScenarioEnum presetScenario = 0; + int8u numberOfPresets = 1; + PresetTypeFeaturesBitmap presetTypeFeatures = 2; + } + + struct QueuedPresetStruct { + nullable octet_string<16> presetHandle = 0; + nullable epoch_s transitionTimestamp = 1; + } + + struct ScheduleTypeStruct { + SystemModeEnum systemMode = 0; + int8u numberOfSchedules = 1; + ScheduleTypeFeaturesBitmap scheduleTypeFeatures = 2; + } + struct WeeklyScheduleTransitionStruct { int16u transitionTime = 0; nullable temperature heatSetpoint = 1; @@ -2039,6 +2114,20 @@ cluster Thermostat = 513 { attribute access(write: manage) optional ACLouverPositionEnum ACLouverPosition = 69; readonly attribute optional nullable temperature ACCoilTemperature = 70; attribute access(write: manage) optional ACCapacityFormatEnum ACCapacityformat = 71; + readonly attribute optional PresetTypeStruct presetTypes[] = 72; + readonly attribute optional ScheduleTypeStruct scheduleTypes[] = 73; + readonly attribute optional int8u numberOfPresets = 74; + readonly attribute optional int8u numberOfSchedules = 75; + readonly attribute optional int8u numberOfScheduleTransitions = 76; + readonly attribute optional nullable int8u numberOfScheduleTransitionPerDay = 77; + readonly attribute optional nullable octet_string<16> activePresetHandle = 78; + 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 QueuedPresetStruct queuedPreset = 85; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -2070,14 +2159,45 @@ cluster Thermostat = 513 { ScheduleModeBitmap modeToReturn = 1; } + request struct SetActiveScheduleRequestRequest { + octet_string<16> scheduleHandle = 0; + } + + request struct SetActivePresetRequestRequest { + octet_string<16> presetHandle = 0; + optional int16u delayMinutes = 1; + } + + request struct StartPresetsSchedulesEditRequestRequest { + int16u timeoutSeconds = 0; + } + + request struct SetTemperatureSetpointHoldPolicyRequest { + TemperatureSetpointHoldPolicyBitmap temperatureSetpointHoldPolicy = 0; + } + /** Command description for SetpointRaiseLower */ command SetpointRaiseLower(SetpointRaiseLowerRequest): DefaultSuccess = 0; /** Command description for SetWeeklySchedule */ command access(invoke: manage) SetWeeklySchedule(SetWeeklyScheduleRequest): DefaultSuccess = 1; /** Command description for GetWeeklySchedule */ command GetWeeklySchedule(GetWeeklyScheduleRequest): GetWeeklyScheduleResponse = 2; - /** The Clear Weekly Schedule command is used to clear the weekly schedule. */ + /** This command is used to clear the weekly schedule. The ClearWeeklySchedule command has no payload. */ command access(invoke: manage) ClearWeeklySchedule(): DefaultSuccess = 3; + /** This command is used to set the active schedule. */ + command SetActiveScheduleRequest(SetActiveScheduleRequestRequest): DefaultSuccess = 5; + /** This command is used to set the active preset. */ + 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 is sent to cancel a queued preset. */ + command access(invoke: manage) CancelSetActivePresetRequest(): DefaultSuccess = 10; + /** This command sets the set point hold policy. */ + command SetTemperatureSetpointHoldPolicy(SetTemperatureSetpointHoldPolicyRequest): DefaultSuccess = 11; } endpoint 0 { diff --git a/examples/thermostat/thermostat-common/thermostat.matter b/examples/thermostat/thermostat-common/thermostat.matter index a3141741f72acd..fa9ac10945582d 100644 --- a/examples/thermostat/thermostat-common/thermostat.matter +++ b/examples/thermostat/thermostat-common/thermostat.matter @@ -1716,6 +1716,16 @@ cluster Thermostat = 513 { kCoolingAndHeatingWithReheat = 5; } + enum PresetScenarioEnum : enum8 { + kUnspecified = 0; + kOccupied = 1; + kUnoccupied = 2; + kSleep = 3; + kWake = 4; + kVacation = 5; + kUserDefined = 6; + } + enum SetpointChangeSourceEnum : enum8 { kManual = 0; kSchedule = 1; @@ -1777,6 +1787,10 @@ cluster Thermostat = 513 { kSetback = 0x10; kAutoMode = 0x20; kLocalTemperatureNotExposed = 0x40; + kMatterScheduleConfiguration = 0x80; + kPresets = 0x100; + kSetpoints = 0x200; + kQueuedPresetsSupported = 0x400; } bitmap HVACSystemTypeBitmap : bitmap8 { @@ -1786,6 +1800,11 @@ cluster Thermostat = 513 { kHeatingUsesFuel = 0x20; } + bitmap PresetTypeFeaturesBitmap : bitmap16 { + kAutomatic = 0x1; + kSupportsNames = 0x2; + } + bitmap ProgrammingOperationModeBitmap : bitmap8 { kScheduleActive = 0x1; kAutoRecovery = 0x2; @@ -1824,6 +1843,62 @@ cluster Thermostat = 513 { kCoolSetpointPresent = 0x2; } + bitmap ScheduleTypeFeaturesBitmap : bitmap16 { + kSupportsPresets = 0x1; + kSupportsSetpoints = 0x2; + kSupportsNames = 0x4; + kSupportsOff = 0x8; + } + + bitmap TemperatureSetpointHoldPolicyBitmap : bitmap8 { + kHoldDurationElapsed = 0x1; + kHoldDurationElapsedOrPresetChanged = 0x2; + } + + struct ScheduleTransitionStruct { + ScheduleDayOfWeekBitmap dayOfWeek = 0; + int16u transitionTime = 1; + optional octet_string<16> presetHandle = 2; + optional SystemModeEnum systemMode = 3; + optional temperature coolingSetpoint = 4; + optional temperature heatingSetpoint = 5; + } + + struct ScheduleStruct { + nullable octet_string<16> scheduleHandle = 0; + SystemModeEnum systemMode = 1; + optional char_string<64> name = 2; + optional octet_string<16> presetHandle = 3; + ScheduleTransitionStruct transitions[] = 4; + optional nullable boolean builtIn = 5; + } + + struct PresetStruct { + nullable octet_string<16> presetHandle = 0; + PresetScenarioEnum presetScenario = 1; + optional nullable char_string<64> name = 2; + optional temperature coolingSetpoint = 3; + optional temperature heatingSetpoint = 4; + nullable boolean builtIn = 5; + } + + struct PresetTypeStruct { + PresetScenarioEnum presetScenario = 0; + int8u numberOfPresets = 1; + PresetTypeFeaturesBitmap presetTypeFeatures = 2; + } + + struct QueuedPresetStruct { + nullable octet_string<16> presetHandle = 0; + nullable epoch_s transitionTimestamp = 1; + } + + struct ScheduleTypeStruct { + SystemModeEnum systemMode = 0; + int8u numberOfSchedules = 1; + ScheduleTypeFeaturesBitmap scheduleTypeFeatures = 2; + } + struct WeeklyScheduleTransitionStruct { int16u transitionTime = 0; nullable temperature heatSetpoint = 1; @@ -1879,6 +1954,20 @@ cluster Thermostat = 513 { attribute access(write: manage) optional ACLouverPositionEnum ACLouverPosition = 69; readonly attribute optional nullable temperature ACCoilTemperature = 70; attribute access(write: manage) optional ACCapacityFormatEnum ACCapacityformat = 71; + readonly attribute optional PresetTypeStruct presetTypes[] = 72; + readonly attribute optional ScheduleTypeStruct scheduleTypes[] = 73; + readonly attribute optional int8u numberOfPresets = 74; + readonly attribute optional int8u numberOfSchedules = 75; + readonly attribute optional int8u numberOfScheduleTransitions = 76; + readonly attribute optional nullable int8u numberOfScheduleTransitionPerDay = 77; + readonly attribute optional nullable octet_string<16> activePresetHandle = 78; + 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 QueuedPresetStruct queuedPreset = 85; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1910,14 +1999,45 @@ cluster Thermostat = 513 { ScheduleModeBitmap modeToReturn = 1; } + request struct SetActiveScheduleRequestRequest { + octet_string<16> scheduleHandle = 0; + } + + request struct SetActivePresetRequestRequest { + octet_string<16> presetHandle = 0; + optional int16u delayMinutes = 1; + } + + request struct StartPresetsSchedulesEditRequestRequest { + int16u timeoutSeconds = 0; + } + + request struct SetTemperatureSetpointHoldPolicyRequest { + TemperatureSetpointHoldPolicyBitmap temperatureSetpointHoldPolicy = 0; + } + /** Command description for SetpointRaiseLower */ command SetpointRaiseLower(SetpointRaiseLowerRequest): DefaultSuccess = 0; /** Command description for SetWeeklySchedule */ command access(invoke: manage) SetWeeklySchedule(SetWeeklyScheduleRequest): DefaultSuccess = 1; /** Command description for GetWeeklySchedule */ command GetWeeklySchedule(GetWeeklyScheduleRequest): GetWeeklyScheduleResponse = 2; - /** The Clear Weekly Schedule command is used to clear the weekly schedule. */ + /** This command is used to clear the weekly schedule. The ClearWeeklySchedule command has no payload. */ command access(invoke: manage) ClearWeeklySchedule(): DefaultSuccess = 3; + /** This command is used to set the active schedule. */ + command SetActiveScheduleRequest(SetActiveScheduleRequestRequest): DefaultSuccess = 5; + /** This command is used to set the active preset. */ + 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 is sent to cancel a queued preset. */ + command access(invoke: manage) CancelSetActivePresetRequest(): DefaultSuccess = 10; + /** This command sets the set point hold policy. */ + command SetTemperatureSetpointHoldPolicy(SetTemperatureSetpointHoldPolicyRequest): DefaultSuccess = 11; } /** An interface for configuring the user interface of a thermostat (which may be remote from the thermostat). */ diff --git a/src/app/clusters/thermostat-server/thermostat-server.cpp b/src/app/clusters/thermostat-server/thermostat-server.cpp index 85ed4f14d5b6e3..f5a5157a7e44e9 100644 --- a/src/app/clusters/thermostat-server/thermostat-server.cpp +++ b/src/app/clusters/thermostat-server/thermostat-server.cpp @@ -108,6 +108,26 @@ CHIP_ERROR ThermostatAttrAccess::Read(const ConcreteReadAttributePath & aPath, A 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 QueuedPreset::Id: { + DataModel::Nullable value; + return aEncoder.Encode(value); + } default: // return CHIP_NO_ERROR and just read from the attribute store in default break; } @@ -140,6 +160,19 @@ CHIP_ERROR ThermostatAttrAccess::Write(const ConcreteDataAttributePath & aPath, return statusIB.ToChipError(); } break; + case Presets::Id: { + return CHIP_ERROR_NOT_IMPLEMENTED; + } + break; + + case Schedules::Id: { + return CHIP_ERROR_NOT_IMPLEMENTED; + } + break; + case QueuedPreset::Id: { + return CHIP_ERROR_NOT_IMPLEMENTED; + } + break; default: // return CHIP_NO_ERROR and just write to the attribute store in default break; } @@ -462,6 +495,62 @@ 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 emberAfThermostatClusterCancelSetActivePresetRequestCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::Thermostat::Commands::CancelSetActivePresetRequest::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 @@ -603,6 +692,7 @@ int16_t EnforceCoolingSetpointLimits(int16_t CoolingSetpoint, EndpointId endpoin return CoolingSetpoint; } + bool emberAfThermostatClusterSetpointRaiseLowerCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, const Commands::SetpointRaiseLower::DecodableType & commandData) 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 567216018d07ff..948c0937a3fd10 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 @@ -25,6 +25,10 @@ limitations under the License. + + + + @@ -51,6 +55,14 @@ limitations under the License. + + + + + + + + @@ -87,6 +99,18 @@ limitations under the License. + + + + + + + + + + + + @@ -187,6 +211,17 @@ limitations under the License. + + + + + + + + + + + @@ -195,6 +230,56 @@ limitations under the License. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Thermostat HVAC @@ -204,11 +289,13 @@ limitations under the License. true true + + + LocalTemperature OutdoorTemperature Occupancy - - + AbsMinHeatSetpointLimit AbsMaxHeatSetpointLimit AbsMinCoolSetpointLimit @@ -325,6 +412,29 @@ limitations under the License. ACCapacityformat + PresetTypes + ScheduleTypes + NumberOfPresets + NumberOfSchedules + NumberOfScheduleTransitions + NumberOfScheduleTransitionPerDay + ActivePresetHandle + ActiveScheduleHandle + + Presets + + + + Schedules + + + PresetsSchedulesEditable + TemperatureSetpointHoldPolicy + SetpointHoldExpiryTimestamp + QueuedPreset + + + Command description for SetpointRaiseLower @@ -350,11 +460,42 @@ limitations under the License. - - The Clear Weekly Schedule command is used to clear the weekly schedule. - + This command is used to clear the weekly schedule. The ClearWeeklySchedule command has no payload. + + + This command is used to set the active schedule. + + + + This command is used to set the active preset. + + + + This command is used to start editing the presets and schedules. + + + + + This command is used to cancel editing presets and schedules. + + + + This command is used to notify the server that all edits are done and should be committed. + + + + This command is sent to cancel a queued preset. + + + + This command sets the set point hold policy. + + + + + The Current Weekly Schedule Command is sent from the server in response to the Get Weekly Schedule Command. @@ -364,6 +505,6 @@ limitations under the License. - + \ No newline at end of file diff --git a/src/app/zap-templates/zcl/zcl-with-test-extensions.json b/src/app/zap-templates/zcl/zcl-with-test-extensions.json index ecbcea088f51b5..707947cc61558a 100644 --- a/src/app/zap-templates/zcl/zcl-with-test-extensions.json +++ b/src/app/zap-templates/zcl/zcl-with-test-extensions.json @@ -553,6 +553,7 @@ "FeatureMap" ], "Air Quality": ["AirQuality", "FeatureMap"], + "Thermostat": ["QueuedPreset"], "Electrical Energy Measurement": [ "Accuracy", "CumulativeEnergyImported", diff --git a/src/app/zap-templates/zcl/zcl.json b/src/app/zap-templates/zcl/zcl.json index 80b9ff7bbd84f9..4898e0b2e6d3b4 100644 --- a/src/app/zap-templates/zcl/zcl.json +++ b/src/app/zap-templates/zcl/zcl.json @@ -551,6 +551,7 @@ "FeatureMap" ], "Air Quality": ["AirQuality", "FeatureMap"], + "Thermostat": ["QueuedPreset"], "Electrical Energy Measurement": [ "Accuracy", "CumulativeEnergyImported", diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 32f85159295d80..d99ab989625a54 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -5816,6 +5816,16 @@ cluster Thermostat = 513 { kCoolingAndHeatingWithReheat = 5; } + enum PresetScenarioEnum : enum8 { + kUnspecified = 0; + kOccupied = 1; + kUnoccupied = 2; + kSleep = 3; + kWake = 4; + kVacation = 5; + kUserDefined = 6; + } + enum SetpointChangeSourceEnum : enum8 { kManual = 0; kSchedule = 1; @@ -5877,6 +5887,10 @@ cluster Thermostat = 513 { kSetback = 0x10; kAutoMode = 0x20; kLocalTemperatureNotExposed = 0x40; + kMatterScheduleConfiguration = 0x80; + kPresets = 0x100; + kSetpoints = 0x200; + kQueuedPresetsSupported = 0x400; } bitmap HVACSystemTypeBitmap : bitmap8 { @@ -5886,6 +5900,11 @@ cluster Thermostat = 513 { kHeatingUsesFuel = 0x20; } + bitmap PresetTypeFeaturesBitmap : bitmap16 { + kAutomatic = 0x1; + kSupportsNames = 0x2; + } + bitmap ProgrammingOperationModeBitmap : bitmap8 { kScheduleActive = 0x1; kAutoRecovery = 0x2; @@ -5924,6 +5943,62 @@ cluster Thermostat = 513 { kCoolSetpointPresent = 0x2; } + bitmap ScheduleTypeFeaturesBitmap : bitmap16 { + kSupportsPresets = 0x1; + kSupportsSetpoints = 0x2; + kSupportsNames = 0x4; + kSupportsOff = 0x8; + } + + bitmap TemperatureSetpointHoldPolicyBitmap : bitmap8 { + kHoldDurationElapsed = 0x1; + kHoldDurationElapsedOrPresetChanged = 0x2; + } + + struct ScheduleTransitionStruct { + ScheduleDayOfWeekBitmap dayOfWeek = 0; + int16u transitionTime = 1; + optional octet_string<16> presetHandle = 2; + optional SystemModeEnum systemMode = 3; + optional temperature coolingSetpoint = 4; + optional temperature heatingSetpoint = 5; + } + + struct ScheduleStruct { + nullable octet_string<16> scheduleHandle = 0; + SystemModeEnum systemMode = 1; + optional char_string<64> name = 2; + optional octet_string<16> presetHandle = 3; + ScheduleTransitionStruct transitions[] = 4; + optional nullable boolean builtIn = 5; + } + + struct PresetStruct { + nullable octet_string<16> presetHandle = 0; + PresetScenarioEnum presetScenario = 1; + optional nullable char_string<64> name = 2; + optional temperature coolingSetpoint = 3; + optional temperature heatingSetpoint = 4; + nullable boolean builtIn = 5; + } + + struct PresetTypeStruct { + PresetScenarioEnum presetScenario = 0; + int8u numberOfPresets = 1; + PresetTypeFeaturesBitmap presetTypeFeatures = 2; + } + + struct QueuedPresetStruct { + nullable octet_string<16> presetHandle = 0; + nullable epoch_s transitionTimestamp = 1; + } + + struct ScheduleTypeStruct { + SystemModeEnum systemMode = 0; + int8u numberOfSchedules = 1; + ScheduleTypeFeaturesBitmap scheduleTypeFeatures = 2; + } + struct WeeklyScheduleTransitionStruct { int16u transitionTime = 0; nullable temperature heatSetpoint = 1; @@ -5979,6 +6054,20 @@ cluster Thermostat = 513 { attribute access(write: manage) optional ACLouverPositionEnum ACLouverPosition = 69; readonly attribute optional nullable temperature ACCoilTemperature = 70; attribute access(write: manage) optional ACCapacityFormatEnum ACCapacityformat = 71; + readonly attribute optional PresetTypeStruct presetTypes[] = 72; + readonly attribute optional ScheduleTypeStruct scheduleTypes[] = 73; + readonly attribute optional int8u numberOfPresets = 74; + readonly attribute optional int8u numberOfSchedules = 75; + readonly attribute optional int8u numberOfScheduleTransitions = 76; + readonly attribute optional nullable int8u numberOfScheduleTransitionPerDay = 77; + readonly attribute optional nullable octet_string<16> activePresetHandle = 78; + 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 QueuedPresetStruct queuedPreset = 85; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -6010,14 +6099,45 @@ cluster Thermostat = 513 { ScheduleModeBitmap modeToReturn = 1; } + request struct SetActiveScheduleRequestRequest { + octet_string<16> scheduleHandle = 0; + } + + request struct SetActivePresetRequestRequest { + octet_string<16> presetHandle = 0; + optional int16u delayMinutes = 1; + } + + request struct StartPresetsSchedulesEditRequestRequest { + int16u timeoutSeconds = 0; + } + + request struct SetTemperatureSetpointHoldPolicyRequest { + TemperatureSetpointHoldPolicyBitmap temperatureSetpointHoldPolicy = 0; + } + /** Command description for SetpointRaiseLower */ command SetpointRaiseLower(SetpointRaiseLowerRequest): DefaultSuccess = 0; /** Command description for SetWeeklySchedule */ command access(invoke: manage) SetWeeklySchedule(SetWeeklyScheduleRequest): DefaultSuccess = 1; /** Command description for GetWeeklySchedule */ command GetWeeklySchedule(GetWeeklyScheduleRequest): GetWeeklyScheduleResponse = 2; - /** The Clear Weekly Schedule command is used to clear the weekly schedule. */ + /** This command is used to clear the weekly schedule. The ClearWeeklySchedule command has no payload. */ command access(invoke: manage) ClearWeeklySchedule(): DefaultSuccess = 3; + /** This command is used to set the active schedule. */ + command SetActiveScheduleRequest(SetActiveScheduleRequestRequest): DefaultSuccess = 5; + /** This command is used to set the active preset. */ + 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 is sent to cancel a queued preset. */ + command access(invoke: manage) CancelSetActivePresetRequest(): DefaultSuccess = 10; + /** This command sets the set point hold policy. */ + command SetTemperatureSetpointHoldPolicy(SetTemperatureSetpointHoldPolicyRequest): DefaultSuccess = 11; } /** 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 f050f7e1428d6a..110ea806adc10e 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java @@ -36004,6 +36004,20 @@ public static class ThermostatCluster extends BaseChipCluster { 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 PRESET_TYPES_ATTRIBUTE_ID = 72L; + private static final long SCHEDULE_TYPES_ATTRIBUTE_ID = 73L; + private static final long NUMBER_OF_PRESETS_ATTRIBUTE_ID = 74L; + private static final long NUMBER_OF_SCHEDULES_ATTRIBUTE_ID = 75L; + private static final long NUMBER_OF_SCHEDULE_TRANSITIONS_ATTRIBUTE_ID = 76L; + private static final long NUMBER_OF_SCHEDULE_TRANSITION_PER_DAY_ATTRIBUTE_ID = 77L; + private static final long ACTIVE_PRESET_HANDLE_ATTRIBUTE_ID = 78L; + 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 QUEUED_PRESET_ATTRIBUTE_ID = 85L; 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; @@ -36148,6 +36162,138 @@ public void onResponse(StructType invokeStructValue) { }}, commandId, value, timedInvokeTimeoutMs); } + public void setActiveScheduleRequest(DefaultClusterCallback callback, byte[] scheduleHandle) { + setActiveScheduleRequest(callback, scheduleHandle, 0); + } + + public void setActiveScheduleRequest(DefaultClusterCallback callback, byte[] scheduleHandle, int timedInvokeTimeoutMs) { + final long commandId = 5L; + + ArrayList elements = new ArrayList<>(); + final long scheduleHandleFieldID = 0L; + BaseTLVType scheduleHandletlvValue = new ByteArrayType(scheduleHandle); + elements.add(new StructElement(scheduleHandleFieldID, scheduleHandletlvValue)); + + StructType value = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, value, timedInvokeTimeoutMs); + } + + public void setActivePresetRequest(DefaultClusterCallback callback, byte[] presetHandle, Optional delayMinutes) { + setActivePresetRequest(callback, presetHandle, delayMinutes, 0); + } + + public void setActivePresetRequest(DefaultClusterCallback callback, byte[] presetHandle, Optional delayMinutes, int timedInvokeTimeoutMs) { + final long commandId = 6L; + + ArrayList elements = new ArrayList<>(); + final long presetHandleFieldID = 0L; + BaseTLVType presetHandletlvValue = new ByteArrayType(presetHandle); + elements.add(new StructElement(presetHandleFieldID, presetHandletlvValue)); + + final long delayMinutesFieldID = 1L; + BaseTLVType delayMinutestlvValue = delayMinutes.map((nonOptionaldelayMinutes) -> new UIntType(nonOptionaldelayMinutes)).orElse(new EmptyType()); + elements.add(new StructElement(delayMinutesFieldID, delayMinutestlvValue)); + + StructType value = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, value, timedInvokeTimeoutMs); + } + + public void startPresetsSchedulesEditRequest(DefaultClusterCallback callback, Integer timeoutSeconds) { + startPresetsSchedulesEditRequest(callback, timeoutSeconds, 0); + } + + public void startPresetsSchedulesEditRequest(DefaultClusterCallback callback, Integer timeoutSeconds, int timedInvokeTimeoutMs) { + final long commandId = 7L; + + ArrayList elements = new ArrayList<>(); + final long timeoutSecondsFieldID = 0L; + BaseTLVType timeoutSecondstlvValue = new UIntType(timeoutSeconds); + elements.add(new StructElement(timeoutSecondsFieldID, timeoutSecondstlvValue)); + + StructType value = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, value, timedInvokeTimeoutMs); + } + + public void cancelPresetsSchedulesEditRequest(DefaultClusterCallback callback) { + cancelPresetsSchedulesEditRequest(callback, 0); + } + + public void cancelPresetsSchedulesEditRequest(DefaultClusterCallback callback, int timedInvokeTimeoutMs) { + final long commandId = 8L; + + ArrayList elements = new ArrayList<>(); + StructType value = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, value, timedInvokeTimeoutMs); + } + + public void commitPresetsSchedulesRequest(DefaultClusterCallback callback) { + commitPresetsSchedulesRequest(callback, 0); + } + + public void commitPresetsSchedulesRequest(DefaultClusterCallback callback, int timedInvokeTimeoutMs) { + final long commandId = 9L; + + ArrayList elements = new ArrayList<>(); + StructType value = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, value, timedInvokeTimeoutMs); + } + + public void cancelSetActivePresetRequest(DefaultClusterCallback callback) { + cancelSetActivePresetRequest(callback, 0); + } + + public void cancelSetActivePresetRequest(DefaultClusterCallback callback, int timedInvokeTimeoutMs) { + final long commandId = 10L; + + ArrayList elements = new ArrayList<>(); + StructType value = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, value, timedInvokeTimeoutMs); + } + + public void setTemperatureSetpointHoldPolicy(DefaultClusterCallback callback, Integer temperatureSetpointHoldPolicy) { + setTemperatureSetpointHoldPolicy(callback, temperatureSetpointHoldPolicy, 0); + } + + public void setTemperatureSetpointHoldPolicy(DefaultClusterCallback callback, Integer temperatureSetpointHoldPolicy, int timedInvokeTimeoutMs) { + final long commandId = 11L; + + ArrayList elements = new ArrayList<>(); + final long temperatureSetpointHoldPolicyFieldID = 0L; + BaseTLVType temperatureSetpointHoldPolicytlvValue = new UIntType(temperatureSetpointHoldPolicy); + elements.add(new StructElement(temperatureSetpointHoldPolicyFieldID, temperatureSetpointHoldPolicytlvValue)); + + StructType value = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, value, timedInvokeTimeoutMs); + } + public interface GetWeeklyScheduleResponseCallback extends BaseClusterCallback { void onSuccess(Integer numberOfTransitionsForSequence, Integer dayOfWeekForSequence, Integer modeForSequence, ArrayList transitions); } @@ -36196,6 +36342,42 @@ public interface ACCoilTemperatureAttributeCallback extends BaseAttributeCallbac void onSuccess(@Nullable Integer value); } + public interface PresetTypesAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface ScheduleTypesAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface NumberOfScheduleTransitionPerDayAttributeCallback extends BaseAttributeCallback { + void onSuccess(@Nullable Integer value); + } + + public interface ActivePresetHandleAttributeCallback extends BaseAttributeCallback { + void onSuccess(@Nullable byte[] value); + } + + public interface ActiveScheduleHandleAttributeCallback extends BaseAttributeCallback { + void onSuccess(@Nullable byte[] value); + } + + public interface PresetsAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface SchedulesAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface SetpointHoldExpiryTimestampAttributeCallback extends BaseAttributeCallback { + void onSuccess(@Nullable Long value); + } + + public interface QueuedPresetAttributeCallback extends BaseAttributeCallback { + void onSuccess(@Nullable ChipStructs.ThermostatClusterQueuedPresetStruct value); + } + public interface GeneratedCommandListAttributeCallback extends BaseAttributeCallback { void onSuccess(List value); } @@ -37680,6 +37862,374 @@ public void onSuccess(byte[] tlv) { }, A_C_CAPACITYFORMAT_ATTRIBUTE_ID, minInterval, maxInterval); } + public void readPresetTypesAttribute( + PresetTypesAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, PRESET_TYPES_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, PRESET_TYPES_ATTRIBUTE_ID, true); + } + + public void subscribePresetTypesAttribute( + PresetTypesAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, PRESET_TYPES_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + } + }, PRESET_TYPES_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readScheduleTypesAttribute( + ScheduleTypesAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SCHEDULE_TYPES_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, SCHEDULE_TYPES_ATTRIBUTE_ID, true); + } + + public void subscribeScheduleTypesAttribute( + ScheduleTypesAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SCHEDULE_TYPES_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + } + }, SCHEDULE_TYPES_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readNumberOfPresetsAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, NUMBER_OF_PRESETS_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, NUMBER_OF_PRESETS_ATTRIBUTE_ID, true); + } + + public void subscribeNumberOfPresetsAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, NUMBER_OF_PRESETS_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + } + }, NUMBER_OF_PRESETS_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readNumberOfSchedulesAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, NUMBER_OF_SCHEDULES_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, NUMBER_OF_SCHEDULES_ATTRIBUTE_ID, true); + } + + public void subscribeNumberOfSchedulesAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, NUMBER_OF_SCHEDULES_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + } + }, NUMBER_OF_SCHEDULES_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readNumberOfScheduleTransitionsAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, NUMBER_OF_SCHEDULE_TRANSITIONS_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, NUMBER_OF_SCHEDULE_TRANSITIONS_ATTRIBUTE_ID, true); + } + + public void subscribeNumberOfScheduleTransitionsAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, NUMBER_OF_SCHEDULE_TRANSITIONS_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + } + }, NUMBER_OF_SCHEDULE_TRANSITIONS_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readNumberOfScheduleTransitionPerDayAttribute( + NumberOfScheduleTransitionPerDayAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, NUMBER_OF_SCHEDULE_TRANSITION_PER_DAY_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, NUMBER_OF_SCHEDULE_TRANSITION_PER_DAY_ATTRIBUTE_ID, true); + } + + public void subscribeNumberOfScheduleTransitionPerDayAttribute( + NumberOfScheduleTransitionPerDayAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, NUMBER_OF_SCHEDULE_TRANSITION_PER_DAY_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + } + }, NUMBER_OF_SCHEDULE_TRANSITION_PER_DAY_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readActivePresetHandleAttribute( + ActivePresetHandleAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_PRESET_HANDLE_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable byte[] value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ACTIVE_PRESET_HANDLE_ATTRIBUTE_ID, true); + } + + public void subscribeActivePresetHandleAttribute( + ActivePresetHandleAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_PRESET_HANDLE_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable byte[] value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + } + }, ACTIVE_PRESET_HANDLE_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readActiveScheduleHandleAttribute( + ActiveScheduleHandleAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_SCHEDULE_HANDLE_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable byte[] value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ACTIVE_SCHEDULE_HANDLE_ATTRIBUTE_ID, true); + } + + public void subscribeActiveScheduleHandleAttribute( + ActiveScheduleHandleAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_SCHEDULE_HANDLE_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable byte[] value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + } + }, ACTIVE_SCHEDULE_HANDLE_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readPresetsAttribute( + PresetsAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, PRESETS_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, PRESETS_ATTRIBUTE_ID, true); + } + + public void writePresetsAttribute(DefaultClusterCallback callback, ArrayList value) { + writePresetsAttribute(callback, value, 0); + } + + public void writePresetsAttribute(DefaultClusterCallback callback, ArrayList value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = ArrayType.generateArrayType(value, (elementvalue) -> elementvalue.encodeTlv()); + writeAttribute(new WriteAttributesCallbackImpl(callback), PRESETS_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribePresetsAttribute( + PresetsAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, PRESETS_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + } + }, PRESETS_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readSchedulesAttribute( + SchedulesAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SCHEDULES_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, SCHEDULES_ATTRIBUTE_ID, true); + } + + public void writeSchedulesAttribute(DefaultClusterCallback callback, ArrayList value) { + writeSchedulesAttribute(callback, value, 0); + } + + public void writeSchedulesAttribute(DefaultClusterCallback callback, ArrayList value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = ArrayType.generateArrayType(value, (elementvalue) -> elementvalue.encodeTlv()); + writeAttribute(new WriteAttributesCallbackImpl(callback), SCHEDULES_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeSchedulesAttribute( + SchedulesAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SCHEDULES_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, 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); + } + }, 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); + } + }, 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); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, SETPOINT_HOLD_EXPIRY_TIMESTAMP_ATTRIBUTE_ID, true); + } + + public void subscribeSetpointHoldExpiryTimestampAttribute( + SetpointHoldExpiryTimestampAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SETPOINT_HOLD_EXPIRY_TIMESTAMP_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + } + }, SETPOINT_HOLD_EXPIRY_TIMESTAMP_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readQueuedPresetAttribute( + QueuedPresetAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, QUEUED_PRESET_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable ChipStructs.ThermostatClusterQueuedPresetStruct value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, QUEUED_PRESET_ATTRIBUTE_ID, true); + } + + public void subscribeQueuedPresetAttribute( + QueuedPresetAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, QUEUED_PRESET_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable ChipStructs.ThermostatClusterQueuedPresetStruct value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + } + }, QUEUED_PRESET_ATTRIBUTE_ID, minInterval, maxInterval); + } + public void readGeneratedCommandListAttribute( GeneratedCommandListAttributeCallback callback) { ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, GENERATED_COMMAND_LIST_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 98bc3ca71303f5..4374f2e29ee7ad 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java @@ -7473,6 +7473,582 @@ public String toString() { return output.toString(); } } +public static class ThermostatClusterScheduleTransitionStruct { + public Integer dayOfWeek; + public Integer transitionTime; + public Optional presetHandle; + public Optional systemMode; + public Optional coolingSetpoint; + public Optional heatingSetpoint; + private static final long DAY_OF_WEEK_ID = 0L; + private static final long TRANSITION_TIME_ID = 1L; + private static final long PRESET_HANDLE_ID = 2L; + private static final long SYSTEM_MODE_ID = 3L; + private static final long COOLING_SETPOINT_ID = 4L; + private static final long HEATING_SETPOINT_ID = 5L; + + public ThermostatClusterScheduleTransitionStruct( + Integer dayOfWeek, + Integer transitionTime, + Optional presetHandle, + Optional systemMode, + Optional coolingSetpoint, + Optional heatingSetpoint + ) { + this.dayOfWeek = dayOfWeek; + this.transitionTime = transitionTime; + this.presetHandle = presetHandle; + this.systemMode = systemMode; + this.coolingSetpoint = coolingSetpoint; + this.heatingSetpoint = heatingSetpoint; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(DAY_OF_WEEK_ID, new UIntType(dayOfWeek))); + values.add(new StructElement(TRANSITION_TIME_ID, new UIntType(transitionTime))); + values.add(new StructElement(PRESET_HANDLE_ID, presetHandle.map((nonOptionalpresetHandle) -> new ByteArrayType(nonOptionalpresetHandle)).orElse(new EmptyType()))); + values.add(new StructElement(SYSTEM_MODE_ID, systemMode.map((nonOptionalsystemMode) -> new UIntType(nonOptionalsystemMode)).orElse(new EmptyType()))); + values.add(new StructElement(COOLING_SETPOINT_ID, coolingSetpoint.map((nonOptionalcoolingSetpoint) -> new IntType(nonOptionalcoolingSetpoint)).orElse(new EmptyType()))); + values.add(new StructElement(HEATING_SETPOINT_ID, heatingSetpoint.map((nonOptionalheatingSetpoint) -> new IntType(nonOptionalheatingSetpoint)).orElse(new EmptyType()))); + + return new StructType(values); + } + + public static ThermostatClusterScheduleTransitionStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Integer dayOfWeek = null; + Integer transitionTime = null; + Optional presetHandle = Optional.empty(); + Optional systemMode = Optional.empty(); + Optional coolingSetpoint = Optional.empty(); + Optional heatingSetpoint = Optional.empty(); + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == DAY_OF_WEEK_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + dayOfWeek = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == TRANSITION_TIME_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + transitionTime = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == PRESET_HANDLE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.ByteArray) { + ByteArrayType castingValue = element.value(ByteArrayType.class); + presetHandle = Optional.of(castingValue.value(byte[].class)); + } + } else if (element.contextTagNum() == SYSTEM_MODE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + systemMode = Optional.of(castingValue.value(Integer.class)); + } + } else if (element.contextTagNum() == COOLING_SETPOINT_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Int) { + IntType castingValue = element.value(IntType.class); + coolingSetpoint = Optional.of(castingValue.value(Integer.class)); + } + } else if (element.contextTagNum() == HEATING_SETPOINT_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Int) { + IntType castingValue = element.value(IntType.class); + heatingSetpoint = Optional.of(castingValue.value(Integer.class)); + } + } + } + return new ThermostatClusterScheduleTransitionStruct( + dayOfWeek, + transitionTime, + presetHandle, + systemMode, + coolingSetpoint, + heatingSetpoint + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("ThermostatClusterScheduleTransitionStruct {\n"); + output.append("\tdayOfWeek: "); + output.append(dayOfWeek); + output.append("\n"); + output.append("\ttransitionTime: "); + output.append(transitionTime); + output.append("\n"); + output.append("\tpresetHandle: "); + output.append(presetHandle.isPresent() ? Arrays.toString(presetHandle.get()) : ""); + output.append("\n"); + output.append("\tsystemMode: "); + output.append(systemMode); + output.append("\n"); + output.append("\tcoolingSetpoint: "); + output.append(coolingSetpoint); + output.append("\n"); + output.append("\theatingSetpoint: "); + output.append(heatingSetpoint); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class ThermostatClusterScheduleStruct { + public @Nullable byte[] scheduleHandle; + public Integer systemMode; + public Optional name; + public Optional presetHandle; + public ArrayList transitions; + public @Nullable Optional builtIn; + private static final long SCHEDULE_HANDLE_ID = 0L; + private static final long SYSTEM_MODE_ID = 1L; + private static final long NAME_ID = 2L; + private static final long PRESET_HANDLE_ID = 3L; + private static final long TRANSITIONS_ID = 4L; + private static final long BUILT_IN_ID = 5L; + + public ThermostatClusterScheduleStruct( + @Nullable byte[] scheduleHandle, + Integer systemMode, + Optional name, + Optional presetHandle, + ArrayList transitions, + @Nullable Optional builtIn + ) { + this.scheduleHandle = scheduleHandle; + this.systemMode = systemMode; + this.name = name; + this.presetHandle = presetHandle; + this.transitions = transitions; + this.builtIn = builtIn; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(SCHEDULE_HANDLE_ID, scheduleHandle != null ? new ByteArrayType(scheduleHandle) : new NullType())); + values.add(new StructElement(SYSTEM_MODE_ID, new UIntType(systemMode))); + values.add(new StructElement(NAME_ID, name.map((nonOptionalname) -> new StringType(nonOptionalname)).orElse(new EmptyType()))); + values.add(new StructElement(PRESET_HANDLE_ID, presetHandle.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.map((nonOptionalbuiltIn) -> new BooleanType(nonOptionalbuiltIn)).orElse(new EmptyType()) : new NullType())); + + return new StructType(values); + } + + public static ThermostatClusterScheduleStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + @Nullable byte[] scheduleHandle = null; + Integer systemMode = null; + Optional name = Optional.empty(); + Optional presetHandle = Optional.empty(); + ArrayList transitions = null; + @Nullable Optional builtIn = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == SCHEDULE_HANDLE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.ByteArray) { + ByteArrayType castingValue = element.value(ByteArrayType.class); + scheduleHandle = castingValue.value(byte[].class); + } + } else if (element.contextTagNum() == SYSTEM_MODE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + systemMode = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == NAME_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.String) { + StringType castingValue = element.value(StringType.class); + name = Optional.of(castingValue.value(String.class)); + } + } else if (element.contextTagNum() == PRESET_HANDLE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.ByteArray) { + ByteArrayType castingValue = element.value(ByteArrayType.class); + presetHandle = Optional.of(castingValue.value(byte[].class)); + } + } else if (element.contextTagNum() == TRANSITIONS_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Array) { + ArrayType castingValue = element.value(ArrayType.class); + transitions = castingValue.map((elementcastingValue) -> ChipStructs.ThermostatClusterScheduleTransitionStruct.decodeTlv(elementcastingValue)); + } + } 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)); + } + } + } + return new ThermostatClusterScheduleStruct( + scheduleHandle, + systemMode, + name, + presetHandle, + transitions, + builtIn + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("ThermostatClusterScheduleStruct {\n"); + output.append("\tscheduleHandle: "); + output.append(Arrays.toString(scheduleHandle)); + output.append("\n"); + output.append("\tsystemMode: "); + output.append(systemMode); + output.append("\n"); + output.append("\tname: "); + output.append(name); + output.append("\n"); + output.append("\tpresetHandle: "); + output.append(presetHandle.isPresent() ? Arrays.toString(presetHandle.get()) : ""); + output.append("\n"); + output.append("\ttransitions: "); + output.append(transitions); + output.append("\n"); + output.append("\tbuiltIn: "); + output.append(builtIn); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class ThermostatClusterPresetStruct { + public @Nullable byte[] presetHandle; + public Integer presetScenario; + public @Nullable Optional name; + public Optional coolingSetpoint; + public Optional heatingSetpoint; + public @Nullable Boolean builtIn; + private static final long PRESET_HANDLE_ID = 0L; + private static final long PRESET_SCENARIO_ID = 1L; + private static final long NAME_ID = 2L; + private static final long COOLING_SETPOINT_ID = 3L; + private static final long HEATING_SETPOINT_ID = 4L; + private static final long BUILT_IN_ID = 5L; + + public ThermostatClusterPresetStruct( + @Nullable byte[] presetHandle, + Integer presetScenario, + @Nullable Optional name, + Optional coolingSetpoint, + Optional heatingSetpoint, + @Nullable Boolean builtIn + ) { + this.presetHandle = presetHandle; + this.presetScenario = presetScenario; + this.name = name; + this.coolingSetpoint = coolingSetpoint; + this.heatingSetpoint = heatingSetpoint; + this.builtIn = builtIn; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(PRESET_HANDLE_ID, presetHandle != null ? new ByteArrayType(presetHandle) : new NullType())); + values.add(new StructElement(PRESET_SCENARIO_ID, new UIntType(presetScenario))); + values.add(new StructElement(NAME_ID, name != null ? name.map((nonOptionalname) -> new StringType(nonOptionalname)).orElse(new EmptyType()) : new NullType())); + values.add(new StructElement(COOLING_SETPOINT_ID, coolingSetpoint.map((nonOptionalcoolingSetpoint) -> new IntType(nonOptionalcoolingSetpoint)).orElse(new EmptyType()))); + values.add(new StructElement(HEATING_SETPOINT_ID, heatingSetpoint.map((nonOptionalheatingSetpoint) -> new IntType(nonOptionalheatingSetpoint)).orElse(new EmptyType()))); + values.add(new StructElement(BUILT_IN_ID, builtIn != null ? new BooleanType(builtIn) : new NullType())); + + return new StructType(values); + } + + public static ThermostatClusterPresetStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + @Nullable byte[] presetHandle = null; + Integer presetScenario = null; + @Nullable Optional name = null; + Optional coolingSetpoint = Optional.empty(); + Optional heatingSetpoint = Optional.empty(); + @Nullable Boolean builtIn = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == PRESET_HANDLE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.ByteArray) { + ByteArrayType castingValue = element.value(ByteArrayType.class); + presetHandle = castingValue.value(byte[].class); + } + } else if (element.contextTagNum() == PRESET_SCENARIO_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + presetScenario = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == NAME_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.String) { + StringType castingValue = element.value(StringType.class); + name = Optional.of(castingValue.value(String.class)); + } + } else if (element.contextTagNum() == COOLING_SETPOINT_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Int) { + IntType castingValue = element.value(IntType.class); + coolingSetpoint = Optional.of(castingValue.value(Integer.class)); + } + } else if (element.contextTagNum() == HEATING_SETPOINT_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Int) { + IntType castingValue = element.value(IntType.class); + heatingSetpoint = Optional.of(castingValue.value(Integer.class)); + } + } else if (element.contextTagNum() == BUILT_IN_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Boolean) { + BooleanType castingValue = element.value(BooleanType.class); + builtIn = castingValue.value(Boolean.class); + } + } + } + return new ThermostatClusterPresetStruct( + presetHandle, + presetScenario, + name, + coolingSetpoint, + heatingSetpoint, + builtIn + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("ThermostatClusterPresetStruct {\n"); + output.append("\tpresetHandle: "); + output.append(Arrays.toString(presetHandle)); + output.append("\n"); + output.append("\tpresetScenario: "); + output.append(presetScenario); + output.append("\n"); + output.append("\tname: "); + output.append(name); + output.append("\n"); + output.append("\tcoolingSetpoint: "); + output.append(coolingSetpoint); + output.append("\n"); + output.append("\theatingSetpoint: "); + output.append(heatingSetpoint); + output.append("\n"); + output.append("\tbuiltIn: "); + output.append(builtIn); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class ThermostatClusterPresetTypeStruct { + public Integer presetScenario; + public Integer numberOfPresets; + public Integer presetTypeFeatures; + private static final long PRESET_SCENARIO_ID = 0L; + private static final long NUMBER_OF_PRESETS_ID = 1L; + private static final long PRESET_TYPE_FEATURES_ID = 2L; + + public ThermostatClusterPresetTypeStruct( + Integer presetScenario, + Integer numberOfPresets, + Integer presetTypeFeatures + ) { + this.presetScenario = presetScenario; + this.numberOfPresets = numberOfPresets; + this.presetTypeFeatures = presetTypeFeatures; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(PRESET_SCENARIO_ID, new UIntType(presetScenario))); + values.add(new StructElement(NUMBER_OF_PRESETS_ID, new UIntType(numberOfPresets))); + values.add(new StructElement(PRESET_TYPE_FEATURES_ID, new UIntType(presetTypeFeatures))); + + return new StructType(values); + } + + public static ThermostatClusterPresetTypeStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Integer presetScenario = null; + Integer numberOfPresets = null; + Integer presetTypeFeatures = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == PRESET_SCENARIO_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + presetScenario = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == NUMBER_OF_PRESETS_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + numberOfPresets = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == PRESET_TYPE_FEATURES_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + presetTypeFeatures = castingValue.value(Integer.class); + } + } + } + return new ThermostatClusterPresetTypeStruct( + presetScenario, + numberOfPresets, + presetTypeFeatures + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("ThermostatClusterPresetTypeStruct {\n"); + output.append("\tpresetScenario: "); + output.append(presetScenario); + output.append("\n"); + output.append("\tnumberOfPresets: "); + output.append(numberOfPresets); + output.append("\n"); + output.append("\tpresetTypeFeatures: "); + output.append(presetTypeFeatures); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class ThermostatClusterQueuedPresetStruct { + public @Nullable byte[] presetHandle; + public @Nullable Long transitionTimestamp; + private static final long PRESET_HANDLE_ID = 0L; + private static final long TRANSITION_TIMESTAMP_ID = 1L; + + public ThermostatClusterQueuedPresetStruct( + @Nullable byte[] presetHandle, + @Nullable Long transitionTimestamp + ) { + this.presetHandle = presetHandle; + this.transitionTimestamp = transitionTimestamp; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(PRESET_HANDLE_ID, presetHandle != null ? new ByteArrayType(presetHandle) : new NullType())); + values.add(new StructElement(TRANSITION_TIMESTAMP_ID, transitionTimestamp != null ? new UIntType(transitionTimestamp) : new NullType())); + + return new StructType(values); + } + + public static ThermostatClusterQueuedPresetStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + @Nullable byte[] presetHandle = null; + @Nullable Long transitionTimestamp = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == PRESET_HANDLE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.ByteArray) { + ByteArrayType castingValue = element.value(ByteArrayType.class); + presetHandle = castingValue.value(byte[].class); + } + } else if (element.contextTagNum() == TRANSITION_TIMESTAMP_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + transitionTimestamp = castingValue.value(Long.class); + } + } + } + return new ThermostatClusterQueuedPresetStruct( + presetHandle, + transitionTimestamp + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("ThermostatClusterQueuedPresetStruct {\n"); + output.append("\tpresetHandle: "); + output.append(Arrays.toString(presetHandle)); + output.append("\n"); + output.append("\ttransitionTimestamp: "); + output.append(transitionTimestamp); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class ThermostatClusterScheduleTypeStruct { + public Integer systemMode; + public Integer numberOfSchedules; + public Integer scheduleTypeFeatures; + private static final long SYSTEM_MODE_ID = 0L; + private static final long NUMBER_OF_SCHEDULES_ID = 1L; + private static final long SCHEDULE_TYPE_FEATURES_ID = 2L; + + public ThermostatClusterScheduleTypeStruct( + Integer systemMode, + Integer numberOfSchedules, + Integer scheduleTypeFeatures + ) { + this.systemMode = systemMode; + this.numberOfSchedules = numberOfSchedules; + this.scheduleTypeFeatures = scheduleTypeFeatures; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(SYSTEM_MODE_ID, new UIntType(systemMode))); + values.add(new StructElement(NUMBER_OF_SCHEDULES_ID, new UIntType(numberOfSchedules))); + values.add(new StructElement(SCHEDULE_TYPE_FEATURES_ID, new UIntType(scheduleTypeFeatures))); + + return new StructType(values); + } + + public static ThermostatClusterScheduleTypeStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Integer systemMode = null; + Integer numberOfSchedules = null; + Integer scheduleTypeFeatures = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == SYSTEM_MODE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + systemMode = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == NUMBER_OF_SCHEDULES_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + numberOfSchedules = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == SCHEDULE_TYPE_FEATURES_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + scheduleTypeFeatures = castingValue.value(Integer.class); + } + } + } + return new ThermostatClusterScheduleTypeStruct( + systemMode, + numberOfSchedules, + scheduleTypeFeatures + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("ThermostatClusterScheduleTypeStruct {\n"); + output.append("\tsystemMode: "); + output.append(systemMode); + output.append("\n"); + output.append("\tnumberOfSchedules: "); + output.append(numberOfSchedules); + output.append("\n"); + output.append("\tscheduleTypeFeatures: "); + output.append(scheduleTypeFeatures); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} public static class ThermostatClusterWeeklyScheduleTransitionStruct { public Integer transitionTime; public @Nullable Integer heatSetpoint; diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java index 2e712af09006a4..a6a447c64bc67c 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java @@ -10887,6 +10887,20 @@ public enum Attribute { ACLouverPosition(69L), ACCoilTemperature(70L), ACCapacityformat(71L), + PresetTypes(72L), + ScheduleTypes(73L), + NumberOfPresets(74L), + NumberOfSchedules(75L), + NumberOfScheduleTransitions(76L), + NumberOfScheduleTransitionPerDay(77L), + ActivePresetHandle(78L), + ActiveScheduleHandle(79L), + Presets(80L), + Schedules(81L), + PresetsSchedulesEditable(82L), + TemperatureSetpointHoldPolicy(83L), + SetpointHoldExpiryTimestamp(84L), + QueuedPreset(85L), GeneratedCommandList(65528L), AcceptedCommandList(65529L), EventList(65530L), @@ -10936,7 +10950,14 @@ public enum Command { SetpointRaiseLower(0L), SetWeeklySchedule(1L), GetWeeklySchedule(2L), - ClearWeeklySchedule(3L),; + ClearWeeklySchedule(3L), + SetActiveScheduleRequest(5L), + SetActivePresetRequest(6L), + StartPresetsSchedulesEditRequest(7L), + CancelPresetsSchedulesEditRequest(8L), + CommitPresetsSchedulesRequest(9L), + CancelSetActivePresetRequest(10L), + SetTemperatureSetpointHoldPolicy(11L),; private final long id; Command(long id) { this.id = id; @@ -11005,6 +11026,74 @@ public static GetWeeklyScheduleCommandField value(int id) throws NoSuchFieldErro } throw new NoSuchFieldError(); } + }public enum SetActiveScheduleRequestCommandField {ScheduleHandle(0),; + private final int id; + SetActiveScheduleRequestCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static SetActiveScheduleRequestCommandField value(int id) throws NoSuchFieldError { + for (SetActiveScheduleRequestCommandField field : SetActiveScheduleRequestCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }public enum SetActivePresetRequestCommandField {PresetHandle(0),DelayMinutes(1),; + private final int id; + SetActivePresetRequestCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static SetActivePresetRequestCommandField value(int id) throws NoSuchFieldError { + for (SetActivePresetRequestCommandField field : SetActivePresetRequestCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }public enum StartPresetsSchedulesEditRequestCommandField {TimeoutSeconds(0),; + private final int id; + StartPresetsSchedulesEditRequestCommandField(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()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } }@Override public String getAttributeName(long id) throws NoSuchFieldError { return Attribute.value(id).toString(); diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java index 94cda4091ba5dc..06097ad7878a8c 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java @@ -12523,6 +12523,195 @@ public void onError(Exception ex) { } } + public static class DelegatedThermostatClusterPresetTypesAttributeCallback implements ChipClusters.ThermostatCluster.PresetTypesAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedThermostatClusterScheduleTypesAttributeCallback implements ChipClusters.ThermostatCluster.ScheduleTypesAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedThermostatClusterNumberOfScheduleTransitionPerDayAttributeCallback implements ChipClusters.ThermostatCluster.NumberOfScheduleTransitionPerDayAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable Integer value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Integer"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedThermostatClusterActivePresetHandleAttributeCallback implements ChipClusters.ThermostatCluster.ActivePresetHandleAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable byte[] value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "byte[]"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedThermostatClusterActiveScheduleHandleAttributeCallback implements ChipClusters.ThermostatCluster.ActiveScheduleHandleAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable byte[] value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "byte[]"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedThermostatClusterPresetsAttributeCallback implements ChipClusters.ThermostatCluster.PresetsAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedThermostatClusterSchedulesAttributeCallback implements ChipClusters.ThermostatCluster.SchedulesAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedThermostatClusterSetpointHoldExpiryTimestampAttributeCallback implements ChipClusters.ThermostatCluster.SetpointHoldExpiryTimestampAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable Long value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Long"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedThermostatClusterQueuedPresetAttributeCallback implements ChipClusters.ThermostatCluster.QueuedPresetAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable ChipStructs.ThermostatClusterQueuedPresetStruct value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "ChipStructs.ThermostatClusterQueuedPresetStruct"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + public static class DelegatedThermostatClusterGeneratedCommandListAttributeCallback implements ChipClusters.ThermostatCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override @@ -24110,6 +24299,115 @@ public Map> getCommandMap() { ); thermostatClusterInteractionInfoMap.put("clearWeeklySchedule", thermostatclearWeeklyScheduleInteractionInfo); + Map thermostatsetActiveScheduleRequestCommandParams = new LinkedHashMap(); + + CommandParameterInfo thermostatsetActiveScheduleRequestscheduleHandleCommandParameterInfo = new CommandParameterInfo("scheduleHandle", byte[].class, byte[].class); + thermostatsetActiveScheduleRequestCommandParams.put("scheduleHandle",thermostatsetActiveScheduleRequestscheduleHandleCommandParameterInfo); + InteractionInfo thermostatsetActiveScheduleRequestInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .setActiveScheduleRequest((DefaultClusterCallback) callback + , (byte[]) + commandArguments.get("scheduleHandle") + ); + }, + () -> new DelegatedDefaultClusterCallback(), + thermostatsetActiveScheduleRequestCommandParams + ); + thermostatClusterInteractionInfoMap.put("setActiveScheduleRequest", thermostatsetActiveScheduleRequestInteractionInfo); + + Map thermostatsetActivePresetRequestCommandParams = new LinkedHashMap(); + + CommandParameterInfo thermostatsetActivePresetRequestpresetHandleCommandParameterInfo = new CommandParameterInfo("presetHandle", byte[].class, byte[].class); + thermostatsetActivePresetRequestCommandParams.put("presetHandle",thermostatsetActivePresetRequestpresetHandleCommandParameterInfo); + + CommandParameterInfo thermostatsetActivePresetRequestdelayMinutesCommandParameterInfo = new CommandParameterInfo("delayMinutes", Optional.class, Integer.class); + thermostatsetActivePresetRequestCommandParams.put("delayMinutes",thermostatsetActivePresetRequestdelayMinutesCommandParameterInfo); + InteractionInfo thermostatsetActivePresetRequestInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .setActivePresetRequest((DefaultClusterCallback) callback + , (byte[]) + commandArguments.get("presetHandle") + , (Optional) + commandArguments.get("delayMinutes") + ); + }, + () -> new DelegatedDefaultClusterCallback(), + thermostatsetActivePresetRequestCommandParams + ); + thermostatClusterInteractionInfoMap.put("setActivePresetRequest", thermostatsetActivePresetRequestInteractionInfo); + + Map thermostatstartPresetsSchedulesEditRequestCommandParams = new LinkedHashMap(); + + 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); + + Map thermostatcancelPresetsSchedulesEditRequestCommandParams = new LinkedHashMap(); + InteractionInfo thermostatcancelPresetsSchedulesEditRequestInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .cancelPresetsSchedulesEditRequest((DefaultClusterCallback) callback + ); + }, + () -> new DelegatedDefaultClusterCallback(), + thermostatcancelPresetsSchedulesEditRequestCommandParams + ); + thermostatClusterInteractionInfoMap.put("cancelPresetsSchedulesEditRequest", thermostatcancelPresetsSchedulesEditRequestInteractionInfo); + + Map thermostatcommitPresetsSchedulesRequestCommandParams = new LinkedHashMap(); + InteractionInfo thermostatcommitPresetsSchedulesRequestInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .commitPresetsSchedulesRequest((DefaultClusterCallback) callback + ); + }, + () -> new DelegatedDefaultClusterCallback(), + thermostatcommitPresetsSchedulesRequestCommandParams + ); + thermostatClusterInteractionInfoMap.put("commitPresetsSchedulesRequest", thermostatcommitPresetsSchedulesRequestInteractionInfo); + + Map thermostatcancelSetActivePresetRequestCommandParams = new LinkedHashMap(); + InteractionInfo thermostatcancelSetActivePresetRequestInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster) + .cancelSetActivePresetRequest((DefaultClusterCallback) callback + ); + }, + () -> new DelegatedDefaultClusterCallback(), + thermostatcancelSetActivePresetRequestCommandParams + ); + thermostatClusterInteractionInfoMap.put("cancelSetActivePresetRequest", thermostatcancelSetActivePresetRequestInteractionInfo); + + Map thermostatsetTemperatureSetpointHoldPolicyCommandParams = new LinkedHashMap(); + + 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); + commandMap.put("thermostat", thermostatClusterInteractionInfoMap); Map fanControlClusterInteractionInfoMap = new LinkedHashMap<>(); diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java index 16c71818bad11c..1ea61257791b59 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java @@ -11751,6 +11751,149 @@ private static Map readThermostatInteractionInfo() { readThermostatACCapacityformatCommandParams ); result.put("readACCapacityformatAttribute", readThermostatACCapacityformatAttributeInteractionInfo); + Map readThermostatPresetTypesCommandParams = new LinkedHashMap(); + InteractionInfo readThermostatPresetTypesAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster).readPresetTypesAttribute( + (ChipClusters.ThermostatCluster.PresetTypesAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedThermostatClusterPresetTypesAttributeCallback(), + readThermostatPresetTypesCommandParams + ); + result.put("readPresetTypesAttribute", readThermostatPresetTypesAttributeInteractionInfo); + Map readThermostatScheduleTypesCommandParams = new LinkedHashMap(); + InteractionInfo readThermostatScheduleTypesAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster).readScheduleTypesAttribute( + (ChipClusters.ThermostatCluster.ScheduleTypesAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedThermostatClusterScheduleTypesAttributeCallback(), + readThermostatScheduleTypesCommandParams + ); + result.put("readScheduleTypesAttribute", readThermostatScheduleTypesAttributeInteractionInfo); + Map readThermostatNumberOfPresetsCommandParams = new LinkedHashMap(); + InteractionInfo readThermostatNumberOfPresetsAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster).readNumberOfPresetsAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readThermostatNumberOfPresetsCommandParams + ); + result.put("readNumberOfPresetsAttribute", readThermostatNumberOfPresetsAttributeInteractionInfo); + Map readThermostatNumberOfSchedulesCommandParams = new LinkedHashMap(); + InteractionInfo readThermostatNumberOfSchedulesAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster).readNumberOfSchedulesAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readThermostatNumberOfSchedulesCommandParams + ); + result.put("readNumberOfSchedulesAttribute", readThermostatNumberOfSchedulesAttributeInteractionInfo); + Map readThermostatNumberOfScheduleTransitionsCommandParams = new LinkedHashMap(); + InteractionInfo readThermostatNumberOfScheduleTransitionsAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster).readNumberOfScheduleTransitionsAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readThermostatNumberOfScheduleTransitionsCommandParams + ); + result.put("readNumberOfScheduleTransitionsAttribute", readThermostatNumberOfScheduleTransitionsAttributeInteractionInfo); + Map readThermostatNumberOfScheduleTransitionPerDayCommandParams = new LinkedHashMap(); + InteractionInfo readThermostatNumberOfScheduleTransitionPerDayAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster).readNumberOfScheduleTransitionPerDayAttribute( + (ChipClusters.ThermostatCluster.NumberOfScheduleTransitionPerDayAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedThermostatClusterNumberOfScheduleTransitionPerDayAttributeCallback(), + readThermostatNumberOfScheduleTransitionPerDayCommandParams + ); + result.put("readNumberOfScheduleTransitionPerDayAttribute", readThermostatNumberOfScheduleTransitionPerDayAttributeInteractionInfo); + Map readThermostatActivePresetHandleCommandParams = new LinkedHashMap(); + InteractionInfo readThermostatActivePresetHandleAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster).readActivePresetHandleAttribute( + (ChipClusters.ThermostatCluster.ActivePresetHandleAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedThermostatClusterActivePresetHandleAttributeCallback(), + readThermostatActivePresetHandleCommandParams + ); + result.put("readActivePresetHandleAttribute", readThermostatActivePresetHandleAttributeInteractionInfo); + Map readThermostatActiveScheduleHandleCommandParams = new LinkedHashMap(); + InteractionInfo readThermostatActiveScheduleHandleAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster).readActiveScheduleHandleAttribute( + (ChipClusters.ThermostatCluster.ActiveScheduleHandleAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedThermostatClusterActiveScheduleHandleAttributeCallback(), + readThermostatActiveScheduleHandleCommandParams + ); + result.put("readActiveScheduleHandleAttribute", readThermostatActiveScheduleHandleAttributeInteractionInfo); + Map readThermostatPresetsCommandParams = new LinkedHashMap(); + InteractionInfo readThermostatPresetsAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster).readPresetsAttribute( + (ChipClusters.ThermostatCluster.PresetsAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedThermostatClusterPresetsAttributeCallback(), + readThermostatPresetsCommandParams + ); + result.put("readPresetsAttribute", readThermostatPresetsAttributeInteractionInfo); + Map readThermostatSchedulesCommandParams = new LinkedHashMap(); + InteractionInfo readThermostatSchedulesAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster).readSchedulesAttribute( + (ChipClusters.ThermostatCluster.SchedulesAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedThermostatClusterSchedulesAttributeCallback(), + readThermostatSchedulesCommandParams + ); + result.put("readSchedulesAttribute", readThermostatSchedulesAttributeInteractionInfo); + Map readThermostatPresetsSchedulesEditableCommandParams = new LinkedHashMap(); + InteractionInfo readThermostatPresetsSchedulesEditableAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster).readPresetsSchedulesEditableAttribute( + (ChipClusters.BooleanAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), + readThermostatPresetsSchedulesEditableCommandParams + ); + result.put("readPresetsSchedulesEditableAttribute", readThermostatPresetsSchedulesEditableAttributeInteractionInfo); + Map readThermostatTemperatureSetpointHoldPolicyCommandParams = new LinkedHashMap(); + InteractionInfo readThermostatTemperatureSetpointHoldPolicyAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster).readTemperatureSetpointHoldPolicyAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readThermostatTemperatureSetpointHoldPolicyCommandParams + ); + result.put("readTemperatureSetpointHoldPolicyAttribute", readThermostatTemperatureSetpointHoldPolicyAttributeInteractionInfo); + Map readThermostatSetpointHoldExpiryTimestampCommandParams = new LinkedHashMap(); + InteractionInfo readThermostatSetpointHoldExpiryTimestampAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThermostatCluster) cluster).readSetpointHoldExpiryTimestampAttribute( + (ChipClusters.ThermostatCluster.SetpointHoldExpiryTimestampAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedThermostatClusterSetpointHoldExpiryTimestampAttributeCallback(), + readThermostatSetpointHoldExpiryTimestampCommandParams + ); + result.put("readSetpointHoldExpiryTimestampAttribute", readThermostatSetpointHoldExpiryTimestampAttributeInteractionInfo); Map readThermostatGeneratedCommandListCommandParams = new LinkedHashMap(); InteractionInfo readThermostatGeneratedCommandListAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { 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 41532a359802fa..71cd44ecdf0ce4 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni @@ -104,6 +104,12 @@ structs_sources = [ "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ScenesClusterSceneInfoStruct.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/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/ThermostatClusterQueuedPresetStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThermostatClusterScheduleStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThermostatClusterScheduleTransitionStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThermostatClusterScheduleTypeStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThermostatClusterWeeklyScheduleTransitionStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThreadNetworkDiagnosticsClusterNeighborTableStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThreadNetworkDiagnosticsClusterOperationalDatasetComponents.kt", diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThermostatClusterPresetStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThermostatClusterPresetStruct.kt new file mode 100644 index 00000000000000..cb91c04d920b9c --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThermostatClusterPresetStruct.kt @@ -0,0 +1,140 @@ +/* + * + * 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 ThermostatClusterPresetStruct( + val presetHandle: ByteArray?, + val presetScenario: UInt, + val name: Optional?, + val coolingSetpoint: Optional, + val heatingSetpoint: Optional, + val builtIn: Boolean? +) { + override fun toString(): String = buildString { + append("ThermostatClusterPresetStruct {\n") + append("\tpresetHandle : $presetHandle\n") + append("\tpresetScenario : $presetScenario\n") + append("\tname : $name\n") + append("\tcoolingSetpoint : $coolingSetpoint\n") + append("\theatingSetpoint : $heatingSetpoint\n") + append("\tbuiltIn : $builtIn\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + if (presetHandle != null) { + put(ContextSpecificTag(TAG_PRESET_HANDLE), presetHandle) + } else { + putNull(ContextSpecificTag(TAG_PRESET_HANDLE)) + } + put(ContextSpecificTag(TAG_PRESET_SCENARIO), presetScenario) + if (name != null) { + if (name.isPresent) { + val optname = name.get() + put(ContextSpecificTag(TAG_NAME), optname) + } + } else { + putNull(ContextSpecificTag(TAG_NAME)) + } + if (coolingSetpoint.isPresent) { + val optcoolingSetpoint = coolingSetpoint.get() + put(ContextSpecificTag(TAG_COOLING_SETPOINT), optcoolingSetpoint) + } + if (heatingSetpoint.isPresent) { + val optheatingSetpoint = heatingSetpoint.get() + put(ContextSpecificTag(TAG_HEATING_SETPOINT), optheatingSetpoint) + } + if (builtIn != null) { + put(ContextSpecificTag(TAG_BUILT_IN), builtIn) + } else { + putNull(ContextSpecificTag(TAG_BUILT_IN)) + } + endStructure() + } + } + + companion object { + private const val TAG_PRESET_HANDLE = 0 + private const val TAG_PRESET_SCENARIO = 1 + private const val TAG_NAME = 2 + private const val TAG_COOLING_SETPOINT = 3 + private const val TAG_HEATING_SETPOINT = 4 + private const val TAG_BUILT_IN = 5 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ThermostatClusterPresetStruct { + tlvReader.enterStructure(tlvTag) + val presetHandle = + if (!tlvReader.isNull()) { + tlvReader.getByteArray(ContextSpecificTag(TAG_PRESET_HANDLE)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_PRESET_HANDLE)) + null + } + val presetScenario = tlvReader.getUInt(ContextSpecificTag(TAG_PRESET_SCENARIO)) + val name = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(ContextSpecificTag(TAG_NAME))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_NAME))) + } else { + Optional.empty() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_NAME)) + null + } + val coolingSetpoint = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_COOLING_SETPOINT))) { + Optional.of(tlvReader.getInt(ContextSpecificTag(TAG_COOLING_SETPOINT))) + } else { + Optional.empty() + } + val heatingSetpoint = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_HEATING_SETPOINT))) { + Optional.of(tlvReader.getInt(ContextSpecificTag(TAG_HEATING_SETPOINT))) + } else { + Optional.empty() + } + val builtIn = + if (!tlvReader.isNull()) { + tlvReader.getBoolean(ContextSpecificTag(TAG_BUILT_IN)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_BUILT_IN)) + null + } + + tlvReader.exitContainer() + + return ThermostatClusterPresetStruct( + presetHandle, + presetScenario, + name, + coolingSetpoint, + heatingSetpoint, + builtIn + ) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThermostatClusterPresetTypeStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThermostatClusterPresetTypeStruct.kt new file mode 100644 index 00000000000000..386af8f682e665 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThermostatClusterPresetTypeStruct.kt @@ -0,0 +1,64 @@ +/* + * + * 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 matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ThermostatClusterPresetTypeStruct( + val presetScenario: UInt, + val numberOfPresets: UInt, + val presetTypeFeatures: UInt +) { + override fun toString(): String = buildString { + append("ThermostatClusterPresetTypeStruct {\n") + append("\tpresetScenario : $presetScenario\n") + append("\tnumberOfPresets : $numberOfPresets\n") + append("\tpresetTypeFeatures : $presetTypeFeatures\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_PRESET_SCENARIO), presetScenario) + put(ContextSpecificTag(TAG_NUMBER_OF_PRESETS), numberOfPresets) + put(ContextSpecificTag(TAG_PRESET_TYPE_FEATURES), presetTypeFeatures) + endStructure() + } + } + + companion object { + private const val TAG_PRESET_SCENARIO = 0 + private const val TAG_NUMBER_OF_PRESETS = 1 + private const val TAG_PRESET_TYPE_FEATURES = 2 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ThermostatClusterPresetTypeStruct { + tlvReader.enterStructure(tlvTag) + val presetScenario = tlvReader.getUInt(ContextSpecificTag(TAG_PRESET_SCENARIO)) + val numberOfPresets = tlvReader.getUInt(ContextSpecificTag(TAG_NUMBER_OF_PRESETS)) + val presetTypeFeatures = tlvReader.getUInt(ContextSpecificTag(TAG_PRESET_TYPE_FEATURES)) + + tlvReader.exitContainer() + + return ThermostatClusterPresetTypeStruct(presetScenario, numberOfPresets, presetTypeFeatures) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThermostatClusterQueuedPresetStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThermostatClusterQueuedPresetStruct.kt new file mode 100644 index 00000000000000..4ecaecf98901dc --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThermostatClusterQueuedPresetStruct.kt @@ -0,0 +1,79 @@ +/* + * + * 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 matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ThermostatClusterQueuedPresetStruct( + val presetHandle: ByteArray?, + val transitionTimestamp: ULong? +) { + override fun toString(): String = buildString { + append("ThermostatClusterQueuedPresetStruct {\n") + append("\tpresetHandle : $presetHandle\n") + append("\ttransitionTimestamp : $transitionTimestamp\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + if (presetHandle != null) { + put(ContextSpecificTag(TAG_PRESET_HANDLE), presetHandle) + } else { + putNull(ContextSpecificTag(TAG_PRESET_HANDLE)) + } + if (transitionTimestamp != null) { + put(ContextSpecificTag(TAG_TRANSITION_TIMESTAMP), transitionTimestamp) + } else { + putNull(ContextSpecificTag(TAG_TRANSITION_TIMESTAMP)) + } + endStructure() + } + } + + companion object { + private const val TAG_PRESET_HANDLE = 0 + private const val TAG_TRANSITION_TIMESTAMP = 1 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ThermostatClusterQueuedPresetStruct { + tlvReader.enterStructure(tlvTag) + val presetHandle = + if (!tlvReader.isNull()) { + tlvReader.getByteArray(ContextSpecificTag(TAG_PRESET_HANDLE)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_PRESET_HANDLE)) + null + } + val transitionTimestamp = + if (!tlvReader.isNull()) { + tlvReader.getULong(ContextSpecificTag(TAG_TRANSITION_TIMESTAMP)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_TRANSITION_TIMESTAMP)) + null + } + + tlvReader.exitContainer() + + return ThermostatClusterQueuedPresetStruct(presetHandle, transitionTimestamp) + } + } +} 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 new file mode 100644 index 00000000000000..ac1ffbde1caca9 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThermostatClusterScheduleStruct.kt @@ -0,0 +1,142 @@ +/* + * + * 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.AnonymousTag +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ThermostatClusterScheduleStruct( + val scheduleHandle: ByteArray?, + val systemMode: UInt, + val name: Optional, + val presetHandle: Optional, + val transitions: List, + val builtIn: Optional? +) { + override fun toString(): String = buildString { + append("ThermostatClusterScheduleStruct {\n") + append("\tscheduleHandle : $scheduleHandle\n") + append("\tsystemMode : $systemMode\n") + append("\tname : $name\n") + append("\tpresetHandle : $presetHandle\n") + append("\ttransitions : $transitions\n") + append("\tbuiltIn : $builtIn\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + if (scheduleHandle != null) { + put(ContextSpecificTag(TAG_SCHEDULE_HANDLE), scheduleHandle) + } else { + putNull(ContextSpecificTag(TAG_SCHEDULE_HANDLE)) + } + put(ContextSpecificTag(TAG_SYSTEM_MODE), systemMode) + if (name.isPresent) { + val optname = name.get() + put(ContextSpecificTag(TAG_NAME), optname) + } + if (presetHandle.isPresent) { + val optpresetHandle = presetHandle.get() + put(ContextSpecificTag(TAG_PRESET_HANDLE), optpresetHandle) + } + startArray(ContextSpecificTag(TAG_TRANSITIONS)) + for (item in transitions.iterator()) { + item.toTlv(AnonymousTag, this) + } + endArray() + if (builtIn != null) { + if (builtIn.isPresent) { + val optbuiltIn = builtIn.get() + put(ContextSpecificTag(TAG_BUILT_IN), optbuiltIn) + } + } else { + putNull(ContextSpecificTag(TAG_BUILT_IN)) + } + endStructure() + } + } + + companion object { + private const val TAG_SCHEDULE_HANDLE = 0 + private const val TAG_SYSTEM_MODE = 1 + private const val TAG_NAME = 2 + private const val TAG_PRESET_HANDLE = 3 + private const val TAG_TRANSITIONS = 4 + private const val TAG_BUILT_IN = 5 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ThermostatClusterScheduleStruct { + tlvReader.enterStructure(tlvTag) + val scheduleHandle = + if (!tlvReader.isNull()) { + tlvReader.getByteArray(ContextSpecificTag(TAG_SCHEDULE_HANDLE)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_SCHEDULE_HANDLE)) + null + } + val systemMode = tlvReader.getUInt(ContextSpecificTag(TAG_SYSTEM_MODE)) + val name = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_NAME))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_NAME))) + } else { + Optional.empty() + } + val presetHandle = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_PRESET_HANDLE))) { + Optional.of(tlvReader.getByteArray(ContextSpecificTag(TAG_PRESET_HANDLE))) + } else { + Optional.empty() + } + val transitions = + buildList { + tlvReader.enterArray(ContextSpecificTag(TAG_TRANSITIONS)) + while (!tlvReader.isEndOfContainer()) { + add(ThermostatClusterScheduleTransitionStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + val builtIn = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(ContextSpecificTag(TAG_BUILT_IN))) { + Optional.of(tlvReader.getBoolean(ContextSpecificTag(TAG_BUILT_IN))) + } else { + Optional.empty() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_BUILT_IN)) + null + } + + tlvReader.exitContainer() + + return ThermostatClusterScheduleStruct( + scheduleHandle, + systemMode, + name, + presetHandle, + transitions, + builtIn + ) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThermostatClusterScheduleTransitionStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThermostatClusterScheduleTransitionStruct.kt new file mode 100644 index 00000000000000..aabb3b6418da7b --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThermostatClusterScheduleTransitionStruct.kt @@ -0,0 +1,119 @@ +/* + * + * 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 ThermostatClusterScheduleTransitionStruct( + val dayOfWeek: UInt, + val transitionTime: UInt, + val presetHandle: Optional, + val systemMode: Optional, + val coolingSetpoint: Optional, + val heatingSetpoint: Optional +) { + override fun toString(): String = buildString { + append("ThermostatClusterScheduleTransitionStruct {\n") + append("\tdayOfWeek : $dayOfWeek\n") + append("\ttransitionTime : $transitionTime\n") + append("\tpresetHandle : $presetHandle\n") + append("\tsystemMode : $systemMode\n") + append("\tcoolingSetpoint : $coolingSetpoint\n") + append("\theatingSetpoint : $heatingSetpoint\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_DAY_OF_WEEK), dayOfWeek) + put(ContextSpecificTag(TAG_TRANSITION_TIME), transitionTime) + if (presetHandle.isPresent) { + val optpresetHandle = presetHandle.get() + put(ContextSpecificTag(TAG_PRESET_HANDLE), optpresetHandle) + } + if (systemMode.isPresent) { + val optsystemMode = systemMode.get() + put(ContextSpecificTag(TAG_SYSTEM_MODE), optsystemMode) + } + if (coolingSetpoint.isPresent) { + val optcoolingSetpoint = coolingSetpoint.get() + put(ContextSpecificTag(TAG_COOLING_SETPOINT), optcoolingSetpoint) + } + if (heatingSetpoint.isPresent) { + val optheatingSetpoint = heatingSetpoint.get() + put(ContextSpecificTag(TAG_HEATING_SETPOINT), optheatingSetpoint) + } + endStructure() + } + } + + companion object { + private const val TAG_DAY_OF_WEEK = 0 + private const val TAG_TRANSITION_TIME = 1 + private const val TAG_PRESET_HANDLE = 2 + private const val TAG_SYSTEM_MODE = 3 + private const val TAG_COOLING_SETPOINT = 4 + private const val TAG_HEATING_SETPOINT = 5 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ThermostatClusterScheduleTransitionStruct { + tlvReader.enterStructure(tlvTag) + val dayOfWeek = tlvReader.getUInt(ContextSpecificTag(TAG_DAY_OF_WEEK)) + val transitionTime = tlvReader.getUInt(ContextSpecificTag(TAG_TRANSITION_TIME)) + val presetHandle = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_PRESET_HANDLE))) { + Optional.of(tlvReader.getByteArray(ContextSpecificTag(TAG_PRESET_HANDLE))) + } else { + Optional.empty() + } + val systemMode = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_SYSTEM_MODE))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_SYSTEM_MODE))) + } else { + Optional.empty() + } + val coolingSetpoint = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_COOLING_SETPOINT))) { + Optional.of(tlvReader.getInt(ContextSpecificTag(TAG_COOLING_SETPOINT))) + } else { + Optional.empty() + } + val heatingSetpoint = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_HEATING_SETPOINT))) { + Optional.of(tlvReader.getInt(ContextSpecificTag(TAG_HEATING_SETPOINT))) + } else { + Optional.empty() + } + + tlvReader.exitContainer() + + return ThermostatClusterScheduleTransitionStruct( + dayOfWeek, + transitionTime, + presetHandle, + systemMode, + coolingSetpoint, + heatingSetpoint + ) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThermostatClusterScheduleTypeStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThermostatClusterScheduleTypeStruct.kt new file mode 100644 index 00000000000000..eb62cbf32b28a4 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThermostatClusterScheduleTypeStruct.kt @@ -0,0 +1,68 @@ +/* + * + * 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 matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ThermostatClusterScheduleTypeStruct( + val systemMode: UInt, + val numberOfSchedules: UInt, + val scheduleTypeFeatures: UInt +) { + override fun toString(): String = buildString { + append("ThermostatClusterScheduleTypeStruct {\n") + append("\tsystemMode : $systemMode\n") + append("\tnumberOfSchedules : $numberOfSchedules\n") + append("\tscheduleTypeFeatures : $scheduleTypeFeatures\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_SYSTEM_MODE), systemMode) + put(ContextSpecificTag(TAG_NUMBER_OF_SCHEDULES), numberOfSchedules) + put(ContextSpecificTag(TAG_SCHEDULE_TYPE_FEATURES), scheduleTypeFeatures) + endStructure() + } + } + + companion object { + private const val TAG_SYSTEM_MODE = 0 + private const val TAG_NUMBER_OF_SCHEDULES = 1 + private const val TAG_SCHEDULE_TYPE_FEATURES = 2 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ThermostatClusterScheduleTypeStruct { + tlvReader.enterStructure(tlvTag) + val systemMode = tlvReader.getUInt(ContextSpecificTag(TAG_SYSTEM_MODE)) + val numberOfSchedules = tlvReader.getUInt(ContextSpecificTag(TAG_NUMBER_OF_SCHEDULES)) + val scheduleTypeFeatures = tlvReader.getUInt(ContextSpecificTag(TAG_SCHEDULE_TYPE_FEATURES)) + + tlvReader.exitContainer() + + return ThermostatClusterScheduleTypeStruct( + systemMode, + numberOfSchedules, + scheduleTypeFeatures + ) + } + } +} 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 274ed8e0234f00..2fa28950db06cd 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,6 +22,7 @@ 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 @@ -165,6 +166,104 @@ class ThermostatCluster(private val controller: MatterController, private val en object SubscriptionEstablished : ACCoilTemperatureAttributeSubscriptionState() } + class PresetTypesAttribute(val value: List?) + + sealed class PresetTypesAttributeSubscriptionState { + data class Success(val value: List?) : + PresetTypesAttributeSubscriptionState() + + data class Error(val exception: Exception) : PresetTypesAttributeSubscriptionState() + + object SubscriptionEstablished : PresetTypesAttributeSubscriptionState() + } + + class ScheduleTypesAttribute(val value: List?) + + sealed class ScheduleTypesAttributeSubscriptionState { + data class Success(val value: List?) : + ScheduleTypesAttributeSubscriptionState() + + data class Error(val exception: Exception) : ScheduleTypesAttributeSubscriptionState() + + object SubscriptionEstablished : ScheduleTypesAttributeSubscriptionState() + } + + class NumberOfScheduleTransitionPerDayAttribute(val value: UByte?) + + sealed class NumberOfScheduleTransitionPerDayAttributeSubscriptionState { + data class Success(val value: UByte?) : + NumberOfScheduleTransitionPerDayAttributeSubscriptionState() + + data class Error(val exception: Exception) : + NumberOfScheduleTransitionPerDayAttributeSubscriptionState() + + object SubscriptionEstablished : NumberOfScheduleTransitionPerDayAttributeSubscriptionState() + } + + class ActivePresetHandleAttribute(val value: ByteArray?) + + sealed class ActivePresetHandleAttributeSubscriptionState { + data class Success(val value: ByteArray?) : ActivePresetHandleAttributeSubscriptionState() + + data class Error(val exception: Exception) : ActivePresetHandleAttributeSubscriptionState() + + object SubscriptionEstablished : ActivePresetHandleAttributeSubscriptionState() + } + + class ActiveScheduleHandleAttribute(val value: ByteArray?) + + sealed class ActiveScheduleHandleAttributeSubscriptionState { + data class Success(val value: ByteArray?) : ActiveScheduleHandleAttributeSubscriptionState() + + data class Error(val exception: Exception) : ActiveScheduleHandleAttributeSubscriptionState() + + object SubscriptionEstablished : ActiveScheduleHandleAttributeSubscriptionState() + } + + class PresetsAttribute(val value: List?) + + sealed class PresetsAttributeSubscriptionState { + data class Success(val value: List?) : + PresetsAttributeSubscriptionState() + + data class Error(val exception: Exception) : PresetsAttributeSubscriptionState() + + object SubscriptionEstablished : PresetsAttributeSubscriptionState() + } + + class SchedulesAttribute(val value: List?) + + sealed class SchedulesAttributeSubscriptionState { + data class Success(val value: List?) : + SchedulesAttributeSubscriptionState() + + data class Error(val exception: Exception) : SchedulesAttributeSubscriptionState() + + object SubscriptionEstablished : SchedulesAttributeSubscriptionState() + } + + class SetpointHoldExpiryTimestampAttribute(val value: UInt?) + + sealed class SetpointHoldExpiryTimestampAttributeSubscriptionState { + data class Success(val value: UInt?) : SetpointHoldExpiryTimestampAttributeSubscriptionState() + + data class Error(val exception: Exception) : + SetpointHoldExpiryTimestampAttributeSubscriptionState() + + object SubscriptionEstablished : SetpointHoldExpiryTimestampAttributeSubscriptionState() + } + + class QueuedPresetAttribute(val value: ThermostatClusterQueuedPresetStruct?) + + sealed class QueuedPresetAttributeSubscriptionState { + data class Success(val value: ThermostatClusterQueuedPresetStruct?) : + QueuedPresetAttributeSubscriptionState() + + data class Error(val exception: Exception) : QueuedPresetAttributeSubscriptionState() + + object SubscriptionEstablished : QueuedPresetAttributeSubscriptionState() + } + class GeneratedCommandListAttribute(val value: List) sealed class GeneratedCommandListAttributeSubscriptionState { @@ -386,6 +485,163 @@ class ThermostatCluster(private val controller: MatterController, private val en logger.log(Level.FINE, "Invoke command succeeded: ${response}") } + suspend fun setActiveScheduleRequest( + scheduleHandle: ByteArray, + timedInvokeTimeout: Duration? = null + ) { + val commandId: UInt = 5u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + + val TAG_SCHEDULE_HANDLE_REQ: Int = 0 + tlvWriter.put(ContextSpecificTag(TAG_SCHEDULE_HANDLE_REQ), scheduleHandle) + 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}") + } + + suspend fun setActivePresetRequest( + presetHandle: ByteArray, + delayMinutes: UShort?, + timedInvokeTimeout: Duration? = null + ) { + val commandId: UInt = 6u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + + val TAG_PRESET_HANDLE_REQ: Int = 0 + tlvWriter.put(ContextSpecificTag(TAG_PRESET_HANDLE_REQ), presetHandle) + + val TAG_DELAY_MINUTES_REQ: Int = 1 + delayMinutes?.let { tlvWriter.put(ContextSpecificTag(TAG_DELAY_MINUTES_REQ), delayMinutes) } + 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}") + } + + suspend fun startPresetsSchedulesEditRequest( + timeoutSeconds: UShort, + timedInvokeTimeout: Duration? = null + ) { + val commandId: UInt = 7u + + 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}") + } + + suspend fun cancelPresetsSchedulesEditRequest(timedInvokeTimeout: Duration? = null) { + val commandId: UInt = 8u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + 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}") + } + + suspend fun commitPresetsSchedulesRequest(timedInvokeTimeout: Duration? = null) { + val commandId: UInt = 9u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + 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}") + } + + suspend fun cancelSetActivePresetRequest(timedInvokeTimeout: Duration? = null) { + val commandId: UInt = 10u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + 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}") + } + + suspend fun setTemperatureSetpointHoldPolicy( + temperatureSetpointHoldPolicy: UByte, + timedInvokeTimeout: Duration? = null + ) { + val commandId: UInt = 11u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + + val TAG_TEMPERATURE_SETPOINT_HOLD_POLICY_REQ: Int = 0 + tlvWriter.put( + ContextSpecificTag(TAG_TEMPERATURE_SETPOINT_HOLD_POLICY_REQ), + temperatureSetpointHoldPolicy + ) + 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}") + } + suspend fun readLocalTemperatureAttribute(): LocalTemperatureAttribute { val ATTRIBUTE_ID: UInt = 0u @@ -6142,6 +6398,1499 @@ class ThermostatCluster(private val controller: MatterController, private val en } } + suspend fun readPresetTypesAttribute(): PresetTypesAttribute { + val ATTRIBUTE_ID: UInt = 72u + + 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().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Presettypes attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List? = + if (tlvReader.isNextTag(AnonymousTag)) { + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(ThermostatClusterPresetTypeStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + } else { + null + } + + return PresetTypesAttribute(decodedValue) + } + + suspend fun subscribePresetTypesAttribute( + minInterval: Int, + maxInterval: Int + ): Flow { + val ATTRIBUTE_ID: UInt = 72u + 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( + PresetTypesAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { "Presettypes attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List? = + if (tlvReader.isNextTag(AnonymousTag)) { + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(ThermostatClusterPresetTypeStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + } else { + null + } + + decodedValue?.let { emit(PresetTypesAttributeSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(PresetTypesAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readScheduleTypesAttribute(): ScheduleTypesAttribute { + val ATTRIBUTE_ID: UInt = 73u + + 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().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Scheduletypes attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List? = + if (tlvReader.isNextTag(AnonymousTag)) { + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(ThermostatClusterScheduleTypeStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + } else { + null + } + + return ScheduleTypesAttribute(decodedValue) + } + + suspend fun subscribeScheduleTypesAttribute( + minInterval: Int, + maxInterval: Int + ): Flow { + val ATTRIBUTE_ID: UInt = 73u + 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( + ScheduleTypesAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { "Scheduletypes attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List? = + if (tlvReader.isNextTag(AnonymousTag)) { + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(ThermostatClusterScheduleTypeStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + } else { + null + } + + decodedValue?.let { emit(ScheduleTypesAttributeSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(ScheduleTypesAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readNumberOfPresetsAttribute(): UByte? { + val ATTRIBUTE_ID: UInt = 74u + + 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().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Numberofpresets 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 subscribeNumberOfPresetsAttribute( + minInterval: Int, + maxInterval: Int + ): Flow { + val ATTRIBUTE_ID: UInt = 74u + 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() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Numberofpresets 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 readNumberOfSchedulesAttribute(): UByte? { + val ATTRIBUTE_ID: UInt = 75u + + 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().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Numberofschedules 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 subscribeNumberOfSchedulesAttribute( + minInterval: Int, + maxInterval: Int + ): Flow { + val ATTRIBUTE_ID: UInt = 75u + 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() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Numberofschedules 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 readNumberOfScheduleTransitionsAttribute(): UByte? { + val ATTRIBUTE_ID: UInt = 76u + + 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().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Numberofscheduletransitions 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 subscribeNumberOfScheduleTransitionsAttribute( + minInterval: Int, + maxInterval: Int + ): Flow { + val ATTRIBUTE_ID: UInt = 76u + 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() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Numberofscheduletransitions 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 readNumberOfScheduleTransitionPerDayAttribute(): + NumberOfScheduleTransitionPerDayAttribute { + val ATTRIBUTE_ID: UInt = 77u + + 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().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { + "Numberofscheduletransitionperday attribute not found in response" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte? = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUByte(AnonymousTag) + } else { + null + } + } else { + tlvReader.getNull(AnonymousTag) + null + } + + return NumberOfScheduleTransitionPerDayAttribute(decodedValue) + } + + suspend fun subscribeNumberOfScheduleTransitionPerDayAttribute( + minInterval: Int, + maxInterval: Int + ): Flow { + val ATTRIBUTE_ID: UInt = 77u + 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( + NumberOfScheduleTransitionPerDayAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Numberofscheduletransitionperday 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.isNull()) { + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUByte(AnonymousTag) + } else { + null + } + } else { + tlvReader.getNull(AnonymousTag) + null + } + + decodedValue?.let { + emit(NumberOfScheduleTransitionPerDayAttributeSubscriptionState.Success(it)) + } + } + SubscriptionState.SubscriptionEstablished -> { + emit(NumberOfScheduleTransitionPerDayAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readActivePresetHandleAttribute(): ActivePresetHandleAttribute { + val ATTRIBUTE_ID: UInt = 78u + + 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().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Activepresethandle attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: ByteArray? = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getByteArray(AnonymousTag) + } else { + null + } + } else { + tlvReader.getNull(AnonymousTag) + null + } + + return ActivePresetHandleAttribute(decodedValue) + } + + suspend fun subscribeActivePresetHandleAttribute( + minInterval: Int, + maxInterval: Int + ): Flow { + val ATTRIBUTE_ID: UInt = 78u + 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( + ActivePresetHandleAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Activepresethandle attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: ByteArray? = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getByteArray(AnonymousTag) + } else { + null + } + } else { + tlvReader.getNull(AnonymousTag) + null + } + + decodedValue?.let { emit(ActivePresetHandleAttributeSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(ActivePresetHandleAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readActiveScheduleHandleAttribute(): ActiveScheduleHandleAttribute { + val ATTRIBUTE_ID: UInt = 79u + + 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().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Activeschedulehandle attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: ByteArray? = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getByteArray(AnonymousTag) + } else { + null + } + } else { + tlvReader.getNull(AnonymousTag) + null + } + + return ActiveScheduleHandleAttribute(decodedValue) + } + + suspend fun subscribeActiveScheduleHandleAttribute( + minInterval: Int, + maxInterval: Int + ): Flow { + val ATTRIBUTE_ID: UInt = 79u + 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( + ActiveScheduleHandleAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Activeschedulehandle attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: ByteArray? = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getByteArray(AnonymousTag) + } else { + null + } + } else { + tlvReader.getNull(AnonymousTag) + null + } + + decodedValue?.let { emit(ActiveScheduleHandleAttributeSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(ActiveScheduleHandleAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readPresetsAttribute(): PresetsAttribute { + val ATTRIBUTE_ID: UInt = 80u + + 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().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Presets attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List? = + if (tlvReader.isNextTag(AnonymousTag)) { + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(ThermostatClusterPresetStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + } else { + null + } + + return PresetsAttribute(decodedValue) + } + + suspend fun writePresetsAttribute( + value: List, + timedWriteTimeout: Duration? = null + ) { + val ATTRIBUTE_ID: UInt = 80u + + val tlvWriter = TlvWriter() + tlvWriter.startArray(AnonymousTag) + for (item in value.iterator()) { + item.toTlv(AnonymousTag, tlvWriter) + } + tlvWriter.endArray() + + val writeRequests: WriteRequests = + WriteRequests( + requests = + listOf( + WriteRequest( + attributePath = + AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), + tlvPayload = tlvWriter.getEncoded() + ) + ), + timedRequest = timedWriteTimeout + ) + + val response: WriteResponse = controller.write(writeRequests) + + when (response) { + is WriteResponse.Success -> { + logger.log(Level.FINE, "Write command succeeded") + } + is WriteResponse.PartialWriteFailure -> { + val aggregatedErrorMessage = + response.failures.joinToString("\n") { failure -> + "Error at ${failure.attributePath}: ${failure.ex.message}" + } + + response.failures.forEach { failure -> + logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") + } + + throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") + } + } + } + + suspend fun subscribePresetsAttribute( + minInterval: Int, + maxInterval: Int + ): Flow { + val ATTRIBUTE_ID: UInt = 80u + 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( + PresetsAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { "Presets attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List? = + if (tlvReader.isNextTag(AnonymousTag)) { + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(ThermostatClusterPresetStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + } else { + null + } + + decodedValue?.let { emit(PresetsAttributeSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(PresetsAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readSchedulesAttribute(): SchedulesAttribute { + val ATTRIBUTE_ID: UInt = 81u + + 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().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Schedules attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List? = + if (tlvReader.isNextTag(AnonymousTag)) { + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(ThermostatClusterScheduleStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + } else { + null + } + + return SchedulesAttribute(decodedValue) + } + + suspend fun writeSchedulesAttribute( + value: List, + timedWriteTimeout: Duration? = null + ) { + val ATTRIBUTE_ID: UInt = 81u + + val tlvWriter = TlvWriter() + tlvWriter.startArray(AnonymousTag) + for (item in value.iterator()) { + item.toTlv(AnonymousTag, tlvWriter) + } + tlvWriter.endArray() + + val writeRequests: WriteRequests = + WriteRequests( + requests = + listOf( + WriteRequest( + attributePath = + AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), + tlvPayload = tlvWriter.getEncoded() + ) + ), + timedRequest = timedWriteTimeout + ) + + val response: WriteResponse = controller.write(writeRequests) + + when (response) { + is WriteResponse.Success -> { + logger.log(Level.FINE, "Write command succeeded") + } + is WriteResponse.PartialWriteFailure -> { + val aggregatedErrorMessage = + response.failures.joinToString("\n") { failure -> + "Error at ${failure.attributePath}: ${failure.ex.message}" + } + + response.failures.forEach { failure -> + logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") + } + + throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") + } + } + } + + suspend fun subscribeSchedulesAttribute( + minInterval: Int, + maxInterval: Int + ): Flow { + val ATTRIBUTE_ID: UInt = 81u + 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( + SchedulesAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { "Schedules attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List? = + if (tlvReader.isNextTag(AnonymousTag)) { + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(ThermostatClusterScheduleStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + } else { + null + } + + decodedValue?.let { emit(SchedulesAttributeSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(SchedulesAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + 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().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 { + 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() + .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().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 { + 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() + .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 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().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Setpointholdexpirytimestamp attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UInt? = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUInt(AnonymousTag) + } else { + null + } + } else { + tlvReader.getNull(AnonymousTag) + null + } + + return SetpointHoldExpiryTimestampAttribute(decodedValue) + } + + suspend fun subscribeSetpointHoldExpiryTimestampAttribute( + minInterval: Int, + maxInterval: Int + ): Flow { + val ATTRIBUTE_ID: UInt = 84u + 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( + SetpointHoldExpiryTimestampAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Setpointholdexpirytimestamp attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UInt? = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUInt(AnonymousTag) + } else { + null + } + } else { + tlvReader.getNull(AnonymousTag) + null + } + + decodedValue?.let { + emit(SetpointHoldExpiryTimestampAttributeSubscriptionState.Success(it)) + } + } + SubscriptionState.SubscriptionEstablished -> { + emit(SetpointHoldExpiryTimestampAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readQueuedPresetAttribute(): QueuedPresetAttribute { + val ATTRIBUTE_ID: UInt = 85u + + 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().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Queuedpreset attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: ThermostatClusterQueuedPresetStruct? = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(AnonymousTag)) { + ThermostatClusterQueuedPresetStruct.fromTlv(AnonymousTag, tlvReader) + } else { + null + } + } else { + tlvReader.getNull(AnonymousTag) + null + } + + return QueuedPresetAttribute(decodedValue) + } + + suspend fun subscribeQueuedPresetAttribute( + minInterval: Int, + maxInterval: Int + ): Flow { + val ATTRIBUTE_ID: UInt = 85u + 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( + QueuedPresetAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { "Queuedpreset attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: ThermostatClusterQueuedPresetStruct? = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(AnonymousTag)) { + ThermostatClusterQueuedPresetStruct.fromTlv(AnonymousTag, tlvReader) + } else { + null + } + } else { + tlvReader.getNull(AnonymousTag) + null + } + + decodedValue?.let { emit(QueuedPresetAttributeSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(QueuedPresetAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + suspend fun readGeneratedCommandListAttribute(): GeneratedCommandListAttribute { val ATTRIBUTE_ID: UInt = 65528u 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 2ebed3b24f6c2c..132c4f40450d1d 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/files.gni +++ b/src/controller/java/generated/java/matter/controller/cluster/files.gni @@ -104,6 +104,12 @@ matter_structs_sources = [ "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/ScenesClusterSceneInfoStruct.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/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/ThermostatClusterQueuedPresetStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/ThermostatClusterScheduleStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/ThermostatClusterScheduleTransitionStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/ThermostatClusterScheduleTypeStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/ThermostatClusterWeeklyScheduleTransitionStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/ThreadNetworkDiagnosticsClusterNeighborTableStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/ThreadNetworkDiagnosticsClusterOperationalDatasetComponents.kt", diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/ThermostatClusterPresetStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/ThermostatClusterPresetStruct.kt new file mode 100644 index 00000000000000..498a7a1ee039f9 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/ThermostatClusterPresetStruct.kt @@ -0,0 +1,140 @@ +/* + * + * 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 ThermostatClusterPresetStruct( + val presetHandle: ByteArray?, + val presetScenario: UByte, + val name: Optional?, + val coolingSetpoint: Optional, + val heatingSetpoint: Optional, + val builtIn: Boolean? +) { + override fun toString(): String = buildString { + append("ThermostatClusterPresetStruct {\n") + append("\tpresetHandle : $presetHandle\n") + append("\tpresetScenario : $presetScenario\n") + append("\tname : $name\n") + append("\tcoolingSetpoint : $coolingSetpoint\n") + append("\theatingSetpoint : $heatingSetpoint\n") + append("\tbuiltIn : $builtIn\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + if (presetHandle != null) { + put(ContextSpecificTag(TAG_PRESET_HANDLE), presetHandle) + } else { + putNull(ContextSpecificTag(TAG_PRESET_HANDLE)) + } + put(ContextSpecificTag(TAG_PRESET_SCENARIO), presetScenario) + if (name != null) { + if (name.isPresent) { + val optname = name.get() + put(ContextSpecificTag(TAG_NAME), optname) + } + } else { + putNull(ContextSpecificTag(TAG_NAME)) + } + if (coolingSetpoint.isPresent) { + val optcoolingSetpoint = coolingSetpoint.get() + put(ContextSpecificTag(TAG_COOLING_SETPOINT), optcoolingSetpoint) + } + if (heatingSetpoint.isPresent) { + val optheatingSetpoint = heatingSetpoint.get() + put(ContextSpecificTag(TAG_HEATING_SETPOINT), optheatingSetpoint) + } + if (builtIn != null) { + put(ContextSpecificTag(TAG_BUILT_IN), builtIn) + } else { + putNull(ContextSpecificTag(TAG_BUILT_IN)) + } + endStructure() + } + } + + companion object { + private const val TAG_PRESET_HANDLE = 0 + private const val TAG_PRESET_SCENARIO = 1 + private const val TAG_NAME = 2 + private const val TAG_COOLING_SETPOINT = 3 + private const val TAG_HEATING_SETPOINT = 4 + private const val TAG_BUILT_IN = 5 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ThermostatClusterPresetStruct { + tlvReader.enterStructure(tlvTag) + val presetHandle = + if (!tlvReader.isNull()) { + tlvReader.getByteArray(ContextSpecificTag(TAG_PRESET_HANDLE)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_PRESET_HANDLE)) + null + } + val presetScenario = tlvReader.getUByte(ContextSpecificTag(TAG_PRESET_SCENARIO)) + val name = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(ContextSpecificTag(TAG_NAME))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_NAME))) + } else { + Optional.empty() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_NAME)) + null + } + val coolingSetpoint = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_COOLING_SETPOINT))) { + Optional.of(tlvReader.getShort(ContextSpecificTag(TAG_COOLING_SETPOINT))) + } else { + Optional.empty() + } + val heatingSetpoint = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_HEATING_SETPOINT))) { + Optional.of(tlvReader.getShort(ContextSpecificTag(TAG_HEATING_SETPOINT))) + } else { + Optional.empty() + } + val builtIn = + if (!tlvReader.isNull()) { + tlvReader.getBoolean(ContextSpecificTag(TAG_BUILT_IN)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_BUILT_IN)) + null + } + + tlvReader.exitContainer() + + return ThermostatClusterPresetStruct( + presetHandle, + presetScenario, + name, + coolingSetpoint, + heatingSetpoint, + builtIn + ) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/ThermostatClusterPresetTypeStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/ThermostatClusterPresetTypeStruct.kt new file mode 100644 index 00000000000000..d33ca6f93fdd6b --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/ThermostatClusterPresetTypeStruct.kt @@ -0,0 +1,64 @@ +/* + * + * 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 matter.controller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ThermostatClusterPresetTypeStruct( + val presetScenario: UByte, + val numberOfPresets: UByte, + val presetTypeFeatures: UShort +) { + override fun toString(): String = buildString { + append("ThermostatClusterPresetTypeStruct {\n") + append("\tpresetScenario : $presetScenario\n") + append("\tnumberOfPresets : $numberOfPresets\n") + append("\tpresetTypeFeatures : $presetTypeFeatures\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_PRESET_SCENARIO), presetScenario) + put(ContextSpecificTag(TAG_NUMBER_OF_PRESETS), numberOfPresets) + put(ContextSpecificTag(TAG_PRESET_TYPE_FEATURES), presetTypeFeatures) + endStructure() + } + } + + companion object { + private const val TAG_PRESET_SCENARIO = 0 + private const val TAG_NUMBER_OF_PRESETS = 1 + private const val TAG_PRESET_TYPE_FEATURES = 2 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ThermostatClusterPresetTypeStruct { + tlvReader.enterStructure(tlvTag) + val presetScenario = tlvReader.getUByte(ContextSpecificTag(TAG_PRESET_SCENARIO)) + val numberOfPresets = tlvReader.getUByte(ContextSpecificTag(TAG_NUMBER_OF_PRESETS)) + val presetTypeFeatures = tlvReader.getUShort(ContextSpecificTag(TAG_PRESET_TYPE_FEATURES)) + + tlvReader.exitContainer() + + return ThermostatClusterPresetTypeStruct(presetScenario, numberOfPresets, presetTypeFeatures) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/ThermostatClusterQueuedPresetStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/ThermostatClusterQueuedPresetStruct.kt new file mode 100644 index 00000000000000..80a2e263806dda --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/ThermostatClusterQueuedPresetStruct.kt @@ -0,0 +1,79 @@ +/* + * + * 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 matter.controller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ThermostatClusterQueuedPresetStruct( + val presetHandle: ByteArray?, + val transitionTimestamp: UInt? +) { + override fun toString(): String = buildString { + append("ThermostatClusterQueuedPresetStruct {\n") + append("\tpresetHandle : $presetHandle\n") + append("\ttransitionTimestamp : $transitionTimestamp\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + if (presetHandle != null) { + put(ContextSpecificTag(TAG_PRESET_HANDLE), presetHandle) + } else { + putNull(ContextSpecificTag(TAG_PRESET_HANDLE)) + } + if (transitionTimestamp != null) { + put(ContextSpecificTag(TAG_TRANSITION_TIMESTAMP), transitionTimestamp) + } else { + putNull(ContextSpecificTag(TAG_TRANSITION_TIMESTAMP)) + } + endStructure() + } + } + + companion object { + private const val TAG_PRESET_HANDLE = 0 + private const val TAG_TRANSITION_TIMESTAMP = 1 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ThermostatClusterQueuedPresetStruct { + tlvReader.enterStructure(tlvTag) + val presetHandle = + if (!tlvReader.isNull()) { + tlvReader.getByteArray(ContextSpecificTag(TAG_PRESET_HANDLE)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_PRESET_HANDLE)) + null + } + val transitionTimestamp = + if (!tlvReader.isNull()) { + tlvReader.getUInt(ContextSpecificTag(TAG_TRANSITION_TIMESTAMP)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_TRANSITION_TIMESTAMP)) + null + } + + tlvReader.exitContainer() + + return ThermostatClusterQueuedPresetStruct(presetHandle, transitionTimestamp) + } + } +} 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 new file mode 100644 index 00000000000000..25b8ff012cf7bc --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/ThermostatClusterScheduleStruct.kt @@ -0,0 +1,142 @@ +/* + * + * 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.AnonymousTag +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ThermostatClusterScheduleStruct( + val scheduleHandle: ByteArray?, + val systemMode: UByte, + val name: Optional, + val presetHandle: Optional, + val transitions: List, + val builtIn: Optional? +) { + override fun toString(): String = buildString { + append("ThermostatClusterScheduleStruct {\n") + append("\tscheduleHandle : $scheduleHandle\n") + append("\tsystemMode : $systemMode\n") + append("\tname : $name\n") + append("\tpresetHandle : $presetHandle\n") + append("\ttransitions : $transitions\n") + append("\tbuiltIn : $builtIn\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + if (scheduleHandle != null) { + put(ContextSpecificTag(TAG_SCHEDULE_HANDLE), scheduleHandle) + } else { + putNull(ContextSpecificTag(TAG_SCHEDULE_HANDLE)) + } + put(ContextSpecificTag(TAG_SYSTEM_MODE), systemMode) + if (name.isPresent) { + val optname = name.get() + put(ContextSpecificTag(TAG_NAME), optname) + } + if (presetHandle.isPresent) { + val optpresetHandle = presetHandle.get() + put(ContextSpecificTag(TAG_PRESET_HANDLE), optpresetHandle) + } + startArray(ContextSpecificTag(TAG_TRANSITIONS)) + for (item in transitions.iterator()) { + item.toTlv(AnonymousTag, this) + } + endArray() + if (builtIn != null) { + if (builtIn.isPresent) { + val optbuiltIn = builtIn.get() + put(ContextSpecificTag(TAG_BUILT_IN), optbuiltIn) + } + } else { + putNull(ContextSpecificTag(TAG_BUILT_IN)) + } + endStructure() + } + } + + companion object { + private const val TAG_SCHEDULE_HANDLE = 0 + private const val TAG_SYSTEM_MODE = 1 + private const val TAG_NAME = 2 + private const val TAG_PRESET_HANDLE = 3 + private const val TAG_TRANSITIONS = 4 + private const val TAG_BUILT_IN = 5 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ThermostatClusterScheduleStruct { + tlvReader.enterStructure(tlvTag) + val scheduleHandle = + if (!tlvReader.isNull()) { + tlvReader.getByteArray(ContextSpecificTag(TAG_SCHEDULE_HANDLE)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_SCHEDULE_HANDLE)) + null + } + val systemMode = tlvReader.getUByte(ContextSpecificTag(TAG_SYSTEM_MODE)) + val name = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_NAME))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_NAME))) + } else { + Optional.empty() + } + val presetHandle = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_PRESET_HANDLE))) { + Optional.of(tlvReader.getByteArray(ContextSpecificTag(TAG_PRESET_HANDLE))) + } else { + Optional.empty() + } + val transitions = + buildList { + tlvReader.enterArray(ContextSpecificTag(TAG_TRANSITIONS)) + while (!tlvReader.isEndOfContainer()) { + add(ThermostatClusterScheduleTransitionStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + val builtIn = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(ContextSpecificTag(TAG_BUILT_IN))) { + Optional.of(tlvReader.getBoolean(ContextSpecificTag(TAG_BUILT_IN))) + } else { + Optional.empty() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_BUILT_IN)) + null + } + + tlvReader.exitContainer() + + return ThermostatClusterScheduleStruct( + scheduleHandle, + systemMode, + name, + presetHandle, + transitions, + builtIn + ) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/ThermostatClusterScheduleTransitionStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/ThermostatClusterScheduleTransitionStruct.kt new file mode 100644 index 00000000000000..bd9e4b6e3ca842 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/ThermostatClusterScheduleTransitionStruct.kt @@ -0,0 +1,119 @@ +/* + * + * 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 ThermostatClusterScheduleTransitionStruct( + val dayOfWeek: UByte, + val transitionTime: UShort, + val presetHandle: Optional, + val systemMode: Optional, + val coolingSetpoint: Optional, + val heatingSetpoint: Optional +) { + override fun toString(): String = buildString { + append("ThermostatClusterScheduleTransitionStruct {\n") + append("\tdayOfWeek : $dayOfWeek\n") + append("\ttransitionTime : $transitionTime\n") + append("\tpresetHandle : $presetHandle\n") + append("\tsystemMode : $systemMode\n") + append("\tcoolingSetpoint : $coolingSetpoint\n") + append("\theatingSetpoint : $heatingSetpoint\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_DAY_OF_WEEK), dayOfWeek) + put(ContextSpecificTag(TAG_TRANSITION_TIME), transitionTime) + if (presetHandle.isPresent) { + val optpresetHandle = presetHandle.get() + put(ContextSpecificTag(TAG_PRESET_HANDLE), optpresetHandle) + } + if (systemMode.isPresent) { + val optsystemMode = systemMode.get() + put(ContextSpecificTag(TAG_SYSTEM_MODE), optsystemMode) + } + if (coolingSetpoint.isPresent) { + val optcoolingSetpoint = coolingSetpoint.get() + put(ContextSpecificTag(TAG_COOLING_SETPOINT), optcoolingSetpoint) + } + if (heatingSetpoint.isPresent) { + val optheatingSetpoint = heatingSetpoint.get() + put(ContextSpecificTag(TAG_HEATING_SETPOINT), optheatingSetpoint) + } + endStructure() + } + } + + companion object { + private const val TAG_DAY_OF_WEEK = 0 + private const val TAG_TRANSITION_TIME = 1 + private const val TAG_PRESET_HANDLE = 2 + private const val TAG_SYSTEM_MODE = 3 + private const val TAG_COOLING_SETPOINT = 4 + private const val TAG_HEATING_SETPOINT = 5 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ThermostatClusterScheduleTransitionStruct { + tlvReader.enterStructure(tlvTag) + val dayOfWeek = tlvReader.getUByte(ContextSpecificTag(TAG_DAY_OF_WEEK)) + val transitionTime = tlvReader.getUShort(ContextSpecificTag(TAG_TRANSITION_TIME)) + val presetHandle = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_PRESET_HANDLE))) { + Optional.of(tlvReader.getByteArray(ContextSpecificTag(TAG_PRESET_HANDLE))) + } else { + Optional.empty() + } + val systemMode = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_SYSTEM_MODE))) { + Optional.of(tlvReader.getUByte(ContextSpecificTag(TAG_SYSTEM_MODE))) + } else { + Optional.empty() + } + val coolingSetpoint = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_COOLING_SETPOINT))) { + Optional.of(tlvReader.getShort(ContextSpecificTag(TAG_COOLING_SETPOINT))) + } else { + Optional.empty() + } + val heatingSetpoint = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_HEATING_SETPOINT))) { + Optional.of(tlvReader.getShort(ContextSpecificTag(TAG_HEATING_SETPOINT))) + } else { + Optional.empty() + } + + tlvReader.exitContainer() + + return ThermostatClusterScheduleTransitionStruct( + dayOfWeek, + transitionTime, + presetHandle, + systemMode, + coolingSetpoint, + heatingSetpoint + ) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/ThermostatClusterScheduleTypeStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/ThermostatClusterScheduleTypeStruct.kt new file mode 100644 index 00000000000000..91135f990547ff --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/ThermostatClusterScheduleTypeStruct.kt @@ -0,0 +1,68 @@ +/* + * + * 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 matter.controller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ThermostatClusterScheduleTypeStruct( + val systemMode: UByte, + val numberOfSchedules: UByte, + val scheduleTypeFeatures: UShort +) { + override fun toString(): String = buildString { + append("ThermostatClusterScheduleTypeStruct {\n") + append("\tsystemMode : $systemMode\n") + append("\tnumberOfSchedules : $numberOfSchedules\n") + append("\tscheduleTypeFeatures : $scheduleTypeFeatures\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_SYSTEM_MODE), systemMode) + put(ContextSpecificTag(TAG_NUMBER_OF_SCHEDULES), numberOfSchedules) + put(ContextSpecificTag(TAG_SCHEDULE_TYPE_FEATURES), scheduleTypeFeatures) + endStructure() + } + } + + companion object { + private const val TAG_SYSTEM_MODE = 0 + private const val TAG_NUMBER_OF_SCHEDULES = 1 + private const val TAG_SCHEDULE_TYPE_FEATURES = 2 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ThermostatClusterScheduleTypeStruct { + tlvReader.enterStructure(tlvTag) + val systemMode = tlvReader.getUByte(ContextSpecificTag(TAG_SYSTEM_MODE)) + val numberOfSchedules = tlvReader.getUByte(ContextSpecificTag(TAG_NUMBER_OF_SCHEDULES)) + val scheduleTypeFeatures = tlvReader.getUShort(ContextSpecificTag(TAG_SCHEDULE_TYPE_FEATURES)) + + tlvReader.exitContainer() + + return ThermostatClusterScheduleTypeStruct( + systemMode, + numberOfSchedules, + scheduleTypeFeatures + ) + } + } +} diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index 58fb6a4bdd6646..3b49ab4f4cf7aa 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -26832,6 +26832,745 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR value); return value; } + case Attributes::PresetTypes::Id: { + using TypeInfo = Attributes::PresetTypes::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + jobject newElement_0_presetScenario; + std::string newElement_0_presetScenarioClassName = "java/lang/Integer"; + std::string newElement_0_presetScenarioCtorSignature = "(I)V"; + jint jninewElement_0_presetScenario = static_cast(entry_0.presetScenario); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_presetScenarioClassName.c_str(), newElement_0_presetScenarioCtorSignature.c_str(), + jninewElement_0_presetScenario, newElement_0_presetScenario); + jobject newElement_0_numberOfPresets; + std::string newElement_0_numberOfPresetsClassName = "java/lang/Integer"; + std::string newElement_0_numberOfPresetsCtorSignature = "(I)V"; + jint jninewElement_0_numberOfPresets = static_cast(entry_0.numberOfPresets); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_numberOfPresetsClassName.c_str(), newElement_0_numberOfPresetsCtorSignature.c_str(), + jninewElement_0_numberOfPresets, newElement_0_numberOfPresets); + jobject newElement_0_presetTypeFeatures; + std::string newElement_0_presetTypeFeaturesClassName = "java/lang/Integer"; + std::string newElement_0_presetTypeFeaturesCtorSignature = "(I)V"; + jint jninewElement_0_presetTypeFeatures = static_cast(entry_0.presetTypeFeatures.Raw()); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_presetTypeFeaturesClassName.c_str(), newElement_0_presetTypeFeaturesCtorSignature.c_str(), + jninewElement_0_presetTypeFeatures, newElement_0_presetTypeFeatures); + + jclass presetTypeStructStructClass_1; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$ThermostatClusterPresetTypeStruct", presetTypeStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ThermostatClusterPresetTypeStruct"); + return nullptr; + } + + jmethodID presetTypeStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, presetTypeStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V", + &presetTypeStructStructCtor_1); + if (err != CHIP_NO_ERROR || presetTypeStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ThermostatClusterPresetTypeStruct constructor"); + return nullptr; + } + + newElement_0 = + env->NewObject(presetTypeStructStructClass_1, presetTypeStructStructCtor_1, newElement_0_presetScenario, + newElement_0_numberOfPresets, newElement_0_presetTypeFeatures); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::ScheduleTypes::Id: { + using TypeInfo = Attributes::ScheduleTypes::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + jobject newElement_0_systemMode; + std::string newElement_0_systemModeClassName = "java/lang/Integer"; + std::string newElement_0_systemModeCtorSignature = "(I)V"; + jint jninewElement_0_systemMode = static_cast(entry_0.systemMode); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_systemModeClassName.c_str(), + newElement_0_systemModeCtorSignature.c_str(), + jninewElement_0_systemMode, newElement_0_systemMode); + jobject newElement_0_numberOfSchedules; + std::string newElement_0_numberOfSchedulesClassName = "java/lang/Integer"; + std::string newElement_0_numberOfSchedulesCtorSignature = "(I)V"; + jint jninewElement_0_numberOfSchedules = static_cast(entry_0.numberOfSchedules); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_numberOfSchedulesClassName.c_str(), newElement_0_numberOfSchedulesCtorSignature.c_str(), + jninewElement_0_numberOfSchedules, newElement_0_numberOfSchedules); + jobject newElement_0_scheduleTypeFeatures; + std::string newElement_0_scheduleTypeFeaturesClassName = "java/lang/Integer"; + std::string newElement_0_scheduleTypeFeaturesCtorSignature = "(I)V"; + jint jninewElement_0_scheduleTypeFeatures = static_cast(entry_0.scheduleTypeFeatures.Raw()); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_scheduleTypeFeaturesClassName.c_str(), newElement_0_scheduleTypeFeaturesCtorSignature.c_str(), + jninewElement_0_scheduleTypeFeatures, newElement_0_scheduleTypeFeatures); + + jclass scheduleTypeStructStructClass_1; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$ThermostatClusterScheduleTypeStruct", scheduleTypeStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ThermostatClusterScheduleTypeStruct"); + return nullptr; + } + + jmethodID scheduleTypeStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, scheduleTypeStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V", + &scheduleTypeStructStructCtor_1); + if (err != CHIP_NO_ERROR || scheduleTypeStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ThermostatClusterScheduleTypeStruct constructor"); + return nullptr; + } + + newElement_0 = + env->NewObject(scheduleTypeStructStructClass_1, scheduleTypeStructStructCtor_1, newElement_0_systemMode, + newElement_0_numberOfSchedules, newElement_0_scheduleTypeFeatures); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::NumberOfPresets::Id: { + using TypeInfo = Attributes::NumberOfPresets::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(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, + value); + return value; + } + case Attributes::NumberOfSchedules::Id: { + using TypeInfo = Attributes::NumberOfSchedules::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(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, + value); + return value; + } + case Attributes::NumberOfScheduleTransitions::Id: { + using TypeInfo = Attributes::NumberOfScheduleTransitions::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(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, + value); + return value; + } + case Attributes::NumberOfScheduleTransitionPerDay::Id: { + using TypeInfo = Attributes::NumberOfScheduleTransitionPerDay::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + jint jnivalue = static_cast(cppValue.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + } + return value; + } + case Attributes::ActivePresetHandle::Id: { + using TypeInfo = Attributes::ActivePresetHandle::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + jbyteArray valueByteArray = env->NewByteArray(static_cast(cppValue.Value().size())); + env->SetByteArrayRegion(valueByteArray, 0, static_cast(cppValue.Value().size()), + reinterpret_cast(cppValue.Value().data())); + value = valueByteArray; + } + return value; + } + case Attributes::ActiveScheduleHandle::Id: { + using TypeInfo = Attributes::ActiveScheduleHandle::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + jbyteArray valueByteArray = env->NewByteArray(static_cast(cppValue.Value().size())); + env->SetByteArrayRegion(valueByteArray, 0, static_cast(cppValue.Value().size()), + reinterpret_cast(cppValue.Value().data())); + value = valueByteArray; + } + return value; + } + case Attributes::Presets::Id: { + using TypeInfo = Attributes::Presets::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + jobject newElement_0_presetHandle; + if (entry_0.presetHandle.IsNull()) + { + newElement_0_presetHandle = nullptr; + } + else + { + jbyteArray newElement_0_presetHandleByteArray = + env->NewByteArray(static_cast(entry_0.presetHandle.Value().size())); + env->SetByteArrayRegion(newElement_0_presetHandleByteArray, 0, + static_cast(entry_0.presetHandle.Value().size()), + reinterpret_cast(entry_0.presetHandle.Value().data())); + newElement_0_presetHandle = newElement_0_presetHandleByteArray; + } + jobject newElement_0_presetScenario; + std::string newElement_0_presetScenarioClassName = "java/lang/Integer"; + std::string newElement_0_presetScenarioCtorSignature = "(I)V"; + jint jninewElement_0_presetScenario = static_cast(entry_0.presetScenario); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_presetScenarioClassName.c_str(), newElement_0_presetScenarioCtorSignature.c_str(), + jninewElement_0_presetScenario, newElement_0_presetScenario); + jobject newElement_0_name; + if (!entry_0.name.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_name); + } + else + { + jobject newElement_0_nameInsideOptional; + if (entry_0.name.Value().IsNull()) + { + newElement_0_nameInsideOptional = nullptr; + } + else + { + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.name.Value().Value(), + newElement_0_nameInsideOptional)); + } + chip::JniReferences::GetInstance().CreateOptional(newElement_0_nameInsideOptional, newElement_0_name); + } + jobject newElement_0_coolingSetpoint; + if (!entry_0.coolingSetpoint.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_coolingSetpoint); + } + else + { + jobject newElement_0_coolingSetpointInsideOptional; + std::string newElement_0_coolingSetpointInsideOptionalClassName = "java/lang/Integer"; + std::string newElement_0_coolingSetpointInsideOptionalCtorSignature = "(I)V"; + jint jninewElement_0_coolingSetpointInsideOptional = static_cast(entry_0.coolingSetpoint.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_coolingSetpointInsideOptionalClassName.c_str(), + newElement_0_coolingSetpointInsideOptionalCtorSignature.c_str(), + jninewElement_0_coolingSetpointInsideOptional, newElement_0_coolingSetpointInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(newElement_0_coolingSetpointInsideOptional, + newElement_0_coolingSetpoint); + } + jobject newElement_0_heatingSetpoint; + if (!entry_0.heatingSetpoint.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_heatingSetpoint); + } + else + { + jobject newElement_0_heatingSetpointInsideOptional; + std::string newElement_0_heatingSetpointInsideOptionalClassName = "java/lang/Integer"; + std::string newElement_0_heatingSetpointInsideOptionalCtorSignature = "(I)V"; + jint jninewElement_0_heatingSetpointInsideOptional = static_cast(entry_0.heatingSetpoint.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_heatingSetpointInsideOptionalClassName.c_str(), + newElement_0_heatingSetpointInsideOptionalCtorSignature.c_str(), + jninewElement_0_heatingSetpointInsideOptional, newElement_0_heatingSetpointInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(newElement_0_heatingSetpointInsideOptional, + newElement_0_heatingSetpoint); + } + jobject newElement_0_builtIn; + if (entry_0.builtIn.IsNull()) + { + newElement_0_builtIn = nullptr; + } + else + { + std::string newElement_0_builtInClassName = "java/lang/Boolean"; + std::string newElement_0_builtInCtorSignature = "(Z)V"; + jboolean jninewElement_0_builtIn = static_cast(entry_0.builtIn.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_builtInClassName.c_str(), + newElement_0_builtInCtorSignature.c_str(), + jninewElement_0_builtIn, newElement_0_builtIn); + } + + jclass presetStructStructClass_1; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$ThermostatClusterPresetStruct", presetStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ThermostatClusterPresetStruct"); + return nullptr; + } + + jmethodID presetStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, presetStructStructClass_1, "", + "([BLjava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/lang/Boolean;)V", + &presetStructStructCtor_1); + if (err != CHIP_NO_ERROR || presetStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ThermostatClusterPresetStruct constructor"); + return nullptr; + } + + newElement_0 = env->NewObject(presetStructStructClass_1, presetStructStructCtor_1, newElement_0_presetHandle, + newElement_0_presetScenario, newElement_0_name, newElement_0_coolingSetpoint, + newElement_0_heatingSetpoint, newElement_0_builtIn); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::Schedules::Id: { + using TypeInfo = Attributes::Schedules::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + jobject newElement_0_scheduleHandle; + if (entry_0.scheduleHandle.IsNull()) + { + newElement_0_scheduleHandle = nullptr; + } + else + { + jbyteArray newElement_0_scheduleHandleByteArray = + env->NewByteArray(static_cast(entry_0.scheduleHandle.Value().size())); + env->SetByteArrayRegion(newElement_0_scheduleHandleByteArray, 0, + static_cast(entry_0.scheduleHandle.Value().size()), + reinterpret_cast(entry_0.scheduleHandle.Value().data())); + newElement_0_scheduleHandle = newElement_0_scheduleHandleByteArray; + } + jobject newElement_0_systemMode; + std::string newElement_0_systemModeClassName = "java/lang/Integer"; + std::string newElement_0_systemModeCtorSignature = "(I)V"; + jint jninewElement_0_systemMode = static_cast(entry_0.systemMode); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_systemModeClassName.c_str(), + newElement_0_systemModeCtorSignature.c_str(), + jninewElement_0_systemMode, newElement_0_systemMode); + jobject newElement_0_name; + if (!entry_0.name.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_name); + } + else + { + jobject newElement_0_nameInsideOptional; + LogErrorOnFailure( + chip::JniReferences::GetInstance().CharToStringUTF(entry_0.name.Value(), newElement_0_nameInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(newElement_0_nameInsideOptional, newElement_0_name); + } + jobject newElement_0_presetHandle; + if (!entry_0.presetHandle.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_presetHandle); + } + else + { + jobject newElement_0_presetHandleInsideOptional; + jbyteArray newElement_0_presetHandleInsideOptionalByteArray = + env->NewByteArray(static_cast(entry_0.presetHandle.Value().size())); + env->SetByteArrayRegion(newElement_0_presetHandleInsideOptionalByteArray, 0, + static_cast(entry_0.presetHandle.Value().size()), + reinterpret_cast(entry_0.presetHandle.Value().data())); + newElement_0_presetHandleInsideOptional = newElement_0_presetHandleInsideOptionalByteArray; + chip::JniReferences::GetInstance().CreateOptional(newElement_0_presetHandleInsideOptional, + newElement_0_presetHandle); + } + jobject newElement_0_transitions; + chip::JniReferences::GetInstance().CreateArrayList(newElement_0_transitions); + + auto iter_newElement_0_transitions_2 = entry_0.transitions.begin(); + while (iter_newElement_0_transitions_2.Next()) + { + auto & entry_2 = iter_newElement_0_transitions_2.GetValue(); + jobject newElement_2; + jobject newElement_2_dayOfWeek; + std::string newElement_2_dayOfWeekClassName = "java/lang/Integer"; + std::string newElement_2_dayOfWeekCtorSignature = "(I)V"; + jint jninewElement_2_dayOfWeek = static_cast(entry_2.dayOfWeek.Raw()); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_2_dayOfWeekClassName.c_str(), + newElement_2_dayOfWeekCtorSignature.c_str(), + jninewElement_2_dayOfWeek, newElement_2_dayOfWeek); + jobject newElement_2_transitionTime; + std::string newElement_2_transitionTimeClassName = "java/lang/Integer"; + std::string newElement_2_transitionTimeCtorSignature = "(I)V"; + jint jninewElement_2_transitionTime = static_cast(entry_2.transitionTime); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_2_transitionTimeClassName.c_str(), newElement_2_transitionTimeCtorSignature.c_str(), + jninewElement_2_transitionTime, newElement_2_transitionTime); + jobject newElement_2_presetHandle; + if (!entry_2.presetHandle.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_2_presetHandle); + } + else + { + jobject newElement_2_presetHandleInsideOptional; + jbyteArray newElement_2_presetHandleInsideOptionalByteArray = + env->NewByteArray(static_cast(entry_2.presetHandle.Value().size())); + env->SetByteArrayRegion(newElement_2_presetHandleInsideOptionalByteArray, 0, + static_cast(entry_2.presetHandle.Value().size()), + reinterpret_cast(entry_2.presetHandle.Value().data())); + newElement_2_presetHandleInsideOptional = newElement_2_presetHandleInsideOptionalByteArray; + chip::JniReferences::GetInstance().CreateOptional(newElement_2_presetHandleInsideOptional, + newElement_2_presetHandle); + } + jobject newElement_2_systemMode; + if (!entry_2.systemMode.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_2_systemMode); + } + else + { + jobject newElement_2_systemModeInsideOptional; + std::string newElement_2_systemModeInsideOptionalClassName = "java/lang/Integer"; + std::string newElement_2_systemModeInsideOptionalCtorSignature = "(I)V"; + jint jninewElement_2_systemModeInsideOptional = static_cast(entry_2.systemMode.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_2_systemModeInsideOptionalClassName.c_str(), + newElement_2_systemModeInsideOptionalCtorSignature.c_str(), jninewElement_2_systemModeInsideOptional, + newElement_2_systemModeInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(newElement_2_systemModeInsideOptional, + newElement_2_systemMode); + } + jobject newElement_2_coolingSetpoint; + if (!entry_2.coolingSetpoint.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_2_coolingSetpoint); + } + else + { + jobject newElement_2_coolingSetpointInsideOptional; + std::string newElement_2_coolingSetpointInsideOptionalClassName = "java/lang/Integer"; + std::string newElement_2_coolingSetpointInsideOptionalCtorSignature = "(I)V"; + jint jninewElement_2_coolingSetpointInsideOptional = static_cast(entry_2.coolingSetpoint.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_2_coolingSetpointInsideOptionalClassName.c_str(), + newElement_2_coolingSetpointInsideOptionalCtorSignature.c_str(), + jninewElement_2_coolingSetpointInsideOptional, newElement_2_coolingSetpointInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(newElement_2_coolingSetpointInsideOptional, + newElement_2_coolingSetpoint); + } + jobject newElement_2_heatingSetpoint; + if (!entry_2.heatingSetpoint.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_2_heatingSetpoint); + } + else + { + jobject newElement_2_heatingSetpointInsideOptional; + std::string newElement_2_heatingSetpointInsideOptionalClassName = "java/lang/Integer"; + std::string newElement_2_heatingSetpointInsideOptionalCtorSignature = "(I)V"; + jint jninewElement_2_heatingSetpointInsideOptional = static_cast(entry_2.heatingSetpoint.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_2_heatingSetpointInsideOptionalClassName.c_str(), + newElement_2_heatingSetpointInsideOptionalCtorSignature.c_str(), + jninewElement_2_heatingSetpointInsideOptional, newElement_2_heatingSetpointInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(newElement_2_heatingSetpointInsideOptional, + newElement_2_heatingSetpoint); + } + + jclass scheduleTransitionStructStructClass_3; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$ThermostatClusterScheduleTransitionStruct", + scheduleTransitionStructStructClass_3); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ThermostatClusterScheduleTransitionStruct"); + return nullptr; + } + + jmethodID scheduleTransitionStructStructCtor_3; + err = chip::JniReferences::GetInstance().FindMethod( + env, scheduleTransitionStructStructClass_3, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/" + "util/Optional;)V", + &scheduleTransitionStructStructCtor_3); + if (err != CHIP_NO_ERROR || scheduleTransitionStructStructCtor_3 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ThermostatClusterScheduleTransitionStruct constructor"); + return nullptr; + } + + newElement_2 = + env->NewObject(scheduleTransitionStructStructClass_3, scheduleTransitionStructStructCtor_3, + newElement_2_dayOfWeek, newElement_2_transitionTime, newElement_2_presetHandle, + newElement_2_systemMode, newElement_2_coolingSetpoint, newElement_2_heatingSetpoint); + chip::JniReferences::GetInstance().AddToList(newElement_0_transitions, newElement_2); + } + jobject newElement_0_builtIn; + if (!entry_0.builtIn.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_builtIn); + } + 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(entry_0.builtIn.Value().Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + 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); + } + + jclass scheduleStructStructClass_1; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$ThermostatClusterScheduleStruct", scheduleStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ThermostatClusterScheduleStruct"); + return nullptr; + } + + jmethodID scheduleStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, scheduleStructStructClass_1, "", + "([BLjava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/ArrayList;Ljava/util/Optional;)V", + &scheduleStructStructCtor_1); + if (err != CHIP_NO_ERROR || scheduleStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ThermostatClusterScheduleStruct constructor"); + return nullptr; + } + + newElement_0 = env->NewObject(scheduleStructStructClass_1, scheduleStructStructCtor_1, newElement_0_scheduleHandle, + newElement_0_systemMode, newElement_0_name, newElement_0_presetHandle, + newElement_0_transitions, newElement_0_builtIn); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + 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(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(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(cppValue.Raw()); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, + value); + return value; + } + case Attributes::SetpointHoldExpiryTimestamp::Id: { + using TypeInfo = Attributes::SetpointHoldExpiryTimestamp::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + jlong jnivalue = static_cast(cppValue.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + } + return value; + } + case Attributes::QueuedPreset::Id: { + using TypeInfo = Attributes::QueuedPreset::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + jobject value_presetHandle; + if (cppValue.Value().presetHandle.IsNull()) + { + value_presetHandle = nullptr; + } + else + { + jbyteArray value_presetHandleByteArray = + env->NewByteArray(static_cast(cppValue.Value().presetHandle.Value().size())); + env->SetByteArrayRegion(value_presetHandleByteArray, 0, + static_cast(cppValue.Value().presetHandle.Value().size()), + reinterpret_cast(cppValue.Value().presetHandle.Value().data())); + value_presetHandle = value_presetHandleByteArray; + } + jobject value_transitionTimestamp; + if (cppValue.Value().transitionTimestamp.IsNull()) + { + value_transitionTimestamp = nullptr; + } + else + { + std::string value_transitionTimestampClassName = "java/lang/Long"; + std::string value_transitionTimestampCtorSignature = "(J)V"; + jlong jnivalue_transitionTimestamp = static_cast(cppValue.Value().transitionTimestamp.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_transitionTimestampClassName.c_str(), value_transitionTimestampCtorSignature.c_str(), + jnivalue_transitionTimestamp, value_transitionTimestamp); + } + + jclass queuedPresetStructStructClass_1; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$ThermostatClusterQueuedPresetStruct", queuedPresetStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ThermostatClusterQueuedPresetStruct"); + return nullptr; + } + + jmethodID queuedPresetStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, queuedPresetStructStructClass_1, "", + "([BLjava/lang/Long;)V", &queuedPresetStructStructCtor_1); + if (err != CHIP_NO_ERROR || queuedPresetStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ThermostatClusterQueuedPresetStruct constructor"); + return nullptr; + } + + value = env->NewObject(queuedPresetStructStructClass_1, queuedPresetStructStructCtor_1, value_presetHandle, + value_transitionTimestamp); + } + return value; + } case Attributes::GeneratedCommandList::Id: { using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; TypeInfo::DecodableType cppValue; diff --git a/src/controller/java/zap-generated/CHIPClientCallbacks.h b/src/controller/java/zap-generated/CHIPClientCallbacks.h index 14101937393e4c..f3275d2400a40a 100644 --- a/src/controller/java/zap-generated/CHIPClientCallbacks.h +++ b/src/controller/java/zap-generated/CHIPClientCallbacks.h @@ -829,6 +829,18 @@ typedef void (*PumpConfigurationAndControlEventListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); typedef void (*PumpConfigurationAndControlAttributeListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*ThermostatPresetTypesListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList & data); +typedef void (*ThermostatScheduleTypesListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList & data); +typedef void (*ThermostatPresetsListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList & data); +typedef void (*ThermostatSchedulesListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList & data); typedef void (*ThermostatGeneratedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); typedef void (*ThermostatAcceptedCommandListListAttributeCallback)( diff --git a/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp b/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp index bbb1d9df9158c1..8f6a3a734af413 100644 --- a/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp +++ b/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp @@ -6771,6 +6771,399 @@ JNI_METHOD(void, ThermostatCluster, writeACCapacityformatAttribute) onFailure.release(); } +JNI_METHOD(void, ThermostatCluster, writePresetsAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + ListFreer listFreer; + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::Presets::TypeInfo; + TypeInfo::Type cppValue; + + std::vector> cleanupByteArrays; + std::vector> cleanupStrings; + + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + jint valueSize; + chip::JniReferences::GetInstance().GetListSize(value, valueSize); + if (valueSize != 0) + { + auto * listHolder_0 = new ListHolder(valueSize); + listFreer.add(listHolder_0); + + for (jint i_0 = 0; i_0 < valueSize; ++i_0) + { + jobject element_0; + chip::JniReferences::GetInstance().GetListItem(value, i_0, element_0); + jobject element_0_presetHandleItem_1; + chip::JniReferences::GetInstance().GetObjectField(element_0, "presetHandle", "[B", element_0_presetHandleItem_1); + if (element_0_presetHandleItem_1 == nullptr) + { + listHolder_0->mList[i_0].presetHandle.SetNull(); + } + else + { + auto & nonNullValue_2 = listHolder_0->mList[i_0].presetHandle.SetNonNull(); + cleanupByteArrays.push_back( + chip::Platform::MakeUnique(env, static_cast(element_0_presetHandleItem_1))); + nonNullValue_2 = cleanupByteArrays.back()->byteSpan(); + } + jobject element_0_presetScenarioItem_1; + chip::JniReferences::GetInstance().GetObjectField(element_0, "presetScenario", "Ljava/lang/Integer;", + element_0_presetScenarioItem_1); + listHolder_0->mList[i_0].presetScenario = + static_castmList[i_0].presetScenario)>>( + chip::JniReferences::GetInstance().IntegerToPrimitive(element_0_presetScenarioItem_1)); + jobject element_0_nameItem_1; + chip::JniReferences::GetInstance().GetObjectField(element_0, "name", "Ljava/util/Optional;", element_0_nameItem_1); + if (element_0_nameItem_1 != nullptr) + { + jobject optionalValue_2; + chip::JniReferences::GetInstance().GetOptionalValue(element_0_nameItem_1, optionalValue_2); + if (optionalValue_2 != nullptr) + { + auto & definedValue_2 = listHolder_0->mList[i_0].name.Emplace(); + if (optionalValue_2 == nullptr) + { + definedValue_2.SetNull(); + } + else + { + auto & nonNullValue_3 = definedValue_2.SetNonNull(); + cleanupStrings.push_back( + chip::Platform::MakeUnique(env, static_cast(optionalValue_2))); + nonNullValue_3 = cleanupStrings.back()->charSpan(); + } + } + } + jobject element_0_coolingSetpointItem_1; + chip::JniReferences::GetInstance().GetObjectField(element_0, "coolingSetpoint", "Ljava/util/Optional;", + element_0_coolingSetpointItem_1); + if (element_0_coolingSetpointItem_1 != nullptr) + { + jobject optionalValue_2; + chip::JniReferences::GetInstance().GetOptionalValue(element_0_coolingSetpointItem_1, optionalValue_2); + if (optionalValue_2 != nullptr) + { + auto & definedValue_2 = listHolder_0->mList[i_0].coolingSetpoint.Emplace(); + definedValue_2 = static_cast>( + chip::JniReferences::GetInstance().IntegerToPrimitive(optionalValue_2)); + } + } + jobject element_0_heatingSetpointItem_1; + chip::JniReferences::GetInstance().GetObjectField(element_0, "heatingSetpoint", "Ljava/util/Optional;", + element_0_heatingSetpointItem_1); + if (element_0_heatingSetpointItem_1 != nullptr) + { + jobject optionalValue_2; + chip::JniReferences::GetInstance().GetOptionalValue(element_0_heatingSetpointItem_1, optionalValue_2); + if (optionalValue_2 != nullptr) + { + auto & definedValue_2 = listHolder_0->mList[i_0].heatingSetpoint.Emplace(); + definedValue_2 = static_cast>( + chip::JniReferences::GetInstance().IntegerToPrimitive(optionalValue_2)); + } + } + jobject element_0_builtInItem_1; + chip::JniReferences::GetInstance().GetObjectField(element_0, "builtIn", "Ljava/lang/Boolean;", + element_0_builtInItem_1); + if (element_0_builtInItem_1 == nullptr) + { + listHolder_0->mList[i_0].builtIn.SetNull(); + } + else + { + auto & nonNullValue_2 = listHolder_0->mList[i_0].builtIn.SetNonNull(); + nonNullValue_2 = static_cast>( + chip::JniReferences::GetInstance().BooleanToPrimitive(element_0_builtInItem_1)); + } + } + cppValue = ListType_0(listHolder_0->mList, valueSize); + } + else + { + cppValue = ListType_0(); + } + } + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, ThermostatCluster, writeSchedulesAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + ListFreer listFreer; + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::Schedules::TypeInfo; + TypeInfo::Type cppValue; + + std::vector> cleanupByteArrays; + std::vector> cleanupStrings; + + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + jint valueSize; + chip::JniReferences::GetInstance().GetListSize(value, valueSize); + if (valueSize != 0) + { + auto * listHolder_0 = new ListHolder(valueSize); + listFreer.add(listHolder_0); + + for (jint i_0 = 0; i_0 < valueSize; ++i_0) + { + jobject element_0; + chip::JniReferences::GetInstance().GetListItem(value, i_0, element_0); + jobject element_0_scheduleHandleItem_1; + chip::JniReferences::GetInstance().GetObjectField(element_0, "scheduleHandle", "[B", + element_0_scheduleHandleItem_1); + if (element_0_scheduleHandleItem_1 == nullptr) + { + listHolder_0->mList[i_0].scheduleHandle.SetNull(); + } + else + { + auto & nonNullValue_2 = listHolder_0->mList[i_0].scheduleHandle.SetNonNull(); + cleanupByteArrays.push_back(chip::Platform::MakeUnique( + env, static_cast(element_0_scheduleHandleItem_1))); + nonNullValue_2 = cleanupByteArrays.back()->byteSpan(); + } + jobject element_0_systemModeItem_1; + chip::JniReferences::GetInstance().GetObjectField(element_0, "systemMode", "Ljava/lang/Integer;", + element_0_systemModeItem_1); + listHolder_0->mList[i_0].systemMode = + static_castmList[i_0].systemMode)>>( + chip::JniReferences::GetInstance().IntegerToPrimitive(element_0_systemModeItem_1)); + jobject element_0_nameItem_1; + chip::JniReferences::GetInstance().GetObjectField(element_0, "name", "Ljava/util/Optional;", element_0_nameItem_1); + if (element_0_nameItem_1 != nullptr) + { + jobject optionalValue_2; + chip::JniReferences::GetInstance().GetOptionalValue(element_0_nameItem_1, optionalValue_2); + if (optionalValue_2 != nullptr) + { + auto & definedValue_2 = listHolder_0->mList[i_0].name.Emplace(); + cleanupStrings.push_back( + chip::Platform::MakeUnique(env, static_cast(optionalValue_2))); + definedValue_2 = cleanupStrings.back()->charSpan(); + } + } + jobject element_0_presetHandleItem_1; + chip::JniReferences::GetInstance().GetObjectField(element_0, "presetHandle", "Ljava/util/Optional;", + element_0_presetHandleItem_1); + if (element_0_presetHandleItem_1 != nullptr) + { + jobject optionalValue_2; + chip::JniReferences::GetInstance().GetOptionalValue(element_0_presetHandleItem_1, optionalValue_2); + if (optionalValue_2 != nullptr) + { + auto & definedValue_2 = listHolder_0->mList[i_0].presetHandle.Emplace(); + cleanupByteArrays.push_back( + chip::Platform::MakeUnique(env, static_cast(optionalValue_2))); + definedValue_2 = cleanupByteArrays.back()->byteSpan(); + } + } + jobject element_0_transitionsItem_1; + chip::JniReferences::GetInstance().GetObjectField(element_0, "transitions", "Ljava/util/ArrayList;", + element_0_transitionsItem_1); + { + using ListType_2 = std::remove_reference_tmList[i_0].transitions)>; + using ListMemberType_2 = ListMemberTypeGetter::Type; + jint element_0_transitionsItem_1Size; + chip::JniReferences::GetInstance().GetListSize(element_0_transitionsItem_1, element_0_transitionsItem_1Size); + if (element_0_transitionsItem_1Size != 0) + { + auto * listHolder_2 = new ListHolder(element_0_transitionsItem_1Size); + listFreer.add(listHolder_2); + + for (jint i_2 = 0; i_2 < element_0_transitionsItem_1Size; ++i_2) + { + jobject element_2; + chip::JniReferences::GetInstance().GetListItem(element_0_transitionsItem_1, i_2, element_2); + jobject element_2_dayOfWeekItem_3; + chip::JniReferences::GetInstance().GetObjectField(element_2, "dayOfWeek", "Ljava/lang/Integer;", + element_2_dayOfWeekItem_3); + listHolder_2->mList[i_2].dayOfWeek.SetRaw( + static_castmList[i_2].dayOfWeek)>::IntegerType>( + chip::JniReferences::GetInstance().IntegerToPrimitive(element_2_dayOfWeekItem_3))); + jobject element_2_transitionTimeItem_3; + chip::JniReferences::GetInstance().GetObjectField(element_2, "transitionTime", "Ljava/lang/Integer;", + element_2_transitionTimeItem_3); + listHolder_2->mList[i_2].transitionTime = + static_castmList[i_2].transitionTime)>>( + chip::JniReferences::GetInstance().IntegerToPrimitive(element_2_transitionTimeItem_3)); + jobject element_2_presetHandleItem_3; + chip::JniReferences::GetInstance().GetObjectField(element_2, "presetHandle", "Ljava/util/Optional;", + element_2_presetHandleItem_3); + if (element_2_presetHandleItem_3 != nullptr) + { + jobject optionalValue_4; + chip::JniReferences::GetInstance().GetOptionalValue(element_2_presetHandleItem_3, optionalValue_4); + if (optionalValue_4 != nullptr) + { + auto & definedValue_4 = listHolder_2->mList[i_2].presetHandle.Emplace(); + cleanupByteArrays.push_back(chip::Platform::MakeUnique( + env, static_cast(optionalValue_4))); + definedValue_4 = cleanupByteArrays.back()->byteSpan(); + } + } + jobject element_2_systemModeItem_3; + chip::JniReferences::GetInstance().GetObjectField(element_2, "systemMode", "Ljava/util/Optional;", + element_2_systemModeItem_3); + if (element_2_systemModeItem_3 != nullptr) + { + jobject optionalValue_4; + chip::JniReferences::GetInstance().GetOptionalValue(element_2_systemModeItem_3, optionalValue_4); + if (optionalValue_4 != nullptr) + { + auto & definedValue_4 = listHolder_2->mList[i_2].systemMode.Emplace(); + definedValue_4 = static_cast>( + chip::JniReferences::GetInstance().IntegerToPrimitive(optionalValue_4)); + } + } + jobject element_2_coolingSetpointItem_3; + chip::JniReferences::GetInstance().GetObjectField(element_2, "coolingSetpoint", "Ljava/util/Optional;", + element_2_coolingSetpointItem_3); + if (element_2_coolingSetpointItem_3 != nullptr) + { + jobject optionalValue_4; + chip::JniReferences::GetInstance().GetOptionalValue(element_2_coolingSetpointItem_3, + optionalValue_4); + if (optionalValue_4 != nullptr) + { + auto & definedValue_4 = listHolder_2->mList[i_2].coolingSetpoint.Emplace(); + definedValue_4 = static_cast>( + chip::JniReferences::GetInstance().IntegerToPrimitive(optionalValue_4)); + } + } + jobject element_2_heatingSetpointItem_3; + chip::JniReferences::GetInstance().GetObjectField(element_2, "heatingSetpoint", "Ljava/util/Optional;", + element_2_heatingSetpointItem_3); + if (element_2_heatingSetpointItem_3 != nullptr) + { + jobject optionalValue_4; + chip::JniReferences::GetInstance().GetOptionalValue(element_2_heatingSetpointItem_3, + optionalValue_4); + if (optionalValue_4 != nullptr) + { + auto & definedValue_4 = listHolder_2->mList[i_2].heatingSetpoint.Emplace(); + definedValue_4 = static_cast>( + chip::JniReferences::GetInstance().IntegerToPrimitive(optionalValue_4)); + } + } + } + listHolder_0->mList[i_0].transitions = ListType_2(listHolder_2->mList, element_0_transitionsItem_1Size); + } + else + { + listHolder_0->mList[i_0].transitions = ListType_2(); + } + } + jobject element_0_builtInItem_1; + chip::JniReferences::GetInstance().GetObjectField(element_0, "builtIn", "Ljava/util/Optional;", + element_0_builtInItem_1); + if (element_0_builtInItem_1 != nullptr) + { + jobject optionalValue_2; + chip::JniReferences::GetInstance().GetOptionalValue(element_0_builtInItem_1, optionalValue_2); + if (optionalValue_2 != nullptr) + { + auto & definedValue_2 = listHolder_0->mList[i_0].builtIn.Emplace(); + if (optionalValue_2 == nullptr) + { + definedValue_2.SetNull(); + } + else + { + auto & nonNullValue_3 = definedValue_2.SetNonNull(); + nonNullValue_3 = static_cast>( + chip::JniReferences::GetInstance().BooleanToPrimitive(optionalValue_2)); + } + } + } + } + cppValue = ListType_0(listHolder_0->mList, valueSize); + } + else + { + cppValue = ListType_0(); + } + } + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + JNI_METHOD(void, FanControlCluster, writeFanModeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) { diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp index fbfd2968e4217b..6db0e9cb9b9056 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp @@ -39236,6 +39236,952 @@ void CHIPThermostatACCoilTemperatureAttributeCallback::CallbackFn(void * context env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); } +CHIPThermostatPresetTypesAttributeCallback::CHIPThermostatPresetTypesAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPThermostatPresetTypesAttributeCallback::~CHIPThermostatPresetTypesAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPThermostatPresetTypesAttributeCallback::CallbackFn( + void * context, + const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + jobject newElement_0_presetScenario; + std::string newElement_0_presetScenarioClassName = "java/lang/Integer"; + std::string newElement_0_presetScenarioCtorSignature = "(I)V"; + jint jninewElement_0_presetScenario = static_cast(entry_0.presetScenario); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_presetScenarioClassName.c_str(), + newElement_0_presetScenarioCtorSignature.c_str(), + jninewElement_0_presetScenario, newElement_0_presetScenario); + jobject newElement_0_numberOfPresets; + std::string newElement_0_numberOfPresetsClassName = "java/lang/Integer"; + std::string newElement_0_numberOfPresetsCtorSignature = "(I)V"; + jint jninewElement_0_numberOfPresets = static_cast(entry_0.numberOfPresets); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_numberOfPresetsClassName.c_str(), + newElement_0_numberOfPresetsCtorSignature.c_str(), + jninewElement_0_numberOfPresets, newElement_0_numberOfPresets); + jobject newElement_0_presetTypeFeatures; + std::string newElement_0_presetTypeFeaturesClassName = "java/lang/Integer"; + std::string newElement_0_presetTypeFeaturesCtorSignature = "(I)V"; + jint jninewElement_0_presetTypeFeatures = static_cast(entry_0.presetTypeFeatures.Raw()); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_presetTypeFeaturesClassName.c_str(), newElement_0_presetTypeFeaturesCtorSignature.c_str(), + jninewElement_0_presetTypeFeatures, newElement_0_presetTypeFeatures); + + jclass presetTypeStructStructClass_1; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$ThermostatClusterPresetTypeStruct", presetTypeStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ThermostatClusterPresetTypeStruct"); + return; + } + + jmethodID presetTypeStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, presetTypeStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V", + &presetTypeStructStructCtor_1); + if (err != CHIP_NO_ERROR || presetTypeStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ThermostatClusterPresetTypeStruct constructor"); + return; + } + + newElement_0 = env->NewObject(presetTypeStructStructClass_1, presetTypeStructStructCtor_1, newElement_0_presetScenario, + newElement_0_numberOfPresets, newElement_0_presetTypeFeatures); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPThermostatScheduleTypesAttributeCallback::CHIPThermostatScheduleTypesAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPThermostatScheduleTypesAttributeCallback::~CHIPThermostatScheduleTypesAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPThermostatScheduleTypesAttributeCallback::CallbackFn( + void * context, + const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + jobject newElement_0_systemMode; + std::string newElement_0_systemModeClassName = "java/lang/Integer"; + std::string newElement_0_systemModeCtorSignature = "(I)V"; + jint jninewElement_0_systemMode = static_cast(entry_0.systemMode); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_systemModeClassName.c_str(), + newElement_0_systemModeCtorSignature.c_str(), + jninewElement_0_systemMode, newElement_0_systemMode); + jobject newElement_0_numberOfSchedules; + std::string newElement_0_numberOfSchedulesClassName = "java/lang/Integer"; + std::string newElement_0_numberOfSchedulesCtorSignature = "(I)V"; + jint jninewElement_0_numberOfSchedules = static_cast(entry_0.numberOfSchedules); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_numberOfSchedulesClassName.c_str(), newElement_0_numberOfSchedulesCtorSignature.c_str(), + jninewElement_0_numberOfSchedules, newElement_0_numberOfSchedules); + jobject newElement_0_scheduleTypeFeatures; + std::string newElement_0_scheduleTypeFeaturesClassName = "java/lang/Integer"; + std::string newElement_0_scheduleTypeFeaturesCtorSignature = "(I)V"; + jint jninewElement_0_scheduleTypeFeatures = static_cast(entry_0.scheduleTypeFeatures.Raw()); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_scheduleTypeFeaturesClassName.c_str(), newElement_0_scheduleTypeFeaturesCtorSignature.c_str(), + jninewElement_0_scheduleTypeFeatures, newElement_0_scheduleTypeFeatures); + + jclass scheduleTypeStructStructClass_1; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$ThermostatClusterScheduleTypeStruct", scheduleTypeStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ThermostatClusterScheduleTypeStruct"); + return; + } + + jmethodID scheduleTypeStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, scheduleTypeStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V", + &scheduleTypeStructStructCtor_1); + if (err != CHIP_NO_ERROR || scheduleTypeStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ThermostatClusterScheduleTypeStruct constructor"); + return; + } + + newElement_0 = env->NewObject(scheduleTypeStructStructClass_1, scheduleTypeStructStructCtor_1, newElement_0_systemMode, + newElement_0_numberOfSchedules, newElement_0_scheduleTypeFeatures); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPThermostatNumberOfScheduleTransitionPerDayAttributeCallback::CHIPThermostatNumberOfScheduleTransitionPerDayAttributeCallback( + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPThermostatNumberOfScheduleTransitionPerDayAttributeCallback::~CHIPThermostatNumberOfScheduleTransitionPerDayAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPThermostatNumberOfScheduleTransitionPerDayAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::Nullable & value) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + if (value.IsNull()) + { + javaValue = nullptr; + } + else + { + std::string javaValueClassName = "java/lang/Integer"; + std::string javaValueCtorSignature = "(I)V"; + jint jnijavaValue = static_cast(value.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), + jnijavaValue, javaValue); + } + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPThermostatActivePresetHandleAttributeCallback::CHIPThermostatActivePresetHandleAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPThermostatActivePresetHandleAttributeCallback::~CHIPThermostatActivePresetHandleAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPThermostatActivePresetHandleAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::Nullable & value) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "([B)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + if (value.IsNull()) + { + javaValue = nullptr; + } + else + { + jbyteArray javaValueByteArray = env->NewByteArray(static_cast(value.Value().size())); + env->SetByteArrayRegion(javaValueByteArray, 0, static_cast(value.Value().size()), + reinterpret_cast(value.Value().data())); + javaValue = javaValueByteArray; + } + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPThermostatActiveScheduleHandleAttributeCallback::CHIPThermostatActiveScheduleHandleAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPThermostatActiveScheduleHandleAttributeCallback::~CHIPThermostatActiveScheduleHandleAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPThermostatActiveScheduleHandleAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::Nullable & value) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "([B)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + if (value.IsNull()) + { + javaValue = nullptr; + } + else + { + jbyteArray javaValueByteArray = env->NewByteArray(static_cast(value.Value().size())); + env->SetByteArrayRegion(javaValueByteArray, 0, static_cast(value.Value().size()), + reinterpret_cast(value.Value().data())); + javaValue = javaValueByteArray; + } + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPThermostatPresetsAttributeCallback::CHIPThermostatPresetsAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPThermostatPresetsAttributeCallback::~CHIPThermostatPresetsAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPThermostatPresetsAttributeCallback::CallbackFn( + void * context, + const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + jobject newElement_0_presetHandle; + if (entry_0.presetHandle.IsNull()) + { + newElement_0_presetHandle = nullptr; + } + else + { + jbyteArray newElement_0_presetHandleByteArray = + env->NewByteArray(static_cast(entry_0.presetHandle.Value().size())); + env->SetByteArrayRegion(newElement_0_presetHandleByteArray, 0, static_cast(entry_0.presetHandle.Value().size()), + reinterpret_cast(entry_0.presetHandle.Value().data())); + newElement_0_presetHandle = newElement_0_presetHandleByteArray; + } + jobject newElement_0_presetScenario; + std::string newElement_0_presetScenarioClassName = "java/lang/Integer"; + std::string newElement_0_presetScenarioCtorSignature = "(I)V"; + jint jninewElement_0_presetScenario = static_cast(entry_0.presetScenario); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_presetScenarioClassName.c_str(), + newElement_0_presetScenarioCtorSignature.c_str(), + jninewElement_0_presetScenario, newElement_0_presetScenario); + jobject newElement_0_name; + if (!entry_0.name.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_name); + } + else + { + jobject newElement_0_nameInsideOptional; + if (entry_0.name.Value().IsNull()) + { + newElement_0_nameInsideOptional = nullptr; + } + else + { + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.name.Value().Value(), + newElement_0_nameInsideOptional)); + } + chip::JniReferences::GetInstance().CreateOptional(newElement_0_nameInsideOptional, newElement_0_name); + } + jobject newElement_0_coolingSetpoint; + if (!entry_0.coolingSetpoint.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_coolingSetpoint); + } + else + { + jobject newElement_0_coolingSetpointInsideOptional; + std::string newElement_0_coolingSetpointInsideOptionalClassName = "java/lang/Integer"; + std::string newElement_0_coolingSetpointInsideOptionalCtorSignature = "(I)V"; + jint jninewElement_0_coolingSetpointInsideOptional = static_cast(entry_0.coolingSetpoint.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_coolingSetpointInsideOptionalClassName.c_str(), + newElement_0_coolingSetpointInsideOptionalCtorSignature.c_str(), jninewElement_0_coolingSetpointInsideOptional, + newElement_0_coolingSetpointInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(newElement_0_coolingSetpointInsideOptional, + newElement_0_coolingSetpoint); + } + jobject newElement_0_heatingSetpoint; + if (!entry_0.heatingSetpoint.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_heatingSetpoint); + } + else + { + jobject newElement_0_heatingSetpointInsideOptional; + std::string newElement_0_heatingSetpointInsideOptionalClassName = "java/lang/Integer"; + std::string newElement_0_heatingSetpointInsideOptionalCtorSignature = "(I)V"; + jint jninewElement_0_heatingSetpointInsideOptional = static_cast(entry_0.heatingSetpoint.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_heatingSetpointInsideOptionalClassName.c_str(), + newElement_0_heatingSetpointInsideOptionalCtorSignature.c_str(), jninewElement_0_heatingSetpointInsideOptional, + newElement_0_heatingSetpointInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(newElement_0_heatingSetpointInsideOptional, + newElement_0_heatingSetpoint); + } + jobject newElement_0_builtIn; + if (entry_0.builtIn.IsNull()) + { + newElement_0_builtIn = nullptr; + } + else + { + std::string newElement_0_builtInClassName = "java/lang/Boolean"; + std::string newElement_0_builtInCtorSignature = "(Z)V"; + jboolean jninewElement_0_builtIn = static_cast(entry_0.builtIn.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_builtInClassName.c_str(), + newElement_0_builtInCtorSignature.c_str(), + jninewElement_0_builtIn, newElement_0_builtIn); + } + + jclass presetStructStructClass_1; + err = chip::JniReferences::GetInstance().GetClassRef(env, "chip/devicecontroller/ChipStructs$ThermostatClusterPresetStruct", + presetStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ThermostatClusterPresetStruct"); + return; + } + + jmethodID presetStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, presetStructStructClass_1, "", + "([BLjava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/lang/Boolean;)V", + &presetStructStructCtor_1); + if (err != CHIP_NO_ERROR || presetStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ThermostatClusterPresetStruct constructor"); + return; + } + + newElement_0 = env->NewObject(presetStructStructClass_1, presetStructStructCtor_1, newElement_0_presetHandle, + newElement_0_presetScenario, newElement_0_name, newElement_0_coolingSetpoint, + newElement_0_heatingSetpoint, newElement_0_builtIn); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPThermostatSchedulesAttributeCallback::CHIPThermostatSchedulesAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPThermostatSchedulesAttributeCallback::~CHIPThermostatSchedulesAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPThermostatSchedulesAttributeCallback::CallbackFn( + void * context, + const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + jobject newElement_0_scheduleHandle; + if (entry_0.scheduleHandle.IsNull()) + { + newElement_0_scheduleHandle = nullptr; + } + else + { + jbyteArray newElement_0_scheduleHandleByteArray = + env->NewByteArray(static_cast(entry_0.scheduleHandle.Value().size())); + env->SetByteArrayRegion(newElement_0_scheduleHandleByteArray, 0, + static_cast(entry_0.scheduleHandle.Value().size()), + reinterpret_cast(entry_0.scheduleHandle.Value().data())); + newElement_0_scheduleHandle = newElement_0_scheduleHandleByteArray; + } + jobject newElement_0_systemMode; + std::string newElement_0_systemModeClassName = "java/lang/Integer"; + std::string newElement_0_systemModeCtorSignature = "(I)V"; + jint jninewElement_0_systemMode = static_cast(entry_0.systemMode); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_systemModeClassName.c_str(), + newElement_0_systemModeCtorSignature.c_str(), + jninewElement_0_systemMode, newElement_0_systemMode); + jobject newElement_0_name; + if (!entry_0.name.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_name); + } + else + { + jobject newElement_0_nameInsideOptional; + LogErrorOnFailure( + chip::JniReferences::GetInstance().CharToStringUTF(entry_0.name.Value(), newElement_0_nameInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(newElement_0_nameInsideOptional, newElement_0_name); + } + jobject newElement_0_presetHandle; + if (!entry_0.presetHandle.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_presetHandle); + } + else + { + jobject newElement_0_presetHandleInsideOptional; + jbyteArray newElement_0_presetHandleInsideOptionalByteArray = + env->NewByteArray(static_cast(entry_0.presetHandle.Value().size())); + env->SetByteArrayRegion(newElement_0_presetHandleInsideOptionalByteArray, 0, + static_cast(entry_0.presetHandle.Value().size()), + reinterpret_cast(entry_0.presetHandle.Value().data())); + newElement_0_presetHandleInsideOptional = newElement_0_presetHandleInsideOptionalByteArray; + chip::JniReferences::GetInstance().CreateOptional(newElement_0_presetHandleInsideOptional, newElement_0_presetHandle); + } + jobject newElement_0_transitions; + chip::JniReferences::GetInstance().CreateArrayList(newElement_0_transitions); + + auto iter_newElement_0_transitions_2 = entry_0.transitions.begin(); + while (iter_newElement_0_transitions_2.Next()) + { + auto & entry_2 = iter_newElement_0_transitions_2.GetValue(); + jobject newElement_2; + jobject newElement_2_dayOfWeek; + std::string newElement_2_dayOfWeekClassName = "java/lang/Integer"; + std::string newElement_2_dayOfWeekCtorSignature = "(I)V"; + jint jninewElement_2_dayOfWeek = static_cast(entry_2.dayOfWeek.Raw()); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_2_dayOfWeekClassName.c_str(), + newElement_2_dayOfWeekCtorSignature.c_str(), + jninewElement_2_dayOfWeek, newElement_2_dayOfWeek); + jobject newElement_2_transitionTime; + std::string newElement_2_transitionTimeClassName = "java/lang/Integer"; + std::string newElement_2_transitionTimeCtorSignature = "(I)V"; + jint jninewElement_2_transitionTime = static_cast(entry_2.transitionTime); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_2_transitionTimeClassName.c_str(), + newElement_2_transitionTimeCtorSignature.c_str(), + jninewElement_2_transitionTime, newElement_2_transitionTime); + jobject newElement_2_presetHandle; + if (!entry_2.presetHandle.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_2_presetHandle); + } + else + { + jobject newElement_2_presetHandleInsideOptional; + jbyteArray newElement_2_presetHandleInsideOptionalByteArray = + env->NewByteArray(static_cast(entry_2.presetHandle.Value().size())); + env->SetByteArrayRegion(newElement_2_presetHandleInsideOptionalByteArray, 0, + static_cast(entry_2.presetHandle.Value().size()), + reinterpret_cast(entry_2.presetHandle.Value().data())); + newElement_2_presetHandleInsideOptional = newElement_2_presetHandleInsideOptionalByteArray; + chip::JniReferences::GetInstance().CreateOptional(newElement_2_presetHandleInsideOptional, + newElement_2_presetHandle); + } + jobject newElement_2_systemMode; + if (!entry_2.systemMode.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_2_systemMode); + } + else + { + jobject newElement_2_systemModeInsideOptional; + std::string newElement_2_systemModeInsideOptionalClassName = "java/lang/Integer"; + std::string newElement_2_systemModeInsideOptionalCtorSignature = "(I)V"; + jint jninewElement_2_systemModeInsideOptional = static_cast(entry_2.systemMode.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_2_systemModeInsideOptionalClassName.c_str(), + newElement_2_systemModeInsideOptionalCtorSignature.c_str(), jninewElement_2_systemModeInsideOptional, + newElement_2_systemModeInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(newElement_2_systemModeInsideOptional, newElement_2_systemMode); + } + jobject newElement_2_coolingSetpoint; + if (!entry_2.coolingSetpoint.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_2_coolingSetpoint); + } + else + { + jobject newElement_2_coolingSetpointInsideOptional; + std::string newElement_2_coolingSetpointInsideOptionalClassName = "java/lang/Integer"; + std::string newElement_2_coolingSetpointInsideOptionalCtorSignature = "(I)V"; + jint jninewElement_2_coolingSetpointInsideOptional = static_cast(entry_2.coolingSetpoint.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_2_coolingSetpointInsideOptionalClassName.c_str(), + newElement_2_coolingSetpointInsideOptionalCtorSignature.c_str(), jninewElement_2_coolingSetpointInsideOptional, + newElement_2_coolingSetpointInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(newElement_2_coolingSetpointInsideOptional, + newElement_2_coolingSetpoint); + } + jobject newElement_2_heatingSetpoint; + if (!entry_2.heatingSetpoint.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_2_heatingSetpoint); + } + else + { + jobject newElement_2_heatingSetpointInsideOptional; + std::string newElement_2_heatingSetpointInsideOptionalClassName = "java/lang/Integer"; + std::string newElement_2_heatingSetpointInsideOptionalCtorSignature = "(I)V"; + jint jninewElement_2_heatingSetpointInsideOptional = static_cast(entry_2.heatingSetpoint.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_2_heatingSetpointInsideOptionalClassName.c_str(), + newElement_2_heatingSetpointInsideOptionalCtorSignature.c_str(), jninewElement_2_heatingSetpointInsideOptional, + newElement_2_heatingSetpointInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(newElement_2_heatingSetpointInsideOptional, + newElement_2_heatingSetpoint); + } + + jclass scheduleTransitionStructStructClass_3; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$ThermostatClusterScheduleTransitionStruct", + scheduleTransitionStructStructClass_3); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ThermostatClusterScheduleTransitionStruct"); + return; + } + + jmethodID scheduleTransitionStructStructCtor_3; + err = chip::JniReferences::GetInstance().FindMethod(env, scheduleTransitionStructStructClass_3, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/Optional;Ljava/" + "util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", + &scheduleTransitionStructStructCtor_3); + if (err != CHIP_NO_ERROR || scheduleTransitionStructStructCtor_3 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ThermostatClusterScheduleTransitionStruct constructor"); + return; + } + + newElement_2 = env->NewObject(scheduleTransitionStructStructClass_3, scheduleTransitionStructStructCtor_3, + newElement_2_dayOfWeek, newElement_2_transitionTime, newElement_2_presetHandle, + newElement_2_systemMode, newElement_2_coolingSetpoint, newElement_2_heatingSetpoint); + chip::JniReferences::GetInstance().AddToList(newElement_0_transitions, newElement_2); + } + jobject newElement_0_builtIn; + if (!entry_0.builtIn.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_builtIn); + } + 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(entry_0.builtIn.Value().Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + 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); + } + + jclass scheduleStructStructClass_1; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$ThermostatClusterScheduleStruct", scheduleStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ThermostatClusterScheduleStruct"); + return; + } + + jmethodID scheduleStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, scheduleStructStructClass_1, "", + "([BLjava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/ArrayList;Ljava/util/Optional;)V", + &scheduleStructStructCtor_1); + if (err != CHIP_NO_ERROR || scheduleStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ThermostatClusterScheduleStruct constructor"); + return; + } + + newElement_0 = env->NewObject(scheduleStructStructClass_1, scheduleStructStructCtor_1, newElement_0_scheduleHandle, + newElement_0_systemMode, newElement_0_name, newElement_0_presetHandle, + newElement_0_transitions, newElement_0_builtIn); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPThermostatSetpointHoldExpiryTimestampAttributeCallback::CHIPThermostatSetpointHoldExpiryTimestampAttributeCallback( + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPThermostatSetpointHoldExpiryTimestampAttributeCallback::~CHIPThermostatSetpointHoldExpiryTimestampAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPThermostatSetpointHoldExpiryTimestampAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::Nullable & value) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Long;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + if (value.IsNull()) + { + javaValue = nullptr; + } + else + { + std::string javaValueClassName = "java/lang/Long"; + std::string javaValueCtorSignature = "(J)V"; + jlong jnijavaValue = static_cast(value.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), + jnijavaValue, javaValue); + } + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + CHIPThermostatGeneratedCommandListAttributeCallback::CHIPThermostatGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index 7954593df97171..ed3abef0aef44a 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -8112,6 +8112,53 @@ class ChipClusters: "args": { }, }, + 0x00000005: { + "commandId": 0x00000005, + "commandName": "SetActiveScheduleRequest", + "args": { + "scheduleHandle": "bytes", + }, + }, + 0x00000006: { + "commandId": 0x00000006, + "commandName": "SetActivePresetRequest", + "args": { + "presetHandle": "bytes", + "delayMinutes": "int", + }, + }, + 0x00000007: { + "commandId": 0x00000007, + "commandName": "StartPresetsSchedulesEditRequest", + "args": { + "timeoutSeconds": "int", + }, + }, + 0x00000008: { + "commandId": 0x00000008, + "commandName": "CancelPresetsSchedulesEditRequest", + "args": { + }, + }, + 0x00000009: { + "commandId": 0x00000009, + "commandName": "CommitPresetsSchedulesRequest", + "args": { + }, + }, + 0x0000000A: { + "commandId": 0x0000000A, + "commandName": "CancelSetActivePresetRequest", + "args": { + }, + }, + 0x0000000B: { + "commandId": 0x0000000B, + "commandName": "SetTemperatureSetpointHoldPolicy", + "args": { + "temperatureSetpointHoldPolicy": "int", + }, + }, }, "attributes": { 0x00000000: { @@ -8435,6 +8482,92 @@ class ChipClusters: "reportable": True, "writable": True, }, + 0x00000048: { + "attributeName": "PresetTypes", + "attributeId": 0x00000048, + "type": "", + "reportable": True, + }, + 0x00000049: { + "attributeName": "ScheduleTypes", + "attributeId": 0x00000049, + "type": "", + "reportable": True, + }, + 0x0000004A: { + "attributeName": "NumberOfPresets", + "attributeId": 0x0000004A, + "type": "int", + "reportable": True, + }, + 0x0000004B: { + "attributeName": "NumberOfSchedules", + "attributeId": 0x0000004B, + "type": "int", + "reportable": True, + }, + 0x0000004C: { + "attributeName": "NumberOfScheduleTransitions", + "attributeId": 0x0000004C, + "type": "int", + "reportable": True, + }, + 0x0000004D: { + "attributeName": "NumberOfScheduleTransitionPerDay", + "attributeId": 0x0000004D, + "type": "int", + "reportable": True, + }, + 0x0000004E: { + "attributeName": "ActivePresetHandle", + "attributeId": 0x0000004E, + "type": "bytes", + "reportable": True, + }, + 0x0000004F: { + "attributeName": "ActiveScheduleHandle", + "attributeId": 0x0000004F, + "type": "bytes", + "reportable": True, + }, + 0x00000050: { + "attributeName": "Presets", + "attributeId": 0x00000050, + "type": "", + "reportable": True, + "writable": True, + }, + 0x00000051: { + "attributeName": "Schedules", + "attributeId": 0x00000051, + "type": "", + "reportable": True, + "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, + "type": "int", + "reportable": True, + }, + 0x00000055: { + "attributeName": "QueuedPreset", + "attributeId": 0x00000055, + "type": "", + "reportable": True, + }, 0x0000FFF8: { "attributeName": "GeneratedCommandList", "attributeId": 0x0000FFF8, diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 9d62cf5eba9b40..c5f991fb7cdb18 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -29143,6 +29143,20 @@ def descriptor(cls) -> ClusterObjectDescriptor: 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="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]), + ClusterObjectFieldDescriptor(Label="numberOfSchedules", Tag=0x0000004B, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="numberOfScheduleTransitions", Tag=0x0000004C, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="numberOfScheduleTransitionPerDay", Tag=0x0000004D, Type=typing.Union[None, Nullable, uint]), + ClusterObjectFieldDescriptor(Label="activePresetHandle", Tag=0x0000004E, Type=typing.Union[None, Nullable, bytes]), + 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="queuedPreset", Tag=0x00000055, Type=typing.Union[None, Nullable, Thermostat.Structs.QueuedPresetStruct]), 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]), @@ -29200,6 +29214,20 @@ def descriptor(cls) -> ClusterObjectDescriptor: ACLouverPosition: 'typing.Optional[Thermostat.Enums.ACLouverPositionEnum]' = None ACCoilTemperature: 'typing.Union[None, Nullable, int]' = 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 + numberOfSchedules: 'typing.Optional[uint]' = None + numberOfScheduleTransitions: 'typing.Optional[uint]' = None + numberOfScheduleTransitionPerDay: 'typing.Union[None, Nullable, uint]' = None + activePresetHandle: 'typing.Union[None, Nullable, bytes]' = None + 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 + queuedPreset: 'typing.Union[None, Nullable, Thermostat.Structs.QueuedPresetStruct]' = None generatedCommandList: 'typing.List[uint]' = None acceptedCommandList: 'typing.List[uint]' = None eventList: 'typing.List[uint]' = None @@ -29275,6 +29303,20 @@ class ControlSequenceOfOperationEnum(MatterIntEnum): # enum value. This specific should never be transmitted. kUnknownEnumValue = 6, + class PresetScenarioEnum(MatterIntEnum): + kUnspecified = 0x00 + kOccupied = 0x01 + kUnoccupied = 0x02 + kSleep = 0x03 + kWake = 0x04 + kVacation = 0x05 + kUserDefined = 0x06 + # 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, + class SetpointChangeSourceEnum(MatterIntEnum): kManual = 0x00 kSchedule = 0x01 @@ -29360,6 +29402,10 @@ class Feature(IntFlag): kSetback = 0x10 kAutoMode = 0x20 kLocalTemperatureNotExposed = 0x40 + kMatterScheduleConfiguration = 0x80 + kPresets = 0x100 + kSetpoints = 0x200 + kQueuedPresetsSupported = 0x400 class HVACSystemTypeBitmap(IntFlag): kCoolingStage = 0x3 @@ -29367,6 +29413,10 @@ class HVACSystemTypeBitmap(IntFlag): kHeatingIsHeatPump = 0x10 kHeatingUsesFuel = 0x20 + class PresetTypeFeaturesBitmap(IntFlag): + kAutomatic = 0x1 + kSupportsNames = 0x2 + class ProgrammingOperationModeBitmap(IntFlag): kScheduleActive = 0x1 kAutoRecovery = 0x2 @@ -29400,7 +29450,123 @@ class ScheduleModeBitmap(IntFlag): kHeatSetpointPresent = 0x1 kCoolSetpointPresent = 0x2 + class ScheduleTypeFeaturesBitmap(IntFlag): + kSupportsPresets = 0x1 + kSupportsSetpoints = 0x2 + kSupportsNames = 0x4 + kSupportsOff = 0x8 + + class TemperatureSetpointHoldPolicyBitmap(IntFlag): + kHoldDurationElapsed = 0x1 + kHoldDurationElapsedOrPresetChanged = 0x2 + class Structs: + @dataclass + class ScheduleTransitionStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="dayOfWeek", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="transitionTime", Tag=1, Type=uint), + ClusterObjectFieldDescriptor(Label="presetHandle", Tag=2, Type=typing.Optional[bytes]), + ClusterObjectFieldDescriptor(Label="systemMode", Tag=3, Type=typing.Optional[Thermostat.Enums.SystemModeEnum]), + ClusterObjectFieldDescriptor(Label="coolingSetpoint", Tag=4, Type=typing.Optional[int]), + ClusterObjectFieldDescriptor(Label="heatingSetpoint", Tag=5, Type=typing.Optional[int]), + ]) + + dayOfWeek: 'uint' = 0 + transitionTime: 'uint' = 0 + presetHandle: 'typing.Optional[bytes]' = None + systemMode: 'typing.Optional[Thermostat.Enums.SystemModeEnum]' = None + coolingSetpoint: 'typing.Optional[int]' = None + heatingSetpoint: 'typing.Optional[int]' = None + + @dataclass + class ScheduleStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="scheduleHandle", Tag=0, Type=typing.Union[Nullable, bytes]), + ClusterObjectFieldDescriptor(Label="systemMode", Tag=1, Type=Thermostat.Enums.SystemModeEnum), + 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]), + ]) + + scheduleHandle: 'typing.Union[Nullable, bytes]' = NullValue + systemMode: 'Thermostat.Enums.SystemModeEnum' = 0 + 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 + + @dataclass + class PresetStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="presetHandle", Tag=0, Type=typing.Union[Nullable, bytes]), + ClusterObjectFieldDescriptor(Label="presetScenario", Tag=1, Type=Thermostat.Enums.PresetScenarioEnum), + ClusterObjectFieldDescriptor(Label="name", Tag=2, Type=typing.Union[None, Nullable, str]), + ClusterObjectFieldDescriptor(Label="coolingSetpoint", Tag=3, Type=typing.Optional[int]), + ClusterObjectFieldDescriptor(Label="heatingSetpoint", Tag=4, Type=typing.Optional[int]), + ClusterObjectFieldDescriptor(Label="builtIn", Tag=5, Type=typing.Union[Nullable, bool]), + ]) + + presetHandle: 'typing.Union[Nullable, bytes]' = NullValue + presetScenario: 'Thermostat.Enums.PresetScenarioEnum' = 0 + name: 'typing.Union[None, Nullable, str]' = None + coolingSetpoint: 'typing.Optional[int]' = None + heatingSetpoint: 'typing.Optional[int]' = None + builtIn: 'typing.Union[Nullable, bool]' = NullValue + + @dataclass + class PresetTypeStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="presetScenario", Tag=0, Type=Thermostat.Enums.PresetScenarioEnum), + ClusterObjectFieldDescriptor(Label="numberOfPresets", Tag=1, Type=uint), + ClusterObjectFieldDescriptor(Label="presetTypeFeatures", Tag=2, Type=uint), + ]) + + presetScenario: 'Thermostat.Enums.PresetScenarioEnum' = 0 + numberOfPresets: 'uint' = 0 + presetTypeFeatures: 'uint' = 0 + + @dataclass + class QueuedPresetStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="presetHandle", Tag=0, Type=typing.Union[Nullable, bytes]), + ClusterObjectFieldDescriptor(Label="transitionTimestamp", Tag=1, Type=typing.Union[Nullable, uint]), + ]) + + presetHandle: 'typing.Union[Nullable, bytes]' = NullValue + transitionTimestamp: 'typing.Union[Nullable, uint]' = NullValue + + @dataclass + class ScheduleTypeStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="systemMode", Tag=0, Type=Thermostat.Enums.SystemModeEnum), + ClusterObjectFieldDescriptor(Label="numberOfSchedules", Tag=1, Type=uint), + ClusterObjectFieldDescriptor(Label="scheduleTypeFeatures", Tag=2, Type=uint), + ]) + + systemMode: 'Thermostat.Enums.SystemModeEnum' = 0 + numberOfSchedules: 'uint' = 0 + scheduleTypeFeatures: 'uint' = 0 + @dataclass class WeeklyScheduleTransitionStruct(ClusterObject): @ChipUtility.classproperty @@ -29510,6 +29676,111 @@ def descriptor(cls) -> ClusterObjectDescriptor: Fields=[ ]) + @dataclass + class SetActiveScheduleRequest(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000201 + command_id: typing.ClassVar[int] = 0x00000005 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="scheduleHandle", Tag=0, Type=bytes), + ]) + + scheduleHandle: 'bytes' = b"" + + @dataclass + class SetActivePresetRequest(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000201 + command_id: typing.ClassVar[int] = 0x00000006 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="presetHandle", Tag=0, Type=bytes), + ClusterObjectFieldDescriptor(Label="delayMinutes", Tag=1, Type=typing.Optional[uint]), + ]) + + presetHandle: 'bytes' = b"" + delayMinutes: 'typing.Optional[uint]' = None + + @dataclass + class StartPresetsSchedulesEditRequest(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 + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ]) + + @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=[ + ]) + + @dataclass + class CancelSetActivePresetRequest(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000201 + command_id: typing.ClassVar[int] = 0x0000000A + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ]) + + @dataclass + class SetTemperatureSetpointHoldPolicy(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000201 + command_id: typing.ClassVar[int] = 0x0000000B + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="temperatureSetpointHoldPolicy", Tag=0, Type=uint), + ]) + + temperatureSetpointHoldPolicy: 'uint' = 0 + class Attributes: @dataclass class LocalTemperature(ClusterAttributeDescriptor): @@ -30295,6 +30566,230 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: value: 'typing.Optional[Thermostat.Enums.ACCapacityFormatEnum]' = None + @dataclass + class PresetTypes(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000201 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000048 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[typing.List[Thermostat.Structs.PresetTypeStruct]]) + + value: 'typing.Optional[typing.List[Thermostat.Structs.PresetTypeStruct]]' = None + + @dataclass + class ScheduleTypes(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000201 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000049 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[typing.List[Thermostat.Structs.ScheduleTypeStruct]]) + + value: 'typing.Optional[typing.List[Thermostat.Structs.ScheduleTypeStruct]]' = None + + @dataclass + class NumberOfPresets(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000201 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000004A + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + + value: 'typing.Optional[uint]' = None + + @dataclass + class NumberOfSchedules(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000201 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000004B + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + + value: 'typing.Optional[uint]' = None + + @dataclass + class NumberOfScheduleTransitions(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000201 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000004C + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + + value: 'typing.Optional[uint]' = None + + @dataclass + class NumberOfScheduleTransitionPerDay(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000201 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000004D + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, uint]) + + value: 'typing.Union[None, Nullable, uint]' = None + + @dataclass + class ActivePresetHandle(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000201 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000004E + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, bytes]) + + value: 'typing.Union[None, Nullable, bytes]' = None + + @dataclass + class ActiveScheduleHandle(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000201 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000004F + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, bytes]) + + value: 'typing.Union[None, Nullable, bytes]' = None + + @dataclass + class Presets(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000201 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000050 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[typing.List[Thermostat.Structs.PresetStruct]]) + + value: 'typing.Optional[typing.List[Thermostat.Structs.PresetStruct]]' = None + + @dataclass + class Schedules(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000201 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000051 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[typing.List[Thermostat.Structs.ScheduleStruct]]) + + 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 + def cluster_id(cls) -> int: + return 0x00000201 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000054 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, uint]) + + value: 'typing.Union[None, Nullable, uint]' = None + + @dataclass + class QueuedPreset(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000201 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000055 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, Thermostat.Structs.QueuedPresetStruct]) + + value: 'typing.Union[None, Nullable, Thermostat.Structs.QueuedPresetStruct]' = None + @dataclass class GeneratedCommandList(ClusterAttributeDescriptor): @ChipUtility.classproperty diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm index b8c6f1a59ac4bb..c207685fabade6 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm @@ -3777,6 +3777,48 @@ static BOOL AttributeIsSpecifiedInThermostatCluster(AttributeId aAttributeId) case Attributes::ACCapacityformat::Id: { return YES; } + case Attributes::PresetTypes::Id: { + return YES; + } + case Attributes::ScheduleTypes::Id: { + return YES; + } + case Attributes::NumberOfPresets::Id: { + return YES; + } + case Attributes::NumberOfSchedules::Id: { + return YES; + } + case Attributes::NumberOfScheduleTransitions::Id: { + return YES; + } + case Attributes::NumberOfScheduleTransitionPerDay::Id: { + return YES; + } + case Attributes::ActivePresetHandle::Id: { + return YES; + } + case Attributes::ActiveScheduleHandle::Id: { + return YES; + } + case Attributes::Presets::Id: { + return YES; + } + case Attributes::Schedules::Id: { + return YES; + } + case Attributes::PresetsSchedulesEditable::Id: { + return YES; + } + case Attributes::TemperatureSetpointHoldPolicy::Id: { + return YES; + } + case Attributes::SetpointHoldExpiryTimestamp::Id: { + return YES; + } + case Attributes::QueuedPreset::Id: { + return YES; + } case Attributes::GeneratedCommandList::Id: { return YES; } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm index 20633dafe53b0c..8c7df4c32cf1b0 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -10863,6 +10863,359 @@ static id _Nullable DecodeAttributeValueForThermostatCluster(AttributeId aAttrib value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } + case Attributes::PresetTypes::Id: { + using TypeInfo = Attributes::PresetTypes::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRThermostatClusterPresetTypeStruct * newElement_0; + newElement_0 = [MTRThermostatClusterPresetTypeStruct new]; + newElement_0.presetScenario = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.presetScenario)]; + newElement_0.numberOfPresets = [NSNumber numberWithUnsignedChar:entry_0.numberOfPresets]; + newElement_0.presetTypeFeatures = [NSNumber numberWithUnsignedShort:entry_0.presetTypeFeatures.Raw()]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } + return value; + } + case Attributes::ScheduleTypes::Id: { + using TypeInfo = Attributes::ScheduleTypes::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRThermostatClusterScheduleTypeStruct * newElement_0; + newElement_0 = [MTRThermostatClusterScheduleTypeStruct new]; + newElement_0.systemMode = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.systemMode)]; + newElement_0.numberOfSchedules = [NSNumber numberWithUnsignedChar:entry_0.numberOfSchedules]; + newElement_0.scheduleTypeFeatures = [NSNumber numberWithUnsignedShort:entry_0.scheduleTypeFeatures.Raw()]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } + return value; + } + case Attributes::NumberOfPresets::Id: { + using TypeInfo = Attributes::NumberOfPresets::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; + return value; + } + case Attributes::NumberOfSchedules::Id: { + using TypeInfo = Attributes::NumberOfSchedules::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; + return value; + } + case Attributes::NumberOfScheduleTransitions::Id: { + using TypeInfo = Attributes::NumberOfScheduleTransitions::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; + return value; + } + case Attributes::NumberOfScheduleTransitionPerDay::Id: { + using TypeInfo = Attributes::NumberOfScheduleTransitionPerDay::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + } + return value; + } + case Attributes::ActivePresetHandle::Id: { + using TypeInfo = Attributes::ActivePresetHandle::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSData * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = AsData(cppValue.Value()); + } + return value; + } + case Attributes::ActiveScheduleHandle::Id: { + using TypeInfo = Attributes::ActiveScheduleHandle::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSData * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = AsData(cppValue.Value()); + } + return value; + } + case Attributes::Presets::Id: { + using TypeInfo = Attributes::Presets::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRThermostatClusterPresetStruct * newElement_0; + newElement_0 = [MTRThermostatClusterPresetStruct new]; + if (entry_0.presetHandle.IsNull()) { + newElement_0.presetHandle = nil; + } else { + newElement_0.presetHandle = AsData(entry_0.presetHandle.Value()); + } + newElement_0.presetScenario = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.presetScenario)]; + if (entry_0.name.HasValue()) { + if (entry_0.name.Value().IsNull()) { + newElement_0.name = nil; + } else { + newElement_0.name = AsString(entry_0.name.Value().Value()); + if (newElement_0.name == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } + } else { + newElement_0.name = nil; + } + if (entry_0.coolingSetpoint.HasValue()) { + newElement_0.coolingSetpoint = [NSNumber numberWithShort:entry_0.coolingSetpoint.Value()]; + } else { + newElement_0.coolingSetpoint = nil; + } + if (entry_0.heatingSetpoint.HasValue()) { + newElement_0.heatingSetpoint = [NSNumber numberWithShort:entry_0.heatingSetpoint.Value()]; + } else { + newElement_0.heatingSetpoint = nil; + } + if (entry_0.builtIn.IsNull()) { + newElement_0.builtIn = nil; + } else { + newElement_0.builtIn = [NSNumber numberWithBool:entry_0.builtIn.Value()]; + } + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } + return value; + } + case Attributes::Schedules::Id: { + using TypeInfo = Attributes::Schedules::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRThermostatClusterScheduleStruct * newElement_0; + newElement_0 = [MTRThermostatClusterScheduleStruct new]; + if (entry_0.scheduleHandle.IsNull()) { + newElement_0.scheduleHandle = nil; + } else { + newElement_0.scheduleHandle = AsData(entry_0.scheduleHandle.Value()); + } + newElement_0.systemMode = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.systemMode)]; + if (entry_0.name.HasValue()) { + newElement_0.name = AsString(entry_0.name.Value()); + if (newElement_0.name == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } else { + newElement_0.name = nil; + } + if (entry_0.presetHandle.HasValue()) { + newElement_0.presetHandle = AsData(entry_0.presetHandle.Value()); + } else { + newElement_0.presetHandle = nil; + } + { // Scope for our temporary variables + auto * array_2 = [NSMutableArray new]; + auto iter_2 = entry_0.transitions.begin(); + while (iter_2.Next()) { + auto & entry_2 = iter_2.GetValue(); + MTRThermostatClusterScheduleTransitionStruct * newElement_2; + newElement_2 = [MTRThermostatClusterScheduleTransitionStruct new]; + newElement_2.dayOfWeek = [NSNumber numberWithUnsignedChar:entry_2.dayOfWeek.Raw()]; + newElement_2.transitionTime = [NSNumber numberWithUnsignedShort:entry_2.transitionTime]; + if (entry_2.presetHandle.HasValue()) { + newElement_2.presetHandle = AsData(entry_2.presetHandle.Value()); + } else { + newElement_2.presetHandle = nil; + } + if (entry_2.systemMode.HasValue()) { + newElement_2.systemMode = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_2.systemMode.Value())]; + } else { + newElement_2.systemMode = nil; + } + if (entry_2.coolingSetpoint.HasValue()) { + newElement_2.coolingSetpoint = [NSNumber numberWithShort:entry_2.coolingSetpoint.Value()]; + } else { + newElement_2.coolingSetpoint = nil; + } + if (entry_2.heatingSetpoint.HasValue()) { + newElement_2.heatingSetpoint = [NSNumber numberWithShort:entry_2.heatingSetpoint.Value()]; + } else { + newElement_2.heatingSetpoint = nil; + } + [array_2 addObject:newElement_2]; + } + CHIP_ERROR err = iter_2.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + 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 { + newElement_0.builtIn = nil; + } + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } + 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; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; + } + return value; + } + case Attributes::QueuedPreset::Id: { + using TypeInfo = Attributes::QueuedPreset::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + MTRThermostatClusterQueuedPresetStruct * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [MTRThermostatClusterQueuedPresetStruct new]; + if (cppValue.Value().presetHandle.IsNull()) { + value.presetHandle = nil; + } else { + value.presetHandle = AsData(cppValue.Value().presetHandle.Value()); + } + if (cppValue.Value().transitionTimestamp.IsNull()) { + value.transitionTimestamp = nil; + } else { + value.transitionTimestamp = [NSNumber numberWithUnsignedInt:cppValue.Value().transitionTimestamp.Value()]; + } + } + return value; + } default: { break; } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index e599bc3d82f804..9854b85861aaaa 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -9146,11 +9146,59 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) /** * Command ClearWeeklySchedule * - * The Clear Weekly Schedule command is used to clear the weekly schedule. + * This command is used to clear the weekly schedule. The ClearWeeklySchedule command has no payload. */ - (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 MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); +/** + * Command SetActiveScheduleRequest + * + * This command is used to set the active schedule. + */ +- (void)setActiveScheduleRequestWithParams:(MTRThermostatClusterSetActiveScheduleRequestParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +/** + * Command SetActivePresetRequest + * + * This command is used to set the active preset. + */ +- (void)setActivePresetRequestWithParams:(MTRThermostatClusterSetActivePresetRequestParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +/** + * Command StartPresetsSchedulesEditRequest + * + * This command is used to start editing the presets and schedules. + */ +- (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 CancelSetActivePresetRequest + * + * This command is sent to cancel a queued preset. + */ +- (void)cancelSetActivePresetRequestWithParams:(MTRThermostatClusterCancelSetActivePresetRequestParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)cancelSetActivePresetRequestWithCompletion:(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)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 @@ -9500,6 +9548,94 @@ 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)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)); +- (void)readAttributePresetTypesWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributePresetTypesWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributePresetTypesWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeScheduleTypesWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeScheduleTypesWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeScheduleTypesWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeNumberOfPresetsWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeNumberOfPresetsWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeNumberOfPresetsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeNumberOfSchedulesWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeNumberOfSchedulesWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeNumberOfSchedulesWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeNumberOfScheduleTransitionsWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeNumberOfScheduleTransitionsWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeNumberOfScheduleTransitionsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeNumberOfScheduleTransitionPerDayWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeNumberOfScheduleTransitionPerDayWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeNumberOfScheduleTransitionPerDayWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeActivePresetHandleWithCompletion:(void (^)(NSData * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeActivePresetHandleWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSData * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeActivePresetHandleWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSData * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeActiveScheduleHandleWithCompletion:(void (^)(NSData * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeActiveScheduleHandleWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSData * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeActiveScheduleHandleWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSData * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributePresetsWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributePresetsWithValue:(NSArray * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributePresetsWithValue:(NSArray * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributePresetsWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributePresetsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeSchedulesWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeSchedulesWithValue:(NSArray * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeSchedulesWithValue:(NSArray * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeSchedulesWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + 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 + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeSetpointHoldExpiryTimestampWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeQueuedPresetWithCompletion:(void (^)(MTRThermostatClusterQueuedPresetStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeQueuedPresetWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(MTRThermostatClusterQueuedPresetStruct * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeQueuedPresetWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTRThermostatClusterQueuedPresetStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); - (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams *)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished @@ -18003,6 +18139,16 @@ typedef NS_ENUM(uint8_t, MTRThermostatControlSequence) { MTRThermostatControlSequenceCoolingAndHeatingWithReheat MTR_DEPRECATED("Please use MTRThermostatControlSequenceOfOperationCoolingAndHeatingWithReheat", ios(16.1, 17.4), macos(13.0, 14.4), watchos(9.1, 10.4), tvos(16.1, 17.4)) = 0x05, } 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, +} MTR_PROVISIONALLY_AVAILABLE; + typedef NS_ENUM(uint8_t, MTRThermostatSetpointChangeSource) { MTRThermostatSetpointChangeSourceManual MTR_PROVISIONALLY_AVAILABLE = 0x00, MTRThermostatSetpointChangeSourceSchedule MTR_PROVISIONALLY_AVAILABLE = 0x01, @@ -18076,6 +18222,10 @@ typedef NS_OPTIONS(uint32_t, MTRThermostatFeature) { MTRThermostatFeatureAutoMode MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x20, MTRThermostatFeatureAutomode MTR_DEPRECATED("Please use MTRThermostatFeatureAutoMode", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)) = 0x20, 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, + MTRThermostatFeatureQueuedPresetsSupported MTR_PROVISIONALLY_AVAILABLE = 0x400, } MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); typedef NS_OPTIONS(uint8_t, MTRThermostatHVACSystemTypeBitmap) { @@ -18085,6 +18235,11 @@ typedef NS_OPTIONS(uint8_t, MTRThermostatHVACSystemTypeBitmap) { MTRThermostatHVACSystemTypeBitmapHeatingUsesFuel MTR_PROVISIONALLY_AVAILABLE = 0x20, } MTR_PROVISIONALLY_AVAILABLE; +typedef NS_OPTIONS(uint16_t, MTRThermostatPresetTypeFeaturesBitmap) { + MTRThermostatPresetTypeFeaturesBitmapAutomatic MTR_PROVISIONALLY_AVAILABLE = 0x1, + MTRThermostatPresetTypeFeaturesBitmapSupportsNames MTR_PROVISIONALLY_AVAILABLE = 0x2, +} MTR_PROVISIONALLY_AVAILABLE; + typedef NS_OPTIONS(uint8_t, MTRThermostatProgrammingOperationModeBitmap) { MTRThermostatProgrammingOperationModeBitmapScheduleActive MTR_PROVISIONALLY_AVAILABLE = 0x1, MTRThermostatProgrammingOperationModeBitmapAutoRecovery MTR_PROVISIONALLY_AVAILABLE = 0x2, @@ -18142,6 +18297,18 @@ typedef NS_OPTIONS(uint8_t, MTRThermostatModeForSequence) { MTRThermostatModeForSequenceCoolSetpointFieldPresent MTR_DEPRECATED("Please use MTRThermostatScheduleModeBitmapCoolSetpointPresent", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)) = 0x2, } MTR_DEPRECATED("Please use MTRThermostatScheduleModeBitmap", ios(16.1, 17.4), macos(13.0, 14.4), watchos(9.1, 10.4), tvos(16.1, 17.4)); +typedef NS_OPTIONS(uint16_t, MTRThermostatScheduleTypeFeaturesBitmap) { + MTRThermostatScheduleTypeFeaturesBitmapSupportsPresets MTR_PROVISIONALLY_AVAILABLE = 0x1, + MTRThermostatScheduleTypeFeaturesBitmapSupportsSetpoints MTR_PROVISIONALLY_AVAILABLE = 0x2, + MTRThermostatScheduleTypeFeaturesBitmapSupportsNames MTR_PROVISIONALLY_AVAILABLE = 0x4, + 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_PROVISIONALLY_AVAILABLE = 0x00, MTRFanControlAirflowDirectionReverse MTR_PROVISIONALLY_AVAILABLE = 0x01, diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index c91da32da25ad3..aeed364a5986b8 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -64576,6 +64576,186 @@ - (void)clearWeeklyScheduleWithParams:(MTRThermostatClusterClearWeeklySchedulePa queue:self.callbackQueue completion:responseHandler]; } +- (void)setActiveScheduleRequestWithParams:(MTRThermostatClusterSetActiveScheduleRequestParams *)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRThermostatClusterSetActiveScheduleRequestParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = Thermostat::Commands::SetActiveScheduleRequest::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} +- (void)setActivePresetRequestWithParams:(MTRThermostatClusterSetActivePresetRequestParams *)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRThermostatClusterSetActivePresetRequestParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = Thermostat::Commands::SetActivePresetRequest::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} +- (void)startPresetsSchedulesEditRequestWithParams:(MTRThermostatClusterStartPresetsSchedulesEditRequestParams *)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRThermostatClusterStartPresetsSchedulesEditRequestParams + 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.endpoint) + 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.endpoint) + 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.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} +- (void)cancelSetActivePresetRequestWithCompletion:(MTRStatusCompletion)completion +{ + [self cancelSetActivePresetRequestWithParams:nil completion:completion]; +} +- (void)cancelSetActivePresetRequestWithParams:(MTRThermostatClusterCancelSetActivePresetRequestParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRThermostatClusterCancelSetActivePresetRequestParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = Thermostat::Commands::CancelSetActivePresetRequest::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + 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); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = Thermostat::Commands::SetTemperatureSetpointHoldPolicy::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} - (void)readAttributeLocalTemperatureWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { @@ -67112,6 +67292,699 @@ + (void)readAttributeACCapacityformatWithClusterStateCache:(MTRClusterStateCache completion:completion]; } +- (void)readAttributePresetTypesWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = Thermostat::Attributes::PresetTypes::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributePresetTypesWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = Thermostat::Attributes::PresetTypes::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributePresetTypesWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = Thermostat::Attributes::PresetTypes::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeScheduleTypesWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = Thermostat::Attributes::ScheduleTypes::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeScheduleTypesWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = Thermostat::Attributes::ScheduleTypes::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeScheduleTypesWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = Thermostat::Attributes::ScheduleTypes::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeNumberOfPresetsWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = Thermostat::Attributes::NumberOfPresets::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeNumberOfPresetsWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = Thermostat::Attributes::NumberOfPresets::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeNumberOfPresetsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = Thermostat::Attributes::NumberOfPresets::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeNumberOfSchedulesWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = Thermostat::Attributes::NumberOfSchedules::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeNumberOfSchedulesWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = Thermostat::Attributes::NumberOfSchedules::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeNumberOfSchedulesWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = Thermostat::Attributes::NumberOfSchedules::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeNumberOfScheduleTransitionsWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = Thermostat::Attributes::NumberOfScheduleTransitions::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeNumberOfScheduleTransitionsWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = Thermostat::Attributes::NumberOfScheduleTransitions::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeNumberOfScheduleTransitionsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = Thermostat::Attributes::NumberOfScheduleTransitions::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeNumberOfScheduleTransitionPerDayWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = Thermostat::Attributes::NumberOfScheduleTransitionPerDay::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeNumberOfScheduleTransitionPerDayWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = Thermostat::Attributes::NumberOfScheduleTransitionPerDay::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeNumberOfScheduleTransitionPerDayWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = Thermostat::Attributes::NumberOfScheduleTransitionPerDay::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeActivePresetHandleWithCompletion:(void (^)(NSData * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = Thermostat::Attributes::ActivePresetHandle::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeActivePresetHandleWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSData * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = Thermostat::Attributes::ActivePresetHandle::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeActivePresetHandleWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSData * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = Thermostat::Attributes::ActivePresetHandle::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeActiveScheduleHandleWithCompletion:(void (^)(NSData * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = Thermostat::Attributes::ActiveScheduleHandle::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeActiveScheduleHandleWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSData * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = Thermostat::Attributes::ActiveScheduleHandle::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeActiveScheduleHandleWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSData * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = Thermostat::Attributes::ActiveScheduleHandle::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributePresetsWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = Thermostat::Attributes::Presets::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)writeAttributePresetsWithValue:(NSArray * _Nonnull)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributePresetsWithValue:(NSArray * _Nonnull) value params:nil completion:completion]; +} +- (void)writeAttributePresetsWithValue:(NSArray * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + value = [value copy]; + + auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil){ + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + ListFreer listFreer; + using TypeInfo = Thermostat::Attributes::Presets::TypeInfo; + TypeInfo::Type cppValue; + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + if (value.count != 0) { + auto * listHolder_0 = new ListHolder(value.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 < value.count; ++i_0) { + if ( ! [value[i_0] isKindOfClass: [MTRThermostatClusterPresetStruct class]] ) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_0 = (MTRThermostatClusterPresetStruct *)value[i_0]; + if (element_0.presetHandle == nil) { + listHolder_0->mList[i_0].presetHandle.SetNull(); + } else { + auto & nonNullValue_2 = listHolder_0->mList[i_0].presetHandle.SetNonNull(); + nonNullValue_2 = AsByteSpan(element_0.presetHandle); + } + listHolder_0->mList[i_0].presetScenario = static_castmList[i_0].presetScenario)>>(element_0.presetScenario.unsignedCharValue); + if (element_0.name != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].name.Emplace(); + if (element_0.name == nil) { + definedValue_2.SetNull(); + } else { + auto & nonNullValue_3 = definedValue_2.SetNonNull(); + nonNullValue_3 = AsCharSpan(element_0.name); + } + } + if (element_0.coolingSetpoint != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].coolingSetpoint.Emplace(); + definedValue_2 = element_0.coolingSetpoint.shortValue; + } + if (element_0.heatingSetpoint != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].heatingSetpoint.Emplace(); + definedValue_2 = element_0.heatingSetpoint.shortValue; + } + 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 { + cppValue = ListType_0(); + } + } + + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpoint); + return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)subscribeAttributePresetsWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = Thermostat::Attributes::Presets::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributePresetsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = Thermostat::Attributes::Presets::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeSchedulesWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = Thermostat::Attributes::Schedules::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)writeAttributeSchedulesWithValue:(NSArray * _Nonnull)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributeSchedulesWithValue:(NSArray * _Nonnull) value params:nil completion:completion]; +} +- (void)writeAttributeSchedulesWithValue:(NSArray * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + value = [value copy]; + + auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil){ + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + ListFreer listFreer; + using TypeInfo = Thermostat::Attributes::Schedules::TypeInfo; + TypeInfo::Type cppValue; + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + if (value.count != 0) { + auto * listHolder_0 = new ListHolder(value.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 < value.count; ++i_0) { + if ( ! [value[i_0] isKindOfClass: [MTRThermostatClusterScheduleStruct class]] ) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_0 = (MTRThermostatClusterScheduleStruct *)value[i_0]; + if (element_0.scheduleHandle == nil) { + listHolder_0->mList[i_0].scheduleHandle.SetNull(); + } else { + auto & nonNullValue_2 = listHolder_0->mList[i_0].scheduleHandle.SetNonNull(); + nonNullValue_2 = AsByteSpan(element_0.scheduleHandle); + } + listHolder_0->mList[i_0].systemMode = static_castmList[i_0].systemMode)>>(element_0.systemMode.unsignedCharValue); + if (element_0.name != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].name.Emplace(); + definedValue_2 = AsCharSpan(element_0.name); + } + if (element_0.presetHandle != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].presetHandle.Emplace(); + definedValue_2 = AsByteSpan(element_0.presetHandle); + } + { + using ListType_2 = std::remove_reference_tmList[i_0].transitions)>; + using ListMemberType_2 = ListMemberTypeGetter::Type; + if (element_0.transitions.count != 0) { + auto * listHolder_2 = new ListHolder(element_0.transitions.count); + if (listHolder_2 == nullptr || listHolder_2->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_2); + for (size_t i_2 = 0; i_2 < element_0.transitions.count; ++i_2) { + if ( ! [element_0.transitions[i_2] isKindOfClass: [MTRThermostatClusterScheduleTransitionStruct class]] ) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_2 = (MTRThermostatClusterScheduleTransitionStruct *)element_0.transitions[i_2]; + listHolder_2->mList[i_2].dayOfWeek = static_castmList[i_2].dayOfWeek)>>(element_2.dayOfWeek.unsignedCharValue); + listHolder_2->mList[i_2].transitionTime = element_2.transitionTime.unsignedShortValue; + if (element_2.presetHandle != nil) { + auto & definedValue_4 = listHolder_2->mList[i_2].presetHandle.Emplace(); + definedValue_4 = AsByteSpan(element_2.presetHandle); + } + if (element_2.systemMode != nil) { + auto & definedValue_4 = listHolder_2->mList[i_2].systemMode.Emplace(); + definedValue_4 = static_cast>(element_2.systemMode.unsignedCharValue); + } + if (element_2.coolingSetpoint != nil) { + auto & definedValue_4 = listHolder_2->mList[i_2].coolingSetpoint.Emplace(); + definedValue_4 = element_2.coolingSetpoint.shortValue; + } + if (element_2.heatingSetpoint != nil) { + auto & definedValue_4 = listHolder_2->mList[i_2].heatingSetpoint.Emplace(); + definedValue_4 = element_2.heatingSetpoint.shortValue; + } + } + listHolder_0->mList[i_0].transitions = ListType_2(listHolder_2->mList, element_0.transitions.count); + } else { + 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; + } + } + } + cppValue = ListType_0(listHolder_0->mList, value.count); + } else { + cppValue = ListType_0(); + } + } + + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpoint); + return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)subscribeAttributeSchedulesWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = Thermostat::Attributes::Schedules::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeSchedulesWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = Thermostat::Attributes::Schedules::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributePresetsSchedulesEditableWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = Thermostat::Attributes::PresetsSchedulesEditable::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + 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.endpoint) + 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([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.endpoint) + 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.endpoint) + 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([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; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeSetpointHoldExpiryTimestampWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = Thermostat::Attributes::SetpointHoldExpiryTimestamp::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeSetpointHoldExpiryTimestampWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = Thermostat::Attributes::SetpointHoldExpiryTimestamp::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeQueuedPresetWithCompletion:(void (^)(MTRThermostatClusterQueuedPresetStruct * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = Thermostat::Attributes::QueuedPreset::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeQueuedPresetWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(MTRThermostatClusterQueuedPresetStruct * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = Thermostat::Attributes::QueuedPreset::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeQueuedPresetWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTRThermostatClusterQueuedPresetStruct * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = Thermostat::Attributes::QueuedPreset::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { using TypeInfo = Thermostat::Attributes::GeneratedCommandList::TypeInfo; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h index 7c46f6315692cb..ab800aad5bd9be 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h @@ -3390,6 +3390,20 @@ typedef NS_ENUM(uint32_t, MTRAttributeIDType) { 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, + MTRAttributeIDTypeClusterThermostatAttributePresetTypesID MTR_PROVISIONALLY_AVAILABLE = 0x00000048, + MTRAttributeIDTypeClusterThermostatAttributeScheduleTypesID MTR_PROVISIONALLY_AVAILABLE = 0x00000049, + MTRAttributeIDTypeClusterThermostatAttributeNumberOfPresetsID MTR_PROVISIONALLY_AVAILABLE = 0x0000004A, + MTRAttributeIDTypeClusterThermostatAttributeNumberOfSchedulesID MTR_PROVISIONALLY_AVAILABLE = 0x0000004B, + MTRAttributeIDTypeClusterThermostatAttributeNumberOfScheduleTransitionsID MTR_PROVISIONALLY_AVAILABLE = 0x0000004C, + MTRAttributeIDTypeClusterThermostatAttributeNumberOfScheduleTransitionPerDayID MTR_PROVISIONALLY_AVAILABLE = 0x0000004D, + MTRAttributeIDTypeClusterThermostatAttributeActivePresetHandleID MTR_PROVISIONALLY_AVAILABLE = 0x0000004E, + 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, + MTRAttributeIDTypeClusterThermostatAttributeQueuedPresetID MTR_PROVISIONALLY_AVAILABLE = 0x00000055, 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, @@ -6479,6 +6493,13 @@ typedef NS_ENUM(uint32_t, MTRCommandIDType) { MTRCommandIDTypeClusterThermostatCommandSetWeeklyScheduleID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000001, MTRCommandIDTypeClusterThermostatCommandGetWeeklyScheduleID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000002, 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, + MTRCommandIDTypeClusterThermostatCommandCancelSetActivePresetRequestID MTR_PROVISIONALLY_AVAILABLE = 0x0000000A, + MTRCommandIDTypeClusterThermostatCommandSetTemperatureSetpointHoldPolicyID MTR_PROVISIONALLY_AVAILABLE = 0x0000000B, // Cluster FanControl deprecated command id names diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h index 605c522bb489c1..4169e3f2ff9be8 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h @@ -4236,6 +4236,19 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) - (void)clearWeeklyScheduleWithParams:(MTRThermostatClusterClearWeeklyScheduleParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); - (void)clearWeeklyScheduleWithExpectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); +- (void)setActiveScheduleRequestWithParams:(MTRThermostatClusterSetActiveScheduleRequestParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)setActivePresetRequestWithParams:(MTRThermostatClusterSetActivePresetRequestParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)startPresetsSchedulesEditRequestWithParams:(MTRThermostatClusterStartPresetsSchedulesEditRequestParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)cancelPresetsSchedulesEditRequestWithParams:(MTRThermostatClusterCancelPresetsSchedulesEditRequestParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)cancelPresetsSchedulesEditRequestWithExpectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion + MTR_PROVISIONALLY_AVAILABLE; +- (void)commitPresetsSchedulesRequestWithParams:(MTRThermostatClusterCommitPresetsSchedulesRequestParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)commitPresetsSchedulesRequestWithExpectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion + MTR_PROVISIONALLY_AVAILABLE; +- (void)cancelSetActivePresetRequestWithParams:(MTRThermostatClusterCancelSetActivePresetRequestParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)cancelSetActivePresetRequestWithExpectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion + MTR_PROVISIONALLY_AVAILABLE; +- (void)setTemperatureSetpointHoldPolicyWithParams:(MTRThermostatClusterSetTemperatureSetpointHoldPolicyParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; - (NSDictionary * _Nullable)readAttributeLocalTemperatureWithParams:(MTRReadParams * _Nullable)params MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); @@ -4389,6 +4402,38 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) - (void)writeAttributeACCapacityformatWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); - (void)writeAttributeACCapacityformatWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); +- (NSDictionary * _Nullable)readAttributePresetTypesWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeScheduleTypesWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeNumberOfPresetsWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeNumberOfSchedulesWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeNumberOfScheduleTransitionsWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeNumberOfScheduleTransitionPerDayWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeActivePresetHandleWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeActiveScheduleHandleWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributePresetsWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributePresetsWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributePresetsWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeSchedulesWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeSchedulesWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeSchedulesWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributePresetsSchedulesEditableWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeTemperatureSetpointHoldPolicyWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeSetpointHoldExpiryTimestampWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeQueuedPresetWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + - (NSDictionary * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); - (NSDictionary * _Nullable)readAttributeAcceptedCommandListWithParams:(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 ae9159d82900a2..6b71834a8338b3 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm @@ -12478,6 +12478,207 @@ - (void)clearWeeklyScheduleWithParams:(MTRThermostatClusterClearWeeklySchedulePa completion:responseHandler]; } +- (void)setActiveScheduleRequestWithParams:(MTRThermostatClusterSetActiveScheduleRequestParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRThermostatClusterSetActiveScheduleRequestParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = Thermostat::Commands::SetActiveScheduleRequest::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + 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)setActivePresetRequestWithParams:(MTRThermostatClusterSetActivePresetRequestParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRThermostatClusterSetActivePresetRequestParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = Thermostat::Commands::SetActivePresetRequest::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + 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)startPresetsSchedulesEditRequestWithParams:(MTRThermostatClusterStartPresetsSchedulesEditRequestParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRThermostatClusterStartPresetsSchedulesEditRequestParams + 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.endpoint) + 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 *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + [self cancelPresetsSchedulesEditRequestWithParams:nil expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs completion:completion]; +} +- (void)cancelPresetsSchedulesEditRequestWithParams:(MTRThermostatClusterCancelPresetsSchedulesEditRequestParams * _Nullable)params expectedValues:(NSArray *> * _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.endpoint) + 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 *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + [self commitPresetsSchedulesRequestWithParams:nil expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs completion:completion]; +} +- (void)commitPresetsSchedulesRequestWithParams:(MTRThermostatClusterCommitPresetsSchedulesRequestParams * _Nullable)params expectedValues:(NSArray *> * _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.endpoint) + 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)cancelSetActivePresetRequestWithExpectedValues:(NSArray *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + [self cancelSetActivePresetRequestWithParams:nil expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs completion:completion]; +} +- (void)cancelSetActivePresetRequestWithParams:(MTRThermostatClusterCancelSetActivePresetRequestParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRThermostatClusterCancelSetActivePresetRequestParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = Thermostat::Commands::CancelSetActivePresetRequest::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + 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 *> * _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); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = Thermostat::Commands::SetTemperatureSetpointHoldPolicy::Type; + [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint) + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} + - (NSDictionary * _Nullable)readAttributeLocalTemperatureWithParams:(MTRReadParams * _Nullable)params { return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeThermostatID) attributeID:@(MTRAttributeIDTypeClusterThermostatAttributeLocalTemperatureID) params:params]; @@ -13020,6 +13221,98 @@ - (void)writeAttributeACCapacityformatWithValue:(NSDictionary *) [self.device writeAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeThermostatID) attributeID:@(MTRAttributeIDTypeClusterThermostatAttributeACCapacityformatID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; } +- (NSDictionary * _Nullable)readAttributePresetTypesWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeThermostatID) attributeID:@(MTRAttributeIDTypeClusterThermostatAttributePresetTypesID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeScheduleTypesWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeThermostatID) attributeID:@(MTRAttributeIDTypeClusterThermostatAttributeScheduleTypesID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeNumberOfPresetsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeThermostatID) attributeID:@(MTRAttributeIDTypeClusterThermostatAttributeNumberOfPresetsID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeNumberOfSchedulesWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeThermostatID) attributeID:@(MTRAttributeIDTypeClusterThermostatAttributeNumberOfSchedulesID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeNumberOfScheduleTransitionsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeThermostatID) attributeID:@(MTRAttributeIDTypeClusterThermostatAttributeNumberOfScheduleTransitionsID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeNumberOfScheduleTransitionPerDayWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeThermostatID) attributeID:@(MTRAttributeIDTypeClusterThermostatAttributeNumberOfScheduleTransitionPerDayID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeActivePresetHandleWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeThermostatID) attributeID:@(MTRAttributeIDTypeClusterThermostatAttributeActivePresetHandleID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeActiveScheduleHandleWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeThermostatID) attributeID:@(MTRAttributeIDTypeClusterThermostatAttributeActiveScheduleHandleID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributePresetsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeThermostatID) attributeID:@(MTRAttributeIDTypeClusterThermostatAttributePresetsID) params:params]; +} + +- (void)writeAttributePresetsWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributePresetsWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributePresetsWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeThermostatID) attributeID:@(MTRAttributeIDTypeClusterThermostatAttributePresetsID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; +} + +- (NSDictionary * _Nullable)readAttributeSchedulesWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeThermostatID) attributeID:@(MTRAttributeIDTypeClusterThermostatAttributeSchedulesID) params:params]; +} + +- (void)writeAttributeSchedulesWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeSchedulesWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeSchedulesWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeThermostatID) attributeID:@(MTRAttributeIDTypeClusterThermostatAttributeSchedulesID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; +} + +- (NSDictionary * _Nullable)readAttributePresetsSchedulesEditableWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeThermostatID) attributeID:@(MTRAttributeIDTypeClusterThermostatAttributePresetsSchedulesEditableID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeTemperatureSetpointHoldPolicyWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeThermostatID) attributeID:@(MTRAttributeIDTypeClusterThermostatAttributeTemperatureSetpointHoldPolicyID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeSetpointHoldExpiryTimestampWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeThermostatID) attributeID:@(MTRAttributeIDTypeClusterThermostatAttributeSetpointHoldExpiryTimestampID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeQueuedPresetWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeThermostatID) attributeID:@(MTRAttributeIDTypeClusterThermostatAttributeQueuedPresetID) params:params]; +} + - (NSDictionary * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params { return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeThermostatID) attributeID:@(MTRAttributeIDTypeClusterThermostatAttributeGeneratedCommandListID) params:params]; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h index 5f90f0d869be60..09f02d57f5ea12 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h @@ -7702,6 +7702,212 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; @end +MTR_PROVISIONALLY_AVAILABLE +@interface MTRThermostatClusterSetActiveScheduleRequestParams : NSObject + +@property (nonatomic, copy) NSData * _Nonnull scheduleHandle 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; + +/** + * 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 + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRThermostatClusterSetActivePresetRequestParams : NSObject + +@property (nonatomic, copy) NSData * _Nonnull presetHandle MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nullable delayMinutes 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; + +/** + * 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 + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRThermostatClusterStartPresetsSchedulesEditRequestParams : NSObject + +@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; + +/** + * 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 + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRThermostatClusterCancelPresetsSchedulesEditRequestParams : NSObject +/** + * 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; + +/** + * 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 + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRThermostatClusterCommitPresetsSchedulesRequestParams : NSObject +/** + * 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; + +/** + * 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 + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRThermostatClusterCancelSetActivePresetRequestParams : NSObject +/** + * 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; + +/** + * 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 + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRThermostatClusterSetTemperatureSetpointHoldPolicyParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull temperatureSetpointHoldPolicy 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; + +/** + * 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 + MTR_PROVISIONALLY_AVAILABLE @interface MTRFanControlClusterStepParams : NSObject diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm index 4090cfe1b4ed09..5869394d11ffa6 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm @@ -21434,6 +21434,550 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader } @end +@implementation MTRThermostatClusterSetActiveScheduleRequestParams +- (instancetype)init +{ + if (self = [super init]) { + + _scheduleHandle = [NSData data]; + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRThermostatClusterSetActiveScheduleRequestParams alloc] init]; + + other.scheduleHandle = self.scheduleHandle; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: scheduleHandle:%@; >", NSStringFromClass([self class]), [_scheduleHandle base64EncodedStringWithOptions:0]]; + return descriptionString; +} + +@end + +@implementation MTRThermostatClusterSetActiveScheduleRequestParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::Thermostat::Commands::SetActiveScheduleRequest::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.scheduleHandle = AsByteSpan(self.scheduleHandle); + } + + 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 * _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 + +@implementation MTRThermostatClusterSetActivePresetRequestParams +- (instancetype)init +{ + if (self = [super init]) { + + _presetHandle = [NSData data]; + + _delayMinutes = nil; + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRThermostatClusterSetActivePresetRequestParams alloc] init]; + + other.presetHandle = self.presetHandle; + other.delayMinutes = self.delayMinutes; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: presetHandle:%@; delayMinutes:%@; >", NSStringFromClass([self class]), [_presetHandle base64EncodedStringWithOptions:0], _delayMinutes]; + return descriptionString; +} + +@end + +@implementation MTRThermostatClusterSetActivePresetRequestParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::Thermostat::Commands::SetActivePresetRequest::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.presetHandle = AsByteSpan(self.presetHandle); + } + { + if (self.delayMinutes != nil) { + auto & definedValue_0 = encodableStruct.delayMinutes.Emplace(); + definedValue_0 = self.delayMinutes.unsignedShortValue; + } + } + + 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 * _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 + +@implementation MTRThermostatClusterStartPresetsSchedulesEditRequestParams +- (instancetype)init +{ + if (self = [super init]) { + + _timeoutSeconds = @(0); + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRThermostatClusterStartPresetsSchedulesEditRequestParams alloc] init]; + + other.timeoutSeconds = self.timeoutSeconds; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: timeoutSeconds:%@; >", NSStringFromClass([self class]), _timeoutSeconds]; + return descriptionString; +} + +@end + +@implementation MTRThermostatClusterStartPresetsSchedulesEditRequestParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::Thermostat::Commands::StartPresetsSchedulesEditRequest::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.timeoutSeconds = self.timeoutSeconds.unsignedShortValue; + } + + 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 * _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 + +@implementation MTRThermostatClusterCancelPresetsSchedulesEditRequestParams +- (instancetype)init +{ + if (self = [super init]) { + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + 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; +} + +@end + +@implementation MTRThermostatClusterCancelPresetsSchedulesEditRequestParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + 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; + } + + 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 * _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 + +@implementation MTRThermostatClusterCommitPresetsSchedulesRequestParams +- (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 * _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 + +@implementation MTRThermostatClusterCancelSetActivePresetRequestParams +- (instancetype)init +{ + if (self = [super init]) { + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRThermostatClusterCancelSetActivePresetRequestParams 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 MTRThermostatClusterCancelSetActivePresetRequestParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::Thermostat::Commands::CancelSetActivePresetRequest::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 * _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 + +@implementation MTRThermostatClusterSetTemperatureSetpointHoldPolicyParams +- (instancetype)init +{ + if (self = [super init]) { + + _temperatureSetpointHoldPolicy = @(0); + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRThermostatClusterSetTemperatureSetpointHoldPolicyParams alloc] init]; + + other.temperatureSetpointHoldPolicy = self.temperatureSetpointHoldPolicy; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: temperatureSetpointHoldPolicy:%@; >", NSStringFromClass([self class]), _temperatureSetpointHoldPolicy]; + return descriptionString; +} + +@end + +@implementation MTRThermostatClusterSetTemperatureSetpointHoldPolicyParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::Thermostat::Commands::SetTemperatureSetpointHoldPolicy::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.temperatureSetpointHoldPolicy = static_cast>(self.temperatureSetpointHoldPolicy.unsignedCharValue); + } + + 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 * _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 + @implementation MTRFanControlClusterStepParams - (instancetype)init { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h index f2f3b125a44afd..9e953f72fcf7f0 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h @@ -1384,6 +1384,48 @@ NS_ASSUME_NONNULL_BEGIN @end +@interface MTRThermostatClusterSetActiveScheduleRequestParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRThermostatClusterSetActivePresetRequestParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRThermostatClusterStartPresetsSchedulesEditRequestParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRThermostatClusterCancelPresetsSchedulesEditRequestParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRThermostatClusterCommitPresetsSchedulesRequestParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRThermostatClusterCancelSetActivePresetRequestParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRThermostatClusterSetTemperatureSetpointHoldPolicyParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + @interface MTRFanControlClusterStepParams (InternalMethods) - (NSDictionary * _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 c952dc3da5faa2..f4c78467774c87 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h @@ -1455,6 +1455,56 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRPumpConfigurationAndControlClusterTurbineOperationEvent : NSObject @end +MTR_PROVISIONALLY_AVAILABLE +@interface MTRThermostatClusterScheduleTransitionStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull dayOfWeek MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull transitionTime MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSData * _Nullable presetHandle MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable systemMode MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable coolingSetpoint MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable heatingSetpoint MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRThermostatClusterScheduleStruct : NSObject +@property (nonatomic, copy) NSData * _Nullable scheduleHandle MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull systemMode MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSString * _Nullable name MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSData * _Nullable presetHandle MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSArray * _Nonnull transitions MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable builtIn MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRThermostatClusterPresetStruct : NSObject +@property (nonatomic, copy) NSData * _Nullable presetHandle MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull presetScenario MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSString * _Nullable name MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable coolingSetpoint MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable heatingSetpoint MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable builtIn MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRThermostatClusterPresetTypeStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull presetScenario MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull numberOfPresets MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull presetTypeFeatures MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRThermostatClusterQueuedPresetStruct : NSObject +@property (nonatomic, copy) NSData * _Nullable presetHandle MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable transitionTimestamp MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRThermostatClusterScheduleTypeStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull systemMode MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull numberOfSchedules MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull scheduleTypeFeatures MTR_PROVISIONALLY_AVAILABLE; +@end + MTR_AVAILABLE(ios(17.4), macos(14.4), watchos(10.4), tvos(17.4)) @interface MTRThermostatClusterWeeklyScheduleTransitionStruct : NSObject @property (nonatomic, copy) NSNumber * _Nonnull transitionTime MTR_AVAILABLE(ios(17.4), macos(14.4), watchos(10.4), tvos(17.4)); diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm index 9324a04d612704..07f63b03db3ded 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm @@ -6101,6 +6101,228 @@ - (NSString *)description @end +@implementation MTRThermostatClusterScheduleTransitionStruct +- (instancetype)init +{ + if (self = [super init]) { + + _dayOfWeek = @(0); + + _transitionTime = @(0); + + _presetHandle = nil; + + _systemMode = nil; + + _coolingSetpoint = nil; + + _heatingSetpoint = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRThermostatClusterScheduleTransitionStruct alloc] init]; + + other.dayOfWeek = self.dayOfWeek; + other.transitionTime = self.transitionTime; + other.presetHandle = self.presetHandle; + other.systemMode = self.systemMode; + other.coolingSetpoint = self.coolingSetpoint; + other.heatingSetpoint = self.heatingSetpoint; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: dayOfWeek:%@; transitionTime:%@; presetHandle:%@; systemMode:%@; coolingSetpoint:%@; heatingSetpoint:%@; >", NSStringFromClass([self class]), _dayOfWeek, _transitionTime, [_presetHandle base64EncodedStringWithOptions:0], _systemMode, _coolingSetpoint, _heatingSetpoint]; + return descriptionString; +} + +@end + +@implementation MTRThermostatClusterScheduleStruct +- (instancetype)init +{ + if (self = [super init]) { + + _scheduleHandle = nil; + + _systemMode = @(0); + + _name = nil; + + _presetHandle = nil; + + _transitions = [NSArray array]; + + _builtIn = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRThermostatClusterScheduleStruct alloc] init]; + + other.scheduleHandle = self.scheduleHandle; + other.systemMode = self.systemMode; + other.name = self.name; + other.presetHandle = self.presetHandle; + other.transitions = self.transitions; + other.builtIn = self.builtIn; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: scheduleHandle:%@; systemMode:%@; name:%@; presetHandle:%@; transitions:%@; builtIn:%@; >", NSStringFromClass([self class]), [_scheduleHandle base64EncodedStringWithOptions:0], _systemMode, _name, [_presetHandle base64EncodedStringWithOptions:0], _transitions, _builtIn]; + return descriptionString; +} + +@end + +@implementation MTRThermostatClusterPresetStruct +- (instancetype)init +{ + if (self = [super init]) { + + _presetHandle = nil; + + _presetScenario = @(0); + + _name = nil; + + _coolingSetpoint = nil; + + _heatingSetpoint = nil; + + _builtIn = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRThermostatClusterPresetStruct alloc] init]; + + other.presetHandle = self.presetHandle; + other.presetScenario = self.presetScenario; + other.name = self.name; + other.coolingSetpoint = self.coolingSetpoint; + other.heatingSetpoint = self.heatingSetpoint; + other.builtIn = self.builtIn; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: presetHandle:%@; presetScenario:%@; name:%@; coolingSetpoint:%@; heatingSetpoint:%@; builtIn:%@; >", NSStringFromClass([self class]), [_presetHandle base64EncodedStringWithOptions:0], _presetScenario, _name, _coolingSetpoint, _heatingSetpoint, _builtIn]; + return descriptionString; +} + +@end + +@implementation MTRThermostatClusterPresetTypeStruct +- (instancetype)init +{ + if (self = [super init]) { + + _presetScenario = @(0); + + _numberOfPresets = @(0); + + _presetTypeFeatures = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRThermostatClusterPresetTypeStruct alloc] init]; + + other.presetScenario = self.presetScenario; + other.numberOfPresets = self.numberOfPresets; + other.presetTypeFeatures = self.presetTypeFeatures; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: presetScenario:%@; numberOfPresets:%@; presetTypeFeatures:%@; >", NSStringFromClass([self class]), _presetScenario, _numberOfPresets, _presetTypeFeatures]; + return descriptionString; +} + +@end + +@implementation MTRThermostatClusterQueuedPresetStruct +- (instancetype)init +{ + if (self = [super init]) { + + _presetHandle = nil; + + _transitionTimestamp = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRThermostatClusterQueuedPresetStruct alloc] init]; + + other.presetHandle = self.presetHandle; + other.transitionTimestamp = self.transitionTimestamp; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: presetHandle:%@; transitionTimestamp:%@; >", NSStringFromClass([self class]), [_presetHandle base64EncodedStringWithOptions:0], _transitionTimestamp]; + return descriptionString; +} + +@end + +@implementation MTRThermostatClusterScheduleTypeStruct +- (instancetype)init +{ + if (self = [super init]) { + + _systemMode = @(0); + + _numberOfSchedules = @(0); + + _scheduleTypeFeatures = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRThermostatClusterScheduleTypeStruct alloc] init]; + + other.systemMode = self.systemMode; + other.numberOfSchedules = self.numberOfSchedules; + other.scheduleTypeFeatures = self.scheduleTypeFeatures; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: systemMode:%@; numberOfSchedules:%@; scheduleTypeFeatures:%@; >", NSStringFromClass([self class]), _systemMode, _numberOfSchedules, _scheduleTypeFeatures]; + return descriptionString; +} + +@end + @implementation MTRThermostatClusterWeeklyScheduleTransitionStruct - (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 7f8664022616bb..3a14df9249bffa 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 @@ -17699,6 +17699,367 @@ EmberAfStatus Set(chip::EndpointId endpoint, chip::app::Clusters::Thermostat::AC } // namespace ACCapacityformat +namespace NumberOfPresets { + +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + *value = Traits::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); +} + +} // namespace NumberOfPresets + +namespace NumberOfSchedules { + +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + *value = Traits::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); +} + +} // namespace NumberOfSchedules + +namespace NumberOfScheduleTransitions { + +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + *value = Traits::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); +} + +} // namespace NumberOfScheduleTransitions + +namespace NumberOfScheduleTransitionPerDay { + +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (Traits::IsNullValue(temp)) + { + value.SetNull(); + } + else + { + value.SetNonNull() = Traits::StorageToWorking(temp); + } + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); +} + +EmberAfStatus SetNull(chip::EndpointId endpoint) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); +} + +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + +} // namespace NumberOfScheduleTransitionPerDay + +namespace ActivePresetHandle { + +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) +{ + uint8_t zclString[16 + 1]; + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + value.SetNull(); + return EMBER_ZCL_STATUS_SUCCESS; + } + auto & span = value.SetNonNull(); + + VerifyOrReturnError(span.size() == 16, EMBER_ZCL_STATUS_INVALID_DATA_TYPE); + memcpy(span.data(), &zclString[1], 16); + span.reduce_size(length); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value) +{ + static_assert(16 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); + VerifyOrReturnError(value.size() <= 16, EMBER_ZCL_STATUS_CONSTRAINT_ERROR); + uint8_t zclString[16 + 1]; + auto length = static_cast(value.size()); + Encoding::Put8(zclString, length); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, zclString, ZCL_OCTET_STRING_ATTRIBUTE_TYPE); +} + +EmberAfStatus SetNull(chip::EndpointId endpoint) +{ + uint8_t zclString[1] = { 0xFF }; + return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, zclString, ZCL_OCTET_STRING_ATTRIBUTE_TYPE); +} + +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + +} // namespace ActivePresetHandle + +namespace ActiveScheduleHandle { + +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) +{ + uint8_t zclString[16 + 1]; + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) + { + value.SetNull(); + return EMBER_ZCL_STATUS_SUCCESS; + } + auto & span = value.SetNonNull(); + + VerifyOrReturnError(span.size() == 16, EMBER_ZCL_STATUS_INVALID_DATA_TYPE); + memcpy(span.data(), &zclString[1], 16); + span.reduce_size(length); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value) +{ + static_assert(16 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); + VerifyOrReturnError(value.size() <= 16, EMBER_ZCL_STATUS_CONSTRAINT_ERROR); + uint8_t zclString[16 + 1]; + auto length = static_cast(value.size()); + Encoding::Put8(zclString, length); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, zclString, ZCL_OCTET_STRING_ATTRIBUTE_TYPE); +} + +EmberAfStatus SetNull(chip::EndpointId endpoint) +{ + uint8_t zclString[1] = { 0xFF }; + return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, zclString, ZCL_OCTET_STRING_ATTRIBUTE_TYPE); +} + +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + +} // namespace ActiveScheduleHandle + +namespace PresetsSchedulesEditable { + +EmberAfStatus Get(chip::EndpointId endpoint, bool * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + *value = Traits::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, bool value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + 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 { + +EmberAfStatus Get(chip::EndpointId endpoint, + chip::BitMask * value) +{ + using Traits = NumericAttributeTraits>; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + *value = Traits::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, + chip::BitMask value) +{ + using Traits = NumericAttributeTraits>; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + 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 { + +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (Traits::IsNullValue(temp)) + { + value.SetNull(); + } + else + { + value.SetNonNull() = Traits::StorageToWorking(temp); + } + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_EPOCH_S_ATTRIBUTE_TYPE); +} + +EmberAfStatus SetNull(chip::EndpointId endpoint) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_EPOCH_S_ATTRIBUTE_TYPE); +} + +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + +} // namespace SetpointHoldExpiryTimestamp + namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, 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 c80c58fe04468c..a252bc6f5c1c8e 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 @@ -3177,6 +3177,62 @@ EmberAfStatus Get(chip::EndpointId endpoint, chip::app::Clusters::Thermostat::AC EmberAfStatus Set(chip::EndpointId endpoint, chip::app::Clusters::Thermostat::ACCapacityFormatEnum value); } // namespace ACCapacityformat +namespace NumberOfPresets { +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); +} // namespace NumberOfPresets + +namespace NumberOfSchedules { +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); +} // namespace NumberOfSchedules + +namespace NumberOfScheduleTransitions { +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); +} // namespace NumberOfScheduleTransitions + +namespace NumberOfScheduleTransitionPerDay { +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); +} // namespace NumberOfScheduleTransitionPerDay + +namespace ActivePresetHandle { +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // octet_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); +} // namespace ActivePresetHandle + +namespace ActiveScheduleHandle { +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // octet_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); +} // namespace ActiveScheduleHandle + +namespace PresetsSchedulesEditable { +EmberAfStatus Get(chip::EndpointId endpoint, bool * value); // boolean +EmberAfStatus Set(chip::EndpointId endpoint, bool value); +} // namespace PresetsSchedulesEditable + +namespace TemperatureSetpointHoldPolicy { +EmberAfStatus Get(chip::EndpointId endpoint, + chip::BitMask * + value); // TemperatureSetpointHoldPolicyBitmap +EmberAfStatus Set(chip::EndpointId endpoint, + chip::BitMask value); +} // namespace TemperatureSetpointHoldPolicy + +namespace SetpointHoldExpiryTimestamp { +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // epoch_s +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); +} // namespace SetpointHoldExpiryTimestamp + namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // bitmap32 EmberAfStatus 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 eaed7122247be7..a9a862215e6929 100644 --- a/zzz_generated/app-common/app-common/zap-generated/callback.h +++ b/zzz_generated/app-common/app-common/zap-generated/callback.h @@ -5741,6 +5741,48 @@ bool emberAfThermostatClusterGetWeeklyScheduleCallback( bool emberAfThermostatClusterClearWeeklyScheduleCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, const chip::app::Clusters::Thermostat::Commands::ClearWeeklySchedule::DecodableType & commandData); +/** + * @brief Thermostat Cluster SetActiveScheduleRequest Command callback (from client) + */ +bool emberAfThermostatClusterSetActiveScheduleRequestCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::Thermostat::Commands::SetActiveScheduleRequest::DecodableType & commandData); +/** + * @brief Thermostat Cluster SetActivePresetRequest Command callback (from client) + */ +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) + */ +bool emberAfThermostatClusterStartPresetsSchedulesEditRequestCallback( + 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 CancelSetActivePresetRequest Command callback (from client) + */ +bool emberAfThermostatClusterCancelSetActivePresetRequestCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::Thermostat::Commands::CancelSetActivePresetRequest::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); /** * @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 0136ff608c9770..fa83804118b175 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 @@ -2314,6 +2314,23 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(Thermostat::ControlSequ return static_cast(6); } } +static auto __attribute__((unused)) EnsureKnownEnumValue(Thermostat::PresetScenarioEnum val) +{ + 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::kUserDefined: + return val; + default: + return static_cast(7); + } +} static auto __attribute__((unused)) EnsureKnownEnumValue(Thermostat::SetpointChangeSourceEnum val) { using EnumType = Thermostat::SetpointChangeSourceEnum; 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 a7957243e3149e..c432fafd45043d 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 @@ -3367,6 +3367,23 @@ enum class ControlSequenceOfOperationEnum : uint8_t kUnknownEnumValue = 6, }; +// Enum for PresetScenarioEnum +enum class PresetScenarioEnum : uint8_t +{ + kUnspecified = 0x00, + kOccupied = 0x01, + kUnoccupied = 0x02, + kSleep = 0x03, + kWake = 0x04, + kVacation = 0x05, + kUserDefined = 0x06, + // 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, +}; + // Enum for SetpointChangeSourceEnum enum class SetpointChangeSourceEnum : uint8_t { @@ -3467,13 +3484,17 @@ enum class ACErrorCodeBitmap : uint32_t // Bitmap for Feature enum class Feature : uint32_t { - kHeating = 0x1, - kCooling = 0x2, - kOccupancy = 0x4, - kScheduleConfiguration = 0x8, - kSetback = 0x10, - kAutoMode = 0x20, - kLocalTemperatureNotExposed = 0x40, + kHeating = 0x1, + kCooling = 0x2, + kOccupancy = 0x4, + kScheduleConfiguration = 0x8, + kSetback = 0x10, + kAutoMode = 0x20, + kLocalTemperatureNotExposed = 0x40, + kMatterScheduleConfiguration = 0x80, + kPresets = 0x100, + kSetpoints = 0x200, + kQueuedPresetsSupported = 0x400, }; // Bitmap for HVACSystemTypeBitmap @@ -3485,6 +3506,13 @@ enum class HVACSystemTypeBitmap : uint8_t kHeatingUsesFuel = 0x20, }; +// Bitmap for PresetTypeFeaturesBitmap +enum class PresetTypeFeaturesBitmap : uint16_t +{ + kAutomatic = 0x1, + kSupportsNames = 0x2, +}; + // Bitmap for ProgrammingOperationModeBitmap enum class ProgrammingOperationModeBitmap : uint8_t { @@ -3532,6 +3560,22 @@ enum class ScheduleModeBitmap : uint8_t kHeatSetpointPresent = 0x1, kCoolSetpointPresent = 0x2, }; + +// Bitmap for ScheduleTypeFeaturesBitmap +enum class ScheduleTypeFeaturesBitmap : uint16_t +{ + kSupportsPresets = 0x1, + kSupportsSetpoints = 0x2, + kSupportsNames = 0x4, + kSupportsOff = 0x8, +}; + +// Bitmap for TemperatureSetpointHoldPolicyBitmap +enum class TemperatureSetpointHoldPolicyBitmap : uint8_t +{ + kHoldDurationElapsed = 0x1, + kHoldDurationElapsedOrPresetChanged = 0x2, +}; } // namespace Thermostat namespace FanControl { 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 834f1faa123612..7222179be4c93e 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 @@ -18994,6 +18994,322 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) namespace Thermostat { namespace Structs { +namespace ScheduleTransitionStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kDayOfWeek), dayOfWeek); + encoder.Encode(to_underlying(Fields::kTransitionTime), transitionTime); + encoder.Encode(to_underlying(Fields::kPresetHandle), presetHandle); + encoder.Encode(to_underlying(Fields::kSystemMode), systemMode); + encoder.Encode(to_underlying(Fields::kCoolingSetpoint), coolingSetpoint); + encoder.Encode(to_underlying(Fields::kHeatingSetpoint), heatingSetpoint); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kDayOfWeek)) + { + err = DataModel::Decode(reader, dayOfWeek); + } + else if (__context_tag == to_underlying(Fields::kTransitionTime)) + { + err = DataModel::Decode(reader, transitionTime); + } + else if (__context_tag == to_underlying(Fields::kPresetHandle)) + { + err = DataModel::Decode(reader, presetHandle); + } + else if (__context_tag == to_underlying(Fields::kSystemMode)) + { + err = DataModel::Decode(reader, systemMode); + } + else if (__context_tag == to_underlying(Fields::kCoolingSetpoint)) + { + err = DataModel::Decode(reader, coolingSetpoint); + } + else if (__context_tag == to_underlying(Fields::kHeatingSetpoint)) + { + err = DataModel::Decode(reader, heatingSetpoint); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} + +} // namespace ScheduleTransitionStruct + +namespace ScheduleStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kScheduleHandle), scheduleHandle); + encoder.Encode(to_underlying(Fields::kSystemMode), systemMode); + encoder.Encode(to_underlying(Fields::kName), name); + encoder.Encode(to_underlying(Fields::kPresetHandle), presetHandle); + encoder.Encode(to_underlying(Fields::kTransitions), transitions); + encoder.Encode(to_underlying(Fields::kBuiltIn), builtIn); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kScheduleHandle)) + { + err = DataModel::Decode(reader, scheduleHandle); + } + else if (__context_tag == to_underlying(Fields::kSystemMode)) + { + err = DataModel::Decode(reader, systemMode); + } + else if (__context_tag == to_underlying(Fields::kName)) + { + err = DataModel::Decode(reader, name); + } + else if (__context_tag == to_underlying(Fields::kPresetHandle)) + { + err = DataModel::Decode(reader, presetHandle); + } + else if (__context_tag == to_underlying(Fields::kTransitions)) + { + err = DataModel::Decode(reader, transitions); + } + else if (__context_tag == to_underlying(Fields::kBuiltIn)) + { + err = DataModel::Decode(reader, builtIn); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} + +} // namespace ScheduleStruct + +namespace PresetStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kPresetHandle), presetHandle); + encoder.Encode(to_underlying(Fields::kPresetScenario), presetScenario); + encoder.Encode(to_underlying(Fields::kName), name); + encoder.Encode(to_underlying(Fields::kCoolingSetpoint), coolingSetpoint); + encoder.Encode(to_underlying(Fields::kHeatingSetpoint), heatingSetpoint); + encoder.Encode(to_underlying(Fields::kBuiltIn), builtIn); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kPresetHandle)) + { + err = DataModel::Decode(reader, presetHandle); + } + else if (__context_tag == to_underlying(Fields::kPresetScenario)) + { + err = DataModel::Decode(reader, presetScenario); + } + else if (__context_tag == to_underlying(Fields::kName)) + { + err = DataModel::Decode(reader, name); + } + else if (__context_tag == to_underlying(Fields::kCoolingSetpoint)) + { + err = DataModel::Decode(reader, coolingSetpoint); + } + else if (__context_tag == to_underlying(Fields::kHeatingSetpoint)) + { + err = DataModel::Decode(reader, heatingSetpoint); + } + else if (__context_tag == to_underlying(Fields::kBuiltIn)) + { + err = DataModel::Decode(reader, builtIn); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} + +} // namespace PresetStruct + +namespace PresetTypeStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kPresetScenario), presetScenario); + encoder.Encode(to_underlying(Fields::kNumberOfPresets), numberOfPresets); + encoder.Encode(to_underlying(Fields::kPresetTypeFeatures), presetTypeFeatures); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kPresetScenario)) + { + err = DataModel::Decode(reader, presetScenario); + } + else if (__context_tag == to_underlying(Fields::kNumberOfPresets)) + { + err = DataModel::Decode(reader, numberOfPresets); + } + else if (__context_tag == to_underlying(Fields::kPresetTypeFeatures)) + { + err = DataModel::Decode(reader, presetTypeFeatures); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} + +} // namespace PresetTypeStruct + +namespace QueuedPresetStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kPresetHandle), presetHandle); + encoder.Encode(to_underlying(Fields::kTransitionTimestamp), transitionTimestamp); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kPresetHandle)) + { + err = DataModel::Decode(reader, presetHandle); + } + else if (__context_tag == to_underlying(Fields::kTransitionTimestamp)) + { + err = DataModel::Decode(reader, transitionTimestamp); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} + +} // namespace QueuedPresetStruct + +namespace ScheduleTypeStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kSystemMode), systemMode); + encoder.Encode(to_underlying(Fields::kNumberOfSchedules), numberOfSchedules); + encoder.Encode(to_underlying(Fields::kScheduleTypeFeatures), scheduleTypeFeatures); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kSystemMode)) + { + err = DataModel::Decode(reader, systemMode); + } + else if (__context_tag == to_underlying(Fields::kNumberOfSchedules)) + { + err = DataModel::Decode(reader, numberOfSchedules); + } + else if (__context_tag == to_underlying(Fields::kScheduleTypeFeatures)) + { + err = DataModel::Decode(reader, scheduleTypeFeatures); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} + +} // namespace ScheduleTypeStruct + namespace WeeklyScheduleTransitionStruct { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { @@ -19238,6 +19554,207 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } } } // namespace ClearWeeklySchedule. +namespace SetActiveScheduleRequest { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kScheduleHandle), scheduleHandle); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kScheduleHandle)) + { + err = DataModel::Decode(reader, scheduleHandle); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace SetActiveScheduleRequest. +namespace SetActivePresetRequest { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kPresetHandle), presetHandle); + encoder.Encode(to_underlying(Fields::kDelayMinutes), delayMinutes); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kPresetHandle)) + { + err = DataModel::Decode(reader, presetHandle); + } + else if (__context_tag == to_underlying(Fields::kDelayMinutes)) + { + err = DataModel::Decode(reader, delayMinutes); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace SetActivePresetRequest. +namespace StartPresetsSchedulesEditRequest { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kTimeoutSeconds), timeoutSeconds); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kTimeoutSeconds)) + { + err = DataModel::Decode(reader, timeoutSeconds); + } + else + { + } + + 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(__element)) + { + return std::get(__element); + } + } +} +} // 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(__element)) + { + return std::get(__element); + } + } +} +} // namespace CommitPresetsSchedulesRequest. +namespace CancelSetActivePresetRequest { +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(__element)) + { + return std::get(__element); + } + } +} +} // namespace CancelSetActivePresetRequest. +namespace SetTemperatureSetpointHoldPolicy { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kTemperatureSetpointHoldPolicy), temperatureSetpointHoldPolicy); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kTemperatureSetpointHoldPolicy)) + { + err = DataModel::Decode(reader, temperatureSetpointHoldPolicy); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace SetTemperatureSetpointHoldPolicy. } // namespace Commands namespace Attributes { @@ -19343,6 +19860,34 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre return DataModel::Decode(reader, ACCoilTemperature); 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(): + return DataModel::Decode(reader, scheduleTypes); + case Attributes::NumberOfPresets::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, numberOfPresets); + case Attributes::NumberOfSchedules::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, numberOfSchedules); + case Attributes::NumberOfScheduleTransitions::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, numberOfScheduleTransitions); + case Attributes::NumberOfScheduleTransitionPerDay::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, numberOfScheduleTransitionPerDay); + case Attributes::ActivePresetHandle::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, activePresetHandle); + case Attributes::ActiveScheduleHandle::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, activeScheduleHandle); + case Attributes::Presets::TypeInfo::GetAttributeId(): + 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::QueuedPreset::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, queuedPreset); case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): return DataModel::Decode(reader, generatedCommandList); case Attributes::AcceptedCommandList::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 c4fc5f675fae30..86b8334de7f2c2 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 @@ -26892,6 +26892,183 @@ struct DecodableType } // namespace PumpConfigurationAndControl namespace Thermostat { namespace Structs { +namespace ScheduleTransitionStruct { +enum class Fields : uint8_t +{ + kDayOfWeek = 0, + kTransitionTime = 1, + kPresetHandle = 2, + kSystemMode = 3, + kCoolingSetpoint = 4, + kHeatingSetpoint = 5, +}; + +struct Type +{ +public: + chip::BitMask dayOfWeek = static_cast>(0); + uint16_t transitionTime = static_cast(0); + Optional presetHandle; + Optional systemMode; + Optional coolingSetpoint; + Optional heatingSetpoint; + + 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 ScheduleTransitionStruct +namespace ScheduleStruct { +enum class Fields : uint8_t +{ + kScheduleHandle = 0, + kSystemMode = 1, + kName = 2, + kPresetHandle = 3, + kTransitions = 4, + kBuiltIn = 5, +}; + +struct Type +{ +public: + DataModel::Nullable scheduleHandle; + SystemModeEnum systemMode = static_cast(0); + Optional name; + Optional presetHandle; + DataModel::List transitions; + Optional> builtIn; + + static constexpr bool kIsFabricScoped = false; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +struct DecodableType +{ +public: + DataModel::Nullable scheduleHandle; + SystemModeEnum systemMode = static_cast(0); + Optional name; + Optional presetHandle; + DataModel::DecodableList transitions; + Optional> builtIn; + + CHIP_ERROR Decode(TLV::TLVReader & reader); + + static constexpr bool kIsFabricScoped = false; +}; + +} // namespace ScheduleStruct +namespace PresetStruct { +enum class Fields : uint8_t +{ + kPresetHandle = 0, + kPresetScenario = 1, + kName = 2, + kCoolingSetpoint = 3, + kHeatingSetpoint = 4, + kBuiltIn = 5, +}; + +struct Type +{ +public: + DataModel::Nullable presetHandle; + PresetScenarioEnum presetScenario = static_cast(0); + Optional> name; + Optional coolingSetpoint; + Optional heatingSetpoint; + DataModel::Nullable builtIn; + + 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 PresetStruct +namespace PresetTypeStruct { +enum class Fields : uint8_t +{ + kPresetScenario = 0, + kNumberOfPresets = 1, + kPresetTypeFeatures = 2, +}; + +struct Type +{ +public: + PresetScenarioEnum presetScenario = static_cast(0); + uint8_t numberOfPresets = static_cast(0); + chip::BitMask presetTypeFeatures = static_cast>(0); + + 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 PresetTypeStruct +namespace QueuedPresetStruct { +enum class Fields : uint8_t +{ + kPresetHandle = 0, + kTransitionTimestamp = 1, +}; + +struct Type +{ +public: + DataModel::Nullable presetHandle; + DataModel::Nullable transitionTimestamp; + + 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 QueuedPresetStruct +namespace ScheduleTypeStruct { +enum class Fields : uint8_t +{ + kSystemMode = 0, + kNumberOfSchedules = 1, + kScheduleTypeFeatures = 2, +}; + +struct Type +{ +public: + SystemModeEnum systemMode = static_cast(0); + uint8_t numberOfSchedules = static_cast(0); + chip::BitMask scheduleTypeFeatures = static_cast>(0); + + 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 ScheduleTypeStruct namespace WeeklyScheduleTransitionStruct { enum class Fields : uint8_t { @@ -26947,6 +27124,41 @@ struct Type; struct DecodableType; } // namespace ClearWeeklySchedule +namespace SetActiveScheduleRequest { +struct Type; +struct DecodableType; +} // namespace SetActiveScheduleRequest + +namespace SetActivePresetRequest { +struct Type; +struct DecodableType; +} // namespace SetActivePresetRequest + +namespace StartPresetsSchedulesEditRequest { +struct Type; +struct DecodableType; +} // namespace StartPresetsSchedulesEditRequest + +namespace CancelPresetsSchedulesEditRequest { +struct Type; +struct DecodableType; +} // namespace CancelPresetsSchedulesEditRequest + +namespace CommitPresetsSchedulesRequest { +struct Type; +struct DecodableType; +} // namespace CommitPresetsSchedulesRequest + +namespace CancelSetActivePresetRequest { +struct Type; +struct DecodableType; +} // namespace CancelSetActivePresetRequest + +namespace SetTemperatureSetpointHoldPolicy { +struct Type; +struct DecodableType; +} // namespace SetTemperatureSetpointHoldPolicy + } // namespace Commands namespace Commands { @@ -27130,6 +27342,223 @@ struct DecodableType CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace ClearWeeklySchedule +namespace SetActiveScheduleRequest { +enum class Fields : uint8_t +{ + kScheduleHandle = 0, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::SetActiveScheduleRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } + + chip::ByteSpan scheduleHandle; + + 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::SetActiveScheduleRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } + + chip::ByteSpan scheduleHandle; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace SetActiveScheduleRequest +namespace SetActivePresetRequest { +enum class Fields : uint8_t +{ + kPresetHandle = 0, + kDelayMinutes = 1, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::SetActivePresetRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } + + chip::ByteSpan presetHandle; + Optional delayMinutes; + + 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::SetActivePresetRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } + + chip::ByteSpan presetHandle; + Optional delayMinutes; + 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(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(0); + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace StartPresetsSchedulesEditRequest +namespace CancelPresetsSchedulesEditRequest { +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::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 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; } + + 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::CommitPresetsSchedulesRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace CommitPresetsSchedulesRequest +namespace CancelSetActivePresetRequest { +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::CancelSetActivePresetRequest::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::CancelSetActivePresetRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace CancelSetActivePresetRequest +namespace SetTemperatureSetpointHoldPolicy { +enum class Fields : uint8_t +{ + kTemperatureSetpointHoldPolicy = 0, +}; + +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 ClusterId GetClusterId() { return Clusters::Thermostat::Id; } + + chip::BitMask temperatureSetpointHoldPolicy = + static_cast>(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::SetTemperatureSetpointHoldPolicy::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } + + chip::BitMask temperatureSetpointHoldPolicy = + static_cast>(0); + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace SetTemperatureSetpointHoldPolicy } // namespace Commands namespace Attributes { @@ -27722,6 +28151,186 @@ struct TypeInfo static constexpr bool MustUseTimedWrite() { return false; } }; } // namespace ACCapacityformat +namespace PresetTypes { +struct TypeInfo +{ + using Type = chip::app::DataModel::List; + using DecodableType = + chip::app::DataModel::DecodableList; + using DecodableArgType = + const chip::app::DataModel::DecodableList &; + + static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::PresetTypes::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace PresetTypes +namespace ScheduleTypes { +struct TypeInfo +{ + using Type = chip::app::DataModel::List; + using DecodableType = + chip::app::DataModel::DecodableList; + using DecodableArgType = + const chip::app::DataModel::DecodableList &; + + static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::ScheduleTypes::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace ScheduleTypes +namespace NumberOfPresets { +struct TypeInfo +{ + using Type = uint8_t; + using DecodableType = uint8_t; + using DecodableArgType = uint8_t; + + static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::NumberOfPresets::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace NumberOfPresets +namespace NumberOfSchedules { +struct TypeInfo +{ + using Type = uint8_t; + using DecodableType = uint8_t; + using DecodableArgType = uint8_t; + + static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::NumberOfSchedules::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace NumberOfSchedules +namespace NumberOfScheduleTransitions { +struct TypeInfo +{ + using Type = uint8_t; + using DecodableType = uint8_t; + using DecodableArgType = uint8_t; + + static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::NumberOfScheduleTransitions::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace NumberOfScheduleTransitions +namespace NumberOfScheduleTransitionPerDay { +struct TypeInfo +{ + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; + + static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::NumberOfScheduleTransitionPerDay::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace NumberOfScheduleTransitionPerDay +namespace ActivePresetHandle { +struct TypeInfo +{ + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; + + static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::ActivePresetHandle::Id; } + static constexpr bool MustUseTimedWrite() { return false; } + static constexpr size_t MaxLength() { return 16; } +}; +} // namespace ActivePresetHandle +namespace ActiveScheduleHandle { +struct TypeInfo +{ + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; + + static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::ActiveScheduleHandle::Id; } + static constexpr bool MustUseTimedWrite() { return false; } + static constexpr size_t MaxLength() { return 16; } +}; +} // namespace ActiveScheduleHandle +namespace Presets { +struct TypeInfo +{ + using Type = chip::app::DataModel::List; + using DecodableType = + chip::app::DataModel::DecodableList; + using DecodableArgType = + const chip::app::DataModel::DecodableList &; + + static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::Presets::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace Presets +namespace Schedules { +struct TypeInfo +{ + using Type = chip::app::DataModel::List; + using DecodableType = + chip::app::DataModel::DecodableList; + using DecodableArgType = + const chip::app::DataModel::DecodableList &; + + static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::Schedules::Id; } + 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; + using DecodableType = chip::BitMask; + using DecodableArgType = chip::BitMask; + + 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 +{ + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; + + static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::SetpointHoldExpiryTimestamp::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace SetpointHoldExpiryTimestamp +namespace QueuedPreset { +struct TypeInfo +{ + using Type = chip::app::DataModel::Nullable; + using DecodableType = + chip::app::DataModel::Nullable; + using DecodableArgType = + const chip::app::DataModel::Nullable &; + + static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::QueuedPreset::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace QueuedPreset namespace GeneratedCommandList { struct TypeInfo : public Clusters::Globals::Attributes::GeneratedCommandList::TypeInfo { @@ -27830,6 +28439,21 @@ struct TypeInfo Attributes::ACCoilTemperature::TypeInfo::DecodableType ACCoilTemperature; Attributes::ACCapacityformat::TypeInfo::DecodableType ACCapacityformat = static_cast(0); + Attributes::PresetTypes::TypeInfo::DecodableType presetTypes; + Attributes::ScheduleTypes::TypeInfo::DecodableType scheduleTypes; + Attributes::NumberOfPresets::TypeInfo::DecodableType numberOfPresets = static_cast(0); + Attributes::NumberOfSchedules::TypeInfo::DecodableType numberOfSchedules = static_cast(0); + Attributes::NumberOfScheduleTransitions::TypeInfo::DecodableType numberOfScheduleTransitions = static_cast(0); + Attributes::NumberOfScheduleTransitionPerDay::TypeInfo::DecodableType numberOfScheduleTransitionPerDay; + Attributes::ActivePresetHandle::TypeInfo::DecodableType activePresetHandle; + Attributes::ActiveScheduleHandle::TypeInfo::DecodableType activeScheduleHandle; + Attributes::Presets::TypeInfo::DecodableType presets; + Attributes::Schedules::TypeInfo::DecodableType schedules; + Attributes::PresetsSchedulesEditable::TypeInfo::DecodableType presetsSchedulesEditable = static_cast(0); + Attributes::TemperatureSetpointHoldPolicy::TypeInfo::DecodableType temperatureSetpointHoldPolicy = + static_cast>(0); + Attributes::SetpointHoldExpiryTimestamp::TypeInfo::DecodableType setpointHoldExpiryTimestamp; + Attributes::QueuedPreset::TypeInfo::DecodableType queuedPreset; Attributes::GeneratedCommandList::TypeInfo::DecodableType generatedCommandList; Attributes::AcceptedCommandList::TypeInfo::DecodableType acceptedCommandList; Attributes::EventList::TypeInfo::DecodableType eventList; 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 4038c9c9c41723..e037b879154ce4 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 @@ -4722,6 +4722,62 @@ namespace ACCapacityformat { static constexpr AttributeId Id = 0x00000047; } // namespace ACCapacityformat +namespace PresetTypes { +static constexpr AttributeId Id = 0x00000048; +} // namespace PresetTypes + +namespace ScheduleTypes { +static constexpr AttributeId Id = 0x00000049; +} // namespace ScheduleTypes + +namespace NumberOfPresets { +static constexpr AttributeId Id = 0x0000004A; +} // namespace NumberOfPresets + +namespace NumberOfSchedules { +static constexpr AttributeId Id = 0x0000004B; +} // namespace NumberOfSchedules + +namespace NumberOfScheduleTransitions { +static constexpr AttributeId Id = 0x0000004C; +} // namespace NumberOfScheduleTransitions + +namespace NumberOfScheduleTransitionPerDay { +static constexpr AttributeId Id = 0x0000004D; +} // namespace NumberOfScheduleTransitionPerDay + +namespace ActivePresetHandle { +static constexpr AttributeId Id = 0x0000004E; +} // namespace ActivePresetHandle + +namespace ActiveScheduleHandle { +static constexpr AttributeId Id = 0x0000004F; +} // namespace ActiveScheduleHandle + +namespace Presets { +static constexpr AttributeId Id = 0x00000050; +} // namespace Presets + +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; +} // namespace SetpointHoldExpiryTimestamp + +namespace QueuedPreset { +static constexpr AttributeId Id = 0x00000055; +} // namespace QueuedPreset + namespace GeneratedCommandList { static constexpr AttributeId Id = Globals::Attributes::GeneratedCommandList::Id; } // 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 4aa2dada3394fb..68a889ebfe7e19 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 @@ -1224,6 +1224,34 @@ namespace ClearWeeklySchedule { static constexpr CommandId Id = 0x00000003; } // namespace ClearWeeklySchedule +namespace SetActiveScheduleRequest { +static constexpr CommandId Id = 0x00000005; +} // namespace SetActiveScheduleRequest + +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 CommitPresetsSchedulesRequest { +static constexpr CommandId Id = 0x00000009; +} // namespace CommitPresetsSchedulesRequest + +namespace CancelSetActivePresetRequest { +static constexpr CommandId Id = 0x0000000A; +} // namespace CancelSetActivePresetRequest + +namespace SetTemperatureSetpointHoldPolicy { +static constexpr CommandId Id = 0x0000000B; +} // namespace SetTemperatureSetpointHoldPolicy + } // 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 a7645ac8f0c77f..32806d60b968e9 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -8873,6 +8873,13 @@ class BarrierControlBarrierControlStop : public ClusterCommand | * SetWeeklySchedule | 0x01 | | * GetWeeklySchedule | 0x02 | | * ClearWeeklySchedule | 0x03 | +| * SetActiveScheduleRequest | 0x05 | +| * SetActivePresetRequest | 0x06 | +| * StartPresetsSchedulesEditRequest | 0x07 | +| * CancelPresetsSchedulesEditRequest | 0x08 | +| * CommitPresetsSchedulesRequest | 0x09 | +| * CancelSetActivePresetRequest | 0x0A | +| * SetTemperatureSetpointHoldPolicy | 0x0B | |------------------------------------------------------------------------------| | Attributes: | | | * LocalTemperature | 0x0000 | @@ -8924,6 +8931,20 @@ class BarrierControlBarrierControlStop : public ClusterCommand | * ACLouverPosition | 0x0045 | | * ACCoilTemperature | 0x0046 | | * ACCapacityformat | 0x0047 | +| * PresetTypes | 0x0048 | +| * ScheduleTypes | 0x0049 | +| * NumberOfPresets | 0x004A | +| * NumberOfSchedules | 0x004B | +| * NumberOfScheduleTransitions | 0x004C | +| * NumberOfScheduleTransitionPerDay | 0x004D | +| * ActivePresetHandle | 0x004E | +| * ActiveScheduleHandle | 0x004F | +| * Presets | 0x0050 | +| * Schedules | 0x0051 | +| * PresetsSchedulesEditable | 0x0052 | +| * TemperatureSetpointHoldPolicy | 0x0053 | +| * SetpointHoldExpiryTimestamp | 0x0054 | +| * QueuedPreset | 0x0055 | | * GeneratedCommandList | 0xFFF8 | | * AcceptedCommandList | 0xFFF9 | | * EventList | 0xFFFA | @@ -9093,6 +9114,270 @@ class ThermostatClearWeeklySchedule : public ClusterCommand chip::app::Clusters::Thermostat::Commands::ClearWeeklySchedule::Type mRequest; }; +/* + * Command SetActiveScheduleRequest + */ +class ThermostatSetActiveScheduleRequest : public ClusterCommand +{ +public: + ThermostatSetActiveScheduleRequest(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("set-active-schedule-request", credsIssuerConfig) + { + AddArgument("ScheduleHandle", &mRequest.scheduleHandle); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::Thermostat::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::Thermostat::Commands::SetActiveScheduleRequest::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::SetActiveScheduleRequest::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::SetActiveScheduleRequest::Type mRequest; +}; + +/* + * Command SetActivePresetRequest + */ +class ThermostatSetActivePresetRequest : public ClusterCommand +{ +public: + ThermostatSetActivePresetRequest(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("set-active-preset-request", credsIssuerConfig) + { + AddArgument("PresetHandle", &mRequest.presetHandle); + AddArgument("DelayMinutes", 0, UINT16_MAX, &mRequest.delayMinutes); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::Thermostat::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::Thermostat::Commands::SetActivePresetRequest::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::SetActivePresetRequest::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::SetActivePresetRequest::Type mRequest; +}; + +/* + * Command StartPresetsSchedulesEditRequest + */ +class ThermostatStartPresetsSchedulesEditRequest : public ClusterCommand +{ +public: + ThermostatStartPresetsSchedulesEditRequest(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("start-presets-schedules-edit-request", credsIssuerConfig) + { + AddArgument("TimeoutSeconds", 0, UINT16_MAX, &mRequest.timeoutSeconds); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector 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 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 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 CancelSetActivePresetRequest + */ +class ThermostatCancelSetActivePresetRequest : public ClusterCommand +{ +public: + ThermostatCancelSetActivePresetRequest(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("cancel-set-active-preset-request", credsIssuerConfig) + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::Thermostat::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::Thermostat::Commands::CancelSetActivePresetRequest::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::CancelSetActivePresetRequest::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::CancelSetActivePresetRequest::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); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) 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, 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::SetTemperatureSetpointHoldPolicy::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::SetTemperatureSetpointHoldPolicy::Type mRequest; +}; + /*----------------------------------------------------------------------------*\ | Cluster FanControl | 0x0202 | |------------------------------------------------------------------------------| @@ -20967,11 +21252,18 @@ void registerClusterThermostat(Commands & commands, CredentialIssuerCommands * c // // Commands // - make_unique(Id, credsIssuerConfig), // - make_unique(credsIssuerConfig), // - make_unique(credsIssuerConfig), // - make_unique(credsIssuerConfig), // - make_unique(credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // // // Attributes // @@ -21039,6 +21331,25 @@ void registerClusterThermostat(Commands & commands, CredentialIssuerCommands * c make_unique(Id, "aclouver-position", Attributes::ACLouverPosition::Id, credsIssuerConfig), // make_unique(Id, "accoil-temperature", Attributes::ACCoilTemperature::Id, credsIssuerConfig), // make_unique(Id, "accapacityformat", Attributes::ACCapacityformat::Id, credsIssuerConfig), // + make_unique(Id, "preset-types", Attributes::PresetTypes::Id, credsIssuerConfig), // + make_unique(Id, "schedule-types", Attributes::ScheduleTypes::Id, credsIssuerConfig), // + make_unique(Id, "number-of-presets", Attributes::NumberOfPresets::Id, credsIssuerConfig), // + make_unique(Id, "number-of-schedules", Attributes::NumberOfSchedules::Id, credsIssuerConfig), // + make_unique(Id, "number-of-schedule-transitions", Attributes::NumberOfScheduleTransitions::Id, + credsIssuerConfig), // + make_unique(Id, "number-of-schedule-transition-per-day", Attributes::NumberOfScheduleTransitionPerDay::Id, + credsIssuerConfig), // + make_unique(Id, "active-preset-handle", Attributes::ActivePresetHandle::Id, credsIssuerConfig), // + make_unique(Id, "active-schedule-handle", Attributes::ActiveScheduleHandle::Id, credsIssuerConfig), // + make_unique(Id, "presets", Attributes::Presets::Id, credsIssuerConfig), // + make_unique(Id, "schedules", Attributes::Schedules::Id, credsIssuerConfig), // + make_unique(Id, "presets-schedules-editable", Attributes::PresetsSchedulesEditable::Id, + credsIssuerConfig), // + make_unique(Id, "temperature-setpoint-hold-policy", Attributes::TemperatureSetpointHoldPolicy::Id, + credsIssuerConfig), // + make_unique(Id, "setpoint-hold-expiry-timestamp", Attributes::SetpointHoldExpiryTimestamp::Id, + credsIssuerConfig), // + make_unique(Id, "queued-preset", Attributes::QueuedPreset::Id, credsIssuerConfig), // make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // make_unique(Id, "event-list", Attributes::EventList::Id, credsIssuerConfig), // @@ -21176,6 +21487,44 @@ void registerClusterThermostat(Commands & commands, CredentialIssuerCommands * c WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique>( Id, "accapacityformat", 0, UINT8_MAX, Attributes::ACCapacityformat::Id, WriteCommandType::kWrite, credsIssuerConfig), // + make_unique>>( + Id, "preset-types", Attributes::PresetTypes::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "schedule-types", Attributes::ScheduleTypes::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "number-of-presets", 0, UINT8_MAX, Attributes::NumberOfPresets::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "number-of-schedules", 0, UINT8_MAX, Attributes::NumberOfSchedules::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "number-of-schedule-transitions", 0, UINT8_MAX, + Attributes::NumberOfScheduleTransitions::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique>>( + Id, "number-of-schedule-transition-per-day", 0, UINT8_MAX, Attributes::NumberOfScheduleTransitionPerDay::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "active-preset-handle", Attributes::ActivePresetHandle::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "active-schedule-handle", Attributes::ActiveScheduleHandle::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique>>( + Id, "presets", Attributes::Presets::Id, WriteCommandType::kWrite, credsIssuerConfig), // + make_unique>>( + Id, "schedules", Attributes::Schedules::Id, WriteCommandType::kWrite, credsIssuerConfig), // + make_unique>(Id, "presets-schedules-editable", 0, 1, Attributes::PresetsSchedulesEditable::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "temperature-setpoint-hold-policy", 0, UINT8_MAX, Attributes::TemperatureSetpointHoldPolicy::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>(Id, "setpoint-hold-expiry-timestamp", 0, UINT32_MAX, + Attributes::SetpointHoldExpiryTimestamp::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "queued-preset", Attributes::QueuedPreset::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique>>( Id, "generated-command-list", Attributes::GeneratedCommandList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // @@ -21257,6 +21606,25 @@ void registerClusterThermostat(Commands & commands, CredentialIssuerCommands * c make_unique(Id, "aclouver-position", Attributes::ACLouverPosition::Id, credsIssuerConfig), // make_unique(Id, "accoil-temperature", Attributes::ACCoilTemperature::Id, credsIssuerConfig), // make_unique(Id, "accapacityformat", Attributes::ACCapacityformat::Id, credsIssuerConfig), // + make_unique(Id, "preset-types", Attributes::PresetTypes::Id, credsIssuerConfig), // + make_unique(Id, "schedule-types", Attributes::ScheduleTypes::Id, credsIssuerConfig), // + make_unique(Id, "number-of-presets", Attributes::NumberOfPresets::Id, credsIssuerConfig), // + make_unique(Id, "number-of-schedules", Attributes::NumberOfSchedules::Id, credsIssuerConfig), // + make_unique(Id, "number-of-schedule-transitions", Attributes::NumberOfScheduleTransitions::Id, + credsIssuerConfig), // + make_unique(Id, "number-of-schedule-transition-per-day", + Attributes::NumberOfScheduleTransitionPerDay::Id, credsIssuerConfig), // + make_unique(Id, "active-preset-handle", Attributes::ActivePresetHandle::Id, credsIssuerConfig), // + make_unique(Id, "active-schedule-handle", Attributes::ActiveScheduleHandle::Id, credsIssuerConfig), // + make_unique(Id, "presets", Attributes::Presets::Id, credsIssuerConfig), // + make_unique(Id, "schedules", Attributes::Schedules::Id, credsIssuerConfig), // + make_unique(Id, "presets-schedules-editable", Attributes::PresetsSchedulesEditable::Id, + credsIssuerConfig), // + make_unique(Id, "temperature-setpoint-hold-policy", Attributes::TemperatureSetpointHoldPolicy::Id, + credsIssuerConfig), // + make_unique(Id, "setpoint-hold-expiry-timestamp", Attributes::SetpointHoldExpiryTimestamp::Id, + credsIssuerConfig), // + make_unique(Id, "queued-preset", Attributes::QueuedPreset::Id, credsIssuerConfig), // make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // make_unique(Id, "event-list", Attributes::EventList::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 acbd349dc09dfc..8c8d4b57d3c2e8 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp @@ -3313,6 +3313,305 @@ void ComplexArgumentParser::Finalize(chip::app::Clusters::DoorLock::Structs::Cre ComplexArgumentParser::Finalize(request.credentialIndex); } +CHIP_ERROR ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::Thermostat::Structs::ScheduleTransitionStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("ScheduleTransitionStruct.dayOfWeek", "dayOfWeek", value.isMember("dayOfWeek"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ScheduleTransitionStruct.transitionTime", "transitionTime", + value.isMember("transitionTime"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "dayOfWeek"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.dayOfWeek, value["dayOfWeek"])); + valueCopy.removeMember("dayOfWeek"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "transitionTime"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.transitionTime, value["transitionTime"])); + valueCopy.removeMember("transitionTime"); + + if (value.isMember("presetHandle")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "presetHandle"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.presetHandle, value["presetHandle"])); + } + valueCopy.removeMember("presetHandle"); + + if (value.isMember("systemMode")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "systemMode"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.systemMode, value["systemMode"])); + } + valueCopy.removeMember("systemMode"); + + if (value.isMember("coolingSetpoint")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "coolingSetpoint"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.coolingSetpoint, value["coolingSetpoint"])); + } + valueCopy.removeMember("coolingSetpoint"); + + if (value.isMember("heatingSetpoint")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "heatingSetpoint"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.heatingSetpoint, value["heatingSetpoint"])); + } + valueCopy.removeMember("heatingSetpoint"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::Thermostat::Structs::ScheduleTransitionStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.dayOfWeek); + ComplexArgumentParser::Finalize(request.transitionTime); + ComplexArgumentParser::Finalize(request.presetHandle); + ComplexArgumentParser::Finalize(request.systemMode); + ComplexArgumentParser::Finalize(request.coolingSetpoint); + ComplexArgumentParser::Finalize(request.heatingSetpoint); +} + +CHIP_ERROR ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::Thermostat::Structs::ScheduleStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ScheduleStruct.scheduleHandle", "scheduleHandle", + value.isMember("scheduleHandle"))); + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("ScheduleStruct.systemMode", "systemMode", value.isMember("systemMode"))); + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("ScheduleStruct.transitions", "transitions", value.isMember("transitions"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "scheduleHandle"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.scheduleHandle, value["scheduleHandle"])); + valueCopy.removeMember("scheduleHandle"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "systemMode"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.systemMode, value["systemMode"])); + valueCopy.removeMember("systemMode"); + + if (value.isMember("name")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "name"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.name, value["name"])); + } + valueCopy.removeMember("name"); + + if (value.isMember("presetHandle")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "presetHandle"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.presetHandle, value["presetHandle"])); + } + valueCopy.removeMember("presetHandle"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "transitions"); + 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"])); + } + valueCopy.removeMember("builtIn"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::Thermostat::Structs::ScheduleStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.scheduleHandle); + ComplexArgumentParser::Finalize(request.systemMode); + ComplexArgumentParser::Finalize(request.name); + ComplexArgumentParser::Finalize(request.presetHandle); + ComplexArgumentParser::Finalize(request.transitions); + ComplexArgumentParser::Finalize(request.builtIn); +} + +CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::Thermostat::Structs::PresetStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("PresetStruct.presetHandle", "presetHandle", value.isMember("presetHandle"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("PresetStruct.presetScenario", "presetScenario", + value.isMember("presetScenario"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("PresetStruct.builtIn", "builtIn", value.isMember("builtIn"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "presetHandle"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.presetHandle, value["presetHandle"])); + valueCopy.removeMember("presetHandle"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "presetScenario"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.presetScenario, value["presetScenario"])); + valueCopy.removeMember("presetScenario"); + + if (value.isMember("name")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "name"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.name, value["name"])); + } + valueCopy.removeMember("name"); + + if (value.isMember("coolingSetpoint")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "coolingSetpoint"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.coolingSetpoint, value["coolingSetpoint"])); + } + valueCopy.removeMember("coolingSetpoint"); + + if (value.isMember("heatingSetpoint")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "heatingSetpoint"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.heatingSetpoint, value["heatingSetpoint"])); + } + valueCopy.removeMember("heatingSetpoint"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "builtIn"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.builtIn, value["builtIn"])); + valueCopy.removeMember("builtIn"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::Thermostat::Structs::PresetStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.presetHandle); + ComplexArgumentParser::Finalize(request.presetScenario); + ComplexArgumentParser::Finalize(request.name); + ComplexArgumentParser::Finalize(request.coolingSetpoint); + ComplexArgumentParser::Finalize(request.heatingSetpoint); + ComplexArgumentParser::Finalize(request.builtIn); +} + +CHIP_ERROR ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::Thermostat::Structs::PresetTypeStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("PresetTypeStruct.presetScenario", "presetScenario", + value.isMember("presetScenario"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("PresetTypeStruct.numberOfPresets", "numberOfPresets", + value.isMember("numberOfPresets"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("PresetTypeStruct.presetTypeFeatures", "presetTypeFeatures", + value.isMember("presetTypeFeatures"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "presetScenario"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.presetScenario, value["presetScenario"])); + valueCopy.removeMember("presetScenario"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "numberOfPresets"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.numberOfPresets, value["numberOfPresets"])); + valueCopy.removeMember("numberOfPresets"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "presetTypeFeatures"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.presetTypeFeatures, value["presetTypeFeatures"])); + valueCopy.removeMember("presetTypeFeatures"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::Thermostat::Structs::PresetTypeStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.presetScenario); + ComplexArgumentParser::Finalize(request.numberOfPresets); + ComplexArgumentParser::Finalize(request.presetTypeFeatures); +} + +CHIP_ERROR ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::Thermostat::Structs::QueuedPresetStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("QueuedPresetStruct.presetHandle", "presetHandle", + value.isMember("presetHandle"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("QueuedPresetStruct.transitionTimestamp", "transitionTimestamp", + value.isMember("transitionTimestamp"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "presetHandle"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.presetHandle, value["presetHandle"])); + valueCopy.removeMember("presetHandle"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "transitionTimestamp"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.transitionTimestamp, value["transitionTimestamp"])); + valueCopy.removeMember("transitionTimestamp"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::Thermostat::Structs::QueuedPresetStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.presetHandle); + ComplexArgumentParser::Finalize(request.transitionTimestamp); +} + +CHIP_ERROR ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::Thermostat::Structs::ScheduleTypeStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("ScheduleTypeStruct.systemMode", "systemMode", value.isMember("systemMode"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ScheduleTypeStruct.numberOfSchedules", "numberOfSchedules", + value.isMember("numberOfSchedules"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ScheduleTypeStruct.scheduleTypeFeatures", "scheduleTypeFeatures", + value.isMember("scheduleTypeFeatures"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "systemMode"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.systemMode, value["systemMode"])); + valueCopy.removeMember("systemMode"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "numberOfSchedules"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.numberOfSchedules, value["numberOfSchedules"])); + valueCopy.removeMember("numberOfSchedules"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "scheduleTypeFeatures"); + ReturnErrorOnFailure( + ComplexArgumentParser::Setup(labelWithMember, request.scheduleTypeFeatures, value["scheduleTypeFeatures"])); + valueCopy.removeMember("scheduleTypeFeatures"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::Thermostat::Structs::ScheduleTypeStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.systemMode); + ComplexArgumentParser::Finalize(request.numberOfSchedules); + ComplexArgumentParser::Finalize(request.scheduleTypeFeatures); +} + CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::Thermostat::Structs::WeeklyScheduleTransitionStruct::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 445524c97f85e4..6bb98bb03a2cd3 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h @@ -388,6 +388,36 @@ static CHIP_ERROR Setup(const char * label, chip::app::Clusters::DoorLock::Struc static void Finalize(chip::app::Clusters::DoorLock::Structs::CredentialStruct::Type & request); +static CHIP_ERROR Setup(const char * label, chip::app::Clusters::Thermostat::Structs::ScheduleTransitionStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::Thermostat::Structs::ScheduleTransitionStruct::Type & request); + +static CHIP_ERROR Setup(const char * label, chip::app::Clusters::Thermostat::Structs::ScheduleStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::Thermostat::Structs::ScheduleStruct::Type & request); + +static CHIP_ERROR Setup(const char * label, chip::app::Clusters::Thermostat::Structs::PresetStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::Thermostat::Structs::PresetStruct::Type & request); + +static CHIP_ERROR Setup(const char * label, chip::app::Clusters::Thermostat::Structs::PresetTypeStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::Thermostat::Structs::PresetTypeStruct::Type & request); + +static CHIP_ERROR Setup(const char * label, chip::app::Clusters::Thermostat::Structs::QueuedPresetStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::Thermostat::Structs::QueuedPresetStruct::Type & request); + +static CHIP_ERROR Setup(const char * label, chip::app::Clusters::Thermostat::Structs::ScheduleTypeStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::Thermostat::Structs::ScheduleTypeStruct::Type & request); + static CHIP_ERROR Setup(const char * label, chip::app::Clusters::Thermostat::Structs::WeeklyScheduleTransitionStruct::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 2da87471d0a3c0..3c49f3129db325 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -2940,6 +2940,269 @@ 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::ScheduleTransitionStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("DayOfWeek", indent + 1, value.dayOfWeek); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'DayOfWeek'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("TransitionTime", indent + 1, value.transitionTime); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'TransitionTime'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("PresetHandle", indent + 1, value.presetHandle); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'PresetHandle'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("SystemMode", indent + 1, value.systemMode); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'SystemMode'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("CoolingSetpoint", indent + 1, value.coolingSetpoint); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'CoolingSetpoint'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("HeatingSetpoint", indent + 1, value.heatingSetpoint); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'HeatingSetpoint'"); + 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::ScheduleStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("ScheduleHandle", indent + 1, value.scheduleHandle); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ScheduleHandle'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("SystemMode", indent + 1, value.systemMode); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'SystemMode'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("Name", indent + 1, value.name); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Name'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("PresetHandle", indent + 1, value.presetHandle); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'PresetHandle'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("Transitions", indent + 1, value.transitions); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Transitions'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("BuiltIn", indent + 1, value.builtIn); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'BuiltIn'"); + 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) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("PresetHandle", indent + 1, value.presetHandle); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'PresetHandle'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("PresetScenario", indent + 1, value.presetScenario); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'PresetScenario'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("Name", indent + 1, value.name); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Name'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("CoolingSetpoint", indent + 1, value.coolingSetpoint); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'CoolingSetpoint'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("HeatingSetpoint", indent + 1, value.heatingSetpoint); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'HeatingSetpoint'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("BuiltIn", indent + 1, value.builtIn); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'BuiltIn'"); + 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::PresetTypeStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("PresetScenario", indent + 1, value.presetScenario); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'PresetScenario'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("NumberOfPresets", indent + 1, value.numberOfPresets); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'NumberOfPresets'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("PresetTypeFeatures", indent + 1, value.presetTypeFeatures); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'PresetTypeFeatures'"); + 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::QueuedPresetStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("PresetHandle", indent + 1, value.presetHandle); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'PresetHandle'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("TransitionTimestamp", indent + 1, value.transitionTimestamp); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'TransitionTimestamp'"); + 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::ScheduleTypeStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("SystemMode", indent + 1, value.systemMode); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'SystemMode'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("NumberOfSchedules", indent + 1, value.numberOfSchedules); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'NumberOfSchedules'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("ScheduleTypeFeatures", indent + 1, value.scheduleTypeFeatures); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ScheduleTypeFeatures'"); + 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::WeeklyScheduleTransitionStruct::DecodableType & value) @@ -13118,6 +13381,76 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ACCapacityformat", 1, value); } + case Thermostat::Attributes::PresetTypes::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("PresetTypes", 1, value); + } + case Thermostat::Attributes::ScheduleTypes::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("ScheduleTypes", 1, value); + } + case Thermostat::Attributes::NumberOfPresets::Id: { + uint8_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("NumberOfPresets", 1, value); + } + case Thermostat::Attributes::NumberOfSchedules::Id: { + uint8_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("NumberOfSchedules", 1, value); + } + case Thermostat::Attributes::NumberOfScheduleTransitions::Id: { + uint8_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("NumberOfScheduleTransitions", 1, value); + } + case Thermostat::Attributes::NumberOfScheduleTransitionPerDay::Id: { + chip::app::DataModel::Nullable value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("NumberOfScheduleTransitionPerDay", 1, value); + } + case Thermostat::Attributes::ActivePresetHandle::Id: { + chip::app::DataModel::Nullable value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("ActivePresetHandle", 1, value); + } + case Thermostat::Attributes::ActiveScheduleHandle::Id: { + chip::app::DataModel::Nullable value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("ActiveScheduleHandle", 1, value); + } + case Thermostat::Attributes::Presets::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("Presets", 1, value); + } + case Thermostat::Attributes::Schedules::Id: { + chip::app::DataModel::DecodableList value; + 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 value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("TemperatureSetpointHoldPolicy", 1, value); + } + case Thermostat::Attributes::SetpointHoldExpiryTimestamp::Id: { + chip::app::DataModel::Nullable value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("SetpointHoldExpiryTimestamp", 1, value); + } + case Thermostat::Attributes::QueuedPreset::Id: { + chip::app::DataModel::Nullable value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("QueuedPreset", 1, value); + } case Thermostat::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); 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 2880226ecb9d14..8fd0f2dec21890 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h @@ -244,6 +244,24 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::DoorLock::Structs::CredentialStruct::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::Thermostat::Structs::ScheduleTransitionStruct::DecodableType & value); + +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::PresetStruct::DecodableType & value); + +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::Thermostat::Structs::PresetTypeStruct::DecodableType & value); + +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::Thermostat::Structs::QueuedPresetStruct::DecodableType & value); + +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::Thermostat::Structs::ScheduleTypeStruct::DecodableType & value); + static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::Thermostat::Structs::WeeklyScheduleTransitionStruct::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 8b7c3cfbf53724..68db98302b2269 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -98094,6 +98094,13 @@ class SubscribeAttributePumpConfigurationAndControlClusterRevision : public Subs | * SetWeeklySchedule | 0x01 | | * GetWeeklySchedule | 0x02 | | * ClearWeeklySchedule | 0x03 | +| * SetActiveScheduleRequest | 0x05 | +| * SetActivePresetRequest | 0x06 | +| * StartPresetsSchedulesEditRequest | 0x07 | +| * CancelPresetsSchedulesEditRequest | 0x08 | +| * CommitPresetsSchedulesRequest | 0x09 | +| * CancelSetActivePresetRequest | 0x0A | +| * SetTemperatureSetpointHoldPolicy | 0x0B | |------------------------------------------------------------------------------| | Attributes: | | | * LocalTemperature | 0x0000 | @@ -98145,6 +98152,20 @@ class SubscribeAttributePumpConfigurationAndControlClusterRevision : public Subs | * ACLouverPosition | 0x0045 | | * ACCoilTemperature | 0x0046 | | * ACCapacityformat | 0x0047 | +| * PresetTypes | 0x0048 | +| * ScheduleTypes | 0x0049 | +| * NumberOfPresets | 0x004A | +| * NumberOfSchedules | 0x004B | +| * NumberOfScheduleTransitions | 0x004C | +| * NumberOfScheduleTransitionPerDay | 0x004D | +| * ActivePresetHandle | 0x004E | +| * ActiveScheduleHandle | 0x004F | +| * Presets | 0x0050 | +| * Schedules | 0x0051 | +| * PresetsSchedulesEditable | 0x0052 | +| * TemperatureSetpointHoldPolicy | 0x0053 | +| * SetpointHoldExpiryTimestamp | 0x0054 | +| * QueuedPreset | 0x0055 | | * GeneratedCommandList | 0xFFF8 | | * AcceptedCommandList | 0xFFF9 | | * EventList | 0xFFFA | @@ -98377,6 +98398,367 @@ class ThermostatClearWeeklySchedule : public ClusterCommand { private: }; +#if MTR_ENABLE_PROVISIONAL +/* + * Command SetActiveScheduleRequest + */ +class ThermostatSetActiveScheduleRequest : public ClusterCommand { +public: + ThermostatSetActiveScheduleRequest() + : ClusterCommand("set-active-schedule-request") + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("ScheduleHandle", &mRequest.scheduleHandle); +#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::SetActiveScheduleRequest::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 = [[MTRThermostatClusterSetActiveScheduleRequestParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + params.scheduleHandle = [NSData dataWithBytes:mRequest.scheduleHandle.data() length:mRequest.scheduleHandle.size()]; +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster setActiveScheduleRequestWithParams: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::SetActiveScheduleRequest::Type mRequest; +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command SetActivePresetRequest + */ +class ThermostatSetActivePresetRequest : public ClusterCommand { +public: + ThermostatSetActivePresetRequest() + : ClusterCommand("set-active-preset-request") + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("PresetHandle", &mRequest.presetHandle); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("DelayMinutes", 0, UINT16_MAX, &mRequest.delayMinutes); +#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::SetActivePresetRequest::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 = [[MTRThermostatClusterSetActivePresetRequestParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + params.presetHandle = [NSData dataWithBytes:mRequest.presetHandle.data() length:mRequest.presetHandle.size()]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + if (mRequest.delayMinutes.HasValue()) { + params.delayMinutes = [NSNumber numberWithUnsignedShort:mRequest.delayMinutes.Value()]; + } else { + params.delayMinutes = nil; + } +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster setActivePresetRequestWithParams: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::SetActivePresetRequest::Type mRequest; +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command StartPresetsSchedulesEditRequest + */ +class ThermostatStartPresetsSchedulesEditRequest : public ClusterCommand { +public: + ThermostatStartPresetsSchedulesEditRequest() + : ClusterCommand("start-presets-schedules-edit-request") + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("TimeoutSeconds", 0, UINT16_MAX, &mRequest.timeoutSeconds); +#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; +}; + +#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: +}; + +#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; + + 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]; + 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 CancelSetActivePresetRequest + */ +class ThermostatCancelSetActivePresetRequest : public ClusterCommand { +public: + ThermostatCancelSetActivePresetRequest() + : ClusterCommand("cancel-set-active-preset-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::CancelSetActivePresetRequest::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 = [[MTRThermostatClusterCancelSetActivePresetRequestParams 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 cancelSetActivePresetRequestWithParams: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") + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("TemperatureSetpointHoldPolicy", 0, UINT8_MAX, &mRequest.temperatureSetpointHoldPolicy); +#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()]; +#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); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::Thermostat::Commands::SetTemperatureSetpointHoldPolicy::Type mRequest; +}; + +#endif // MTR_ENABLE_PROVISIONAL + /* * Attribute LocalTemperature */ @@ -103511,6 +103893,1387 @@ class SubscribeAttributeThermostatACCapacityformat : public SubscribeAttribute { } }; +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute PresetTypes + */ +class ReadThermostatPresetTypes : public ReadAttribute { +public: + ReadThermostatPresetTypes() + : ReadAttribute("preset-types") + { + } + + ~ReadThermostatPresetTypes() + { + } + + 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::PresetTypes::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 readAttributePresetTypesWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.PresetTypes response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("Thermostat PresetTypes read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeThermostatPresetTypes : public SubscribeAttribute { +public: + SubscribeAttributeThermostatPresetTypes() + : SubscribeAttribute("preset-types") + { + } + + ~SubscribeAttributeThermostatPresetTypes() + { + } + + 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::PresetTypes::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 subscribeAttributePresetTypesWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.PresetTypes 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 ScheduleTypes + */ +class ReadThermostatScheduleTypes : public ReadAttribute { +public: + ReadThermostatScheduleTypes() + : ReadAttribute("schedule-types") + { + } + + ~ReadThermostatScheduleTypes() + { + } + + 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::ScheduleTypes::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 readAttributeScheduleTypesWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.ScheduleTypes response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("Thermostat ScheduleTypes read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeThermostatScheduleTypes : public SubscribeAttribute { +public: + SubscribeAttributeThermostatScheduleTypes() + : SubscribeAttribute("schedule-types") + { + } + + ~SubscribeAttributeThermostatScheduleTypes() + { + } + + 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::ScheduleTypes::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 subscribeAttributeScheduleTypesWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.ScheduleTypes 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 NumberOfPresets + */ +class ReadThermostatNumberOfPresets : public ReadAttribute { +public: + ReadThermostatNumberOfPresets() + : ReadAttribute("number-of-presets") + { + } + + ~ReadThermostatNumberOfPresets() + { + } + + 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::NumberOfPresets::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 readAttributeNumberOfPresetsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.NumberOfPresets response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("Thermostat NumberOfPresets read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeThermostatNumberOfPresets : public SubscribeAttribute { +public: + SubscribeAttributeThermostatNumberOfPresets() + : SubscribeAttribute("number-of-presets") + { + } + + ~SubscribeAttributeThermostatNumberOfPresets() + { + } + + 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::NumberOfPresets::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 subscribeAttributeNumberOfPresetsWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.NumberOfPresets 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 NumberOfSchedules + */ +class ReadThermostatNumberOfSchedules : public ReadAttribute { +public: + ReadThermostatNumberOfSchedules() + : ReadAttribute("number-of-schedules") + { + } + + ~ReadThermostatNumberOfSchedules() + { + } + + 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::NumberOfSchedules::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 readAttributeNumberOfSchedulesWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.NumberOfSchedules response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("Thermostat NumberOfSchedules read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeThermostatNumberOfSchedules : public SubscribeAttribute { +public: + SubscribeAttributeThermostatNumberOfSchedules() + : SubscribeAttribute("number-of-schedules") + { + } + + ~SubscribeAttributeThermostatNumberOfSchedules() + { + } + + 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::NumberOfSchedules::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 subscribeAttributeNumberOfSchedulesWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.NumberOfSchedules 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 NumberOfScheduleTransitions + */ +class ReadThermostatNumberOfScheduleTransitions : public ReadAttribute { +public: + ReadThermostatNumberOfScheduleTransitions() + : ReadAttribute("number-of-schedule-transitions") + { + } + + ~ReadThermostatNumberOfScheduleTransitions() + { + } + + 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::NumberOfScheduleTransitions::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 readAttributeNumberOfScheduleTransitionsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.NumberOfScheduleTransitions response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("Thermostat NumberOfScheduleTransitions read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeThermostatNumberOfScheduleTransitions : public SubscribeAttribute { +public: + SubscribeAttributeThermostatNumberOfScheduleTransitions() + : SubscribeAttribute("number-of-schedule-transitions") + { + } + + ~SubscribeAttributeThermostatNumberOfScheduleTransitions() + { + } + + 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::NumberOfScheduleTransitions::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 subscribeAttributeNumberOfScheduleTransitionsWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.NumberOfScheduleTransitions 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 NumberOfScheduleTransitionPerDay + */ +class ReadThermostatNumberOfScheduleTransitionPerDay : public ReadAttribute { +public: + ReadThermostatNumberOfScheduleTransitionPerDay() + : ReadAttribute("number-of-schedule-transition-per-day") + { + } + + ~ReadThermostatNumberOfScheduleTransitionPerDay() + { + } + + 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::NumberOfScheduleTransitionPerDay::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 readAttributeNumberOfScheduleTransitionPerDayWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.NumberOfScheduleTransitionPerDay response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("Thermostat NumberOfScheduleTransitionPerDay read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeThermostatNumberOfScheduleTransitionPerDay : public SubscribeAttribute { +public: + SubscribeAttributeThermostatNumberOfScheduleTransitionPerDay() + : SubscribeAttribute("number-of-schedule-transition-per-day") + { + } + + ~SubscribeAttributeThermostatNumberOfScheduleTransitionPerDay() + { + } + + 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::NumberOfScheduleTransitionPerDay::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 subscribeAttributeNumberOfScheduleTransitionPerDayWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.NumberOfScheduleTransitionPerDay 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 ActivePresetHandle + */ +class ReadThermostatActivePresetHandle : public ReadAttribute { +public: + ReadThermostatActivePresetHandle() + : ReadAttribute("active-preset-handle") + { + } + + ~ReadThermostatActivePresetHandle() + { + } + + 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::ActivePresetHandle::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 readAttributeActivePresetHandleWithCompletion:^(NSData * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.ActivePresetHandle response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("Thermostat ActivePresetHandle read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeThermostatActivePresetHandle : public SubscribeAttribute { +public: + SubscribeAttributeThermostatActivePresetHandle() + : SubscribeAttribute("active-preset-handle") + { + } + + ~SubscribeAttributeThermostatActivePresetHandle() + { + } + + 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::ActivePresetHandle::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 subscribeAttributeActivePresetHandleWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSData * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.ActivePresetHandle 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 ActiveScheduleHandle + */ +class ReadThermostatActiveScheduleHandle : public ReadAttribute { +public: + ReadThermostatActiveScheduleHandle() + : ReadAttribute("active-schedule-handle") + { + } + + ~ReadThermostatActiveScheduleHandle() + { + } + + 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::ActiveScheduleHandle::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 readAttributeActiveScheduleHandleWithCompletion:^(NSData * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.ActiveScheduleHandle response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("Thermostat ActiveScheduleHandle read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeThermostatActiveScheduleHandle : public SubscribeAttribute { +public: + SubscribeAttributeThermostatActiveScheduleHandle() + : SubscribeAttribute("active-schedule-handle") + { + } + + ~SubscribeAttributeThermostatActiveScheduleHandle() + { + } + + 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::ActiveScheduleHandle::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 subscribeAttributeActiveScheduleHandleWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSData * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.ActiveScheduleHandle 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 Presets + */ +class ReadThermostatPresets : public ReadAttribute { +public: + ReadThermostatPresets() + : ReadAttribute("presets") + { + } + + ~ReadThermostatPresets() + { + } + + 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::Presets::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 readAttributePresetsWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.Presets response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("Thermostat Presets read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteThermostatPresets : public WriteAttribute { +public: + WriteThermostatPresets() + : WriteAttribute("presets") + , mComplex(&mValue) + { + AddArgument("attr-name", "presets"); + AddArgument("attr-value", &mComplex); + WriteAttribute::AddArguments(); + } + + ~WriteThermostatPresets() + { + } + + 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::Presets::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); + __auto_type * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + for (auto & entry_0 : mValue) { + MTRThermostatClusterPresetStruct * newElement_0; + newElement_0 = [MTRThermostatClusterPresetStruct new]; + if (entry_0.presetHandle.IsNull()) { + newElement_0.presetHandle = nil; + } else { + newElement_0.presetHandle = [NSData dataWithBytes:entry_0.presetHandle.Value().data() length:entry_0.presetHandle.Value().size()]; + } + newElement_0.presetScenario = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.presetScenario)]; + if (entry_0.name.HasValue()) { + if (entry_0.name.Value().IsNull()) { + newElement_0.name = nil; + } else { + newElement_0.name = [[NSString alloc] initWithBytes:entry_0.name.Value().Value().data() length:entry_0.name.Value().Value().size() encoding:NSUTF8StringEncoding]; + } + } else { + newElement_0.name = nil; + } + if (entry_0.coolingSetpoint.HasValue()) { + newElement_0.coolingSetpoint = [NSNumber numberWithShort:entry_0.coolingSetpoint.Value()]; + } else { + newElement_0.coolingSetpoint = nil; + } + if (entry_0.heatingSetpoint.HasValue()) { + newElement_0.heatingSetpoint = [NSNumber numberWithShort:entry_0.heatingSetpoint.Value()]; + } else { + newElement_0.heatingSetpoint = nil; + } + if (entry_0.builtIn.IsNull()) { + newElement_0.builtIn = nil; + } else { + newElement_0.builtIn = [NSNumber numberWithBool:entry_0.builtIn.Value()]; + } + [array_0 addObject:newElement_0]; + } + value = array_0; + } + + [cluster writeAttributePresetsWithValue:value params:params completion:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("Thermostat Presets write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + chip::app::DataModel::List mValue; + TypedComplexArgument> mComplex; +}; + +class SubscribeAttributeThermostatPresets : public SubscribeAttribute { +public: + SubscribeAttributeThermostatPresets() + : SubscribeAttribute("presets") + { + } + + ~SubscribeAttributeThermostatPresets() + { + } + + 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::Presets::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 subscribeAttributePresetsWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.Presets 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 Schedules + */ +class ReadThermostatSchedules : public ReadAttribute { +public: + ReadThermostatSchedules() + : ReadAttribute("schedules") + { + } + + ~ReadThermostatSchedules() + { + } + + 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::Schedules::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 readAttributeSchedulesWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.Schedules response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("Thermostat Schedules read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteThermostatSchedules : public WriteAttribute { +public: + WriteThermostatSchedules() + : WriteAttribute("schedules") + , mComplex(&mValue) + { + AddArgument("attr-name", "schedules"); + AddArgument("attr-value", &mComplex); + WriteAttribute::AddArguments(); + } + + ~WriteThermostatSchedules() + { + } + + 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::Schedules::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); + __auto_type * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + for (auto & entry_0 : mValue) { + MTRThermostatClusterScheduleStruct * newElement_0; + newElement_0 = [MTRThermostatClusterScheduleStruct new]; + if (entry_0.scheduleHandle.IsNull()) { + newElement_0.scheduleHandle = nil; + } else { + newElement_0.scheduleHandle = [NSData dataWithBytes:entry_0.scheduleHandle.Value().data() length:entry_0.scheduleHandle.Value().size()]; + } + newElement_0.systemMode = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.systemMode)]; + if (entry_0.name.HasValue()) { + newElement_0.name = [[NSString alloc] initWithBytes:entry_0.name.Value().data() length:entry_0.name.Value().size() encoding:NSUTF8StringEncoding]; + } else { + newElement_0.name = nil; + } + if (entry_0.presetHandle.HasValue()) { + newElement_0.presetHandle = [NSData dataWithBytes:entry_0.presetHandle.Value().data() length:entry_0.presetHandle.Value().size()]; + } else { + newElement_0.presetHandle = nil; + } + { // Scope for our temporary variables + auto * array_2 = [NSMutableArray new]; + for (auto & entry_2 : entry_0.transitions) { + MTRThermostatClusterScheduleTransitionStruct * newElement_2; + newElement_2 = [MTRThermostatClusterScheduleTransitionStruct new]; + newElement_2.dayOfWeek = [NSNumber numberWithUnsignedChar:entry_2.dayOfWeek.Raw()]; + newElement_2.transitionTime = [NSNumber numberWithUnsignedShort:entry_2.transitionTime]; + if (entry_2.presetHandle.HasValue()) { + newElement_2.presetHandle = [NSData dataWithBytes:entry_2.presetHandle.Value().data() length:entry_2.presetHandle.Value().size()]; + } else { + newElement_2.presetHandle = nil; + } + if (entry_2.systemMode.HasValue()) { + newElement_2.systemMode = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_2.systemMode.Value())]; + } else { + newElement_2.systemMode = nil; + } + if (entry_2.coolingSetpoint.HasValue()) { + newElement_2.coolingSetpoint = [NSNumber numberWithShort:entry_2.coolingSetpoint.Value()]; + } else { + newElement_2.coolingSetpoint = nil; + } + if (entry_2.heatingSetpoint.HasValue()) { + newElement_2.heatingSetpoint = [NSNumber numberWithShort:entry_2.heatingSetpoint.Value()]; + } else { + newElement_2.heatingSetpoint = nil; + } + [array_2 addObject:newElement_2]; + } + 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 { + newElement_0.builtIn = nil; + } + [array_0 addObject:newElement_0]; + } + value = array_0; + } + + [cluster writeAttributeSchedulesWithValue:value params:params completion:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("Thermostat Schedules write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + chip::app::DataModel::List mValue; + TypedComplexArgument> mComplex; +}; + +class SubscribeAttributeThermostatSchedules : public SubscribeAttribute { +public: + SubscribeAttributeThermostatSchedules() + : SubscribeAttribute("schedules") + { + } + + ~SubscribeAttributeThermostatSchedules() + { + } + + 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::Schedules::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 subscribeAttributeSchedulesWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.Schedules 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 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 + */ +class ReadThermostatSetpointHoldExpiryTimestamp : public ReadAttribute { +public: + ReadThermostatSetpointHoldExpiryTimestamp() + : ReadAttribute("setpoint-hold-expiry-timestamp") + { + } + + ~ReadThermostatSetpointHoldExpiryTimestamp() + { + } + + 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::SetpointHoldExpiryTimestamp::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 readAttributeSetpointHoldExpiryTimestampWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.SetpointHoldExpiryTimestamp response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("Thermostat SetpointHoldExpiryTimestamp read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeThermostatSetpointHoldExpiryTimestamp : public SubscribeAttribute { +public: + SubscribeAttributeThermostatSetpointHoldExpiryTimestamp() + : SubscribeAttribute("setpoint-hold-expiry-timestamp") + { + } + + ~SubscribeAttributeThermostatSetpointHoldExpiryTimestamp() + { + } + + 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::SetpointHoldExpiryTimestamp::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 subscribeAttributeSetpointHoldExpiryTimestampWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.SetpointHoldExpiryTimestamp 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 QueuedPreset + */ +class ReadThermostatQueuedPreset : public ReadAttribute { +public: + ReadThermostatQueuedPreset() + : ReadAttribute("queued-preset") + { + } + + ~ReadThermostatQueuedPreset() + { + } + + 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::QueuedPreset::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 readAttributeQueuedPresetWithCompletion:^(MTRThermostatClusterQueuedPresetStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.QueuedPreset response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("Thermostat QueuedPreset read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeThermostatQueuedPreset : public SubscribeAttribute { +public: + SubscribeAttributeThermostatQueuedPreset() + : SubscribeAttribute("queued-preset") + { + } + + ~SubscribeAttributeThermostatQueuedPreset() + { + } + + 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::QueuedPreset::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 subscribeAttributeQueuedPresetWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(MTRThermostatClusterQueuedPresetStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.QueuedPreset 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 + /* * Attribute GeneratedCommandList */ @@ -179808,6 +181571,27 @@ void registerClusterThermostat(Commands & commands) make_unique(), // make_unique(), // make_unique(), // +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL make_unique(Id), // make_unique(Id), // make_unique(Id), // @@ -179936,6 +181720,64 @@ void registerClusterThermostat(Commands & commands) make_unique(), // make_unique(), // make_unique(), // +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // make_unique(), //