From 6182d2fb3fe7f9dd67615f498e3bf4a846caee85 Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Sun, 23 Aug 2015 12:43:56 +0000 Subject: [PATCH] fhem.pl: add -temporary option to the define command (Forum #39610) git-svn-id: https://svn.fhem.de/fhem/trunk@9118 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/docs/commandref_frame.html | 15 ++++++++++++++- fhem/docs/commandref_frame_DE.html | 16 ++++++++++++++-- fhem/fhem.pl | 9 ++++++++- 3 files changed, 36 insertions(+), 4 deletions(-) diff --git a/fhem/docs/commandref_frame.html b/fhem/docs/commandref_frame.html index 415ad6ec7..bd2673598 100644 --- a/fhem/docs/commandref_frame.html +++ b/fhem/docs/commandref_frame.html @@ -732,7 +732,7 @@ The following local attributes are used by a wider range of devices:

define

diff --git a/fhem/docs/commandref_frame_DE.html b/fhem/docs/commandref_frame_DE.html index e1612bc14..24ad38061 100644 --- a/fhem/docs/commandref_frame_DE.html +++ b/fhem/docs/commandref_frame_DE.html @@ -760,7 +760,7 @@ Die folgenden lokalen Attribute werden von mehreren Geräten verwendet:

define

diff --git a/fhem/fhem.pl b/fhem/fhem.pl index a30a059e5..2bf73581b 100755 --- a/fhem/fhem.pl +++ b/fhem/fhem.pl @@ -1627,7 +1627,7 @@ CommandDefine($$) { my ($cl, $def) = @_; my @a = split("[ \t]+", $def, 3); - my $ignoreErr; + my ($ignoreErr, $temporary); # used by RSS in fhem.cfg.demo, with no GD installed if($a[0] && $a[0] eq "-ignoreErr") { @@ -1635,6 +1635,12 @@ CommandDefine($$) @a = split("[ \t][ \t]*", $def, 3); $ignoreErr = 1; } + if($a[0] && $a[0] eq "-temporary") { # Forum #39610 + $def =~ s/\s*-temporary\s*//; + @a = split("[ \t][ \t]*", $def, 3); + $temporary = 1; + } + my $name = $a[0]; return "Usage: define " if(int(@a) < 2); @@ -1679,6 +1685,7 @@ CommandDefine($$) delete $attr{$name}; } else { + $hash{TEMPORARY} = 1 if($temporary); foreach my $da (sort keys (%defaultattr)) { # Default attributes CommandAttr($cl, "$name $da $defaultattr{$da}"); }