mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-03 16:56:54 +00:00
93_DbRep: contrib 8.8.0
git-svn-id: https://svn.fhem.de/fhem/trunk@17695 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
ad12ed8f38
commit
44b2fe9898
@ -386,12 +386,12 @@ sub DbRep_Define($@) {
|
|||||||
Log3 ($name, 4, "DbRep $name - history sql commandlist read from file ".$attr{global}{modpath}."/FHEM/FhemUtils/cacheDbRep");
|
Log3 ($name, 4, "DbRep $name - history sql commandlist read from file ".$attr{global}{modpath}."/FHEM/FhemUtils/cacheDbRep");
|
||||||
}
|
}
|
||||||
|
|
||||||
RemoveInternalTimer($hash);
|
|
||||||
InternalTimer(gettimeofday()+int(rand(45)), 'DbRep_firstconnect', "$name||onBoot|", 0);
|
|
||||||
|
|
||||||
Log3 ($name, 4, "DbRep $name - initialized");
|
Log3 ($name, 4, "DbRep $name - initialized");
|
||||||
ReadingsSingleUpdateValue ($hash, 'state', 'initialized', 1);
|
ReadingsSingleUpdateValue ($hash, 'state', 'initialized', 1);
|
||||||
|
|
||||||
|
RemoveInternalTimer($hash);
|
||||||
|
InternalTimer(gettimeofday()+int(rand(45)), 'DbRep_firstconnect', "$name||onBoot|", 0);
|
||||||
|
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1052,8 +1052,8 @@ sub DbRep_Attr($$$$) {
|
|||||||
my $val = ($do == 1 ? "disabled" : "initialized");
|
my $val = ($do == 1 ? "disabled" : "initialized");
|
||||||
ReadingsSingleUpdateValue ($hash, "state", $val, 1);
|
ReadingsSingleUpdateValue ($hash, "state", $val, 1);
|
||||||
if ($do == 0) {
|
if ($do == 0) {
|
||||||
RemoveInternalTimer($hash);
|
#RemoveInternalTimer($hash);
|
||||||
InternalTimer(time+5, 'DbRep_firstconnect', "$name|||", 0);
|
#InternalTimer(time+5, 'DbRep_firstconnect', "$name|||", 0);
|
||||||
} else {
|
} else {
|
||||||
my $dbh = $hash->{DBH};
|
my $dbh = $hash->{DBH};
|
||||||
$dbh->disconnect() if($dbh);
|
$dbh->disconnect() if($dbh);
|
||||||
@ -1363,12 +1363,11 @@ sub DbRep_firstconnect(@) {
|
|||||||
RemoveInternalTimer($hash, "DbRep_firstconnect");
|
RemoveInternalTimer($hash, "DbRep_firstconnect");
|
||||||
return if(IsDisabled($name));
|
return if(IsDisabled($name));
|
||||||
|
|
||||||
if (AttrVal($name, "fastStart", 0) && $prop eq "onBoot" ) {
|
|
||||||
$hash->{LASTCMD} = "init database connect stopped due to attribute fastStart";
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($init_done == 1) {
|
if ($init_done == 1) {
|
||||||
|
if (AttrVal($name, "fastStart", 0) && $prop eq "onBoot" ) {
|
||||||
|
$hash->{LASTCMD} = "init database connect stopped due to attribute fastStart";
|
||||||
|
return;
|
||||||
|
}
|
||||||
# DB Struktur aus DbLog Instanz übernehmen
|
# DB Struktur aus DbLog Instanz übernehmen
|
||||||
$hash->{HELPER}{DBREPCOL}{COLSET} = $dbloghash->{HELPER}{COLSET};
|
$hash->{HELPER}{DBREPCOL}{COLSET} = $dbloghash->{HELPER}{COLSET};
|
||||||
$hash->{HELPER}{DBREPCOL}{DEVICECOL} = $dbloghash->{HELPER}{DEVICECOL};
|
$hash->{HELPER}{DBREPCOL}{DEVICECOL} = $dbloghash->{HELPER}{DEVICECOL};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user