mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-13 17:26:34 +00:00
Bugfix: attributes get deleted
git-svn-id: https://svn.fhem.de/fhem/trunk@293 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
5c865076cb
commit
7653fda0b1
@ -81,24 +81,28 @@ at_Exec($)
|
||||
my ($name) = @_;
|
||||
my ($skip, $disable);
|
||||
|
||||
return if(!$defs{$name}{DEF}); # Just deleted
|
||||
|
||||
if(defined($attr{$name})) {
|
||||
$skip = 1 if($attr{$name} && $attr{$name}{skip_next});
|
||||
$disable = 1 if($attr{$name} && $attr{$name}{disable});
|
||||
}
|
||||
|
||||
delete $attr{$name}{skip_next} if($skip);
|
||||
return if(!$defs{$name}{DEF}); # Just deleted
|
||||
my (undef, $command) = split("[ \t]+", $defs{$name}{DEF}, 2);
|
||||
$command = SemicolonEscape($command);
|
||||
AnalyzeCommandChain(undef, $command) if(!$skip && !$disable);
|
||||
|
||||
my $count = $defs{$name}{REP};
|
||||
my $def = $defs{$name}{DEF};
|
||||
|
||||
my $oldattr = $attr{$name}; # delete removes the attributes too
|
||||
CommandDelete(undef, $name); # Recreate ourselves
|
||||
|
||||
if($count) {
|
||||
$def =~ s/{\d+}/{$count}/ if($def =~ m/^\+?\*{/); # Replace the count }
|
||||
CommandDefine(undef, "$name at $def"); # Recompute the next TRIGGERTIME
|
||||
$attr{$name} = $oldattr;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user