mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-03 16:56:54 +00:00
FB_CALLLIST: delete also corresponding readings if a call gets deleted (Forum: #52158)
git-svn-id: https://svn.fhem.de/fhem/trunk@11300 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
68af103947
commit
3ae0174d47
@ -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.
|
||||
- change: FB_CALLLIST: delete also corresponding readings if a call gets
|
||||
deleted
|
||||
- feature: 49_SSCam: Attribute "disable" to deactivate the module added
|
||||
- bugfix: 14_CUL_TCM97001: Fix battery bits.
|
||||
Fix Auriol receive
|
||||
|
@ -316,7 +316,7 @@ sub FB_CALLLIST_Notify($$)
|
||||
FB_CALLLIST_cleanupList($hash);
|
||||
|
||||
# Inform all FHEMWEB clients
|
||||
FB_CALLLIST_updateFhemWebClients($hash) if(grep(m/^(?:ATTR|DELETEATTR)$/, @{$d->{CHANGED}}));
|
||||
FB_CALLLIST_updateFhemWebClients($hash) if(grep(m/^(?:ATTR|DELETEATTR)/, @{$d->{CHANGED}}));
|
||||
|
||||
# save current list state to file/configDB
|
||||
FB_CALLLIST_saveList($hash);
|
||||
@ -741,7 +741,6 @@ sub FB_CALLLIST_list2html($;$)
|
||||
$ret .= '<div class="fhemWidget" informId="'.$name.'" cmd="" arg="fbcalllist" dev="'.$name.'">'; # div tag to support inform updates
|
||||
$ret .= '<table class="block fbcalllist">';
|
||||
|
||||
|
||||
$ret .= FB_CALLLIST_returnOrderedHTMLOutput($hash, FB_CALLLIST_returnTableHeader($hash), 'class="fbcalllist header"','') if(AttrVal($name, "no-table-header", "0") eq "0");
|
||||
|
||||
if(exists($hash->{helper}{DATA}) and (scalar keys %{$hash->{helper}{DATA}}) > 0)
|
||||
@ -762,6 +761,8 @@ sub FB_CALLLIST_list2html($;$)
|
||||
@list = grep { !$hash->{helper}{DATA}{$_}{running_call} } @list;
|
||||
}
|
||||
|
||||
readingsBeginUpdate($hash) if($to_json and $create_readings eq "1");
|
||||
|
||||
foreach my $index (@list)
|
||||
{
|
||||
$count++;
|
||||
@ -797,7 +798,22 @@ sub FB_CALLLIST_list2html($;$)
|
||||
$ret .= FB_CALLLIST_returnOrderedHTMLOutput($hash, $line, 'number="'.$count.'" class="fbcalllist '.($count % 2 == 1 ? "odd" : "even").'"', 'class="fbcalllist" '.$td_style);
|
||||
}
|
||||
|
||||
readingsSingleUpdate($hash, "numberOfCalls", $count, 1) if($to_json and $create_readings eq "1");
|
||||
if($to_json and $create_readings eq "1")
|
||||
{
|
||||
readingsBulkUpdate($hash, "numberOfCalls", $count, 1);
|
||||
|
||||
my @delete_readings;
|
||||
|
||||
for my $reading (grep { /^(\d+)-/ and ($1 > $count) } keys %{$hash->{READINGS}})
|
||||
{
|
||||
readingsBulkUpdate($hash, $reading, "");
|
||||
push @delete_readings, $reading;
|
||||
}
|
||||
|
||||
readingsEndUpdate($hash, 1) if($to_json and $create_readings eq "1");
|
||||
|
||||
map { delete($hash->{READINGS}{$_}) } @delete_readings;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1017,14 +1033,11 @@ sub FB_CALLLIST_updateReadings($$)
|
||||
|
||||
$line_tmp{state} = FB_CALLLIST_returnCallState($hash, $line->{index}, 0);
|
||||
|
||||
readingsBeginUpdate($hash);
|
||||
|
||||
foreach my $col (@order)
|
||||
{
|
||||
readingsBulkUpdate($hash, $line_tmp{line}."-$col", $line_tmp{$col});
|
||||
}
|
||||
|
||||
readingsEndUpdate($hash, 1);
|
||||
}
|
||||
|
||||
#####################################
|
||||
|
Loading…
x
Reference in New Issue
Block a user