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:
@@ -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}) &&
|
||||||
|
|||||||
Reference in New Issue
Block a user