2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 03:06:37 +00:00

98_serviced: fix update only after init_done

git-svn-id: https://svn.fhem.de/fhem/trunk@23884 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
deespe 2021-03-03 19:12:42 +00:00
parent ba2c5b5d9b
commit 0462b5b5b6

View File

@ -77,11 +77,7 @@ sub serviced_Define($$)
"StatusJammed=state,values=/error|failed/:JAMMED;/.*/:NOT_JAMMED";
}
}
if ($init_done)
{
readingsSingleUpdate($hash,"state","Initialized",1) ;
serviced_GetUpdate($hash);
}
readingsSingleUpdate($hash,"state","Initialized",1) if ($init_done);
return undef;
}
@ -391,10 +387,10 @@ sub serviced_GetUpdate(@)
{
my ($hash) = @_;
my $name = $hash->{NAME};
RemoveInternalTimer($hash);
return if (IsDisabled($name) || !$init_done);
my $sec = defined $hash->{helper}{interval} ? $hash->{helper}{interval} : AttrNum($name,"serviceStatusInterval",undef);
delete $hash->{helper}{interval} if (defined $hash->{helper}{interval});
RemoveInternalTimer($hash);
return if (IsDisabled($name));
serviced_Set($hash,$name,"status");
return if (!$sec);
InternalTimer(gettimeofday() + $sec,"serviced_GetUpdate",$hash);