diff --git a/CHANGELOG.md b/CHANGELOG.md index a07e05fc6..8e87989b1 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ All notable changes to this project will be documented in this file. ### Fixed - Athom esp32 2-3-4 gang change led behaviour after firmware update (#24509) - ESP8266 heap drain and exception 29 when DHCP provides NTP server (#24515) +- NeoPool fix possible IntegerDivideByZero ### Removed diff --git a/tasmota/tasmota_xsns_sensor/xsns_83_neopool.ino b/tasmota/tasmota_xsns_sensor/xsns_83_neopool.ino index 49014b7a9..626a32e9b 100644 --- a/tasmota/tasmota_xsns_sensor/xsns_83_neopool.ino +++ b/tasmota/tasmota_xsns_sensor/xsns_83_neopool.ino @@ -2173,8 +2173,8 @@ void NeoPoolShow(bool json) ResponseAppend_P(PSTR(",\"" D_NEOPOOL_JSON_MAX "\":" NEOPOOL_FMT_HIDRO), decimals, &fvalue); ResponseAppend_P(PSTR(",\"" D_NEOPOOL_JSON_PERCENT "\":{")); - ResponseAppend_P(PSTR( "\"" D_JSON_DATA "\":%d"), data * 100 / max); - ResponseAppend_P(PSTR(",\"" D_NEOPOOL_JSON_SETPOINT "\":%d"), setpoint * 100 / max); + ResponseAppend_P(PSTR( "\"" D_JSON_DATA "\":%d"), max ? (data * 100 / max) : 0); + ResponseAppend_P(PSTR(",\"" D_NEOPOOL_JSON_SETPOINT "\":%d"), max ? (setpoint * 100 / max) : 0); ResponseJsonEnd(); ResponseAppend_P(PSTR(",\"" D_NEOPOOL_JSON_CELL_RUNTIME "\":{"));