From 2ce3dc1563833655a262ee26797f589b57778cbf Mon Sep 17 00:00:00 2001 From: mfr69bs <> Date: Sun, 13 Jan 2013 19:26:57 +0000 Subject: [PATCH] reading "address" changed to "id" for serial number devices git-svn-id: https://svn.fhem.de/fhem/trunk@2509 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/11_OWDevice.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fhem/FHEM/11_OWDevice.pm b/fhem/FHEM/11_OWDevice.pm index b258e1965..e9e109f01 100644 --- a/fhem/FHEM/11_OWDevice.pm +++ b/fhem/FHEM/11_OWDevice.pm @@ -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);