From 56e8d4dff2ca5c011d5badb60266f8bf05bc4189 Mon Sep 17 00:00:00 2001 From: markusbloch <> Date: Sun, 6 Mar 2016 11:10:39 +0000 Subject: [PATCH] FB_CALLLIST: new reading "numberOfCalls" which shows the number of shown call entries. git-svn-id: https://svn.fhem.de/fhem/trunk@11003 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 2 ++ fhem/FHEM/72_FB_CALLLIST.pm | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/fhem/CHANGED b/fhem/CHANGED index 8cef00703..59f7e4af3 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,7 @@ # Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # Do not insert empty lines here, update check depends on it. + - feature: FB_CALLLIST: new reading "numberOfCalls" which shows the number + of shown call entries. - bugfix: 00_SIGNALduino: updated firmware to 3.2.0-hf1 solves MU and MC issue - bugfix: PRESENCE/presenced: fixed crash of presenced when receiving an diff --git a/fhem/FHEM/72_FB_CALLLIST.pm b/fhem/FHEM/72_FB_CALLLIST.pm index 6bddf3f9a..79ab85932 100755 --- a/fhem/FHEM/72_FB_CALLLIST.pm +++ b/fhem/FHEM/72_FB_CALLLIST.pm @@ -638,7 +638,7 @@ sub FB_CALLLIST_list2html($;$) if(exists($hash->{helper}{DATA}) and (scalar keys %{$hash->{helper}{DATA}}) > 0) { - my $count = 1; + my $count = 0; my @json_list; @@ -656,6 +656,7 @@ sub FB_CALLLIST_list2html($;$) foreach my $index (@list) { + $count++; my $data = \%{$hash->{helper}{DATA}{$index}}; my $number = $data->{external_number}; @@ -667,7 +668,6 @@ sub FB_CALLLIST_list2html($;$) $number = ''.$number.""; } - $line = { index => $index, line => $count, @@ -682,12 +682,12 @@ sub FB_CALLLIST_list2html($;$) duration => FB_CALLLIST_formatDuration($hash, $index) }; - push @json_output, FB_CALLLIST_returnOrderedJSONOutput($hash, $line); FB_CALLLIST_updateReadings($hash, $line) if($to_json and $create_readings eq "1"); $ret .= FB_CALLLIST_returnOrderedHTMLOutput($hash, $line, 'number="'.$count.'" class="fbcalllist '.($count % 2 == 1 ? "odd" : "even").'"', 'class="fbcalllist" '.$td_style); - $count++; } + + readingsSingleUpdate($hash, "numberOfCalls", $count, 1) if($to_json and $create_readings eq "1"); } else {