fix DIMMER ! to use correct dim value (#23196)

This commit is contained in:
Qowy 2025-04-01 22:57:58 +02:00 committed by GitHub
parent 08f20b9404
commit 90c690e67a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2060,11 +2060,19 @@ uint16_t fadeGammaReverse(uint32_t channel, uint16_t vg) {
}
}
uint16_t fadeEndGammaReverse(uint32_t channel, uint16_t vg) {
if (isChannelGammaCorrected(channel)) {
return ledGammaReverse(vg);
} else {
return vg;
}
}
uint8_t LightGetCurFadeBri(void) {
uint8_t max_bri = 0;
uint8_t bri_i = 0;
for (uint8_t i = 0; i < LST_MAX; i++) {
bri_i = changeUIntScale(fadeGammaReverse(i, Light.fade_cur_10[i]), 4, 1023, 1, 100);
bri_i = changeUIntScale(fadeEndGammaReverse(i, Light.fade_cur_10[i]), 4, 1023, 1, 100);
if (bri_i > max_bri) max_bri = bri_i ;
}
return max_bri;