From d8e7e74aace8fa7ae280a39656113b7e69424ecb Mon Sep 17 00:00:00 2001 From: markusbloch <> Date: Tue, 23 Jan 2018 09:05:40 +0000 Subject: [PATCH] FB_CALLLIST: use readingsDelete() to delete readings git-svn-id: https://svn.fhem.de/fhem/trunk@15965 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/72_FB_CALLLIST.pm | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/fhem/FHEM/72_FB_CALLLIST.pm b/fhem/FHEM/72_FB_CALLLIST.pm index 662458729..de6213e40 100755 --- a/fhem/FHEM/72_FB_CALLLIST.pm +++ b/fhem/FHEM/72_FB_CALLLIST.pm @@ -232,16 +232,16 @@ sub FB_CALLLIST_Set($@) if(AttrVal($name, "create-readings", "0") eq "1") { readingsBeginUpdate($hash); + readingsBulkUpdate($hash, "numberOfCalls", 0, 1); - for my $reading (keys %{$hash->{READINGS}}) + for my $reading (grep { /^\d+-/ } keys %{$hash->{READINGS}}) { readingsBulkUpdate($hash, $reading, ""); + readingsDelete($hash, $reading); } readingsEndUpdate($hash, 1); - - CommandDeleteReading($hash->{CL}, $name.' \d+-.*'); } # Inform all FHEMWEB clients @@ -989,13 +989,11 @@ sub FB_CALLLIST_createReadings($) for my $reading (grep { /^(\d+)-/ and ($1 > @item_list) } keys %{$hash->{READINGS}}) { readingsBulkUpdate($hash, $reading, ""); - push @delete_readings, $reading; + readingsDelete($hash, $_) ; } readingsEndUpdate($hash, 1); - map { CommandDeleteReading(undef, "$name $_") } @delete_readings; - return undef; }