Fix LED strip length in RGBController_LEDStrip

This commit is contained in:
Adam Honse 2019-08-22 18:19:10 -05:00
parent 854d7d0ec5
commit ef79de6c7c
3 changed files with 4 additions and 9 deletions

View file

@ -84,11 +84,6 @@ char* LEDStripController::GetLEDString()
return(led_string);
}
void LEDStripController::SetNumLEDs(int numleds)
{
num_leds = numleds;
}
void LEDStripController::SetLEDs(std::vector<RGBColor> colors)
{
if (serialport != NULL )

View file

@ -29,12 +29,12 @@ public:
void InitializeUDP(char* clientname, char* port);
void InitializeEspurna(char* clientname, char* port, char * apikey);
char* GetLEDString();
void SetNumLEDs(int numleds);
void SetLEDs(std::vector<RGBColor> colors);
int num_leds;
private:
int baud_rate;
int num_leds;
int fans;
int channel;
const int hueSize = 125;

View file

@ -20,7 +20,7 @@ RGBController_LEDStrip::RGBController_LEDStrip(LEDStripController* ledstrip_ptr)
led_mode.name = "Custom";
modes.push_back(led_mode);
for (int i = 0; i < 15; i++)
for (int i = 0; i < strip->num_leds; i++)
{
colors.push_back(0x00000000);
led new_led;
@ -31,7 +31,7 @@ RGBController_LEDStrip::RGBController_LEDStrip(LEDStripController* ledstrip_ptr)
zone led_zone;
led_zone.name = "LED Strip";
std::vector<int> led_zone_map;
for (int i = 0; i < 15; i++)
for (int i = 0; i < strip->num_leds; i++)
{
led_zone_map.push_back(i);
}