From 5c30778d250275bcd07551e2f5bc547a43f64a67 Mon Sep 17 00:00:00 2001 From: martinp876 <> Date: Sat, 30 Jan 2021 16:21:19 +0000 Subject: [PATCH] HMInfo: update init procedure git-svn-id: https://svn.fhem.de/fhem/trunk@23643 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/98_HMinfo.pm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/fhem/FHEM/98_HMinfo.pm b/fhem/FHEM/98_HMinfo.pm index b27515438..d952a2e08 100644 --- a/fhem/FHEM/98_HMinfo.pm +++ b/fhem/FHEM/98_HMinfo.pm @@ -68,7 +68,8 @@ sub HMinfo_Initialize($$) {#################################################### ."verbCULHM:multiple,none,allSet,allGet,allSetVerb,allGetVerb " .$readingFnAttributes; $hash->{NOTIFYDEV} = "global"; - InternalTimer(gettimeofday()+5,"HMinfo_init", "HMinfo_init", 0); + $modules{HMinfo}{helper}{initDone} = 0; + HMinfo_init(); } sub HMinfo_Define($$){######################################################### my ($hash, $def) = @_; @@ -96,6 +97,8 @@ sub HMinfo_Define($$){######################################################### .",cover:closed" ; $hash->{nb}{cnt} = 0; + $modules{HMinfo}{helper}{initDone} = 0; + HMinfo_init(); return; } sub HMinfo_Undef($$){########################################################## @@ -251,6 +254,7 @@ sub HMinfo_Notify(@){########################################################## HMinfo_archConfig($hash,$name,"","") if(AttrVal($name,"autoArchive",undef)); } if (grep /INITIALIZED/,@{$events}){ + $modules{HMinfo}{helper}{initDone} = 0; HMinfo_init(); } return undef; @@ -258,10 +262,11 @@ sub HMinfo_Notify(@){########################################################## sub HMinfo_init(){############################################################# RemoveInternalTimer("HMinfo_init");# just to be secure... if ($init_done){ - if (!defined $modules{HMinfo}{helper}{initDone} || !$modules{HMinfo}{helper}{initDone}){ # && !$modules{HMinfo}{helper}{initDone}){ + if (!$modules{HMinfo}{helper}{initDone}){ # && !$modules{HMinfo}{helper}{initDone}){ my ($hm) = devspec2array("TYPE=HMinfo"); if (substr(AttrVal($hm, "autoLoadArchive", 0),0,1) ne 0){ HMinfo_SetFn($defs{$hm},$hm,"loadConfig"); + InternalTimer(gettimeofday()+5,"HMinfo_init", "HMinfo_init", 0); } else{ $modules{HMinfo}{helper}{initDone} = 1;