From ffc47718359aa42a827aa91030cd5c5dd68aa626 Mon Sep 17 00:00:00 2001 From: DS_Starter Date: Tue, 19 Jan 2021 12:12:28 +0000 Subject: [PATCH] 76_Solarforcast: contrib 0.2.0 git-svn-id: https://svn.fhem.de/fhem/trunk@23551 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/contrib/DS_Starter/76_SolarForecast.pm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/fhem/contrib/DS_Starter/76_SolarForecast.pm b/fhem/contrib/DS_Starter/76_SolarForecast.pm index 19750f80a..ea03f5833 100644 --- a/fhem/contrib/DS_Starter/76_SolarForecast.pm +++ b/fhem/contrib/DS_Starter/76_SolarForecast.pm @@ -2284,8 +2284,8 @@ sub setPVhistory { my $name = $paref->{name}; my $t = $paref->{t}; # aktuelle Unix-Zeit my $chour = $paref->{chour}; - my $ethishour = $paref->{ethishour}; - my $calcpv = $paref->{calcpv}; + my $ethishour = $paref->{ethishour} // 0; + my $calcpv = $paref->{calcpv} // 0; my $type = $hash->{TYPE}; my $day = strftime "%d", localtime($t); # aktueller Tag @@ -2311,8 +2311,10 @@ sub listPVHistory { my $day = shift; my $ret; for my $key (sort{$a<=>$b} keys %{$pvhh->{$day}}) { - $ret .= "\n " if($ret); - $ret .= $key." => pvreal:".$pvhh->{$day}{$key}{pvrl}.", pvforecast:".$pvhh->{$day}{$key}{pvfc}; + my $pvrl = $pvhh->{$day}{$key}{pvrl} // 0; + my $pvfc = $pvhh->{$day}{$key}{pvfc} // 0; + $ret .= "\n " if($ret); + $ret .= $key." => pvreal: $pvrl, pvforecast: $pvfc"; } return $ret; };