FastLED 3.10.8
Loading...
Searching...
No Matches
fl::WLEDClient Class Reference

Detailed Description

WLED Client for controlling LEDs through FastLED interface.

Provides a simplified interface for controlling LEDs with WLED-style operations (brightness, on/off, clear). Uses dependency injection to allow both real FastLED control and mock implementations for testing.

Example usage: // Real usage auto controller = createFastLEDController(leds, NUM_LEDS); WLEDClient client(controller); client.setBrightness(128); client.setOn(true);

// Test usage auto mock = fl::make_shared<MockFastLEDController>(100); WLEDClient client(mock); client.setBrightness(128); REQUIRE(mock->getLastBrightness() == 128);

Definition at line 28 of file client.h.

#include <client.h>

+ Collaboration diagram for fl::WLEDClient:

Public Member Functions

 WLEDClient (fl::shared_ptr< IFastLED > controller) FL_NO_EXCEPT
 Construct WLEDClient with FastLED controller.
 
void clear (bool writeToStrip=false) FL_NO_EXCEPT
 Clear all LEDs.
 
void clearSegment () FL_NO_EXCEPT
 Clear the segment range (operate on full LED array)
 
u8 getBrightness () const FL_NO_EXCEPT
 Get current brightness level.
 
fl::span< CRGB > getLEDs () FL_NO_EXCEPT
 Get access to LED array.
 
u16 getMaxRefreshRate () const FL_NO_EXCEPT
 Get maximum refresh rate.
 
size_t getNumLEDs () const FL_NO_EXCEPT
 Get number of LEDs.
 
bool getOn () const FL_NO_EXCEPT
 Get on/off state.
 
void setBrightness (u8 brightness) FL_NO_EXCEPT
 Set brightness level.
 
void setCorrection (CRGB correction) FL_NO_EXCEPT
 Set color correction.
 
void setMaxRefreshRate (u16 fps) FL_NO_EXCEPT
 Set maximum refresh rate.
 
void setOn (bool on) FL_NO_EXCEPT
 Set on/off state.
 
void setSegment (size_t start, size_t end) FL_NO_EXCEPT
 Set a segment range for subsequent operations.
 
void setTemperature (CRGB temperature) FL_NO_EXCEPT
 Set color temperature.
 
void update () FL_NO_EXCEPT
 Update physical LED strip.
 

Private Attributes

u8 mBrightness
 
fl::shared_ptr< IFastLED > mController
 
bool mOn
 

The documentation for this class was generated from the following files: