From 48e7baeef3d1a4b8d49965edeed050eccbbc1977 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Josefsen?= <69624991+ReneJosefsen@users.noreply.github.com> Date: Tue, 30 Jan 2024 16:53:54 +0100 Subject: [PATCH] Fix SetValveLevel, correct error code and added include needed by other platforms (#31750) --- .../valve-configuration-and-control-server.cpp | 3 ++- .../valve-configuration-and-control-server.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/app/clusters/valve-configuration-and-control-server/valve-configuration-and-control-server.cpp b/src/app/clusters/valve-configuration-and-control-server/valve-configuration-and-control-server.cpp index 0f6968f98e5826..30481d8ddf5cbc 100644 --- a/src/app/clusters/valve-configuration-and-control-server/valve-configuration-and-control-server.cpp +++ b/src/app/clusters/valve-configuration-and-control-server/valve-configuration-and-control-server.cpp @@ -40,6 +40,7 @@ #include #include #include +#include using namespace chip; using namespace chip::app; @@ -335,7 +336,7 @@ CHIP_ERROR SetValveLevel(EndpointId ep, DataModel::Nullable level, Data VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == AutoCloseTime::SetNull(ep), attribute_error); } #else - return CHIP_FAILURE; + return CHIP_ERROR_NOT_IMPLEMENTED; #endif // ZCL_USING_TIME_SYNCHRONIZATION_CLUSTER_SERVER } diff --git a/src/app/clusters/valve-configuration-and-control-server/valve-configuration-and-control-server.h b/src/app/clusters/valve-configuration-and-control-server/valve-configuration-and-control-server.h index 6f46e8cc6356e4..5e94c000aeab27 100644 --- a/src/app/clusters/valve-configuration-and-control-server/valve-configuration-and-control-server.h +++ b/src/app/clusters/valve-configuration-and-control-server/valve-configuration-and-control-server.h @@ -40,7 +40,7 @@ void SetDefaultDelegate(EndpointId endpoint, Delegate * delegate); Delegate * GetDefaultDelegate(EndpointId endpoint); CHIP_ERROR CloseValve(chip::EndpointId ep); -CHIP_ERROR SetValveLevel(chip::EndpointId ep, chip::Percent level, DataModel::Nullable openDuration); +CHIP_ERROR SetValveLevel(chip::EndpointId ep, DataModel::Nullable level, DataModel::Nullable openDuration); CHIP_ERROR UpdateCurrentLevel(chip::EndpointId ep, chip::Percent currentLevel); CHIP_ERROR UpdateCurrentState(chip::EndpointId ep, ValveConfigurationAndControl::ValveStateEnum currentState); CHIP_ERROR EmitValveFault(chip::EndpointId ep, chip::BitMask fault);