Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move OccupancySensing to match the spec #29956

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1465,8 +1465,8 @@ client cluster OccupancySensing = 1030 {
attribute access(write: manage) optional int16u ultrasonicOccupiedToUnoccupiedDelay = 32;
attribute access(write: manage) optional int16u ultrasonicUnoccupiedToOccupiedDelay = 33;
attribute access(write: manage) optional int8u ultrasonicUnoccupiedToOccupiedThreshold = 34;
attribute access(write: manage) optional int16u physicalContactOccupiedToUnoccupiedDelay = 48;
attribute access(write: manage) optional int16u physicalContactUnoccupiedToOccupiedDelay = 49;
attribute access(write: manage) optional nullable int16u physicalContactOccupiedToUnoccupiedDelay = 48;
attribute access(write: manage) optional nullable int16u physicalContactUnoccupiedToOccupiedDelay = 49;
attribute access(write: manage) optional int8u physicalContactUnoccupiedToOccupiedThreshold = 50;
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 @@ -1329,8 +1329,8 @@ client cluster OccupancySensing = 1030 {
attribute access(write: manage) optional int16u ultrasonicOccupiedToUnoccupiedDelay = 32;
attribute access(write: manage) optional int16u ultrasonicUnoccupiedToOccupiedDelay = 33;
attribute access(write: manage) optional int8u ultrasonicUnoccupiedToOccupiedThreshold = 34;
attribute access(write: manage) optional int16u physicalContactOccupiedToUnoccupiedDelay = 48;
attribute access(write: manage) optional int16u physicalContactUnoccupiedToOccupiedDelay = 49;
attribute access(write: manage) optional nullable int16u physicalContactOccupiedToUnoccupiedDelay = 48;
attribute access(write: manage) optional nullable int16u physicalContactUnoccupiedToOccupiedDelay = 49;
attribute access(write: manage) optional int8u physicalContactUnoccupiedToOccupiedThreshold = 50;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
Expand Down
4 changes: 2 additions & 2 deletions examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter
Original file line number Diff line number Diff line change
Expand Up @@ -1408,8 +1408,8 @@ client cluster OccupancySensing = 1030 {
attribute access(write: manage) optional int16u ultrasonicOccupiedToUnoccupiedDelay = 32;
attribute access(write: manage) optional int16u ultrasonicUnoccupiedToOccupiedDelay = 33;
attribute access(write: manage) optional int8u ultrasonicUnoccupiedToOccupiedThreshold = 34;
attribute access(write: manage) optional int16u physicalContactOccupiedToUnoccupiedDelay = 48;
attribute access(write: manage) optional int16u physicalContactUnoccupiedToOccupiedDelay = 49;
attribute access(write: manage) optional nullable int16u physicalContactOccupiedToUnoccupiedDelay = 48;
attribute access(write: manage) optional nullable int16u physicalContactUnoccupiedToOccupiedDelay = 49;
attribute access(write: manage) optional int8u physicalContactUnoccupiedToOccupiedThreshold = 50;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
Expand Down
4 changes: 2 additions & 2 deletions examples/placeholder/linux/apps/app1/config.matter
Original file line number Diff line number Diff line change
Expand Up @@ -5277,8 +5277,8 @@ server cluster OccupancySensing = 1030 {
attribute access(write: manage) int16u ultrasonicOccupiedToUnoccupiedDelay = 32;
attribute access(write: manage) int16u ultrasonicUnoccupiedToOccupiedDelay = 33;
attribute access(write: manage) int8u ultrasonicUnoccupiedToOccupiedThreshold = 34;
attribute access(write: manage) int16u physicalContactOccupiedToUnoccupiedDelay = 48;
attribute access(write: manage) int16u physicalContactUnoccupiedToOccupiedDelay = 49;
attribute access(write: manage) nullable int16u physicalContactOccupiedToUnoccupiedDelay = 48;
attribute access(write: manage) nullable int16u physicalContactUnoccupiedToOccupiedDelay = 49;
attribute access(write: manage) int8u physicalContactUnoccupiedToOccupiedThreshold = 50;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
Expand Down
4 changes: 2 additions & 2 deletions examples/placeholder/linux/apps/app2/config.matter
Original file line number Diff line number Diff line change
Expand Up @@ -5236,8 +5236,8 @@ server cluster OccupancySensing = 1030 {
attribute access(write: manage) int16u ultrasonicOccupiedToUnoccupiedDelay = 32;
attribute access(write: manage) int16u ultrasonicUnoccupiedToOccupiedDelay = 33;
attribute access(write: manage) int8u ultrasonicUnoccupiedToOccupiedThreshold = 34;
attribute access(write: manage) int16u physicalContactOccupiedToUnoccupiedDelay = 48;
attribute access(write: manage) int16u physicalContactUnoccupiedToOccupiedDelay = 49;
attribute access(write: manage) nullable int16u physicalContactOccupiedToUnoccupiedDelay = 48;
attribute access(write: manage) nullable int16u physicalContactUnoccupiedToOccupiedDelay = 49;
attribute access(write: manage) int8u physicalContactUnoccupiedToOccupiedThreshold = 50;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
Expand Down
4 changes: 2 additions & 2 deletions examples/pump-app/pump-common/pump-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -1386,8 +1386,8 @@ client cluster OccupancySensing = 1030 {
attribute access(write: manage) optional int16u ultrasonicOccupiedToUnoccupiedDelay = 32;
attribute access(write: manage) optional int16u ultrasonicUnoccupiedToOccupiedDelay = 33;
attribute access(write: manage) optional int8u ultrasonicUnoccupiedToOccupiedThreshold = 34;
attribute access(write: manage) optional int16u physicalContactOccupiedToUnoccupiedDelay = 48;
attribute access(write: manage) optional int16u physicalContactUnoccupiedToOccupiedDelay = 49;
attribute access(write: manage) optional nullable int16u physicalContactOccupiedToUnoccupiedDelay = 48;
attribute access(write: manage) optional nullable int16u physicalContactUnoccupiedToOccupiedDelay = 49;
attribute access(write: manage) optional int8u physicalContactUnoccupiedToOccupiedThreshold = 50;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
Expand Down
4 changes: 2 additions & 2 deletions examples/pump-app/silabs/data_model/pump-thread-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -1386,8 +1386,8 @@ client cluster OccupancySensing = 1030 {
attribute access(write: manage) optional int16u ultrasonicOccupiedToUnoccupiedDelay = 32;
attribute access(write: manage) optional int16u ultrasonicUnoccupiedToOccupiedDelay = 33;
attribute access(write: manage) optional int8u ultrasonicUnoccupiedToOccupiedThreshold = 34;
attribute access(write: manage) optional int16u physicalContactOccupiedToUnoccupiedDelay = 48;
attribute access(write: manage) optional int16u physicalContactUnoccupiedToOccupiedDelay = 49;
attribute access(write: manage) optional nullable int16u physicalContactOccupiedToUnoccupiedDelay = 48;
attribute access(write: manage) optional nullable int16u physicalContactUnoccupiedToOccupiedDelay = 49;
attribute access(write: manage) optional int8u physicalContactUnoccupiedToOccupiedThreshold = 50;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
Expand Down
4 changes: 2 additions & 2 deletions examples/pump-app/silabs/data_model/pump-wifi-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -1386,8 +1386,8 @@ client cluster OccupancySensing = 1030 {
attribute access(write: manage) optional int16u ultrasonicOccupiedToUnoccupiedDelay = 32;
attribute access(write: manage) optional int16u ultrasonicUnoccupiedToOccupiedDelay = 33;
attribute access(write: manage) optional int8u ultrasonicUnoccupiedToOccupiedThreshold = 34;
attribute access(write: manage) optional int16u physicalContactOccupiedToUnoccupiedDelay = 48;
attribute access(write: manage) optional int16u physicalContactUnoccupiedToOccupiedDelay = 49;
attribute access(write: manage) optional nullable int16u physicalContactOccupiedToUnoccupiedDelay = 48;
attribute access(write: manage) optional nullable int16u physicalContactUnoccupiedToOccupiedDelay = 49;
attribute access(write: manage) optional int8u physicalContactUnoccupiedToOccupiedThreshold = 50;
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 @@ -89,13 +89,13 @@ limitations under the License.
<access op="write" role="manage"/>
</attribute>

<attribute side="server" code="0x0030" define="PHYSICAL_CONTACT_OCCUPIED_TO_UNOCCUPIED_DELAY" type="int16u" writable="true" default="0x0000" optional="true">
<attribute side="server" code="0x0030" define="PHYSICAL_CONTACT_OCCUPIED_TO_UNOCCUPIED_DELAY" type="int16u" writable="true" default="0x0000" optional="true" isNullable="true">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a backwards incompatible API and wire change. We need to change the spec instead.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at the spec, this is also a bit strange. The PhysicalContactOccupiedToUnoccupiedDelay and PhysicalContactUnoccupiedToOccupiedDelay are the only delay attributes which is nullable.

I can make a PR to remove the X quality and remove "The null value indicates that the sensor does not report occupied to unoccupied transition." statement from the attributes? @andreilitvin?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should change the spec here: make things consistent and also not break backwards wire compatibility (which we certainly cannot do)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<description>PhysicalContactOccupiedToUnoccupiedDelay</description>
<access op="read" role="view"/>
<access op="write" role="manage"/>
</attribute>

<attribute side="server" code="0x0031" define="PHYSICAL_CONTACT_UNOCCUPIED_TO_OCCUPIED_DELAY" type="int16u" writable="true" default="0x0000" optional="true">
<attribute side="server" code="0x0031" define="PHYSICAL_CONTACT_UNOCCUPIED_TO_OCCUPIED_DELAY" type="int16u" writable="true" default="0x0000" optional="true" isNullable="true">
<description>PhysicalContactUnoccupiedToOccupiedDelay</description>
<access op="read" role="view"/>
<access op="write" role="manage"/>
Expand Down
4 changes: 2 additions & 2 deletions src/controller/data_model/controller-clusters.matter
Original file line number Diff line number Diff line change
Expand Up @@ -5188,8 +5188,8 @@ client cluster OccupancySensing = 1030 {
attribute access(write: manage) optional int16u ultrasonicOccupiedToUnoccupiedDelay = 32;
attribute access(write: manage) optional int16u ultrasonicUnoccupiedToOccupiedDelay = 33;
attribute access(write: manage) optional int8u ultrasonicUnoccupiedToOccupiedThreshold = 34;
attribute access(write: manage) optional int16u physicalContactOccupiedToUnoccupiedDelay = 48;
attribute access(write: manage) optional int16u physicalContactUnoccupiedToOccupiedDelay = 49;
attribute access(write: manage) optional nullable int16u physicalContactOccupiedToUnoccupiedDelay = 48;
attribute access(write: manage) optional nullable int16u physicalContactUnoccupiedToOccupiedDelay = 49;
attribute access(write: manage) optional int8u physicalContactUnoccupiedToOccupiedThreshold = 50;
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 @@ -21675,6 +21675,18 @@ public OccupancySensingCluster(long devicePtr, int endpointId) {
@Override
public native long initWithDevice(long devicePtr, int endpointId);

public interface PhysicalContactOccupiedToUnoccupiedDelayAttributeCallback {
void onSuccess(@Nullable Integer value);
void onError(Exception ex);
default void onSubscriptionEstablished(long subscriptionId) {}
}

public interface PhysicalContactUnoccupiedToOccupiedDelayAttributeCallback {
void onSuccess(@Nullable Integer value);
void onError(Exception ex);
default void onSubscriptionEstablished(long subscriptionId) {}
}

public interface GeneratedCommandListAttributeCallback {
void onSuccess(List<Long> value);
void onError(Exception ex);
Expand Down Expand Up @@ -21838,7 +21850,7 @@ public void subscribeUltrasonicUnoccupiedToOccupiedThresholdAttribute(
}

public void readPhysicalContactOccupiedToUnoccupiedDelayAttribute(
IntegerAttributeCallback callback) {
PhysicalContactOccupiedToUnoccupiedDelayAttributeCallback callback) {
readPhysicalContactOccupiedToUnoccupiedDelayAttribute(chipClusterPtr, callback);
}

Expand All @@ -21851,12 +21863,12 @@ public void writePhysicalContactOccupiedToUnoccupiedDelayAttribute(DefaultCluste
}

public void subscribePhysicalContactOccupiedToUnoccupiedDelayAttribute(
IntegerAttributeCallback callback, int minInterval, int maxInterval) {
PhysicalContactOccupiedToUnoccupiedDelayAttributeCallback callback, int minInterval, int maxInterval) {
subscribePhysicalContactOccupiedToUnoccupiedDelayAttribute(chipClusterPtr, callback, minInterval, maxInterval);
}

public void readPhysicalContactUnoccupiedToOccupiedDelayAttribute(
IntegerAttributeCallback callback) {
PhysicalContactUnoccupiedToOccupiedDelayAttributeCallback callback) {
readPhysicalContactUnoccupiedToOccupiedDelayAttribute(chipClusterPtr, callback);
}

Expand All @@ -21869,7 +21881,7 @@ public void writePhysicalContactUnoccupiedToOccupiedDelayAttribute(DefaultCluste
}

public void subscribePhysicalContactUnoccupiedToOccupiedDelayAttribute(
IntegerAttributeCallback callback, int minInterval, int maxInterval) {
PhysicalContactUnoccupiedToOccupiedDelayAttributeCallback callback, int minInterval, int maxInterval) {
subscribePhysicalContactUnoccupiedToOccupiedDelayAttribute(chipClusterPtr, callback, minInterval, maxInterval);
}

Expand Down Expand Up @@ -21999,17 +22011,17 @@ public void subscribeClusterRevisionAttribute(

private native void subscribeUltrasonicUnoccupiedToOccupiedThresholdAttribute(long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval);

private native void readPhysicalContactOccupiedToUnoccupiedDelayAttribute(long chipClusterPtr, IntegerAttributeCallback callback);
private native void readPhysicalContactOccupiedToUnoccupiedDelayAttribute(long chipClusterPtr, PhysicalContactOccupiedToUnoccupiedDelayAttributeCallback callback);

private native void writePhysicalContactOccupiedToUnoccupiedDelayAttribute(long chipClusterPtr, DefaultClusterCallback callback, Integer value, @Nullable Integer timedWriteTimeoutMs);

private native void subscribePhysicalContactOccupiedToUnoccupiedDelayAttribute(long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval);
private native void subscribePhysicalContactOccupiedToUnoccupiedDelayAttribute(long chipClusterPtr, PhysicalContactOccupiedToUnoccupiedDelayAttributeCallback callback, int minInterval, int maxInterval);

private native void readPhysicalContactUnoccupiedToOccupiedDelayAttribute(long chipClusterPtr, IntegerAttributeCallback callback);
private native void readPhysicalContactUnoccupiedToOccupiedDelayAttribute(long chipClusterPtr, PhysicalContactUnoccupiedToOccupiedDelayAttributeCallback callback);

private native void writePhysicalContactUnoccupiedToOccupiedDelayAttribute(long chipClusterPtr, DefaultClusterCallback callback, Integer value, @Nullable Integer timedWriteTimeoutMs);

private native void subscribePhysicalContactUnoccupiedToOccupiedDelayAttribute(long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval);
private native void subscribePhysicalContactUnoccupiedToOccupiedDelayAttribute(long chipClusterPtr, PhysicalContactUnoccupiedToOccupiedDelayAttributeCallback callback, int minInterval, int maxInterval);

private native void readPhysicalContactUnoccupiedToOccupiedThresholdAttribute(long chipClusterPtr, IntegerAttributeCallback callback);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11811,6 +11811,48 @@ public void onError(Exception ex) {
}
}

public static class DelegatedOccupancySensingClusterPhysicalContactOccupiedToUnoccupiedDelayAttributeCallback implements ChipClusters.OccupancySensingCluster.PhysicalContactOccupiedToUnoccupiedDelayAttributeCallback, DelegatedClusterCallback {
private ClusterCommandCallback callback;
@Override
public void setCallbackDelegate(ClusterCommandCallback callback) {
this.callback = callback;
}

@Override
public void onSuccess(@Nullable Integer value) {
Map<CommandResponseInfo, Object> responseValues = new LinkedHashMap<>();
CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Integer");
responseValues.put(commandResponseInfo, value);
callback.onSuccess(responseValues);
}

@Override
public void onError(Exception ex) {
callback.onFailure(ex);
}
}

public static class DelegatedOccupancySensingClusterPhysicalContactUnoccupiedToOccupiedDelayAttributeCallback implements ChipClusters.OccupancySensingCluster.PhysicalContactUnoccupiedToOccupiedDelayAttributeCallback, DelegatedClusterCallback {
private ClusterCommandCallback callback;
@Override
public void setCallbackDelegate(ClusterCommandCallback callback) {
this.callback = callback;
}

@Override
public void onSuccess(@Nullable Integer value) {
Map<CommandResponseInfo, Object> responseValues = new LinkedHashMap<>();
CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Integer");
responseValues.put(commandResponseInfo, value);
callback.onSuccess(responseValues);
}

@Override
public void onError(Exception ex) {
callback.onFailure(ex);
}
}

public static class DelegatedOccupancySensingClusterGeneratedCommandListAttributeCallback implements ChipClusters.OccupancySensingCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback {
private ClusterCommandCallback callback;
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11743,21 +11743,21 @@ private static Map<String, InteractionInfo> readOccupancySensingInteractionInfo(
InteractionInfo readOccupancySensingPhysicalContactOccupiedToUnoccupiedDelayAttributeInteractionInfo = new InteractionInfo(
(cluster, callback, commandArguments) -> {
((ChipClusters.OccupancySensingCluster) cluster).readPhysicalContactOccupiedToUnoccupiedDelayAttribute(
(ChipClusters.IntegerAttributeCallback) callback
(ChipClusters.OccupancySensingCluster.PhysicalContactOccupiedToUnoccupiedDelayAttributeCallback) callback
);
},
() -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(),
() -> new ClusterInfoMapping.DelegatedOccupancySensingClusterPhysicalContactOccupiedToUnoccupiedDelayAttributeCallback(),
readOccupancySensingPhysicalContactOccupiedToUnoccupiedDelayCommandParams
);
result.put("readPhysicalContactOccupiedToUnoccupiedDelayAttribute", readOccupancySensingPhysicalContactOccupiedToUnoccupiedDelayAttributeInteractionInfo);
Map<String, CommandParameterInfo> readOccupancySensingPhysicalContactUnoccupiedToOccupiedDelayCommandParams = new LinkedHashMap<String, CommandParameterInfo>();
InteractionInfo readOccupancySensingPhysicalContactUnoccupiedToOccupiedDelayAttributeInteractionInfo = new InteractionInfo(
(cluster, callback, commandArguments) -> {
((ChipClusters.OccupancySensingCluster) cluster).readPhysicalContactUnoccupiedToOccupiedDelayAttribute(
(ChipClusters.IntegerAttributeCallback) callback
(ChipClusters.OccupancySensingCluster.PhysicalContactUnoccupiedToOccupiedDelayAttributeCallback) callback
);
},
() -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(),
() -> new ClusterInfoMapping.DelegatedOccupancySensingClusterPhysicalContactUnoccupiedToOccupiedDelayAttributeCallback(),
readOccupancySensingPhysicalContactUnoccupiedToOccupiedDelayCommandParams
);
result.put("readPhysicalContactUnoccupiedToOccupiedDelayAttribute", readOccupancySensingPhysicalContactUnoccupiedToOccupiedDelayAttributeInteractionInfo);
Expand Down
Loading
Loading