Fix random crash in Zigbee main page (#20481)

This commit is contained in:
s-hadinger 2024-01-12 22:34:42 +01:00 committed by GitHub
parent 08a14ccc9e
commit c1f3561a3e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -19,6 +19,7 @@ All notable changes to this project will be documented in this file.
- Scripter memory leak in `>w x` (#20473)
- ESP8266 GPIO Viewer exception 9 on reading Analog GPIO
- GPIO Viewer single instance
- Fix random crash in Zigbee main page
### Removed

View File

@ -2335,8 +2335,11 @@ void ZigbeeShow(bool json)
WSContentSend_P(PSTR(" 🔅 %d%%"), changeUIntScale(light.getDimmer(),0,254,0,100));
}
if (light.validCT() && ((channels == 2) || (channels == 5))) {
uint32_t ct_k = (((1000000 / light.getCT()) + 25) / 50) * 50;
WSContentSend_P(msg[ZB_WEB_LIGHT_CT], light.getCT(), ct_k);
uint16_t ct = light.getCT();
if (ct != 0) { // ct == 0 means undefined value
uint32_t ct_k = (((1000000 / ct) + 25) / 50) * 50;
WSContentSend_P(msg[ZB_WEB_LIGHT_CT], light.getCT(), ct_k);
}
}
if (light.validHue() && light.validSat() && (channels >= 3)) {
uint8_t r,g,b;