2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-09 20:57:11 +00:00

70_PylonLowVoltage: avoid possible Illegal division by zero

git-svn-id: https://svn.fhem.de/fhem/trunk@28724 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
nasseeder1 2024-03-29 20:00:59 +00:00
parent 55353aab3a
commit 0cbd24b6ac
2 changed files with 4 additions and 2 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.
- change: 70_PylonLowVoltage: avoid possible Illegal division by zero
- feature: 76_SolarForecast: integrate the Open-Meteo API
- change: 50_Signalbot: Improved registration procedure for Voice
- feature: 93_DbRep: multicmd: add attr seqDoubletsVariance

View File

@ -122,6 +122,7 @@ BEGIN {
# Versions History intern (Versions history by Heiko Maaz)
my %vNotesIntern = (
"0.2.4" => "29.03.2024 avoid possible Illegal division by zero at line 1438 ",
"0.2.3" => "19.03.2024 edit commandref ",
"0.2.2" => "20.02.2024 correct commandref ",
"0.2.1" => "18.02.2024 doOnError: print out faulty response, Forum:https://forum.fhem.de/index.php?msg=1303912 ",
@ -1434,8 +1435,8 @@ sub additionalReadings {
my ($vmax, $vmin);
$readings->{averageCellVolt} = sprintf "%.3f", $readings->{packVolt} / $readings->{packCellcount} if(defined $readings->{packCellcount});
$readings->{packSOC} = sprintf "%.2f", ($readings->{packCapacityRemain} / $readings->{packCapacity} * 100) if(defined $readings->{packCapacity});
$readings->{averageCellVolt} = sprintf "%.3f", $readings->{packVolt} / $readings->{packCellcount} if($readings->{packCellcount});
$readings->{packSOC} = sprintf "%.2f", ($readings->{packCapacityRemain} / $readings->{packCapacity} * 100) if($readings->{packCapacity});
$readings->{packPower} = sprintf "%.2f", $readings->{packCurrent} * $readings->{packVolt};
for (my $i=1; $i <= $readings->{packCellcount}; $i++) {