2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-09 20:57:11 +00:00

93_DbRep: V8.2.3, check availability of DbLog-device at definition time of DbRep-device

git-svn-id: https://svn.fhem.de/fhem/trunk@17518 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
nasseeder1 2018-10-12 16:00:37 +00:00
parent ffea47cddd
commit e10359e25e
2 changed files with 10 additions and 5 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_DbRep: V8.2.3, check availability of DbLog-device at
definition time of DbRep-device
- change: 93_Log2Syslog: send BSD-format changed, commandref revised
- bugfix: 93_DbRep: fix don't get the real min timestamp in special cases
- bugfix: 51_MOBILEALERTS: Fix temperature for MA10320PRO

View File

@ -42,6 +42,7 @@ use warnings;
# Versions History intern
our %DbRep_vNotesIntern = (
"8.2.3" => "07.10.2018 check availability of DbLog-device at definition time of DbRep-device ",
"8.2.2" => "07.10.2018 DbRep_getMinTs changed, fix don't get the real min timestamp in rare cases ",
"8.2.1" => "07.10.2018 \$hash->{dbloghash}{HELPER}{REOPEN_RUNS_UNTIL} contains the time until DB is closed ",
"8.2.0" => "05.10.2018 direct help for attributes ",
@ -486,9 +487,11 @@ sub DbRep_Define($@) {
my @a = split("[ \t][ \t]*", $def);
if(int(@a) < 2) {
return "You need to specify more parameters.\n". "Format: define <name> DbRep <DbLog-Device> <Reading> <Timestamp-Begin> <Timestamp-Ende>";
}
if(!$a[2]) {
return "You need to specify more parameters.\n". "Format: define <name> DbRep <DbLog-Device>";
} elsif (!$defs{$a[2]}) {
return "The specified DbLog-Device \"$a[2]\" doesn't exist.";
}
$hash->{LASTCMD} = " ";
$hash->{ROLE} = AttrVal($name, "role", "Client");
@ -1473,9 +1476,9 @@ sub DbRep_getMinTs($) {
# SQL-Startzeit
my $st = [gettimeofday];
# eval { $mints = $dbh->selectrow_array("SELECT min(TIMESTAMP) FROM history;"); };
eval { $mints = $dbh->selectrow_array("SELECT min(TIMESTAMP) FROM history;"); };
# eval { $mints = $dbh->selectrow_array("select TIMESTAMP from history limit 1;"); };
eval { $mints = $dbh->selectrow_array("select TIMESTAMP from history order by TIMESTAMP limit 1;"); };
# eval { $mints = $dbh->selectrow_array("select TIMESTAMP from history order by TIMESTAMP limit 1;"); };
$dbh->disconnect;