Skip to content

Commit

Permalink
Revert "Temperature type (#1330)" (#1331)
Browse files Browse the repository at this point in the history
This reverts commit dc9997e.
  • Loading branch information
paulr34 authored May 24, 2024
1 parent dc9997e commit 851ac0b
Show file tree
Hide file tree
Showing 8 changed files with 5 additions and 10 deletions.
3 changes: 2 additions & 1 deletion src-electron/generator/helper-endpointconfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -651,14 +651,15 @@ function determineAttributeDefaultValue(
typeSize,
isNullable
) {
if (specifiedDefault && (specifiedDefault !== null || !isNullable)) {
if (specifiedDefault !== null || !isNullable) {
return specifiedDefault
}

if (types.isString(type)) {
// Handled elsewhere.
return null
}

if (types.isSignedInteger(type)) {
return '0x80' + '00'.repeat(typeSize - 1)
}
Expand Down
1 change: 0 additions & 1 deletion src-electron/util/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,6 @@ function isSignedInteger(type) {
case 'int48s':
case 'int56s':
case 'int64s':
case 'temperature':
return true
default:
return false
Expand Down
2 changes: 1 addition & 1 deletion test/endpoint-config.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',`
)
Expand Down
3 changes: 0 additions & 3 deletions test/gen-matter-4.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
)
Expand Down
2 changes: 1 addition & 1 deletion test/resource/matter-all-clusters.zap
Original file line number Diff line number Diff line change
Expand Up @@ -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]",
Expand Down
1 change: 0 additions & 1 deletion test/resource/old-matter/chip-types.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,5 @@ limitations under the License.
<type id="0xFD" description="IPv6 Prefix" name="ipv6pre" composite="true"/>
<type id="0xFE" description="Hardware Address" name="hwadr" composite="true"/>
<type id="0xFF" description="Unknown" name="unknown" size="0" />
<type id="0xD8" description="Temperature" name="temperature" size="2" analog="true" signed="true" />
</atomic>
</configurator>
1 change: 0 additions & 1 deletion zcl-builtin/matter/data-model/chip/chip-types.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,5 @@ limitations under the License.
<type id="0xFD" description="IPv6 Prefix" name="ipv6pre" composite="true"/>
<type id="0xFE" description="Hardware Address" name="hwadr" composite="true"/>
<type id="0xFF" description="Unknown" name="unknown" size="0" />
<type id="0xD8" description="Temperature" name="temperature" size="2" analog="true" signed="true" />
</atomic>
</configurator>
2 changes: 1 addition & 1 deletion zcl-builtin/matter/data-model/chip/thermostat-cluster.xml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ limitations under the License.
<client tick="false" init="false">true</client>
<server tick="false" init="false">true</server>
<globalAttribute side="either" code="0xFFFD" value="5"/>
<attribute side="server" code="0x0000" define="LOCAL_TEMPERATURE" type="TEMPERATURE" min="0x954D" max="0x7FFF" writable="false" reportable="true" optional="false" isNullable="true">LocalTemperature</attribute>
<attribute side="server" code="0x0000" define="LOCAL_TEMPERATURE" type="INT16S" min="0x954D" max="0x7FFF" writable="false" reportable="true" optional="false" isNullable="true">LocalTemperature</attribute>
<attribute side="server" code="0x0001" define="OUTDOOR_TEMPERATURE" type="INT16S" min="0x954D" max="0x7FFF" writable="false" optional="true" isNullable="true">OutdoorTemperature</attribute>
<attribute side="server" code="0x0002" define="THERMOSTAT_OCCUPANCY" type="BITMAP8" min="0x00" max="0x01" writable="false" default="0x01" optional="true">Occupancy</attribute>
<!-- OCCUPANCY -->
Expand Down

0 comments on commit 851ac0b

Please sign in to comment.