Skip to content

Commit

Permalink
Address JamesH review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterC1965 committed Jun 15, 2024
1 parent 3cb089f commit 6688c42
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion examples/all-clusters-app/asr/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,13 @@ asr_executable("clusters_app") {
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/smco-stub.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-temperature-levels.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/DEMUtils.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementDelegateImpl.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementManager.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/EVSEManufacturerImpl.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/ElectricalPowerMeasurementDelegate.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyEvseManager.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/DEMUtils.cpp",
"${examples_plat_dir}/ButtonHandler.cpp",
"${examples_plat_dir}/CHIPDeviceManager.cpp",
"${examples_plat_dir}/LEDWidget.cpp",
Expand Down
2 changes: 1 addition & 1 deletion examples/all-clusters-app/infineon/psoc6/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,13 @@ psoc6_executable("clusters_app") {
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/smco-stub.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-temperature-levels.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/DEMUtils.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementDelegateImpl.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementManager.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/EVSEManufacturerImpl.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/ElectricalPowerMeasurementDelegate.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyEvseManager.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/DEMUtils.cpp",
"${examples_plat_dir}/LEDWidget.cpp",
"${examples_plat_dir}/init_psoc6Platform.cpp",
"src/AppTask.cpp",
Expand Down
2 changes: 1 addition & 1 deletion examples/all-clusters-app/nxp/mw320/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@ mw320_executable("shell_mw320") {
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/smco-stub.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-temperature-levels.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/DEMUtils.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementDelegateImpl.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementManager.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/EVSEManufacturerImpl.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/ElectricalPowerMeasurementDelegate.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyEvseManager.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/DEMUtils.cpp",
"${chip_root}/src/lib/shell/streamer_mw320.cpp",
"binding-handler.cpp",
"include/CHIPProjectConfig.h",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class DeviceEnergyManagementDelegate : public DeviceEnergyManagement::Delegate

void SetDeviceEnergyManagementInstance(DeviceEnergyManagement::Instance & instance);

void SetDemManufacturerDelegate(DEMManufacturerDelegate & deviceEnergyManagementManufacturerDelegate);
void SetDEMManufacturerDelegate(DEMManufacturerDelegate & deviceEnergyManagementManufacturerDelegate);

/**
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ uint32_t DeviceEnergyManagementDelegate::HasFeature(Feature feature) const
return hasFeature;
}

void DeviceEnergyManagementDelegate::SetDemManufacturerDelegate(DEMManufacturerDelegate & deviceEnergyManagementManufacturerDelegate)
void DeviceEnergyManagementDelegate::SetDEMManufacturerDelegate(DEMManufacturerDelegate & deviceEnergyManagementManufacturerDelegate)
{
mpDEMManufacturerDelegate = &deviceEnergyManagementManufacturerDelegate;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ CHIP_ERROR EVSEManufacturerInit()
return CHIP_ERROR_NO_MEMORY;
}

gDEMDelegate.get()->SetDemManufacturerDelegate(*gEvseManufacturer.get());
gDEMDelegate.get()->SetDEMManufacturerDelegate(*gEvseManufacturer.get());

/* Call Manufacturer specific init */
err = gEvseManufacturer->Init();
Expand Down
2 changes: 1 addition & 1 deletion src/python_testing/TC_DEM_2_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ async def test_TC_DEM_2_2(self):
cause=Clusters.DeviceEnergyManagement.Enums.AdjustmentCauseEnum.kGridOptimization)

# Wait 5 seconds for an event not to be reported
events_callback.wait_for_no_event_report(5)
events_callback.wait_for_event_expect_no_report(5)

self.step("12a")
await self.check_dem_attribute("ESAState", Clusters.DeviceEnergyManagement.Enums.ESAStateEnum.kPowerAdjustActive)
Expand Down
4 changes: 2 additions & 2 deletions src/python_testing/matter_testing_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,15 +265,15 @@ def wait_for_event_report(self, expected_event: ClusterObjects.ClusterEvent, tim
asserts.assert_equal(res.Header.EventId, expected_event.event_id, "Expected event ID not found in event report")
return res.Data

def wait_for_no_event_report(self, timeout: int = 10):
def wait_for_event_expect_no_report(self, timeout: int = 10):
"""This function succceeds/returns if an event does not arrive within the timeout.
If an event does arrive, an assert is called."""
try:
res = self._q.get(block=True, timeout=timeout)
except queue.Empty:
return

asserts.assert_equal(False, f"Event reported when not expected {res}")
asserts.fail(f"Event reported when not expected {res}")

class InternalTestRunnerHooks(TestRunnerHooks):

Expand Down

0 comments on commit 6688c42

Please sign in to comment.