2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 09:16:53 +00:00

76_SMAPortal: avoid deletion of readings if provider is selected but value not delivered. Forum: #102112.msg1078990.html#msg1078990

git-svn-id: https://svn.fhem.de/fhem/trunk@22640 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
nasseeder1 2020-08-21 07:30:21 +00:00
parent 77daab008b
commit 900f46f4fd
2 changed files with 30 additions and 16 deletions

View File

@ -1,5 +1,8 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # 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. # Do not insert empty lines here, update check depends on it.
- change: 76_SMAPortal: avoid deletion of readings if provider is selected
but value not delivered.
Forum: #102112.msg1078990.html#msg1078990
- bugfix: 73_AutoShuttersControl: fix bug in call - bugfix: 73_AutoShuttersControl: fix bug in call
IsAfterShuttersTimeBlocking() IsAfterShuttersTimeBlocking()
- bugfix: 73_AutoShuttersControl: fix fix numeric eq - bugfix: 73_AutoShuttersControl: fix fix numeric eq

View File

@ -137,6 +137,7 @@ BEGIN {
# Versions History intern # Versions History intern
my %vNotesIntern = ( my %vNotesIntern = (
"3.4.1" => "18.08.2020 add selected providerlevel to deletion blacklist # Forum: https://forum.fhem.de/index.php/topic,102112.msg1078990.html#msg1078990 ",
"3.4.0" => "09.08.2020 attr balanceDay, balanceMonth, balanceYear for data provider balanceDayData, balanceMonthData, balanceYearData ". "3.4.0" => "09.08.2020 attr balanceDay, balanceMonth, balanceYear for data provider balanceDayData, balanceMonthData, balanceYearData ".
"set getData command, update button in header of PortalAsHtml, minor code changes according PBP", "set getData command, update button in header of PortalAsHtml, minor code changes according PBP",
"3.3.4" => "12.07.2020 fix break in header if attribute hourCount was reduced ", "3.3.4" => "12.07.2020 fix break in header if attribute hourCount was reduced ",
@ -2067,7 +2068,7 @@ sub ParseData { ## no critic
@da = split "###", $lc; @da = split "###", $lc;
} }
deleteData($hash, 0) if($getp ne "none"); # Daten nur löschen wenn Datenabruf (kein Verbraucher schalten) deleteData($hash, 1) if($getp ne "none"); # Daten nur löschen wenn Datenabruf (kein Verbraucher schalten)
readingsBeginUpdate($hash); readingsBeginUpdate($hash);
@ -2912,21 +2913,31 @@ sub deleteData {
} }
if($conspl) { # Readings löschen wenn nicht im providerLevel enthalten if($conspl) { # Readings löschen wenn nicht im providerLevel enthalten
for my $key(@allrds) { my $pbl = q{};
my ($lvl) = $key =~ m/^(L\d+)_/x; for my $prl (keys %{$mandatory{$name}}) { # mandatory Provider die abgerufen wurden
my $lvlm = $mandatory{$name}{$prl}{level}; # Forum: https://forum.fhem.de/index.php/topic,102112.msg1078990.html#msg1078990
if ($lvlm) {
$pbl .= "|^".$lvlm."_";
}
}
for my $prl (keys %{$subs{$name}}) { # Provider die abgerufen wurden
my $lvl = $subs{$name}{$prl}{level} if($subs{$name}{$prl}{doit}); # Forum: https://forum.fhem.de/index.php/topic,102112.msg1078990.html#msg1078990
if ($lvl) { if ($lvl) {
for my $p (keys %{$subs{$name}}) { $pbl .= "|^".$lvl."_";
delete($defs{$name}{READINGS}{$key}) if($subs{$name}{$p}{level} eq $lvl && !$subs{$name}{$p}{doit});
} }
} else { }
$bl .= $pbl; # Blacklist ergänzen
for my $key(@allrds) {
delete($defs{$name}{READINGS}{$key}) if($key !~ /$bl/x); delete($defs{$name}{READINGS}{$key}) if($key !~ /$bl/x);
}
delete $defs{$name}{READINGS}{$key} if($key =~ /^$pblvl/x); # Logbuchreadings immer löschen delete $defs{$name}{READINGS}{$key} if($key =~ /^$pblvl/x); # Logbuchreadings immer löschen
} }
return; return;
} }
for my $key(@allrds) { for my $key(@allrds) { # alle Readings löschen bis auf Standard-Blacklist
delete($defs{$name}{READINGS}{$key}) if($key !~ /$bl/x); delete($defs{$name}{READINGS}{$key}) if($key !~ /$bl/x);
} }