mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-16 04:36:02 +00:00
added attributes polls and interfaces to OWDevice
git-svn-id: https://svn.fhem.de/fhem/trunk@2399 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
73274915d6
commit
a4040bf0b2
@ -280,8 +280,8 @@ OWServer_Set($@)
|
|||||||
<ul>
|
<ul>
|
||||||
<code>get <name> devices</code>
|
<code>get <name> devices</code>
|
||||||
<br><br>
|
<br><br>
|
||||||
Lists the addresses and types of all 1-wire devices provided by the owserver, Also shows
|
Lists the addresses and types of all 1-wire devices provided by the owserver. Also shows
|
||||||
the corresponding <a href="#OWDevice">OWDevice</a> devices if defined.
|
the corresponding <a href="#OWDevice">OWDevice</a> if one is defined for the respective 1-wire devices.
|
||||||
<br><br>
|
<br><br>
|
||||||
</ul>
|
</ul>
|
||||||
<br><br>
|
<br><br>
|
||||||
|
@ -38,8 +38,9 @@ OWDevice_Initialize($)
|
|||||||
$hash->{GetFn} = "OWDevice_Get";
|
$hash->{GetFn} = "OWDevice_Get";
|
||||||
$hash->{SetFn} = "OWDevice_Set";
|
$hash->{SetFn} = "OWDevice_Set";
|
||||||
$hash->{DefFn} = "OWDevice_Define";
|
$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
|
sub
|
||||||
OWDevice_Get($@)
|
OWDevice_Get($@)
|
||||||
@ -419,6 +445,8 @@ OWDevice_Define($$)
|
|||||||
<b>Attributes</b>
|
<b>Attributes</b>
|
||||||
<ul>
|
<ul>
|
||||||
<li>trimvalues: removes leading and trailing whitespace from readings. Default is 1 (on).</li>
|
<li>trimvalues: removes leading and trailing whitespace from readings. Default is 1 (on).</li>
|
||||||
|
<li>polls: a comma-separated list of readings to poll. This supersedes the list of default readings to poll.</li>
|
||||||
|
<li>interfaces: supersedes the interfaces exposed by that device.</li>
|
||||||
<li><a href="#loglevel">loglevel</a></li>
|
<li><a href="#loglevel">loglevel</a></li>
|
||||||
<li><a href="#eventMap">eventMap</a></li>
|
<li><a href="#eventMap">eventMap</a></li>
|
||||||
<li><a href="#event-on-update-reading">event-on-update-reading</a></li>
|
<li><a href="#event-on-update-reading">event-on-update-reading</a></li>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user