diff --git a/CHANGED b/CHANGED index 8cef00703..59f7e4af3 100644 --- a/CHANGED +++ b/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/72_FB_CALLLIST.pm b/FHEM/72_FB_CALLLIST.pm index 6bddf3f9a..79ab85932 100755 --- a/FHEM/72_FB_CALLLIST.pm +++ b/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 {