diff --git a/src-electron/generator/helper-endpointconfig.js b/src-electron/generator/helper-endpointconfig.js index 08175c9bc1..21a273c25d 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 !== null || !isNullable) { + if (specifiedDefault && (specifiedDefault !== null || !isNullable)) { return specifiedDefault } @@ -659,7 +659,6 @@ 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 3a958ab2ac..73fcd862b2 100644 --- a/src-electron/util/types.js +++ b/src-electron/util/types.js @@ -286,6 +286,7 @@ 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 2bc79f9146..49057ef98b 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 (12)') + expect(epc).toContain('#define GENERATED_DEFAULTS_COUNT (19)') 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 24de1c25fc..3cdc7b8ea0 100644 --- a/test/gen-matter-4.test.js +++ b/test/gen-matter-4.test.js @@ -179,6 +179,9 @@ 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 8977bdf99f..9cd98b326a 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 [int16s]", + "+ | 0x0000 | | server | RAM | | | | 1 | 0 | 65344 | 0 => LocalTemperature [temperature]", "+ | 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 e5e3e3859b..b71f99aae7 100644 --- a/test/resource/old-matter/chip-types.xml +++ b/test/resource/old-matter/chip-types.xml @@ -82,5 +82,6 @@ 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 95123673d4..f8c986f24a 100644 --- a/zcl-builtin/matter/data-model/chip/chip-types.xml +++ b/zcl-builtin/matter/data-model/chip/chip-types.xml @@ -81,5 +81,6 @@ 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 39ae4188a8..c4637be645 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