Fix compilation for TuyaMCU

This commit is contained in:
Stephan Hadinger 2020-12-29 19:58:38 +01:00
parent 488712c3f0
commit 2afc18bac2
2 changed files with 6 additions and 1 deletions

View File

@ -1221,6 +1221,11 @@ void initCTRange(uint32_t channels) {
}
#endif // USE_LIGHT_VIRTUAL_CT
void getCTRange(uint16_t * min_ct, uint16_t * max_ct) {
if (min_ct != nullptr) { *min_ct = Light.vct_ct[0]; }
if (max_ct != nullptr) { *max_ct = Light.vct_ct[CT_PIVOTS-1]; }
}
void setCTRange(uint16_t ct_min, uint16_t ct_max) {
Light.vct_ct[0] = ct_min;
for (uint32_t i = 1; i < CT_PIVOTS; i++) {

View File

@ -517,7 +517,7 @@ bool TuyaSetChannels(void)
Tuya.Snapshot[0] = changeUIntScale(Light.current_color[0], 0, 255, 0, 100);
Tuya.Snapshot[1] = changeUIntScale(Light.current_color[1], 0, 255, 0, 100);
} else { // CT Light or RGBWC
light_state.getCTRange(&Tuya.CTMin, &Tuya.CTMax); // SetOption82 - Reduce the CT range from 153..500 to 200..380 to accomodate with Alexa range
getCTRange(&Tuya.CTMin, &Tuya.CTMax); // SetOption82 - Reduce the CT range from 153..500 to 200..380 to accomodate with Alexa range
Tuya.Snapshot[0] = light_state.getDimmer();
Tuya.Snapshot[1] = light_state.getCT();
}