############################################## # $Id$ package main; use strict; use warnings; sub dummy_Initialize($) { my ($hash) = @_; $hash->{SetFn} = "dummy_Set"; $hash->{DefFn} = "dummy_Define"; $hash->{AttrList} = "setList ". $readingFnAttributes; } ################################### sub dummy_Set($@) { my ($hash, @a) = @_; my $name = shift @a; return "no set value specified" if(int(@a) < 1); my $setList = AttrVal($name, "setList", " "); return "Unknown argument ?, choose one of $setList" if($a[0] eq "?"); my $v = join(" ", @a); Log3 $name, 4, "dummy set $name $v"; readingsSingleUpdate($hash,"state",$v,1); return undef; } sub dummy_Define($$) { my ($hash, $def) = @_; my @a = split("[ \t][ \t]*", $def); return "Wrong syntax: use define dummy" if(int(@a) != 2); return undef; } 1; =pod =begin html

dummy

=end html =begin html_DE

dummy

=end html_DE =cut