Skip to content

Commit

Permalink
Fix all clusters for TC_OCC_2_2 and some logging
Browse files Browse the repository at this point in the history
  • Loading branch information
andreilitvin committed Aug 1, 2024
1 parent 506d08e commit 2a1f0f0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ void emberAfOccupancySensingClusterInitCallback(EndpointId endpointId)
VerifyOrDie(!gAttrAccess[endpointId]);

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

OccupancySensing::Structs::HoldTimeLimitsStruct::Type holdTimeLimits = {
.holdTimeMin = 1,
Expand Down
11 changes: 1 addition & 10 deletions src/python_testing/TC_OCC_2_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,11 @@
# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto
# === END CI TEST ARGUMENTS ===

from dataclasses import dataclass

import chip.clusters as Clusters
from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main
from mobly import asserts


@dataclass
class FeatureMapping:
"""Maps feature flags to a specific bitmap and sensor type"""
feature_map: int
sensor_type: Clusters.OccupancySensing.Enums.OccupancySensorTypeEnum


class TC_OCC_2_2(MatterBaseTest):
async def read_occ_attribute_expect_success(self, endpoint, attribute):
cluster = Clusters.Objects.OccupancySensing
Expand Down Expand Up @@ -133,7 +124,7 @@ async def test_TC_OCC_2_2(self):
asserts.assert_equal(
(occupancy_sensor_type_bitmap_dut & sensor_bit) != 0,
(feature_map & feature_bit) != 0,
f"Feature bit and sensor bitmap must be equal for {name}"
f"Feature bit and sensor bitmap must be equal for {name} (BITMAP: 0x{occupancy_sensor_type_bitmap_dut:02X}, FEATUREMAP: 0x{feature_map:02X})"
)


Expand Down

0 comments on commit 2a1f0f0

Please sign in to comment.