mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-08 07:24:21 +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:
parent
b5bd45a36b
commit
f2405b71a9
@ -5393,8 +5393,8 @@ sub Attr {
|
|||||||
|
|
||||||
if ($init_done && $aName eq 'ctrlInterval') {
|
if ($init_done && $aName eq 'ctrlInterval') {
|
||||||
_newCycTime ($hash, time, $aVal);
|
_newCycTime ($hash, time, $aVal);
|
||||||
my $nct = CurrentVal ($hash, 'nextCycleTime', 0); # gespeicherte nächste CyleTime
|
my $nct = CurrentVal ($hash, 'nextCycleTime', 0); # gespeicherte nächste CyleTime
|
||||||
readingsSingleUpdate ($hash, 'nextCycletime', FmtTime($nct), 0);
|
readingsSingleUpdate ($hash, 'nextCycletime', (!$nct ? 'Manual' : FmtTime($nct)), 0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -6203,6 +6203,13 @@ sub _newCycTime {
|
|||||||
my $hash = shift;
|
my $hash = shift;
|
||||||
my $t = shift;
|
my $t = shift;
|
||||||
my $interval = 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
|
my $new = $t + $interval; # nächste Wiederholungszeit
|
||||||
$hash->{MODE} = 'Automatic - next Cycletime: '.FmtTime($new);
|
$hash->{MODE} = 'Automatic - next Cycletime: '.FmtTime($new);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user