Skip to content

Commit

Permalink
WIP on tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lpbeliveau-silabs committed Aug 1, 2024
1 parent 6c3dcad commit ff813ba
Show file tree
Hide file tree
Showing 2 changed files with 311 additions and 72 deletions.
20 changes: 2 additions & 18 deletions src/app/clusters/scenes-server/SceneHandlerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,24 +118,8 @@ void CapAttributeID(typename app::NumericAttributeTraits<Type>::WorkingType & Va
if (metadata->HasMinMax())
{
const EmberAfAttributeMinMaxValue * minMaxValue = metadata->defaultValue.ptrToMinMaxValue;
WorkingType rangeMin = ConvertDefaultValueToWorkingValue<Type>(minMaxValue->minValue);
WorkingType rangeMax = ConvertDefaultValueToWorkingValue<Type>(minMaxValue->maxValue);

// Cap based on minimum value
if (rangeMin > Value)
{
Value = rangeMin;
// We assume the max is >= min therefore we can return
return;
}

// Adjust maxValue if greater than the meta data's max value
if (rangeMax < Value)
{
maxValue = rangeMax;
// We assume the metadata's max value respects the odd size integers limits so we can return
return;
}
minValue = ConvertDefaultValueToWorkingValue<Type>(minMaxValue->minValue);
maxValue = ConvertDefaultValueToWorkingValue<Type>(minMaxValue->maxValue);
}

if (minValue > Value)
Expand Down
Loading

0 comments on commit ff813ba

Please sign in to comment.