-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Brightness does nothing #2
Comments
and when i set the slider to 0 it turns off the light strip and it wont turn back on until i pick a color |
Hmmm. I do remember this being an issue. But to my knowledge I did resolve it... What led light strip are you using? |
its an anko brand |
my pwm is reversed with how i am doing it, and i did go through the code and i think i fixed it my doing 255 - colorbrightnessvariable but did i maybe forget to change something that is making it not work with brightness slider? |
Update if i set the brightness then turn off the accessory then press it back on it will update the brightness on the light strip itself, |
ok so i worked it out, when setting the brightness it calls the updateColor() function //updates homekit and lights etc
void updateColor() {
if (is_on) {
if (received_hue && received_sat) {
Serial.println("Updating Colour");
TurnOn();
received_hue = false;
received_sat = false;
}
} else if (!is_on) //lamp - switch to off
{
Serial.println("is_on == false");
TurnOff();
}
} but it was only doing something when the hue and sat was different so when the brightness was calling the function it was literally doing nothing so i decided to just add an else statement //updates homekit and lights etc
void updateColor() {
if (is_on) {
if (received_hue && received_sat) {
Serial.println("Updating Colour");
TurnOn();
received_hue = false;
received_sat = false;
} else {
Serial.println("Updating Brightness");
TurnOn();
}
} else if (!is_on) //lamp - switch to off
{
Serial.println("is_on == false");
TurnOff();
}
} probs not the best way of fixing it but it works so hey :D |
Hi so I have this deployed on a esp8266 and connected to my light strip but the brightness slider seems to do nothing,
I have checked the serial monitor and it says its changing the brightness but nothing happens.
any ideas?
The text was updated successfully, but these errors were encountered: