From f9304ea116f8a7170486396208b31060fe799248 Mon Sep 17 00:00:00 2001 From: grompo <> Date: Wed, 3 Aug 2016 19:43:00 +0000 Subject: [PATCH] fritzbox: bugfix userprofil git-svn-id: https://svn.fhem.de/fhem/trunk@11888 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/72_FRITZBOX.pm | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/fhem/FHEM/72_FRITZBOX.pm b/fhem/FHEM/72_FRITZBOX.pm index b1628e948..f569c72e6 100644 --- a/fhem/FHEM/72_FRITZBOX.pm +++ b/fhem/FHEM/72_FRITZBOX.pm @@ -1537,20 +1537,21 @@ sub FRITZBOX_Readout_Run_Web($) # user profiles $runNo = 1; $rName = "user01"; - foreach ( @{ $result->{userProfil} } ) { - # do not show data for unlimited, blocked or default access rights - if ($_->{filter_profile_UID} !~ /^filtprof[134]$/ || defined $hash->{READINGS}{$rName} ) - { - FRITZBOX_Readout_Add_Reading $hash, \@roReadings, $rName, $_->{name}, "deviceip"; - FRITZBOX_Readout_Add_Reading $hash, \@roReadings, $rName."_thisMonthTime", $_->{this_month_time}, "secondsintime"; - FRITZBOX_Readout_Add_Reading $hash, \@roReadings, $rName."_todayTime", $_->{today_time}, "secondsintime"; - FRITZBOX_Readout_Add_Reading $hash, \@roReadings, $rName."_todaySeconds", $_->{today_time}; - FRITZBOX_Readout_Add_Reading $hash, \@roReadings, $rName."_type", $_->{type}, "usertype"; + if ( ref $result->{userProfil} eq 'ARRAY' ) { + foreach ( @{ $result->{userProfil} } ) { + # do not show data for unlimited, blocked or default access rights + if ($_->{filter_profile_UID} !~ /^filtprof[134]$/ || defined $hash->{READINGS}{$rName} ) + { + FRITZBOX_Readout_Add_Reading $hash, \@roReadings, $rName, $_->{name}, "deviceip"; + FRITZBOX_Readout_Add_Reading $hash, \@roReadings, $rName."_thisMonthTime", $_->{this_month_time}, "secondsintime"; + FRITZBOX_Readout_Add_Reading $hash, \@roReadings, $rName."_todayTime", $_->{today_time}, "secondsintime"; + FRITZBOX_Readout_Add_Reading $hash, \@roReadings, $rName."_todaySeconds", $_->{today_time}; + FRITZBOX_Readout_Add_Reading $hash, \@roReadings, $rName."_type", $_->{type}, "usertype"; + } + $runNo++; + $rName = sprintf ("user%02d",$runNo); } - $runNo++; - $rName = sprintf ("user%02d",$runNo); } - # Diversity $runNo=1;