diff --git a/fhem/CHANGED b/fhem/CHANGED index 67dadb14e..f4c3da852 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,6 @@ # Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # Do not insert empty lines here, update check depends on it. + - feature: 90_at: computeAfterInit attribute (Forum #56706) - change: 93_DbRep: fit to new commandref style - bugfix: 20_ROOMMATE,20_GUEST: Fixed wakeuptimer <> at-device sync - feature 93_DbRep: current_year_begin, previous_year_begin, diff --git a/fhem/FHEM/90_at.pm b/fhem/FHEM/90_at.pm index 40223b270..8f81436f3 100755 --- a/fhem/FHEM/90_at.pm +++ b/fhem/FHEM/90_at.pm @@ -19,7 +19,7 @@ at_Initialize($) $hash->{AttrFn} = "at_Attr"; $hash->{StateFn} = "at_State"; $hash->{AttrList} = "disable:0,1 disabledForIntervals ". - "skip_next:0,1 alignTime"; + "skip_next:0,1 alignTime computeAfterInit"; $hash->{FW_detailFn} = "at_fhemwebFn"; } @@ -285,6 +285,17 @@ at_Attr(@) my $hash = $defs{$name}; + if($cmd eq "set" && $attrName eq "computeAfterInit" && + $attrVal && !$init_done) { + InternalTimer(1, sub(){ +Log 1, "IT"; + $hash->{OLDDEF} = $hash->{DEF}; + at_Define($hash, "$name at $hash->{DEF}"); + delete($hash->{OLDDEF}); + }, $name, 0); + return undef; + } + if($cmd eq "set" && $attrName eq "alignTime") { return "alignTime needs a list of timespec parameters" if(!$attrVal); my $ret = at_adjustAlign($hash, $attrVal); @@ -509,6 +520,28 @@ EOF Attributes @@ -683,6 +702,30 @@ EOF Attribute