Skip to content

Commit d0d9127

Browse files
jaehs6samcecilleandy31415andreilitvin
authored
Occupancy Sensing cluster Python test scripts (#34572)
* Occupancy Sensing cluster Python test scripts Consolidate previous TC-OCC-xx test script PRs (PR 34490, PR 34491, PR 34492, PR 34523) into this one upload. * Update TC_OCC_2_1.py * Update TC_OCC_2_2.py syntax error * Update TC_OCC_2_3.py * Update TC_OCC_3_1.py * Update TC_OCC_3_2.py * Update TC_OCC_2_1.py Accommodated recent test plan attribute conformance and Cecille comments * Update TC_OCC_2_2.py Reflected table 2.7.6.2 * Update TC_OCC_2_3.py Modified according to comments * Update TC_OCC_3_1.py Add CLI * Update TC_OCC_3_2.py Fixed some errors and added some random values for subscription testing * Update TC_OCC_2_1.py Updated more detail test step failure description. * Update TC_OCC_3_1.py Updating some of user input call according to comments. * Update TC_OCC_2_1.py python code bug fixing * Update TC_OCC_2_2.py python bug fixing * Update TC_OCC_2_3.py python bug fix * Update TC_OCC_3_2.py * Update TC_OCC_3_2.py step numbering fix * Update TC_OCC_3_2.py * Update TC_OCC_3_2.py * Update TC_OCC_3_1.py * Update TC_OCC_2_3.py * Update TC_OCC_2_2.py * Update TC_OCC_2_1.py * Update src/python_testing/TC_OCC_2_1.py Co-authored-by: C Freeman <cecille@google.com> * Update src/python_testing/TC_OCC_2_1.py Co-authored-by: C Freeman <cecille@google.com> * Update src/python_testing/TC_OCC_2_1.py Co-authored-by: C Freeman <cecille@google.com> * Update src/python_testing/TC_OCC_2_1.py Co-authored-by: C Freeman <cecille@google.com> * Update src/python_testing/TC_OCC_2_1.py Co-authored-by: C Freeman <cecille@google.com> * Update src/python_testing/TC_OCC_2_1.py Co-authored-by: C Freeman <cecille@google.com> * Update src/python_testing/TC_OCC_2_1.py Co-authored-by: C Freeman <cecille@google.com> * Update src/python_testing/TC_OCC_2_1.py Co-authored-by: C Freeman <cecille@google.com> * Update src/python_testing/TC_OCC_2_1.py Co-authored-by: C Freeman <cecille@google.com> * Update src/python_testing/TC_OCC_2_1.py Co-authored-by: C Freeman <cecille@google.com> * Update src/python_testing/TC_OCC_2_1.py Co-authored-by: C Freeman <cecille@google.com> * Update src/python_testing/TC_OCC_2_1.py Co-authored-by: C Freeman <cecille@google.com> * Update src/python_testing/TC_OCC_2_1.py Co-authored-by: C Freeman <cecille@google.com> * Update src/python_testing/TC_OCC_2_1.py Co-authored-by: C Freeman <cecille@google.com> * Update src/python_testing/TC_OCC_2_1.py Co-authored-by: C Freeman <cecille@google.com> * Update src/python_testing/TC_OCC_2_1.py Co-authored-by: C Freeman <cecille@google.com> * Update src/python_testing/TC_OCC_2_1.py Co-authored-by: C Freeman <cecille@google.com> * Update TC_OCC_2_2.py Fixed bitmap conditional statement * Update TC_OCC_3_1.py * Update TC_OCC_2_1.py Add additional changes according to comments received. * Update TC_OCC_3_1.py * Update TC_OCC_3_2.py test step change * Update TC_OCC_2_1.py * Update TC_OCC_2_1.py * Update TC_OCC_2_1.py * Update TC_OCC_2_1.py * Update TC_OCC_2_1.py * Update TC_OCC_2_1.py update on PIR * Update TC_OCC_2_2.py * Update TC_OCC_2_1.py restyled * Update TC_OCC_2_2.py restyled * Update TC_OCC_2_3.py restyled * Update TC_OCC_3_1.py restyled * Update TC_OCC_3_2.py restyled * Update TC_OCC_2_1.py * Update TC_OCC_2_1.py * Update TC_OCC_2_1.py * Restyle * Update TC_OCC_2_2.py bitmap conditional statement revised * Update TC_OCC_2_2.py Bitmap matching statement update * Update TC_OCC_3_1.py * Update src/python_testing/TC_OCC_2_2.py typo Co-authored-by: Andrei Litvin <andy314@gmail.com> * Update src/python_testing/TC_OCC_2_2.py Co-authored-by: Andrei Litvin <andy314@gmail.com> * Update TC_OCC_2_2.py * Update TC_OCC_2_2.py * Update TC_OCC_2_2.py rewriting sensor type check * Update TC_OCC_2_2.py * Update TC_OCC_2_2.py * Update TC_OCC_2_2.py * Restyle * Proposal for TC_OCC bitmap compares * Fix typo * Fix map * Update TC_OCC_3_2.py added else on conditional statement. * Update TC_OCC_3_2.py put skip back * Restyle * Typo fixes and enable some tests in CI * Fix OCC_2_1 to run in CI * Fix all clusters for TC_OCC_2_2 and some logging * make all TC_OCC_2_* pass * Restyle * Enable tests in ci --------- Co-authored-by: C Freeman <cecille@google.com> Co-authored-by: Andrei Litvin <andy314@gmail.com> Co-authored-by: Andrei Litvin <andreilitvin@google.com>
1 parent 7dd6b4b commit d0d9127

File tree

9 files changed

+959
-11
lines changed

9 files changed

+959
-11
lines changed

.github/workflows/tests.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,9 @@ jobs:
571571
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_TestEventTrigger.py'
572572
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TestBatchInvoke.py'
573573
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TestGroupTableReports.py'
574+
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_OCC_2_1.py'
575+
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_OCC_2_2.py'
576+
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_OCC_2_3.py'
574577
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_OPCREDS_3_1.py'
575578
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_OPCREDS_3_2.py'
576579
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_OPSTATE_2_1.py'

examples/all-clusters-app/all-clusters-common/all-clusters-app.matter

+6-4
Original file line numberDiff line numberDiff line change
@@ -9025,10 +9025,11 @@ endpoint 1 {
90259025
server cluster OccupancySensing {
90269026
ram attribute occupancy;
90279027
ram attribute occupancySensorType;
9028-
ram attribute occupancySensorTypeBitmap;
9028+
ram attribute occupancySensorTypeBitmap default = 1;
90299029
ram attribute holdTime default = 10;
90309030
callback attribute holdTimeLimits;
9031-
ram attribute featureMap default = 0x01;
9031+
ram attribute PIROccupiedToUnoccupiedDelay default = 10;
9032+
ram attribute featureMap default = 0x02;
90329033
ram attribute clusterRevision default = 5;
90339034
}
90349035

@@ -9502,10 +9503,11 @@ endpoint 2 {
95029503
server cluster OccupancySensing {
95039504
ram attribute occupancy;
95049505
ram attribute occupancySensorType;
9505-
ram attribute occupancySensorTypeBitmap;
9506+
ram attribute occupancySensorTypeBitmap default = 1;
95069507
ram attribute holdTime default = 20;
95079508
callback attribute holdTimeLimits;
9508-
ram attribute featureMap default = 0x01;
9509+
ram attribute PIROccupiedToUnoccupiedDelay default = 10;
9510+
ram attribute featureMap default = 0x02;
95099511
ram attribute clusterRevision default = 5;
95109512
}
95119513
}

examples/all-clusters-app/all-clusters-common/all-clusters-app.zap

+38-6
Original file line numberDiff line numberDiff line change
@@ -16678,7 +16678,7 @@
1667816678
"storageOption": "External",
1667916679
"singleton": 0,
1668016680
"bounded": 0,
16681-
"defaultValue": "",
16681+
"defaultValue": null,
1668216682
"reportable": 1,
1668316683
"minInterval": 1,
1668416684
"maxInterval": 65534,
@@ -16726,7 +16726,7 @@
1672616726
"storageOption": "External",
1672716727
"singleton": 0,
1672816728
"bounded": 0,
16729-
"defaultValue": "",
16729+
"defaultValue": null,
1673016730
"reportable": 1,
1673116731
"minInterval": 1,
1673216732
"maxInterval": 65534,
@@ -19103,7 +19103,7 @@
1910319103
"storageOption": "RAM",
1910419104
"singleton": 0,
1910519105
"bounded": 0,
19106-
"defaultValue": "",
19106+
"defaultValue": "1",
1910719107
"reportable": 1,
1910819108
"minInterval": 0,
1910919109
"maxInterval": 65344,
@@ -19141,6 +19141,22 @@
1914119141
"maxInterval": 65534,
1914219142
"reportableChange": 0
1914319143
},
19144+
{
19145+
"name": "PIROccupiedToUnoccupiedDelay",
19146+
"code": 16,
19147+
"mfgCode": null,
19148+
"side": "server",
19149+
"type": "int16u",
19150+
"included": 1,
19151+
"storageOption": "RAM",
19152+
"singleton": 0,
19153+
"bounded": 0,
19154+
"defaultValue": "10",
19155+
"reportable": 1,
19156+
"minInterval": 1,
19157+
"maxInterval": 65534,
19158+
"reportableChange": 0
19159+
},
1914419160
{
1914519161
"name": "FeatureMap",
1914619162
"code": 65532,
@@ -19151,7 +19167,7 @@
1915119167
"storageOption": "RAM",
1915219168
"singleton": 0,
1915319169
"bounded": 0,
19154-
"defaultValue": "0x01",
19170+
"defaultValue": "0x02",
1915519171
"reportable": 1,
1915619172
"minInterval": 1,
1915719173
"maxInterval": 65534,
@@ -25244,7 +25260,7 @@
2524425260
"storageOption": "RAM",
2524525261
"singleton": 0,
2524625262
"bounded": 0,
25247-
"defaultValue": "",
25263+
"defaultValue": "1",
2524825264
"reportable": 1,
2524925265
"minInterval": 0,
2525025266
"maxInterval": 65344,
@@ -25282,6 +25298,22 @@
2528225298
"maxInterval": 65534,
2528325299
"reportableChange": 0
2528425300
},
25301+
{
25302+
"name": "PIROccupiedToUnoccupiedDelay",
25303+
"code": 16,
25304+
"mfgCode": null,
25305+
"side": "server",
25306+
"type": "int16u",
25307+
"included": 1,
25308+
"storageOption": "RAM",
25309+
"singleton": 0,
25310+
"bounded": 0,
25311+
"defaultValue": "10",
25312+
"reportable": 1,
25313+
"minInterval": 1,
25314+
"maxInterval": 65534,
25315+
"reportableChange": 0
25316+
},
2528525317
{
2528625318
"name": "FeatureMap",
2528725319
"code": 65532,
@@ -25292,7 +25324,7 @@
2529225324
"storageOption": "RAM",
2529325325
"singleton": 0,
2529425326
"bounded": 0,
25295-
"defaultValue": "0x01",
25327+
"defaultValue": "0x02",
2529625328
"reportable": 1,
2529725329
"minInterval": 1,
2529825330
"maxInterval": 65534,

examples/all-clusters-app/all-clusters-common/src/occupancy-sensing-stub.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ void emberAfOccupancySensingClusterInitCallback(EndpointId endpointId)
3636
VerifyOrDie(!gAttrAccess[endpointId]);
3737

3838
gAttrAccess[endpointId] = std::make_unique<OccupancySensingAttrAccess>(
39-
BitMask<OccupancySensing::Feature, uint32_t>(OccupancySensing::Feature::kOther));
39+
BitMask<OccupancySensing::Feature, uint32_t>(OccupancySensing::Feature::kPassiveInfrared));
4040

4141
OccupancySensing::Structs::HoldTimeLimitsStruct::Type holdTimeLimits = {
4242
.holdTimeMin = 1,

0 commit comments

Comments
 (0)