mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-28 17:12:32 +00:00
FB_CALLLIST: minor code optimization
git-svn-id: https://svn.fhem.de/fhem/trunk@15886 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
14bb3a3541
commit
436ef86d60
@ -346,11 +346,14 @@ sub FB_CALLLIST_Notify($$)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(grep(m/^(?:INITIALIZED|REREADCFG)$/, @{$events}))
|
||||||
|
{
|
||||||
|
Log3 $name, 2, "FB_CALLLIST ($name) - WARNING - the selected device $callmonitor does not exist" unless(IsDevice($callmonitor));
|
||||||
|
Log3 $name, 2, "FB_CALLLIST ($name) - WARNING - selected device $callmonitor ist not of type FB_CALLMONITOR" if(IsDevice($callmonitor) and !IsDevice($callmonitor,"FB_CALLMONITOR"));
|
||||||
|
}
|
||||||
|
|
||||||
if(grep(m/^(?:ATTR $name .*|DELETEATTR $name.*|INITIALIZED|REREADCFG)$/, @{$events}))
|
if(grep(m/^(?:ATTR $name .*|DELETEATTR $name.*|INITIALIZED|REREADCFG)$/, @{$events}))
|
||||||
{
|
{
|
||||||
Log3 $name, 3, "FB_CALLLIST ($name) - WARNING - the selected device $callmonitor does not exist" unless(IsDevice($callmonitor));
|
|
||||||
Log3 $name, 3, "FB_CALLLIST ($name) - WARNING - selected device $callmonitor ist not of type FB_CALLMONITOR" if(IsDevice($callmonitor) and !IsDevice($callmonitor,"FB_CALLMONITOR"));
|
|
||||||
|
|
||||||
# delete all outdated calls according to attribute list-type, internal-number-filter and number-of-calls
|
# delete all outdated calls according to attribute list-type, internal-number-filter and number-of-calls
|
||||||
FB_CALLLIST_cleanupList($hash);
|
FB_CALLLIST_cleanupList($hash);
|
||||||
|
|
||||||
@ -738,8 +741,7 @@ sub FB_CALLLIST_returnCallState($$;$)
|
|||||||
if($data->{direction} eq "incoming" and ((not exists($data->{internal_connection}) ) or (exists($data->{internal_connection}) and not $data->{internal_connection} =~ /Answering_Machine/)))
|
if($data->{direction} eq "incoming" and ((not exists($data->{internal_connection}) ) or (exists($data->{internal_connection}) and not $data->{internal_connection} =~ /Answering_Machine/)))
|
||||||
{
|
{
|
||||||
$state = "=>".($data->{missed_call} ? " X" : "");
|
$state = "=>".($data->{missed_call} ? " X" : "");
|
||||||
$state = FB_CALLLIST_returnIcon($hash, "incoming.done", $state) if($icons and not $data->{missed_call});
|
$state = FB_CALLLIST_returnIcon($hash, "incoming.".($data->{missed_call} ? "missed" : "done"), $state) if($icons);
|
||||||
$state = FB_CALLLIST_returnIcon($hash, "incoming.missed", $state) if($icons and $data->{missed_call});
|
|
||||||
}
|
}
|
||||||
elsif($data->{direction} eq "incoming" and exists($data->{internal_connection}) and $data->{internal_connection} =~ /^Answering_Machine/)
|
elsif($data->{direction} eq "incoming" and exists($data->{internal_connection}) and $data->{internal_connection} =~ /^Answering_Machine/)
|
||||||
{
|
{
|
||||||
@ -749,8 +751,7 @@ sub FB_CALLLIST_returnCallState($$;$)
|
|||||||
elsif($data->{direction} eq "outgoing")
|
elsif($data->{direction} eq "outgoing")
|
||||||
{
|
{
|
||||||
$state = "<=".($data->{missed_call} ? " X" : "");
|
$state = "<=".($data->{missed_call} ? " X" : "");
|
||||||
$state = FB_CALLLIST_returnIcon($hash, "outgoing.done", $state) if($icons and not $data->{missed_call});
|
$state = FB_CALLLIST_returnIcon($hash, "outgoing.".($data->{missed_call} ? "missed" : "done"), $state) if($icons);
|
||||||
$state = FB_CALLLIST_returnIcon($hash, "outgoing.missed", $state) if($icons and $data->{missed_call});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -956,7 +957,7 @@ sub FB_CALLLIST_list2html($)
|
|||||||
|
|
||||||
|
|
||||||
#####################################
|
#####################################
|
||||||
# creating the call list as json array
|
# generate all readings for the call list
|
||||||
sub FB_CALLLIST_createReadings($)
|
sub FB_CALLLIST_createReadings($)
|
||||||
{
|
{
|
||||||
my ($hash) = @_;
|
my ($hash) = @_;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user