FRITZBOX: bugfix part 2

git-svn-id: https://svn.fhem.de/fhem/trunk@8368 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
tpoitzsch
2015-04-03 18:30:15 +00:00
parent 707f8abb31
commit 68d6e8fed1

View File

@@ -780,19 +780,26 @@ sub FRITZBOX_Readout_Run($)
}
$resultArray = FRITZBOX_Readout_Query( $hash, \@readoutCmdArray, \@readoutReadings );
# Handset and DECT user can be in different orders but should have the same maximum number
for (0..$dectCount-1)
{
my $offset = $_ * 12;
my $intern = $resultArray->[ $offset];
my $user = $resultArray->[ $offset + 11];
if ( $intern )
push @readoutReadings, "fhem->$intern->name|" . $resultArray->[ $offset + 1 ]
if $intern;
my $handsetUser = $resultArray->[ $offset + 11];
my $handsetIntern = $resultArray->[ ($handsetUser-1) * 12 ];
if ( $handsetUser )
{
push @readoutReadings, "dect".$handsetUser."_manufacturer|" . $resultArray->[ $offset + 2 ];
push @readoutReadings, "dect".$handsetUser."_fwVersion|" . $resultArray->[ $offset + 9 ];
push @readoutReadings, "dect".$handsetUser."_model|" . FRITZBOX_Readout_Format($hash, "model", $resultArray->[ $offset + 10 ] );
}
if ( $handsetIntern )
{
push @readoutReadings, "fhem->$intern->name|" . $resultArray->[ $offset + 1 ];
push @readoutReadings, "fhem->$intern->brand|" . $resultArray->[ $offset + 2 ];
push @readoutReadings, "dect".$user."_manufacturer|" . $resultArray->[ $offset + 2 ];
push @readoutReadings, "dect".$user."_fwVersion|" . $resultArray->[ $offset + 9 ];
push @readoutReadings, "fhem->$intern->model|" . FRITZBOX_Readout_Format($hash, "model", $resultArray->[ $offset + 10 ] );
push @readoutReadings, "dect".$user."_model|" . FRITZBOX_Readout_Format($hash, "model", $resultArray->[ $offset + 10 ] );
}
}