From e68bf58f2b7c05655c5929affbca02f99c6de536 Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Tue, 23 Jun 2015 18:02:33 +0000 Subject: [PATCH] 98_dummy.pm: add readingList attribute (Forum #38383) git-svn-id: https://svn.fhem.de/fhem/trunk@8809 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/98_dummy.pm | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/fhem/FHEM/98_dummy.pm b/fhem/FHEM/98_dummy.pm index e2fc845e3..25d37dfbb 100644 --- a/fhem/FHEM/98_dummy.pm +++ b/fhem/FHEM/98_dummy.pm @@ -12,7 +12,7 @@ dummy_Initialize($) $hash->{SetFn} = "dummy_Set"; $hash->{DefFn} = "dummy_Define"; - $hash->{AttrList} = "setList ". $readingFnAttributes; + $hash->{AttrList} = "readingList setList ". $readingFnAttributes; } ################################### @@ -26,6 +26,13 @@ dummy_Set($@) my $setList = AttrVal($name, "setList", " "); return "Unknown argument ?, choose one of $setList" if($a[0] eq "?"); + my @rl = split(" ", AttrVal($name, "readingList", "")); + if(@rl && grep /\b$a[0]\b/, @rl) { + my $v = shift @a; + readingsSingleUpdate($hash, $v, join(" ",@a), 1); + return; + } + my $v = join(" ", @a); Log3 $name, 4, "dummy set $name $v"; @@ -84,11 +91,15 @@ dummy_Define($$) Attributes
@@ -135,13 +146,15 @@ dummy_Define($$) Attributes