diff --git a/FHEM/10_OWServer.pm b/FHEM/10_OWServer.pm index 8b1ae9613..55f2c0454 100644 --- a/FHEM/10_OWServer.pm +++ b/FHEM/10_OWServer.pm @@ -280,8 +280,8 @@ OWServer_Set($@)

diff --git a/FHEM/11_OWDevice.pm b/FHEM/11_OWDevice.pm index 5bb08eba5..54666d440 100644 --- a/FHEM/11_OWDevice.pm +++ b/FHEM/11_OWDevice.pm @@ -38,8 +38,9 @@ OWDevice_Initialize($) $hash->{GetFn} = "OWDevice_Get"; $hash->{SetFn} = "OWDevice_Set"; $hash->{DefFn} = "OWDevice_Define"; + $hash->{AttrFn} = "OWDevice_Attr"; - $hash->{AttrList} = "trimvalues loglevel:0,1,2,3,4,5"; + $hash->{AttrList} = "trimvalues polls interfaces loglevel:0,1,2,3,4,5"; } ################################### @@ -208,6 +209,31 @@ OWDevice_UpdateValues($) { } +################################### +sub +OWDevice_Attr($@) +{ + my ($cmd, $name, $attrName, $attrVal) = @_; + my $hash = $defs{$name}; + + $attrVal= "" unless defined($attrVal); + $attrVal= "" if($cmd eq "del"); + + if($attrName eq "polls") { + my @polls= split(",", $attrVal); + $hash->{fhem}{polls}= \@polls; + Log 5, "$name: polls: " . join(" ", @polls); + } elsif($attrName eq "interfaces") { + if($attrVal ne "") { + $hash->{fhem}{interfaces}= join(";",split(",",$attrVal)); + Log 5, "$name: interfaces: " . $hash->{fhem}{interfaces}; + } else { + delete $hash->{fhem}{interfaces} if(defined($hash->{fhem}{interfaces})); + Log 5, "$name: no interfaces"; + } + } +} + ################################### sub OWDevice_Get($@) @@ -419,6 +445,8 @@ OWDevice_Define($$) Attributes