Fixed PWM1 always full brightness, and Sonoff Basic / Relay not working

This commit is contained in:
Stephan Hadinger 2019-04-27 22:48:51 +02:00
parent d1b073e01d
commit 5a52d1f568
2 changed files with 3 additions and 5 deletions

View File

@ -684,8 +684,6 @@ public:
// channel 0=intensity, channel2=temperature
light_current_color[0] = bri; // set brightness from r (white)
light_current_color[1] = c;
} else if (LT_PWM1 == light_type) {
light_current_color[0] = 255; // One PWM channel only supports Dimmer but needs max color
} else {
switch (light_subtype) {
case LST_NONE:

View File

@ -628,9 +628,9 @@ void HueLightStatus1(uint8_t device, String *response)
*response += FPSTR(HUE_LIGHTS_STATUS_JSON1);
response->replace("{state}", (power & (1 << (device-1))) ? "true" : "false");
// Brightness for all devices with PWM
if (LST_SINGLE <= light_subtype) {
light_status += "\"bri\":" + String(bri) + ",";
}
//if (LST_SINGLE <= light_subtype) {
light_status += "\"bri\":" + String(bri) + ",";
//}
if (LST_COLDWARM <= light_subtype) {
light_status += "\"colormode\":\"" + String(g_gotct ? "ct" : "hs") + "\",";
}