From 2afc18bac2da5621d57d631807529b55d14725dc Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Tue, 29 Dec 2020 19:58:38 +0100 Subject: [PATCH] Fix compilation for TuyaMCU --- tasmota/xdrv_04_light.ino | 5 +++++ tasmota/xdrv_16_tuyamcu.ino | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/tasmota/xdrv_04_light.ino b/tasmota/xdrv_04_light.ino index a47c4a4ca..f0b94bcec 100644 --- a/tasmota/xdrv_04_light.ino +++ b/tasmota/xdrv_04_light.ino @@ -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++) { diff --git a/tasmota/xdrv_16_tuyamcu.ino b/tasmota/xdrv_16_tuyamcu.ino index 13a7864c5..51a0a9c5b 100644 --- a/tasmota/xdrv_16_tuyamcu.ino +++ b/tasmota/xdrv_16_tuyamcu.ino @@ -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(); }