Skip to content

Commit

Permalink
Sync temperature control clusters xml to spec (#27036)
Browse files Browse the repository at this point in the history
* Sync temperature control cluster to updated spec

* Zap regen

* Addressed review comments

* Fixed darwin CI
  • Loading branch information
jadhavrohit924 authored and pull[bot] committed Nov 16, 2023
1 parent 7cad698 commit 1104790
Show file tree
Hide file tree
Showing 37 changed files with 150 additions and 447 deletions.
2 changes: 1 addition & 1 deletion src/app/zap-templates/zcl/data-model/chip/chip-types.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ limitations under the License.
<type id="0xE5" description="System Time Microseconds" name="systime_us" size="8" analog="true" />
<type id="0xD1" description="System Time Milliseconds" name="systime_ms" size="8" analog="true" />
<type id="0xD2" description="Elapsed Time Seconds" name="elapsed_s" size="4" analog="true" />
<type id="0xDB" description="Temperature" name="temperature" size="2" analog="true" />
<type id="0xDB" description="Temperature" name="temperature" size="2" analog="true" signed="true" />
<type id="0xE6" description="Percentage units 1%" name="percent" size="1" analog="true" />
<type id="0xE7" description="Percentage units 0.01%" name="percent100ths" size="2" analog="true" />
<type id="0xE8" description="Cluster ID" name="cluster_id" size="4" discrete="true" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@ limitations under the License.
<configurator>
<domain name="CHIP"/>

<struct name="TemperatureLevelStruct">
<cluster code="0x0056"/>
<item fieldId="0" name="Label" type="char_string" length="64" isNullable="false" writable="false"/>
<item fieldId="1" name="TemperatureLevel" type="int8u" isNullable="false" writable="false"/>
</struct>

<cluster>
<name>Temperature Control</name>
<domain>Appliances</domain>
Expand All @@ -31,22 +25,23 @@ limitations under the License.
<define>TEMPERATURE_CONTROL_CLUSTER</define>
<client tick="false" init="false">true</client>
<server tick="false" init="false">true</server>
<attribute side="server" code="0x0000" define="TEMP_SETPOINT" type="INT16S" writable="false" optional="true">TemperatureSetpoint</attribute>
<attribute side="server" code="0x0001" define="MIN_TEMP" type="INT16S" writable="false" optional="true">MinTemperature</attribute>
<attribute side="server" code="0x0002" define="MAX_TEMP" type="INT16S" writable="false" optional="true">MaxTemperature</attribute>
<attribute side="server" code="0x0003" define="STEP" type="INT16S" writable="false" optional="true">Step</attribute>
<attribute side="server" code="0x0004" define="CURRENT_TEMP_LEVEL_IND" type="INT8U" writable="false" optional="true">CurrentTemperatureLevelIndex</attribute>
<attribute side="server" code="0x0005" define="SUPPORTED_TEMP_LEVELS" type="ARRAY" entryType="TemperatureLevelStruct" writable="false" optional="true">SupportedTemperatureLevels</attribute>
<attribute side="server" code="0x0000" define="TEMP_SETPOINT" type="temperature" writable="false" optional="true">TemperatureSetpoint</attribute>
<attribute side="server" code="0x0001" define="MIN_TEMP" type="temperature" writable="false" optional="true">MinTemperature</attribute>
<attribute side="server" code="0x0002" define="MAX_TEMP" type="temperature" writable="false" optional="true">MaxTemperature</attribute>
<attribute side="server" code="0x0003" define="STEP" type="temperature" writable="false" optional="true">Step</attribute>
<attribute side="server" code="0x0004" define="SELECTED_TEMP_LEVEL" type="INT8U" writable="false" optional="true">SelectedTemperatureLevel</attribute>
<attribute side="server" code="0x0005" define="SUPPORTED_TEMP_LEVELS" type="ARRAY" entryType="char_string" writable="false" optional="true">SupportedTemperatureLevels</attribute>

<command source="client" code="0x00" name="SetTemperature" optional="false">
<description>Set Temperature</description>
<arg name="TargetTemperature" type="INT16S" min="MIN_TEMP" max="MAX_TEMP" optional="true"/>
<arg name="TargetTemperature" type="temperature" min="MIN_TEMP" max="MAX_TEMP" optional="true"/>
<arg name="TargetTemperatureLevel" type="INT8U" optional="true"/>
</command>
</cluster>
<bitmap name="Feature" type="BITMAP32">
<cluster code="0x0056"/>
<field mask="0x01" name="TemperatureNumber" />
<field mask="0x02" name="TemperatureLevel" />
<field mask="0x04" name="TemperatureStep" />
</bitmap>
</configurator>
20 changes: 8 additions & 12 deletions src/controller/data_model/controller-clusters.matter
Original file line number Diff line number Diff line change
Expand Up @@ -3081,19 +3081,15 @@ client cluster TemperatureControl = 86 {
bitmap Feature : BITMAP32 {
kTemperatureNumber = 0x1;
kTemperatureLevel = 0x2;
kTemperatureStep = 0x4;
}

struct TemperatureLevelStruct {
char_string<64> label = 0;
int8u temperatureLevel = 1;
}

readonly attribute optional int16s temperatureSetpoint = 0;
readonly attribute optional int16s minTemperature = 1;
readonly attribute optional int16s maxTemperature = 2;
readonly attribute optional int16s step = 3;
readonly attribute optional int8u currentTemperatureLevelIndex = 4;
readonly attribute optional TemperatureLevelStruct supportedTemperatureLevels[] = 5;
readonly attribute optional temperature temperatureSetpoint = 0;
readonly attribute optional temperature minTemperature = 1;
readonly attribute optional temperature maxTemperature = 2;
readonly attribute optional temperature step = 3;
readonly attribute optional int8u selectedTemperatureLevel = 4;
readonly attribute optional char_string supportedTemperatureLevels[] = 5;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
readonly attribute event_id eventList[] = 65530;
Expand All @@ -3102,7 +3098,7 @@ client cluster TemperatureControl = 86 {
readonly attribute int16u clusterRevision = 65533;

request struct SetTemperatureRequest {
optional INT16S targetTemperature = 0;
optional temperature targetTemperature = 0;
optional INT8U targetTemperatureLevel = 1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6905,7 +6905,7 @@ public enum Attribute {
MinTemperature(1L),
MaxTemperature(2L),
Step(3L),
CurrentTemperatureLevelIndex(4L),
SelectedTemperatureLevel(4L),
SupportedTemperatureLevels(5L),
GeneratedCommandList(65528L),
AcceptedCommandList(65529L),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6601,17 +6601,17 @@ private static Map<String, InteractionInfo> readTemperatureControlInteractionInf
readTemperatureControlStepCommandParams
);
result.put("readStepAttribute", readTemperatureControlStepAttributeInteractionInfo);
Map<String, CommandParameterInfo> readTemperatureControlCurrentTemperatureLevelIndexCommandParams = new LinkedHashMap<String, CommandParameterInfo>();
InteractionInfo readTemperatureControlCurrentTemperatureLevelIndexAttributeInteractionInfo = new InteractionInfo(
Map<String, CommandParameterInfo> readTemperatureControlSelectedTemperatureLevelCommandParams = new LinkedHashMap<String, CommandParameterInfo>();
InteractionInfo readTemperatureControlSelectedTemperatureLevelAttributeInteractionInfo = new InteractionInfo(
(cluster, callback, commandArguments) -> {
((ChipClusters.TemperatureControlCluster) cluster).readCurrentTemperatureLevelIndexAttribute(
((ChipClusters.TemperatureControlCluster) cluster).readSelectedTemperatureLevelAttribute(
(ChipClusters.IntegerAttributeCallback) callback
);
},
() -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(),
readTemperatureControlCurrentTemperatureLevelIndexCommandParams
readTemperatureControlSelectedTemperatureLevelCommandParams
);
result.put("readCurrentTemperatureLevelIndexAttribute", readTemperatureControlCurrentTemperatureLevelIndexAttributeInteractionInfo);
result.put("readSelectedTemperatureLevelAttribute", readTemperatureControlSelectedTemperatureLevelAttributeInteractionInfo);
Map<String, CommandParameterInfo> readTemperatureControlSupportedTemperatureLevelsCommandParams = new LinkedHashMap<String, CommandParameterInfo>();
InteractionInfo readTemperatureControlSupportedTemperatureLevelsAttributeInteractionInfo = new InteractionInfo(
(cluster, callback, commandArguments) -> {
Expand Down
33 changes: 3 additions & 30 deletions src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions src/controller/java/zap-generated/CHIPClientCallbacks.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 2 additions & 31 deletions src/controller/java/zap-generated/CHIPReadCallbacks.cpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/controller/python/chip/clusters/CHIPClusters.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 1104790

Please sign in to comment.