2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-08 13:24:56 +00:00

76_SolarForecast: attr ctrlInterval: immediate impact when set

git-svn-id: https://svn.fhem.de/fhem/trunk@28842 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
nasseeder1 2024-05-06 19:48:12 +00:00
parent b5bd45a36b
commit f2405b71a9

View File

@ -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;
}
}
@ -6204,6 +6204,13 @@ sub _newCycTime {
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);