2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-15 22:26:04 +00:00

Defining a repeated at job in a sunrise/sunset at job fails

git-svn-id: https://svn.fhem.de/fhem/trunk@364 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2009-04-19 09:37:17 +00:00
parent 9e0ced360e
commit 65994c8a54

View File

@ -14,7 +14,7 @@ at_Initialize($)
$hash->{DefFn} = "at_Define";
$hash->{UndefFn} = "at_Undef";
$hash->{AttrFn} = "at_Attr";
$hash->{AttrList} = "disable:0,1 skip_next:0,1";
$hash->{AttrList} = "disable:0,1 skip_next:0,1 loglevel:0,1,2,3,4,5,6";
}
@ -90,16 +90,16 @@ sub
at_Exec($)
{
my ($name) = @_;
my ($skip, $disable);
my ($skip, $disable) = ("","");
return if(!$defs{$name}); # Just deleted
Log GetLogLevel($name,5), "exec at command $name";
if(defined($attr{$name})) {
$skip = 1 if($attr{$name} && $attr{$name}{skip_next});
$disable = 1 if($attr{$name} && $attr{$name}{disable});
}
#Log 1, "EXEC $name";
delete $attr{$name}{skip_next} if($skip);
my (undef, $command) = split("[ \t]+", $defs{$name}{DEF}, 2);
$command = SemicolonEscape($command);
@ -117,7 +117,8 @@ at_Exec($)
CommandDelete(undef, $name); # Recreate ourselves
if($count) {
$def =~ s/{\d+}/{$count}/ if($def =~ m/^\+?\*{/); # Replace the count }
$def =~ s/{\d+}/{$count}/ if($def =~ m/^\+?\*{\d+}/); # Replace the count
Log GetLogLevel($name,5), "redefine at command $name as $def";
CommandDefine(undef, "$name at $def"); # Recompute the next TRIGGERTIME
$attr{$name} = $oldattr;
}