From fbbc44c6c21e164942d8c958a9e45a22245f9b79 Mon Sep 17 00:00:00 2001 From: markusbloch <> Date: Thu, 13 Dec 2018 12:23:17 +0000 Subject: [PATCH] FB_CALLLIST: new readings/events implemented to count different call types (incoming, outgoing, missed, etc.) git-svn-id: https://svn.fhem.de/fhem/trunk@17968 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 2 + fhem/FHEM/72_FB_CALLLIST.pm | 77 +++++++++++++++++++++++++------------ 2 files changed, 54 insertions(+), 25 deletions(-) diff --git a/fhem/CHANGED b/fhem/CHANGED index 0c55510ff..f21a676b5 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: 72_FB_CALLLIST: new readings/events "count-..." implemented to + count different call types - change: 72_FB_CALLMONITOR: removed klicktel.de for reverse search, as the service is not available anymore - bugfix: 49_SSCam: fix in autocreateCams and take snapshot diff --git a/fhem/FHEM/72_FB_CALLLIST.pm b/fhem/FHEM/72_FB_CALLLIST.pm index 03a27d91d..8f6599404 100755 --- a/fhem/FHEM/72_FB_CALLLIST.pm +++ b/fhem/FHEM/72_FB_CALLLIST.pm @@ -231,21 +231,9 @@ sub FB_CALLLIST_Set($@) { delete($hash->{helper}{DATA}); - if(AttrVal($name, "create-readings", "0") eq "1") - { - readingsBeginUpdate($hash); - - readingsBulkUpdate($hash, "numberOfCalls", 0, 1); - - for my $reading (grep { /^\d+-/ } keys %{$hash->{READINGS}}) - { - readingsBulkUpdate($hash, $reading, ""); - readingsDelete($hash, $reading); - } - - readingsEndUpdate($hash, 1); - } - + # update readings if neccessary + FB_CALLLIST_createReadings($hash); + # Inform all FHEMWEB clients FB_CALLLIST_updateFhemWebClients($hash); @@ -480,14 +468,14 @@ sub FB_CALLLIST_Notify($$) Log3 $name, 5, "FB_CALLLIST ($name) - processed connect event for call id $call_id"; } - if($event eq "disconnect" ) + if($event eq "disconnect") { $data->{call_duration} = ReadingsVal($fb, "call_duration", undef); $data->{finished} = gettimeofday(); if($data->{last_event} =~ /^call|ring$/) { - $data->{missed_call} = 1; + $data->{missed_call} = 1; } delete($data->{running_call}); @@ -510,8 +498,6 @@ sub FB_CALLLIST_Notify($$) # Update readings FB_CALLLIST_createReadings($hash); - - } ############################################################################################################ @@ -919,7 +905,6 @@ sub FB_CALLLIST_list2html($) $ret .= ""; } - $ret .= "