@@ -1020,7 +1020,7 @@ void ColorControlServer::startColorLoop(EndpointId endpoint, uint8_t startFromSt
1020
1020
1021
1021
colorHueTransitionState->initialEnhancedHue = startHue;
1022
1022
1023
- if (direction == to_underlying (ColorLoopDirection::IncrementHue ))
1023
+ if (direction == to_underlying (ColorLoopDirectionEnum:: kIncrement ))
1024
1024
{
1025
1025
colorHueTransitionState->finalEnhancedHue = static_cast <uint16_t >(startHue - 1 );
1026
1026
}
@@ -1029,7 +1029,7 @@ void ColorControlServer::startColorLoop(EndpointId endpoint, uint8_t startFromSt
1029
1029
colorHueTransitionState->finalEnhancedHue = static_cast <uint16_t >(startHue + 1 );
1030
1030
}
1031
1031
1032
- colorHueTransitionState->up = (direction == to_underlying (ColorLoopDirection::IncrementHue ));
1032
+ colorHueTransitionState->up = (direction == to_underlying (ColorLoopDirectionEnum:: kIncrement ));
1033
1033
colorHueTransitionState->repeat = true ;
1034
1034
1035
1035
colorHueTransitionState->stepsRemaining = static_cast <uint16_t >(time * TRANSITION_STEPS_PER_1S);
@@ -1507,7 +1507,7 @@ bool ColorControlServer::moveHueCommand(app::CommandHandler * commandObj, const
1507
1507
* @return false Failed
1508
1508
*/
1509
1509
bool ColorControlServer::moveToHueCommand (app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath,
1510
- uint16_t hue, HueDirection moveDirection, uint16_t transitionTime,
1510
+ uint16_t hue, DirectionEnum moveDirection, uint16_t transitionTime,
1511
1511
BitMask<OptionsBitmap> optionsMask, BitMask<OptionsBitmap> optionsOverride,
1512
1512
bool isEnhanced)
1513
1513
{
@@ -1516,7 +1516,7 @@ bool ColorControlServer::moveToHueCommand(app::CommandHandler * commandObj, cons
1516
1516
1517
1517
Status status = Status::Success;
1518
1518
uint16_t currentHue = 0 ;
1519
- HueDirection direction;
1519
+ DirectionEnum direction;
1520
1520
1521
1521
ColorHueTransitionState * colorHueTransitionState = getColorHueTransitionState (endpoint);
1522
1522
@@ -1545,33 +1545,33 @@ bool ColorControlServer::moveToHueCommand(app::CommandHandler * commandObj, cons
1545
1545
// Convert the ShortestDistance/LongestDistance moveDirection values into Up/Down.
1546
1546
switch (moveDirection)
1547
1547
{
1548
- case HueDirection ::kShortest :
1548
+ case DirectionEnum ::kShortest :
1549
1549
if ((isEnhanced && (static_cast <uint16_t >(currentHue - hue) > HALF_MAX_UINT16T)) ||
1550
1550
(!isEnhanced && (static_cast <uint8_t >(currentHue - hue) > HALF_MAX_UINT8T)))
1551
1551
{
1552
- direction = HueDirection ::kUp ;
1552
+ direction = DirectionEnum ::kUp ;
1553
1553
}
1554
1554
else
1555
1555
{
1556
- direction = HueDirection ::kDown ;
1556
+ direction = DirectionEnum ::kDown ;
1557
1557
}
1558
1558
break ;
1559
- case HueDirection ::kLongest :
1559
+ case DirectionEnum ::kLongest :
1560
1560
if ((isEnhanced && (static_cast <uint16_t >(currentHue - hue) > HALF_MAX_UINT16T)) ||
1561
1561
(!isEnhanced && (static_cast <uint8_t >(currentHue - hue) > HALF_MAX_UINT8T)))
1562
1562
{
1563
- direction = HueDirection ::kDown ;
1563
+ direction = DirectionEnum ::kDown ;
1564
1564
}
1565
1565
else
1566
1566
{
1567
- direction = HueDirection ::kUp ;
1567
+ direction = DirectionEnum ::kUp ;
1568
1568
}
1569
1569
break ;
1570
- case HueDirection ::kUp :
1571
- case HueDirection ::kDown :
1570
+ case DirectionEnum ::kUp :
1571
+ case DirectionEnum ::kDown :
1572
1572
direction = moveDirection;
1573
1573
break ;
1574
- case HueDirection ::kUnknownEnumValue :
1574
+ case DirectionEnum ::kUnknownEnumValue :
1575
1575
commandObj->AddStatus (commandPath, Status::InvalidCommand);
1576
1576
return true ;
1577
1577
/* No default case, so if a new direction value gets added we will just fail
@@ -1614,7 +1614,7 @@ bool ColorControlServer::moveToHueCommand(app::CommandHandler * commandObj, cons
1614
1614
colorHueTransitionState->timeRemaining = transitionTime;
1615
1615
colorHueTransitionState->transitionTime = transitionTime;
1616
1616
colorHueTransitionState->endpoint = endpoint;
1617
- colorHueTransitionState->up = (direction == HueDirection ::kUp );
1617
+ colorHueTransitionState->up = (direction == DirectionEnum ::kUp );
1618
1618
colorHueTransitionState->repeat = false ;
1619
1619
1620
1620
SetHSVRemainingTime (endpoint);
@@ -1995,10 +1995,10 @@ bool ColorControlServer::colorLoopCommand(app::CommandHandler * commandObj, cons
1995
1995
// Checks if color loop is active and stays active
1996
1996
if (isColorLoopActive && !deactiveColorLoop)
1997
1997
{
1998
- colorHueTransitionState->up = (direction == ColorLoopDirection ::kIncrement );
1998
+ colorHueTransitionState->up = (direction == ColorLoopDirectionEnum ::kIncrement );
1999
1999
colorHueTransitionState->initialEnhancedHue = colorHueTransitionState->currentEnhancedHue ;
2000
2000
2001
- if (direction == ColorLoopDirection ::kIncrement )
2001
+ if (direction == ColorLoopDirectionEnum ::kIncrement )
2002
2002
{
2003
2003
colorHueTransitionState->finalEnhancedHue = static_cast <uint16_t >(colorHueTransitionState->initialEnhancedHue - 1 );
2004
2004
}
0 commit comments