Skip to content

Commit

Permalink
addressing review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
chirag-silabs committed Dec 11, 2024
1 parent 2c17ce3 commit 31d607a
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions examples/light-switch-app/silabs/src/LightSwitchMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -345,16 +345,10 @@ void LightSwitchMgr::AppEventHandler(AppEvent * aEvent)

void LightSwitchMgr::SwitchActionEventHandler(AppEvent * aEvent)
{
static bool mCurrentButtonState = false;

switch(aEvent->Type)
{
case AppEvent::kEventType_UpPressed: {
mCurrentButtonState = !mCurrentButtonState;
LightSwitchMgr::LightSwitchAction action =
mCurrentButtonState ? LightSwitchMgr::LightSwitchAction::On : LightSwitchMgr::LightSwitchAction::Off;

LightSwitchMgr::GetInstance().TriggerLightSwitchAction(action);
LightSwitchMgr::GetInstance().TriggerLightSwitchAction(LightSwitchMgr::LightSwitchAction::Toggle);
LightSwitchMgr::GetInstance().GenericSwitchOnInitialPress();
}
break;
Expand All @@ -364,7 +358,7 @@ void LightSwitchMgr::SwitchActionEventHandler(AppEvent * aEvent)
#if 0
// TODO: Fix the button handling for the btn0 and btn1
case AppEvent::kEventType_DownPressed:
LightSwitchMgr::GetInstance().TriggerLightSwitchAction(action);
LightSwitchMgr::GetInstance().TriggerLevelControlAction(LevelControl::StepModeEnum::kDown);
break;
#endif
default:
Expand Down

0 comments on commit 31d607a

Please sign in to comment.