2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 06:39:11 +00:00

10_OWServer: avoid init and autocreate on tentative connection

git-svn-id: https://svn.fhem.de/fhem/trunk@16492 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
borisneubert 2018-03-25 19:54:55 +00:00
parent 091156a547
commit f56e9a2306
2 changed files with 16 additions and 3 deletions

View File

@ -1,12 +1,13 @@
# 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.
- bugfix: 10_OWServer: avoid init and autocreate on tentative connection
- feature: 49_SSCam: 3.6.0, new setPreset command, minor changes
- feature: 72_FB_CALLMONITOR: show a "not found" popup, when reverse search
via get command fails
- feature: 93_DbRep: V7.15.0, new command sqlSpecial
- bugfix: 74_XiaomiBTLSens: fix commandref entrys
- feature: 49_SSCam: V3.5.0, new get command listPresets
- change: 93_DbRep: V7.14.8, exportToFile,importFromFile can use file as an
- change: 93_DbRep: V7.14.8, exportToFile,importFromFile can use file as an
argument, fix no save to database if value=0 (writeToDB)
- feature: 10_OWServer: added OWNet module version suggestion to define
- feature: 49_SSCam: V3.4.0, new commands startTracking, stopTracking for

View File

@ -218,7 +218,7 @@ sub OWServer_loadOWNet($) {
require $libfilename;
Log3 $name, 3, "$name: OWNet version $OWNet_version loaded.";
my $owserver= OWServer_OpenDev($hash);
my $owserver= OWServer_TryOpenDev($hash);
if(defined($owserver)) {
my $version= $owserver->read("/system/configuration/version");
Log3 $name, 3, "$name: owserver version $version found.";
@ -267,7 +267,7 @@ OWServer_CloseDev($)
########################
sub
OWServer_OpenDev($)
OWServer_TryOpenDev($)
{
my ($hash) = @_;
my $name = $hash->{NAME};
@ -279,6 +279,18 @@ OWServer_OpenDev($)
my $owserver= OWNet->new($protocol);
if($owserver) {
Log3 $name, 3, "$name: Successfully connected to $protocol.";
} else {
Log3 $name, 2, "$name: Could not connect to $protocol.";
}
return $owserver
}
sub
OWServer_OpenDev($)
{
my ($hash) = @_;
my $owserver= OWServer_TryOpenDev($hash);
if(defined($owserver)) {
$hash->{fhem}{owserver}= $owserver;
readingsSingleUpdate($hash, "state", "CONNECTED", 1);
my $ret = OWServer_DoInit($hash);