Skip to content

Commit 90993cf

Browse files
committed
fix wrong convert_color_temp
1 parent 233b477 commit 90993cf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

h801-mqtt-json.ino

+2-2
Original file line numberDiff line numberDiff line change
@@ -217,11 +217,11 @@ void convert_color_temp(void) {
217217
m_w1 = 255;
218218
m_w2 = 255;
219219
} else if (temp_unit > 0) {
220-
m_w1 = int(round(1-temp_unit*255));
220+
m_w1 = int(round((1.0-temp_unit)*255));
221221
m_w2 = 255;
222222
} else if (temp_unit < 0){
223223
m_w1 = 255;
224-
m_w2 = int(round(1+temp_unit*255));
224+
m_w2 = int(round((1.0+temp_unit)*255));
225225
} else {
226226
return;
227227
}

0 commit comments

Comments
 (0)