From 250ef8d4d98706ac35bfae829ebc6d5377cb1075 Mon Sep 17 00:00:00 2001 From: martinp876 Date: Sat, 16 Oct 2021 10:33:02 +0000 Subject: [PATCH] 98_HMimfo:minor improvement for init at startup git-svn-id: https://svn.fhem.de/fhem/trunk@25079 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/98_HMinfo.pm | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/fhem/FHEM/98_HMinfo.pm b/fhem/FHEM/98_HMinfo.pm index 16a4cd6ad..981148469 100644 --- a/fhem/FHEM/98_HMinfo.pm +++ b/fhem/FHEM/98_HMinfo.pm @@ -263,13 +263,19 @@ sub HMinfo_Notify(@){########################################################## } return undef; } -sub HMinfo_init($){############################################################# - my ($hash, $dev) = @_; +sub HMinfo_init($){############################################################ + #my ($hash, $dev) = @_; + RemoveInternalTimer("HMinfo_init");# just to be sure... if ($init_done){ - Log3($hash,5,"debug: HMinfo_init"); if (!$modules{HMinfo}{helper}{initDone}){ my ($hm) = devspec2array("TYPE=HMinfo"); + Log3($hm,5,"debug: HMinfo_init"); + foreach my $attrName (keys %{$attr{$hm}}){ + #Log 1," update HM attributes - will update CUL_HM settings ocationally"; + HMinfo_Attr("set",$hm, $attrName,$attr{$hm}{$attrName}); + } + if (substr(AttrVal($hm, "autoLoadArchive", 0),0,1) ne 0){ HMinfo_SetFn($defs{$hm},$hm,"loadConfig"); InternalTimer(gettimeofday()+5,"HMinfo_init", "HMinfo_init", 0); @@ -1251,7 +1257,7 @@ sub HMinfo_getCfgDefere($){#################################################### HMinfo_GetFn($defs{$hm},$hm,"configCheck","-f","^(".'\^('.join("|",@{$defs{$hm}{helper}{nbPend}}).')\$'.")\$"); } -sub HMinfo_startBlocking(@){#################################################### +sub HMinfo_startBlocking(@){################################################### my ($name,$fkt,$param) = @_; my $hash = $defs{$name}; Log3 $hash,5,"HMinfo $name start blocking:$fkt";