00_HMUARTLGW.pm: use "state"-reading instead of $hash->{STATE}

git-svn-id: https://svn.fhem.de/fhem/trunk@13312 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
mgernoth
2017-02-02 21:37:19 +00:00
parent f5bb20e376
commit 11dd6e7724

View File

@@ -316,10 +316,11 @@ sub HMUARTLGW_Ready($)
{ {
my ($hash) = @_; my ($hash) = @_;
my $name = $hash->{NAME}; my $name = $hash->{NAME};
my $state = ReadingsVal($name, "state", "unknown");
Log3($hash, 4, "HMUARTLGW ${name} ready: ".$hash->{STATE}); Log3($hash, 4, "HMUARTLGW ${name} ready: ${state}");
if ((!$hash->{lgwHash}) && $hash->{STATE} eq "disconnected") { if ((!$hash->{lgwHash}) && $state eq "disconnected") {
#don't immediately reconnect when we just connected, delay #don't immediately reconnect when we just connected, delay
#for 5s because remote closed the connection on us #for 5s because remote closed the connection on us
if (defined($hash->{LastOpen}) && if (defined($hash->{LastOpen}) &&