FastLED 3.9.15
Loading...
Searching...
No Matches

◆ setOn()

void fl::WLEDClient::setOn ( bool on)

Set on/off state.

Parameters
onTrue to turn on, false to turn off

When turning on, applies current brightness to controller. When turning off, sets controller brightness to 0 but preserves internal brightness.

Definition at line 27 of file client.cpp.hpp.

27 {
28 mOn = on;
29 FL_DBG("WLEDClient: setOn(" << (mOn ? "true" : "false") << ")");
30
31 if (!mController) {
32 return;
33 }
34
35 if (mOn) {
36 // Turning on: apply current brightness
37 mController->setBrightness(mBrightness);
38 } else {
39 // Turning off: set brightness to 0 (but preserve internal brightness)
40 mController->setBrightness(0);
41 }
42}
fl::shared_ptr< IFastLED > mController
Definition client.h:148
#define FL_DBG
Definition log.h:388

References FL_DBG, mBrightness, mController, and mOn.