mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-04 17:36:39 +00:00
93_DbRep: contrib 8.52.5
git-svn-id: https://svn.fhem.de/fhem/trunk@27425 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
5c3042ab97
commit
07ef3ec819
@ -1,5 +1,5 @@
|
||||
##########################################################################################################
|
||||
# $Id: 93_DbRep.pm 27393 2023-04-04 19:30:04Z DS_Starter $
|
||||
# $Id: 93_DbRep.pm 27396 2023-04-05 11:01:24Z DS_Starter $
|
||||
##########################################################################################################
|
||||
# 93_DbRep.pm
|
||||
#
|
||||
@ -59,6 +59,8 @@ no if $] >= 5.017011, warnings => 'experimental::smartmatch';
|
||||
|
||||
# Version History intern
|
||||
my %DbRep_vNotesIntern = (
|
||||
"8.52.5" => "10.04.2023 change diffValue, Forum: https://forum.fhem.de/index.php?msg=1271853 ",
|
||||
"8.52.4" => "10.04.2023 fix perl warning ",
|
||||
"8.52.3" => "04.04.2023 fix diffValue writeToDB: https://forum.fhem.de/index.php?topic=53584.msg1270905#msg1270905 ",
|
||||
"8.52.2" => "28.03.2023 diffValue can operate positive and negative differences, sqlCmd can execute 'describe' statement ",
|
||||
"8.52.1" => "19.03.2023 fix Perl Warnings ",
|
||||
@ -4538,7 +4540,7 @@ sub DbRep_diffval {
|
||||
my $st = [gettimeofday]; # SQL-Startzeit
|
||||
|
||||
for my $row (@ts) { # DB-Abfrage zeilenweise für jeden Array-Eintrag
|
||||
my @a = split("#", $row);
|
||||
my @a = split "#", $row;
|
||||
my $runtime_string = $a[0];
|
||||
my $runtime_string_first = $a[1];
|
||||
my $runtime_string_next = $a[2];
|
||||
@ -4616,8 +4618,9 @@ sub DbRep_diffval {
|
||||
@array = ($runtime_string." ".$rsf[0]."_".$rsf[1]."-".$rsf[2]."\n");
|
||||
}
|
||||
else {
|
||||
my @rsf = split " ", $runtime_string_first;
|
||||
@array = ($runtime_string." ".$rsf[0]."\n");
|
||||
my $rsfe = encode_base64((split " ", $runtime_string_first)[0],"");
|
||||
my @rsf = split " ", $runtime_string_first;
|
||||
@array = ($rsfe." ".$rsf[0]."\n");
|
||||
}
|
||||
}
|
||||
|
||||
@ -4650,11 +4653,14 @@ sub DbRep_diffval {
|
||||
my $runtime_string = decode_base64($a[0]);
|
||||
$lastruntimestring = $runtime_string if ($i == 1);
|
||||
|
||||
next if(!$a[2]);
|
||||
if(!$a[2]) {
|
||||
$rh{$runtime_string} = $runtime_string."|-|".$runtime_string;
|
||||
next;
|
||||
}
|
||||
|
||||
my $timestamp = $a[1]."_".$a[2];
|
||||
my $value = $a[3] ? $a[3] : 0;
|
||||
my $diff = $a[4] ? $a[4] : 0;
|
||||
my $value = $a[3] ? $a[3] : 0;
|
||||
my $diff = $a[4] ? $a[4] : 0;
|
||||
|
||||
$timestamp =~ s/\s+$//g; # Leerzeichen am Ende $timestamp entfernen
|
||||
|
||||
@ -4739,7 +4745,7 @@ sub DbRep_diffval {
|
||||
Log3 ($name, 3, $key) ;
|
||||
}
|
||||
|
||||
$ncps = join('§', %$ncp);
|
||||
$ncps = join '§', %$ncp;
|
||||
$ncpslist = encode_base64($ncps,"");
|
||||
}
|
||||
|
||||
@ -4748,7 +4754,7 @@ sub DbRep_diffval {
|
||||
my $rowsrej;
|
||||
$rowsrej = encode_base64 ($rejectstr, "") if($rejectstr);
|
||||
|
||||
my $rows = join('§', %rh); # Ergebnishash
|
||||
my $rows = join '§', %rh; # Ergebnishash
|
||||
|
||||
my ($wrt,$irowdone); # Ergebnisse in Datenbank schreiben
|
||||
|
||||
@ -4781,7 +4787,7 @@ sub DbRep_diffvalDone {
|
||||
my $reading = $a[4];
|
||||
my $bt = $a[5];
|
||||
my $rowsrej = $a[6] ? decode_base64($a[6]) : ''; # String von Datensätzen die nicht berücksichtigt wurden (diff Schwellenwert Überschreitung)
|
||||
my $ncpslist = $a[6] ? decode_base64($a[7]) : ''; # Hash von Perioden die nicht kalkuliert werden konnten "no calc in period"
|
||||
my $ncpslist = $a[7] ? decode_base64($a[7]) : ''; # Hash von Perioden die nicht kalkuliert werden konnten "no calc in period"
|
||||
my $irowdone = $a[8];
|
||||
|
||||
my $hash = $defs{$name};
|
||||
@ -13458,7 +13464,7 @@ sub DbRep_OutputWriteToDB {
|
||||
|
||||
for my $key (sort(keys(%rh))) {
|
||||
my @k = split "\\|", $rh{$key};
|
||||
$value = defined($k[1]) ? sprintf("%.${ndp}f",$k[1]) : undef;
|
||||
$value = defined($k[1]) && $k[1] ne '-' ? sprintf("%.${ndp}f",$k[1]) : undef;
|
||||
$rsf = $k[2]; # Datum / Zeit für DB-Speicherung
|
||||
|
||||
($date,$time) = split "_", $rsf;
|
||||
@ -14099,12 +14105,12 @@ sub DbRep_setVersionInfo {
|
||||
if($modules{$type}{META}{x_prereqs_src} && !$hash->{HELPER}{MODMETAABSENT}) {
|
||||
# META-Daten sind vorhanden
|
||||
$modules{$type}{META}{version} = "v".$v; # Version aus META.json überschreiben, Anzeige mit {Dumper $modules{SMAPortal}{META}}
|
||||
if($modules{$type}{META}{x_version}) { # {x_version} ( nur gesetzt wenn $Id: 93_DbRep.pm 27393 2023-04-04 19:30:04Z DS_Starter $ im Kopf komplett! vorhanden )
|
||||
if($modules{$type}{META}{x_version}) { # {x_version} ( nur gesetzt wenn $Id: 93_DbRep.pm 27396 2023-04-05 11:01:24Z DS_Starter $ im Kopf komplett! vorhanden )
|
||||
$modules{$type}{META}{x_version} =~ s/1.1.1/$v/g;
|
||||
} else {
|
||||
$modules{$type}{META}{x_version} = $v;
|
||||
}
|
||||
return $@ unless (FHEM::Meta::SetInternals($hash)); # FVERSION wird gesetzt ( nur gesetzt wenn $Id: 93_DbRep.pm 27393 2023-04-04 19:30:04Z DS_Starter $ im Kopf komplett! vorhanden )
|
||||
return $@ unless (FHEM::Meta::SetInternals($hash)); # FVERSION wird gesetzt ( nur gesetzt wenn $Id: 93_DbRep.pm 27396 2023-04-05 11:01:24Z DS_Starter $ im Kopf komplett! vorhanden )
|
||||
if(__PACKAGE__ eq "FHEM::$type" || __PACKAGE__ eq $type) {
|
||||
# es wird mit Packages gearbeitet -> Perl übliche Modulversion setzen
|
||||
# mit {<Modul>->VERSION()} im FHEMWEB kann Modulversion abgefragt werden
|
||||
|
Loading…
x
Reference in New Issue
Block a user