Skip to content

Commit

Permalink
Power toggl
Browse files Browse the repository at this point in the history
Working on power toggle
  • Loading branch information
revision29 committed Oct 15, 2023
1 parent f233cc7 commit 20906cd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/remotecontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,17 @@ void RemoteControl::handle()
break;
case POWER_TOGGLE:
{
if (remoteEffectPower)
if (remoteEffectPower == true)
{
debugI("Power is on, so w turn it off.\n");
remoteEffectPower = false;
effectManager.ClearTemporaryStripEffect();
effectManager.ClearRemoteColor();
effectManager.Update();

}
else
{
debugI("Power is off, so we turn it on\n");
remoteEffectPower = true;
effectManager.SetInterval(0);
effectManager.SetTemporaryStripEffect(make_shared_psram<ColorFillEffect>(lastManualColor, 1));
Expand Down
3 changes: 2 additions & 1 deletion src/userremote.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ void UserRemoteControl::getRemoteButtons() {
buttons.push_back(RemoteButton ("Brightness Up",0xFF3AC5,BRIGHTNESS_UP, ""));
buttons.push_back(RemoteButton ("Brightness Down",0xFFBA45,BRIGHTNESS_DOWN, ""));
buttons.push_back(RemoteButton ("NExt Effect",0xFF827D,NEXT_EFFECT, ""));
buttons.push_back(RemoteButton ("Power Toggle",0xFF02FD,POWER_TOGGLE, ""));
//buttons.push_back(RemoteButton ("Power off",0xFF02FD,POWER_OFF, ""));
buttons.push_back(RemoteButton ("Power",0xFF02FD,POWER_TOGGLE, ""));
//Row 2
buttons.push_back(RemoteButton ("Full Red",0xFF1AE5,FILL_COLOR, "FF0000"));
buttons.push_back(RemoteButton ("Full Green",0xFF9A65,FILL_COLOR, "00FF00"));
Expand Down

0 comments on commit 20906cd

Please sign in to comment.