Skip to content

Commit

Permalink
[SMCO] Rename SensitivityLevel to SmokeSensitivityLevel (#28093)
Browse files Browse the repository at this point in the history
* Rename SensitivityLevel to SmokeSensitivityLevel

* Regen zap

* Update SMCO server

---------

Co-authored-by: Hare <[email protected]>
  • Loading branch information
2 people authored and pull[bot] committed Oct 30, 2023
1 parent 411170f commit 1479828
Show file tree
Hide file tree
Showing 21 changed files with 79 additions and 77 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2666,7 +2666,7 @@ server cluster SmokeCoAlarm = 92 {
readonly attribute AlarmStateEnum interconnectSmokeAlarm = 8;
readonly attribute AlarmStateEnum interconnectCOAlarm = 9;
readonly attribute ContaminationStateEnum contaminationState = 10;
attribute SensitivityEnum sensitivityLevel = 11;
attribute SensitivityEnum smokeSensitivityLevel = 11;
readonly attribute epoch_s expiryDate = 12;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
Expand Down Expand Up @@ -6303,7 +6303,7 @@ endpoint 1 {
ram attribute interconnectSmokeAlarm default = 0;
ram attribute interconnectCOAlarm default = 0;
ram attribute contaminationState default = 0;
ram attribute sensitivityLevel default = 1;
ram attribute smokeSensitivityLevel default = 1;
ram attribute expiryDate default = 0;
ram attribute featureMap default = 3;
ram attribute clusterRevision default = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1705,7 +1705,7 @@ server cluster SmokeCoAlarm = 92 {
readonly attribute AlarmStateEnum interconnectSmokeAlarm = 8;
readonly attribute AlarmStateEnum interconnectCOAlarm = 9;
readonly attribute ContaminationStateEnum contaminationState = 10;
attribute SensitivityEnum sensitivityLevel = 11;
attribute SensitivityEnum smokeSensitivityLevel = 11;
readonly attribute epoch_s expiryDate = 12;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
Expand Down Expand Up @@ -2231,7 +2231,7 @@ endpoint 1 {
ram attribute interconnectSmokeAlarm default = 0;
ram attribute interconnectCOAlarm default = 0;
ram attribute contaminationState default = 0;
ram attribute sensitivityLevel default = 1;
ram attribute smokeSensitivityLevel default = 1;
ram attribute expiryDate default = 0;
ram attribute featureMap default = 3;
ram attribute clusterRevision default = 1;
Expand Down
18 changes: 10 additions & 8 deletions src/app/clusters/smoke-co-alarm-server/smoke-co-alarm-server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -351,15 +351,16 @@ bool SmokeCoAlarmServer::SetContaminationState(EndpointId endpointId, Contaminat
return success;
}

bool SmokeCoAlarmServer::SetSensitivityLevel(EndpointId endpointId, SensitivityEnum newSensitivityLevel)
bool SmokeCoAlarmServer::SetSmokeSensitivityLevel(EndpointId endpointId, SensitivityEnum newSmokeSensitivityLevel)
{
SensitivityEnum sensitivityLevel;
bool success = GetAttribute(endpointId, Attributes::SensitivityLevel::Id, Attributes::SensitivityLevel::Get, sensitivityLevel);
SensitivityEnum smokeSensitivityLevel;
bool success = GetAttribute(endpointId, Attributes::SmokeSensitivityLevel::Id, Attributes::SmokeSensitivityLevel::Get,
smokeSensitivityLevel);

if (success && (sensitivityLevel != newSensitivityLevel))
if (success && (smokeSensitivityLevel != newSmokeSensitivityLevel))
{
success =
SetAttribute(endpointId, Attributes::SensitivityLevel::Id, Attributes::SensitivityLevel::Set, newSensitivityLevel);
success = SetAttribute(endpointId, Attributes::SmokeSensitivityLevel::Id, Attributes::SmokeSensitivityLevel::Set,
newSmokeSensitivityLevel);
}

return success;
Expand Down Expand Up @@ -421,9 +422,10 @@ bool SmokeCoAlarmServer::GetContaminationState(EndpointId endpointId, Contaminat
return GetAttribute(endpointId, Attributes::ContaminationState::Id, Attributes::ContaminationState::Get, contaminationState);
}

bool SmokeCoAlarmServer::GetSensitivityLevel(EndpointId endpointId, SensitivityEnum & sensitivityLevel)
bool SmokeCoAlarmServer::GetSmokeSensitivityLevel(EndpointId endpointId, SensitivityEnum & smokeSensitivityLevel)
{
return GetAttribute(endpointId, Attributes::SensitivityLevel::Id, Attributes::SensitivityLevel::Get, sensitivityLevel);
return GetAttribute(endpointId, Attributes::SmokeSensitivityLevel::Id, Attributes::SmokeSensitivityLevel::Get,
smokeSensitivityLevel);
}

bool SmokeCoAlarmServer::GetExpiryDate(EndpointId endpointId, uint32_t & expiryDate)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class SmokeCoAlarmServer
bool SetInterconnectSmokeAlarm(chip::EndpointId endpointId, AlarmStateEnum newInterconnectSmokeAlarm);
bool SetInterconnectCOAlarm(chip::EndpointId endpointId, AlarmStateEnum newInterconnectCOAlarm);
bool SetContaminationState(chip::EndpointId endpointId, ContaminationStateEnum newContaminationState);
bool SetSensitivityLevel(chip::EndpointId endpointId, SensitivityEnum newSensitivityLevel);
bool SetSmokeSensitivityLevel(chip::EndpointId endpointId, SensitivityEnum newSmokeSensitivityLevel);

bool GetExpressedState(chip::EndpointId endpointId, ExpressedStateEnum & expressedState);
bool GetSmokeState(chip::EndpointId endpointId, AlarmStateEnum & smokeState);
Expand All @@ -84,7 +84,7 @@ class SmokeCoAlarmServer
bool GetInterconnectSmokeAlarm(chip::EndpointId endpointId, AlarmStateEnum & interconnectSmokeAlarm);
bool GetInterconnectCOAlarm(chip::EndpointId endpointId, AlarmStateEnum & interconnectCOAlarm);
bool GetContaminationState(chip::EndpointId endpointId, ContaminationStateEnum & contaminationState);
bool GetSensitivityLevel(chip::EndpointId endpointId, SensitivityEnum & sensitivityLevel);
bool GetSmokeSensitivityLevel(chip::EndpointId endpointId, SensitivityEnum & smokeSensitivityLevel);
bool GetExpiryDate(chip::EndpointId endpointId, uint32_t & expiryDate);

chip::BitFlags<Feature> GetFeatures(chip::EndpointId endpointId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ limitations under the License.
<attribute side="server" code="0x0008" define="INTERCONNECT_SMOKE_ALARM" type="AlarmStateEnum" writable="false" optional="true">InterconnectSmokeAlarm</attribute>
<attribute side="server" code="0x0009" define="INTERCONNECT_CO_ALARM" type="AlarmStateEnum" writable="false" optional="true">InterconnectCOAlarm</attribute>
<attribute side="server" code="0x000A" define="CONTAMINATION_STATE" type="ContaminationStateEnum" writable="false" optional="true">ContaminationState</attribute>
<attribute side="server" code="0x000B" define="SENSITIVITY_LEVEL" type="SensitivityEnum" min="0" max="2" writable="true" optional="true">SensitivityLevel</attribute>
<attribute side="server" code="0x000B" define="SENSITIVITY_LEVEL" type="SensitivityEnum" min="0" max="2" writable="true" optional="true">SmokeSensitivityLevel</attribute>
<attribute side="server" code="0x000C" define="EXPIRY_DATE" type="epoch_s" writable="false" optional="true">ExpiryDate</attribute>

<!-- Commands -->
Expand Down
2 changes: 1 addition & 1 deletion src/controller/data_model/controller-clusters.matter
Original file line number Diff line number Diff line change
Expand Up @@ -3258,7 +3258,7 @@ client cluster SmokeCoAlarm = 92 {
readonly attribute optional AlarmStateEnum interconnectSmokeAlarm = 8;
readonly attribute optional AlarmStateEnum interconnectCOAlarm = 9;
readonly attribute optional ContaminationStateEnum contaminationState = 10;
attribute optional SensitivityEnum sensitivityLevel = 11;
attribute optional SensitivityEnum smokeSensitivityLevel = 11;
readonly attribute optional epoch_s expiryDate = 12;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7352,7 +7352,7 @@ public enum Attribute {
InterconnectSmokeAlarm(8L),
InterconnectCOAlarm(9L),
ContaminationState(10L),
SensitivityLevel(11L),
SmokeSensitivityLevel(11L),
ExpiryDate(12L),
GeneratedCommandList(65528L),
AcceptedCommandList(65529L),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7182,17 +7182,17 @@ private static Map<String, InteractionInfo> readSmokeCoAlarmInteractionInfo() {
readSmokeCoAlarmContaminationStateCommandParams
);
result.put("readContaminationStateAttribute", readSmokeCoAlarmContaminationStateAttributeInteractionInfo);
Map<String, CommandParameterInfo> readSmokeCoAlarmSensitivityLevelCommandParams = new LinkedHashMap<String, CommandParameterInfo>();
InteractionInfo readSmokeCoAlarmSensitivityLevelAttributeInteractionInfo = new InteractionInfo(
Map<String, CommandParameterInfo> readSmokeCoAlarmSmokeSensitivityLevelCommandParams = new LinkedHashMap<String, CommandParameterInfo>();
InteractionInfo readSmokeCoAlarmSmokeSensitivityLevelAttributeInteractionInfo = new InteractionInfo(
(cluster, callback, commandArguments) -> {
((ChipClusters.SmokeCoAlarmCluster) cluster).readSensitivityLevelAttribute(
((ChipClusters.SmokeCoAlarmCluster) cluster).readSmokeSensitivityLevelAttribute(
(ChipClusters.IntegerAttributeCallback) callback
);
},
() -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(),
readSmokeCoAlarmSensitivityLevelCommandParams
readSmokeCoAlarmSmokeSensitivityLevelCommandParams
);
result.put("readSensitivityLevelAttribute", readSmokeCoAlarmSensitivityLevelAttributeInteractionInfo);
result.put("readSmokeSensitivityLevelAttribute", readSmokeCoAlarmSmokeSensitivityLevelAttributeInteractionInfo);
Map<String, CommandParameterInfo> readSmokeCoAlarmExpiryDateCommandParams = new LinkedHashMap<String, CommandParameterInfo>();
InteractionInfo readSmokeCoAlarmExpiryDateAttributeInteractionInfo = new InteractionInfo(
(cluster, callback, commandArguments) -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1053,28 +1053,28 @@ public Map<String, Map<String, InteractionInfo>> getWriteAttributeMap() {
Map<String, InteractionInfo> writeAirQualityInteractionInfo = new LinkedHashMap<>();
writeAttributeMap.put("airQuality", writeAirQualityInteractionInfo);
Map<String, InteractionInfo> writeSmokeCoAlarmInteractionInfo = new LinkedHashMap<>();
Map<String, CommandParameterInfo> writeSmokeCoAlarmSensitivityLevelCommandParams = new LinkedHashMap<String, CommandParameterInfo>();
CommandParameterInfo smokeCoAlarmsensitivityLevelCommandParameterInfo =
Map<String, CommandParameterInfo> writeSmokeCoAlarmSmokeSensitivityLevelCommandParams = new LinkedHashMap<String, CommandParameterInfo>();
CommandParameterInfo smokeCoAlarmsmokeSensitivityLevelCommandParameterInfo =
new CommandParameterInfo(
"value",
Integer.class,
Integer.class
);
writeSmokeCoAlarmSensitivityLevelCommandParams.put(
writeSmokeCoAlarmSmokeSensitivityLevelCommandParams.put(
"value",
smokeCoAlarmsensitivityLevelCommandParameterInfo
smokeCoAlarmsmokeSensitivityLevelCommandParameterInfo
);
InteractionInfo writeSmokeCoAlarmSensitivityLevelAttributeInteractionInfo = new InteractionInfo(
InteractionInfo writeSmokeCoAlarmSmokeSensitivityLevelAttributeInteractionInfo = new InteractionInfo(
(cluster, callback, commandArguments) -> {
((ChipClusters.SmokeCoAlarmCluster) cluster).writeSensitivityLevelAttribute(
((ChipClusters.SmokeCoAlarmCluster) cluster).writeSmokeSensitivityLevelAttribute(
(DefaultClusterCallback) callback,
(Integer) commandArguments.get("value")
);
},
() -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(),
writeSmokeCoAlarmSensitivityLevelCommandParams
writeSmokeCoAlarmSmokeSensitivityLevelCommandParams
);
writeSmokeCoAlarmInteractionInfo.put("writeSensitivityLevelAttribute", writeSmokeCoAlarmSensitivityLevelAttributeInteractionInfo);
writeSmokeCoAlarmInteractionInfo.put("writeSmokeSensitivityLevelAttribute", writeSmokeCoAlarmSmokeSensitivityLevelAttributeInteractionInfo);
writeAttributeMap.put("smokeCoAlarm", writeSmokeCoAlarmInteractionInfo);
Map<String, InteractionInfo> writeDishwasherAlarmInteractionInfo = new LinkedHashMap<>();
writeAttributeMap.put("dishwasherAlarm", writeDishwasherAlarmInteractionInfo);
Expand Down

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/java/zap-generated/CHIPClustersWrite-JNI.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.

2 changes: 1 addition & 1 deletion src/controller/python/chip/clusters/CHIPClusters.py

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

6 changes: 3 additions & 3 deletions src/controller/python/chip/clusters/Objects.py

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.

Loading

0 comments on commit 1479828

Please sign in to comment.