Skip to content

Commit

Permalink
transitionTime only set to NonNull if value is available (#21883)
Browse files Browse the repository at this point in the history
  • Loading branch information
ReneJosefsen authored and pull[bot] committed Oct 17, 2022
1 parent 577130f commit b39e5b3
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/app/clusters/level-control/level-control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -993,6 +993,7 @@ void emberAfOnOffClusterLevelControlEffectCallback(EndpointId endpoint, bool new
{
app::DataModel::Nullable<uint8_t> resolvedLevel;
app::DataModel::Nullable<uint8_t> temporaryCurrentLevelCache;
app::DataModel::Nullable<uint16_t> transitionTime;

uint16_t currentOnOffTransitionTime;
EmberAfStatus status;
Expand Down Expand Up @@ -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<uint16_t> transitionTime;
transitionTime.SetNonNull(currentOnOffTransitionTime);

if (newValue)
{
// If newValue is OnOff::Commands::On::Id...
Expand Down

0 comments on commit b39e5b3

Please sign in to comment.