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,5 +1,6 @@
# 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

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);