From f2405b71a973ab12d94753fd7204e5819089443b Mon Sep 17 00:00:00 2001 From: nasseeder1 Date: Mon, 6 May 2024 19:48:12 +0000 Subject: [PATCH] 76_SolarForecast: attr ctrlInterval: immediate impact when set git-svn-id: https://svn.fhem.de/fhem/trunk@28842 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/76_SolarForecast.pm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/fhem/FHEM/76_SolarForecast.pm b/fhem/FHEM/76_SolarForecast.pm index aa9671192..86ea1dd95 100644 --- a/fhem/FHEM/76_SolarForecast.pm +++ b/fhem/FHEM/76_SolarForecast.pm @@ -5393,8 +5393,8 @@ sub Attr { if ($init_done && $aName eq 'ctrlInterval') { _newCycTime ($hash, time, $aVal); - my $nct = CurrentVal ($hash, 'nextCycleTime', 0); # gespeicherte nächste CyleTime - readingsSingleUpdate ($hash, 'nextCycletime', FmtTime($nct), 0); + my $nct = CurrentVal ($hash, 'nextCycleTime', 0); # gespeicherte nächste CyleTime + readingsSingleUpdate ($hash, 'nextCycletime', (!$nct ? 'Manual' : FmtTime($nct)), 0); return; } } @@ -6203,6 +6203,13 @@ sub _newCycTime { my $hash = shift; my $t = shift; my $interval = shift; + + if (!$interval) { + $hash->{MODE} = 'Manual'; + $data{$hash->{TYPE}}{$hash->{NAME}}{current}{nextCycleTime} = 0; + storeReading ('nextCycletime', 'Manual'); + return; + } my $new = $t + $interval; # nächste Wiederholungszeit $hash->{MODE} = 'Automatic - next Cycletime: '.FmtTime($new);