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

93_DbLog: standard unit assignment for readings beginning with 'temperature' or 'humidity' removed, forum:#125087

git-svn-id: https://svn.fhem.de/fhem/trunk@25393 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
nasseeder1 2021-12-31 07:44:54 +00:00
parent 93a1b9653f
commit 36486563e9
2 changed files with 13 additions and 8 deletions

View File

@ -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: 93_DbLog: standard unit assignment for readings beginning with
'temperature' or 'humidity' removed, forum:#125087
- feature: 36_ShellyMonitor: support for readings of Shelly TRV
- feature: 82_LGTV_WebOS: add weibu and change part's of code
- bugfix: 93_DbLog: logging negative temperature of Type FBDECT

View File

@ -30,6 +30,7 @@ no if $] >= 5.017011, warnings => 'experimental::smartmatch';
# Version History intern by DS_Starter:
my %DbLog_vNotesIntern = (
"4.12.5" => "31.12.2001 standard unit assignment for readings beginning with 'temperature' and 'humidity' removed, forum:#125087 ",
"4.12.4" => "27.12.2021 change ParseEvent for FBDECT, warning messages for deprecated commands added ",
"4.12.3" => "20.04.2021 change sub DbLog_ConnectNewDBH for SQLITE, change error Logging in DbLog_writeFileIfCacheOverflow ",
"4.12.2" => "08.04.2021 change standard splitting ",
@ -1116,11 +1117,11 @@ sub DbLog_ParseEvent {
}
}
#globales Abfangen von
#globales Abfangen von # removed in Version 4.12.5
# - temperature
# - humidity
if ($reading =~ m(^temperature)) { $unit = "°C"; } # wenn reading mit temperature beginnt
elsif($reading =~ m(^humidity)) { $unit = "%"; } # wenn reading mit humidity beginnt
#if ($reading =~ m(^temperature)) { $unit = "°C"; } # wenn reading mit temperature beginnt
#elsif($reading =~ m(^humidity)) { $unit = "%"; } # wenn reading mit humidity beginnt
# the interpretation of the argument depends on the device type
# EMEM, M232Counter, M232Voltage return plain numbers
@ -2620,8 +2621,9 @@ sub DbLog_PushAsync {
# ohne PK
$sqlins = "INSERT INTO $history (TIMESTAMP, DEVICE, TYPE, EVENT, READING, VALUE, UNIT) VALUES ";
}
no warnings 'uninitialized';
foreach my $row (@row_array) {
no warnings 'uninitialized';
for my $row (@row_array) {
my @a = split("\\|",$row);
s/_ESC_/\|/gxs for @a; # escaped Pipe return to "|"
Log3 $hash->{NAME}, 5, "DbLog $name -> processing event Timestamp: $a[0], Device: $a[1], Type: $a[2], Event: $a[3], Reading: $a[4], Value: $a[5], Unit: $a[6]";
@ -2632,7 +2634,8 @@ sub DbLog_PushAsync {
$a[5] =~ s/\\/\\\\/g; # escape \ with \\
$a[6] =~ s/\\/\\\\/g; # escape \ with \\
$sqlins .= "('$a[0]','$a[1]','$a[2]','$a[3]','$a[4]','$a[5]','$a[6]'),";
}
}
use warnings;
chop($sqlins);
@ -2645,9 +2648,9 @@ sub DbLog_PushAsync {
if ($@) {
Log3($name, 2, "DbLog $name -> Error start transaction for $history - $@");
}
eval { $sth_ih = $dbh->prepare($sqlins);
if($tl) {
# Tracelevel setzen
if($tl) { # Tracelevel setzen
$sth_ih->{TraceLevel} = "$tl|$tf";
}
my $ins_hist = $sth_ih->execute();