From 9708e5d60bcea36ccb1b0baf52ac57081cef50cf Mon Sep 17 00:00:00 2001 From: James Harrow Date: Wed, 31 Jul 2024 08:54:27 +0100 Subject: [PATCH] Added missing new Java files. --- ...eaterManagementClusterBoostStartedEvent.kt | 57 ++++++++ ...gementClusterWaterHeaterBoostInfoStruct.kt | 130 ++++++++++++++++++ ...eaterManagementClusterBoostStartedEvent.kt | 57 ++++++++ ...gementClusterWaterHeaterBoostInfoStruct.kt | 130 ++++++++++++++++++ 4 files changed, 374 insertions(+) create mode 100644 src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/WaterHeaterManagementClusterBoostStartedEvent.kt create mode 100644 src/controller/java/generated/java/chip/devicecontroller/cluster/structs/WaterHeaterManagementClusterWaterHeaterBoostInfoStruct.kt create mode 100644 src/controller/java/generated/java/matter/controller/cluster/eventstructs/WaterHeaterManagementClusterBoostStartedEvent.kt create mode 100644 src/controller/java/generated/java/matter/controller/cluster/structs/WaterHeaterManagementClusterWaterHeaterBoostInfoStruct.kt diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/WaterHeaterManagementClusterBoostStartedEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/WaterHeaterManagementClusterBoostStartedEvent.kt new file mode 100644 index 00000000000000..f8a5e55e2e7894 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/WaterHeaterManagementClusterBoostStartedEvent.kt @@ -0,0 +1,57 @@ +/* + * + * 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.eventstructs + +import chip.devicecontroller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class WaterHeaterManagementClusterBoostStartedEvent( + val boostInfo: + chip.devicecontroller.cluster.structs.WaterHeaterManagementClusterWaterHeaterBoostInfoStruct +) { + override fun toString(): String = buildString { + append("WaterHeaterManagementClusterBoostStartedEvent {\n") + append("\tboostInfo : $boostInfo\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + boostInfo.toTlv(ContextSpecificTag(TAG_BOOST_INFO), this) + endStructure() + } + } + + companion object { + private const val TAG_BOOST_INFO = 0 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): WaterHeaterManagementClusterBoostStartedEvent { + tlvReader.enterStructure(tlvTag) + val boostInfo = + chip.devicecontroller.cluster.structs.WaterHeaterManagementClusterWaterHeaterBoostInfoStruct + .fromTlv(ContextSpecificTag(TAG_BOOST_INFO), tlvReader) + + tlvReader.exitContainer() + + return WaterHeaterManagementClusterBoostStartedEvent(boostInfo) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/WaterHeaterManagementClusterWaterHeaterBoostInfoStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/WaterHeaterManagementClusterWaterHeaterBoostInfoStruct.kt new file mode 100644 index 00000000000000..c9f95799bd18ba --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/WaterHeaterManagementClusterWaterHeaterBoostInfoStruct.kt @@ -0,0 +1,130 @@ +/* + * + * 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 WaterHeaterManagementClusterWaterHeaterBoostInfoStruct( + val duration: ULong, + val oneShot: Optional, + val emergencyBoost: Optional, + val temporarySetpoint: Optional, + val targetPercentage: Optional, + val targetReheat: Optional, +) { + override fun toString(): String = buildString { + append("WaterHeaterManagementClusterWaterHeaterBoostInfoStruct {\n") + append("\tduration : $duration\n") + append("\toneShot : $oneShot\n") + append("\temergencyBoost : $emergencyBoost\n") + append("\ttemporarySetpoint : $temporarySetpoint\n") + append("\ttargetPercentage : $targetPercentage\n") + append("\ttargetReheat : $targetReheat\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_DURATION), duration) + if (oneShot.isPresent) { + val optoneShot = oneShot.get() + put(ContextSpecificTag(TAG_ONE_SHOT), optoneShot) + } + if (emergencyBoost.isPresent) { + val optemergencyBoost = emergencyBoost.get() + put(ContextSpecificTag(TAG_EMERGENCY_BOOST), optemergencyBoost) + } + if (temporarySetpoint.isPresent) { + val opttemporarySetpoint = temporarySetpoint.get() + put(ContextSpecificTag(TAG_TEMPORARY_SETPOINT), opttemporarySetpoint) + } + if (targetPercentage.isPresent) { + val opttargetPercentage = targetPercentage.get() + put(ContextSpecificTag(TAG_TARGET_PERCENTAGE), opttargetPercentage) + } + if (targetReheat.isPresent) { + val opttargetReheat = targetReheat.get() + put(ContextSpecificTag(TAG_TARGET_REHEAT), opttargetReheat) + } + endStructure() + } + } + + companion object { + private const val TAG_DURATION = 0 + private const val TAG_ONE_SHOT = 1 + private const val TAG_EMERGENCY_BOOST = 2 + private const val TAG_TEMPORARY_SETPOINT = 3 + private const val TAG_TARGET_PERCENTAGE = 4 + private const val TAG_TARGET_REHEAT = 5 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): WaterHeaterManagementClusterWaterHeaterBoostInfoStruct { + tlvReader.enterStructure(tlvTag) + val duration = tlvReader.getULong(ContextSpecificTag(TAG_DURATION)) + val oneShot = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_ONE_SHOT))) { + Optional.of(tlvReader.getBoolean(ContextSpecificTag(TAG_ONE_SHOT))) + } else { + Optional.empty() + } + val emergencyBoost = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_EMERGENCY_BOOST))) { + Optional.of(tlvReader.getBoolean(ContextSpecificTag(TAG_EMERGENCY_BOOST))) + } else { + Optional.empty() + } + val temporarySetpoint = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_TEMPORARY_SETPOINT))) { + Optional.of(tlvReader.getInt(ContextSpecificTag(TAG_TEMPORARY_SETPOINT))) + } else { + Optional.empty() + } + val targetPercentage = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_TARGET_PERCENTAGE))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_TARGET_PERCENTAGE))) + } else { + Optional.empty() + } + val targetReheat = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_TARGET_REHEAT))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_TARGET_REHEAT))) + } else { + Optional.empty() + } + + tlvReader.exitContainer() + + return WaterHeaterManagementClusterWaterHeaterBoostInfoStruct( + duration, + oneShot, + emergencyBoost, + temporarySetpoint, + targetPercentage, + targetReheat, + ) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/eventstructs/WaterHeaterManagementClusterBoostStartedEvent.kt b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/WaterHeaterManagementClusterBoostStartedEvent.kt new file mode 100644 index 00000000000000..44e51796c1fa50 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/WaterHeaterManagementClusterBoostStartedEvent.kt @@ -0,0 +1,57 @@ +/* + * + * 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.eventstructs + +import matter.controller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class WaterHeaterManagementClusterBoostStartedEvent( + val boostInfo: + matter.controller.cluster.structs.WaterHeaterManagementClusterWaterHeaterBoostInfoStruct +) { + override fun toString(): String = buildString { + append("WaterHeaterManagementClusterBoostStartedEvent {\n") + append("\tboostInfo : $boostInfo\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + boostInfo.toTlv(ContextSpecificTag(TAG_BOOST_INFO), this) + endStructure() + } + } + + companion object { + private const val TAG_BOOST_INFO = 0 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): WaterHeaterManagementClusterBoostStartedEvent { + tlvReader.enterStructure(tlvTag) + val boostInfo = + matter.controller.cluster.structs.WaterHeaterManagementClusterWaterHeaterBoostInfoStruct + .fromTlv(ContextSpecificTag(TAG_BOOST_INFO), tlvReader) + + tlvReader.exitContainer() + + return WaterHeaterManagementClusterBoostStartedEvent(boostInfo) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/WaterHeaterManagementClusterWaterHeaterBoostInfoStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/WaterHeaterManagementClusterWaterHeaterBoostInfoStruct.kt new file mode 100644 index 00000000000000..0b2fede4f1537a --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/WaterHeaterManagementClusterWaterHeaterBoostInfoStruct.kt @@ -0,0 +1,130 @@ +/* + * + * 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 WaterHeaterManagementClusterWaterHeaterBoostInfoStruct( + val duration: UInt, + val oneShot: Optional, + val emergencyBoost: Optional, + val temporarySetpoint: Optional, + val targetPercentage: Optional, + val targetReheat: Optional, +) { + override fun toString(): String = buildString { + append("WaterHeaterManagementClusterWaterHeaterBoostInfoStruct {\n") + append("\tduration : $duration\n") + append("\toneShot : $oneShot\n") + append("\temergencyBoost : $emergencyBoost\n") + append("\ttemporarySetpoint : $temporarySetpoint\n") + append("\ttargetPercentage : $targetPercentage\n") + append("\ttargetReheat : $targetReheat\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_DURATION), duration) + if (oneShot.isPresent) { + val optoneShot = oneShot.get() + put(ContextSpecificTag(TAG_ONE_SHOT), optoneShot) + } + if (emergencyBoost.isPresent) { + val optemergencyBoost = emergencyBoost.get() + put(ContextSpecificTag(TAG_EMERGENCY_BOOST), optemergencyBoost) + } + if (temporarySetpoint.isPresent) { + val opttemporarySetpoint = temporarySetpoint.get() + put(ContextSpecificTag(TAG_TEMPORARY_SETPOINT), opttemporarySetpoint) + } + if (targetPercentage.isPresent) { + val opttargetPercentage = targetPercentage.get() + put(ContextSpecificTag(TAG_TARGET_PERCENTAGE), opttargetPercentage) + } + if (targetReheat.isPresent) { + val opttargetReheat = targetReheat.get() + put(ContextSpecificTag(TAG_TARGET_REHEAT), opttargetReheat) + } + endStructure() + } + } + + companion object { + private const val TAG_DURATION = 0 + private const val TAG_ONE_SHOT = 1 + private const val TAG_EMERGENCY_BOOST = 2 + private const val TAG_TEMPORARY_SETPOINT = 3 + private const val TAG_TARGET_PERCENTAGE = 4 + private const val TAG_TARGET_REHEAT = 5 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): WaterHeaterManagementClusterWaterHeaterBoostInfoStruct { + tlvReader.enterStructure(tlvTag) + val duration = tlvReader.getUInt(ContextSpecificTag(TAG_DURATION)) + val oneShot = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_ONE_SHOT))) { + Optional.of(tlvReader.getBoolean(ContextSpecificTag(TAG_ONE_SHOT))) + } else { + Optional.empty() + } + val emergencyBoost = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_EMERGENCY_BOOST))) { + Optional.of(tlvReader.getBoolean(ContextSpecificTag(TAG_EMERGENCY_BOOST))) + } else { + Optional.empty() + } + val temporarySetpoint = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_TEMPORARY_SETPOINT))) { + Optional.of(tlvReader.getShort(ContextSpecificTag(TAG_TEMPORARY_SETPOINT))) + } else { + Optional.empty() + } + val targetPercentage = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_TARGET_PERCENTAGE))) { + Optional.of(tlvReader.getUByte(ContextSpecificTag(TAG_TARGET_PERCENTAGE))) + } else { + Optional.empty() + } + val targetReheat = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_TARGET_REHEAT))) { + Optional.of(tlvReader.getUByte(ContextSpecificTag(TAG_TARGET_REHEAT))) + } else { + Optional.empty() + } + + tlvReader.exitContainer() + + return WaterHeaterManagementClusterWaterHeaterBoostInfoStruct( + duration, + oneShot, + emergencyBoost, + temporarySetpoint, + targetPercentage, + targetReheat, + ) + } + } +}