From 2ba0502e524b7f59c7782e3094963b3dd42d3729 Mon Sep 17 00:00:00 2001 From: DS_Starter Date: Sun, 21 Mar 2021 15:26:26 +0000 Subject: [PATCH] 76_SolarForecast.pm: contrib 0.17.1 git-svn-id: https://svn.fhem.de/fhem/trunk@24041 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/contrib/DS_Starter/76_SolarForecast.pm | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/fhem/contrib/DS_Starter/76_SolarForecast.pm b/fhem/contrib/DS_Starter/76_SolarForecast.pm index b973418f3..1887ddb74 100644 --- a/fhem/contrib/DS_Starter/76_SolarForecast.pm +++ b/fhem/contrib/DS_Starter/76_SolarForecast.pm @@ -116,7 +116,7 @@ BEGIN { # Versions History intern my %vNotesIntern = ( - "0.17.1" => "21.03.2021 bug fixes ", + "0.17.1" => "21.03.2021 bug fixes, delete Helper->NextHour ", "0.17.0" => "20.03.2021 new attr cloudFactorSlope / rainFactorSlope, fixes in Graphic sub ", "0.16.0" => "19.03.2021 new getter nextHours, some fixes ", "0.15.3" => "19.03.2021 corrected weather consideration for call calcPVforecast ", @@ -1492,12 +1492,7 @@ sub _transferWeatherValues { my $num1 = $num-1; if($num1 >= 0) { - $time_str = "NextHour".sprintf "%02d", $num1; - - $hash->{HELPER}{"${time_str}_WeatherId"} = $wid; - $hash->{HELPER}{"${time_str}_CloudCover"} = $neff; - $hash->{HELPER}{"${time_str}_RainProb"} = $r101; - + $time_str = "NextHour".sprintf "%02d", $num1; $data{$type}{$name}{nexthours}{$time_str}{weatherid} = $wid; $data{$type}{$name}{nexthours}{$time_str}{cloudcover} = $neff; $data{$type}{$name}{nexthours}{$time_str}{rainprob} = $r101; @@ -2130,7 +2125,7 @@ sub forecastGraphic { $val1 = (exists($data{$hash->{TYPE}}{$name}{pvfc}{$t0})) ? $data{$hash->{TYPE}}{$name}{pvfc}{$t0} : 0; $val2 = (exists($data{$hash->{TYPE}}{$name}{pvreal}{$t0})) ? $data{$hash->{TYPE}}{$name}{pvreal}{$t0} : 0; # ToDo : klären ob ThisHour:weather_Id stimmt in Bezug zu ThisHour_Time - $we{0} = (exists($hash->{HELPER}{'NextHour00_WeatherId'})) ? $hash->{HELPER}{"NextHour00_WeatherId"} : -1; + $we{0} = $data{$hash->{TYPE}}{$name}{nexthours}{NextHour00} ? $data{$hash->{TYPE}}{$name}{nexthours}{NextHour00}{weatherid} // -1 : -1; #$is{0} = (ReadingsVal($name,"NextHour00_IsConsumptionRecommended",'no') eq 'yes' ) ? $icon : undef; } @@ -2224,12 +2219,12 @@ sub forecastGraphic { $val1 = ReadingsNum($name, 'NextHour'.$nh.'_PVforecast', 0); # ToDo : klären ob -1 oder nicht ! #$nh = sprintf('%02d', $i+$offset-1); - $we{$i} = (exists($hash->{HELPER}{'NextHour'.$nh.'_WeatherId'})) ?$hash->{HELPER}{'NextHour'.$nh.'_WeatherId'} : -1; + $we{$i} = $data{$hash->{TYPE}}{$name}{nexthours}{'NextHour'.$nh} ? $data{$hash->{TYPE}}{$name}{nexthours}{'NextHour'.$nh}{weatherid} // -1 : -1; } } else { $val1 = ReadingsNum($name, 'NextHour'.$ii.'_PVforecast', 0); # Forecast - $we{$i} = (exists($hash->{HELPER}{'NextHour'.$ii.'_WeatherId'})) ? $hash->{HELPER}{'NextHour'.$ii.'_WeatherId'} : -1; # für Wettericons + $we{$i} = $data{$hash->{TYPE}}{$name}{nexthours}{'NextHour'.$ii} ? $data{$hash->{TYPE}}{$name}{nexthours}{'NextHour'.$ii}{weatherid} // -1 : -1; # für Wettericons #$is{$i} = (ReadingsVal($name,"NextHour".$ii."_IsConsumptionRecommended",'no') eq 'yes') ? $icon : undef; }