From e61a8d077861ce8960125eea03d274100170c134 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Josefsen?= <69624991+ReneJosefsen@users.noreply.github.com> Date: Tue, 16 Aug 2022 04:50:37 +0200 Subject: [PATCH] transitionTime only set to NonNull if value is available (#21883) --- src/app/clusters/level-control/level-control.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/app/clusters/level-control/level-control.cpp b/src/app/clusters/level-control/level-control.cpp index c6c236b08c47d1..bcf52cd169a2ab 100644 --- a/src/app/clusters/level-control/level-control.cpp +++ b/src/app/clusters/level-control/level-control.cpp @@ -993,6 +993,7 @@ void emberAfOnOffClusterLevelControlEffectCallback(EndpointId endpoint, bool new { app::DataModel::Nullable resolvedLevel; app::DataModel::Nullable temporaryCurrentLevelCache; + app::DataModel::Nullable transitionTime; uint16_t currentOnOffTransitionTime; EmberAfStatus status; @@ -1059,18 +1060,16 @@ void emberAfOnOffClusterLevelControlEffectCallback(EndpointId endpoint, bool new emberAfLevelControlClusterPrintln("ERR: reading current level %x", status); return; } + transitionTime.SetNonNull(currentOnOffTransitionTime); } else { - currentOnOffTransitionTime = 0xFFFF; + transitionTime.SetNull(); } #else - currentOnOffTransitionTime = 0xFFFF; + transitionTime.SetNull(); #endif // IGNORE_LEVEL_CONTROL_CLUSTER_ON_OFF_TRANSITION_TIME - app::DataModel::Nullable transitionTime; - transitionTime.SetNonNull(currentOnOffTransitionTime); - if (newValue) { // If newValue is OnOff::Commands::On::Id...