SamZorSec / Arilux_AL-LC0X

Alternative firmware for Arilux AL-LC0X LED controllers, based on the MQTT protocol and a TLS connection
MIT License
190 stars 33 forks source link

Brightness can't be increased to 255 with remote #24

Closed grooverut closed 7 years ago

grooverut commented 7 years ago

Brightness will go to 235 but won't go to 255. It is because of the default step of 25+235>255.

Here is my patched code:

uint8_t Arilux::increaseBrightness(void) {
  if (!m_state)
    return false;
  if ((m_brightness+ARILUX_BRIGHTNESS_STEP) >= ARILUX_PWM_RANGE)
    return setBrightness(ARILUX_PWM_RANGE);  
  if (m_brightness < (ARILUX_PWM_RANGE - ARILUX_BRIGHTNESS_STEP))
    return setBrightness(m_brightness + ARILUX_BRIGHTNESS_STEP);
  return false;
}
SamZorSec commented 7 years ago

Hi @grooverut, Thanks for your input. The bug is now corrected.

Sam