File tree 2 files changed +9
-2
lines changed
2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -1627,7 +1627,9 @@ static BOOL AttributeHasChangesOmittedQuality(MTRAttributePath * attributePath)
1627
1627
1628
1628
// Send read request to device if any of the following are true:
1629
1629
// 1. Subscription not in a state we can expect reports
1630
- // 2. The attribute has (or is assumed to have) the Changes Omitted quality, so we won't get reports for it.
1630
+ // 2. The attribute has the Changes Omitted quality, so we won't get reports for it.
1631
+ // 3. The attribute is not in the spec, and the read params asks to assume
1632
+ // an unknown attribute has the Changes Omitted quality.
1631
1633
if (![self _subscriptionAbleToReport ] || hasChangesOmittedQuality) {
1632
1634
// Read requests container will be a mutable array of items, each being an array containing:
1633
1635
// [attribute request path, params]
Original file line number Diff line number Diff line change @@ -1518,6 +1518,10 @@ - (void)test017_TestMTRDeviceBasics
1518
1518
[self waitForExpectations:@[ onTimeWriteSuccess, onTimePreviousValue ] timeout:10];
1519
1519
1520
1520
// Test if errors are properly received
1521
+ // TODO: We might stop reporting these altogether from MTRDevice, and then
1522
+ // this test will need updating.
1523
+ __auto_type * readThroughForUnknownAttributesParams = [[MTRReadParams alloc] init];
1524
+ readThroughForUnknownAttributesParams.assumeUnknownAttributesReportable = NO;
1521
1525
XCTestExpectation * attributeReportErrorExpectation = [self expectationWithDescription:@"Attribute read error"];
1522
1526
delegate.onAttributeDataReceived = ^(NSArray<NSDictionary<NSString *, id> *> * data) {
1523
1527
for (NSDictionary<NSString *, id> * attributeReponseValue in data) {
@@ -1526,8 +1530,9 @@ - (void)test017_TestMTRDeviceBasics
1526
1530
}
1527
1531
}
1528
1532
};
1533
+
1529
1534
// use the nonexistent attribute and expect read error
1530
- [device readAttributeWithEndpointID:testEndpointID clusterID:testClusterID attributeID:testAttributeID params:nil ];
1535
+ [device readAttributeWithEndpointID:testEndpointID clusterID:testClusterID attributeID:testAttributeID params:readThroughForUnknownAttributesParams ];
1531
1536
[self waitForExpectations:@[ attributeReportErrorExpectation ] timeout:10];
1532
1537
1533
1538
// Resubscription test setup
You can’t perform that action at this time.
0 commit comments