From 851ac0bd673c4848ded8e6b0470da20882b478b0 Mon Sep 17 00:00:00 2001 From: paulr34 <64710345+paulr34@users.noreply.github.com> Date: Fri, 24 May 2024 07:13:38 -0400 Subject: [PATCH] Revert "Temperature type (#1330)" (#1331) This reverts commit dc9997e25bcf2563a2f26ed813f62fffcfb6125a. --- src-electron/generator/helper-endpointconfig.js | 3 ++- src-electron/util/types.js | 1 - test/endpoint-config.test.js | 2 +- test/gen-matter-4.test.js | 3 --- test/resource/matter-all-clusters.zap | 2 +- test/resource/old-matter/chip-types.xml | 1 - zcl-builtin/matter/data-model/chip/chip-types.xml | 1 - zcl-builtin/matter/data-model/chip/thermostat-cluster.xml | 2 +- 8 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src-electron/generator/helper-endpointconfig.js b/src-electron/generator/helper-endpointconfig.js index 21a273c25d..08175c9bc1 100644 --- a/src-electron/generator/helper-endpointconfig.js +++ b/src-electron/generator/helper-endpointconfig.js @@ -651,7 +651,7 @@ function determineAttributeDefaultValue( typeSize, isNullable ) { - if (specifiedDefault && (specifiedDefault !== null || !isNullable)) { + if (specifiedDefault !== null || !isNullable) { return specifiedDefault } @@ -659,6 +659,7 @@ function determineAttributeDefaultValue( // Handled elsewhere. return null } + if (types.isSignedInteger(type)) { return '0x80' + '00'.repeat(typeSize - 1) } diff --git a/src-electron/util/types.js b/src-electron/util/types.js index 73fcd862b2..3a958ab2ac 100644 --- a/src-electron/util/types.js +++ b/src-electron/util/types.js @@ -286,7 +286,6 @@ function isSignedInteger(type) { case 'int48s': case 'int56s': case 'int64s': - case 'temperature': return true default: return false diff --git a/test/endpoint-config.test.js b/test/endpoint-config.test.js index 49057ef98b..2bc79f9146 100644 --- a/test/endpoint-config.test.js +++ b/test/endpoint-config.test.js @@ -216,7 +216,7 @@ test( '#define FIXED_PROFILE_IDS { 0x0107, 0x0104, 0x0104 }' ) expect(epc).toContain('#define FIXED_ENDPOINT_TYPES { 0, 1, 2 }') - expect(epc).toContain('#define GENERATED_DEFAULTS_COUNT (19)') + expect(epc).toContain('#define GENERATED_DEFAULTS_COUNT (12)') expect(epc).toContain( `17, 'T', 'e', 's', 't', ' ', 'm', 'a', 'n', 'u', 'f', 'a', 'c', 't', 'u', 'r', 'e', 'r',` ) diff --git a/test/gen-matter-4.test.js b/test/gen-matter-4.test.js index 3cdc7b8ea0..24de1c25fc 100644 --- a/test/gen-matter-4.test.js +++ b/test/gen-matter-4.test.js @@ -179,9 +179,6 @@ test( .attributeCount = 22, \\ .clusterId = 0x00000028, \\ },\\`) - expect(ept).toContain( - ' { 0x00000000, ZAP_TYPE(TEMPERATURE), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_SIMPLE_DEFAULT(0x8000) },' - ) }, testUtil.timeout.long() ) diff --git a/test/resource/matter-all-clusters.zap b/test/resource/matter-all-clusters.zap index 9cd98b326a..8977bdf99f 100644 --- a/test/resource/matter-all-clusters.zap +++ b/test/resource/matter-all-clusters.zap @@ -2291,7 +2291,7 @@ "0x0000 | | server | 1 | 0 => GetWeeklyScheduleResponse" ], "attributes": [ - "+ | 0x0000 | | server | RAM | | | | 1 | 0 | 65344 | 0 => LocalTemperature [temperature]", + "+ | 0x0000 | | server | RAM | | | | 1 | 0 | 65344 | 0 => LocalTemperature [int16s]", "+ | 0x0003 | | server | RAM | | | 0x02BC | 1 | 0 | 65344 | 0 => AbsMinHeatSetpointLimit [int16s]", "+ | 0x0004 | | server | RAM | | | 0x0BB8 | 1 | 0 | 65344 | 0 => AbsMaxHeatSetpointLimit [int16s]", "+ | 0x0005 | | server | RAM | | | 0x0640 | 1 | 0 | 65344 | 0 => AbsMinCoolSetpointLimit [int16s]", diff --git a/test/resource/old-matter/chip-types.xml b/test/resource/old-matter/chip-types.xml index b71f99aae7..e5e3e3859b 100644 --- a/test/resource/old-matter/chip-types.xml +++ b/test/resource/old-matter/chip-types.xml @@ -82,6 +82,5 @@ limitations under the License. - diff --git a/zcl-builtin/matter/data-model/chip/chip-types.xml b/zcl-builtin/matter/data-model/chip/chip-types.xml index f8c986f24a..95123673d4 100644 --- a/zcl-builtin/matter/data-model/chip/chip-types.xml +++ b/zcl-builtin/matter/data-model/chip/chip-types.xml @@ -81,6 +81,5 @@ limitations under the License. - diff --git a/zcl-builtin/matter/data-model/chip/thermostat-cluster.xml b/zcl-builtin/matter/data-model/chip/thermostat-cluster.xml index c4637be645..39ae4188a8 100644 --- a/zcl-builtin/matter/data-model/chip/thermostat-cluster.xml +++ b/zcl-builtin/matter/data-model/chip/thermostat-cluster.xml @@ -114,7 +114,7 @@ limitations under the License. true true - LocalTemperature + LocalTemperature OutdoorTemperature Occupancy