2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-02-26 10:34:52 +00:00

76_SolarForecast: Illegal division by zero

git-svn-id: https://svn.fhem.de/fhem/trunk@28954 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
nasseeder1 2024-06-08 07:53:09 +00:00
parent c9bed69aef
commit 416e145b23
3 changed files with 7 additions and 0 deletions

View File

@ -1,5 +1,6 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
# Do not insert empty lines here, update check depends on it
- bugfix: 76_SolarForecast: Illegal division by zero
- bufgix: 32_withings: improved token refresh timing
- change: 38_netatmo: improved disconnect handling on auth failure
- change: 76_SolarForecast: set inverterStrings to attr setupInverterStrings

View File

@ -157,6 +157,7 @@ BEGIN {
# Versions History intern
my %vNotesIntern = (
"1.25.1" => "08.06.2024 Illegal division by zero Forum:https://forum.fhem.de/index.php?msg=1314730 ",
"1.25.0" => "05.06.2024 transformed setter inverterStrings to attr setupInverterStrings, calcTodayPVdeviation: fix continuously calc again ",
"1.24.0" => "03.06.2024 transformed setter currentInverterDev to attr setupInverterDev, calcTodayPVdeviation: fix continuously calc ",
"1.23.0" => "02.06.2024 transformed setter currentBatteryDev to attr setupBatteryDev, _transferInverterValues: change output for DEBUG ".
@ -10624,6 +10625,8 @@ sub calcTodayPVdeviation {
}
else {
my $pvfcd = ReadingsNum ($name, 'RestOfDayPVforecast', 0) - $pvfc; # PV Prognose bis jetzt
return if(!$pvfcd); # Illegal division by zero verhindern
$dp = sprintf "%.2f", (100 - (100 * $pvre / abs $pvfcd)); # V 1.25.0
}

View File

@ -157,6 +157,7 @@ BEGIN {
# Versions History intern
my %vNotesIntern = (
"1.25.1" => "08.06.2024 Illegal division by zero Forum:https://forum.fhem.de/index.php?msg=1314730 ",
"1.25.0" => "05.06.2024 transformed setter inverterStrings to attr setupInverterStrings, calcTodayPVdeviation: fix continuously calc again ",
"1.24.0" => "03.06.2024 transformed setter currentInverterDev to attr setupInverterDev, calcTodayPVdeviation: fix continuously calc ",
"1.23.0" => "02.06.2024 transformed setter currentBatteryDev to attr setupBatteryDev, _transferInverterValues: change output for DEBUG ".
@ -10624,6 +10625,8 @@ sub calcTodayPVdeviation {
}
else {
my $pvfcd = ReadingsNum ($name, 'RestOfDayPVforecast', 0) - $pvfc; # PV Prognose bis jetzt
return if(!$pvfcd); # Illegal division by zero verhindern
$dp = sprintf "%.2f", (100 - (100 * $pvre / abs $pvfcd)); # V 1.25.0
}