reading "address" changed to "id" for serial number devices

git-svn-id: https://fhem.svn.sourceforge.net/svnroot/fhem/trunk/fhem@2509 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
mfr69bs
2013-01-13 19:26:57 +00:00
parent b8187a7b94
commit 77aec5c9c3

View File

@@ -43,7 +43,7 @@ $owdevice{"01"} = {
# DS1990A - Serial Number iButton
"read" => [],
"write" => [],
"poll" => [ qw(address) ],
"poll" => [ qw(id) ],
"state" => [],
"interface" => "id",
};
@@ -295,7 +295,7 @@ $owdevice{"81"} = {
# USB id - ID found in DS2490R and DS2490B USB adapters
"read" => [],
"write" => [],
"poll" => [ qw(address) ],
"poll" => [ qw(id) ],
"state" => [],
"interface" => "id",
};
@@ -631,12 +631,13 @@ OWDevice_Define($$)
$hash->{fhem}{bus}= OWDevice_ReadFromServer($hash,"find",$hash->{fhem}{address});
$attr{$name}{model}= OWDevice_ReadValue($hash, "type");
if($interface eq "id" && !defined($hash->{fhem}{interval})) {
my $value= OWDevice_Get($hash, "address");
my $dir= OWDevice_ReadFromServer($hash,"dir","/");
my $present= ($dir =~ m/$hash->{fhem}{address}/) ? 1 :0;
my $bus= OWDevice_ReadFromServer($hash,"find",$hash->{fhem}{address});
my $location= (defined($bus)) ? $bus :"absent";
my $id= OWDevice_Get($hash, $name, "id");
readingsBeginUpdate($hash);
readingsBulkUpdate($hash,"id",$id);
readingsBulkUpdate($hash,"present",$present);
readingsBulkUpdate($hash,"state","present: $present");
readingsBulkUpdate($hash,"location",$location);