From 2b09e289b10443ba995271027eb6f8fda7c1efed Mon Sep 17 00:00:00 2001 From: rudolfkoenig Date: Wed, 9 Sep 2015 13:10:01 +0000 Subject: [PATCH] 98_autocreate: EnOceal special: add support for -temporary. Forum #39610 git-svn-id: https://svn.fhem.de/fhem/trunk@9216 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/98_autocreate.pm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/fhem/FHEM/98_autocreate.pm b/fhem/FHEM/98_autocreate.pm index 21d6a0422..9a1251246 100644 --- a/fhem/FHEM/98_autocreate.pm +++ b/fhem/FHEM/98_autocreate.pm @@ -118,8 +118,14 @@ autocreate_Notify($$) my $s = $dev->{CHANGED}[$i]; $s = "" if(!defined($s)); + my $temporary; ################ + if($s =~ m/^UNDEFINED -temporary/) { # Special for EnOcean. DO NOT use it elsewhere + $temporary = 1; + $s =~ s/ -temporary//; + } + if($s =~ m/^UNDEFINED ([^ ]*) ([^ ]*) (.*)$/) { my ($name, $type, $arg) = ($1, $2, $3); next if(AttrVal($me, "disable", undef)); @@ -213,6 +219,7 @@ autocreate_Notify($$) #################### if(!$hash) { $cmd = "$name $type $arg"; + $cmd = "-temporary $name $type $arg" if($temporary); Log3 $me, 2, "autocreate: define $cmd"; $ret = CommandDefine(undef, $cmd); if($ret) { @@ -227,7 +234,8 @@ autocreate_Notify($$) $room = $attr{$name}{room} if($attr{$name} && $attr{$name}{room}); $attr{$name}{room} = $room if($room); - next if($modules{$hash->{TYPE}}{noAutocreatedFilelog}); + $nrcreated = 0 if($temporary); # do not save + next if($modules{$hash->{TYPE}}{noAutocreatedFilelog} || $temporary); #################### my $fl = replace_wildcards($hash, AttrVal($me, "filelog", ""));