diff --git a/fhem/CHANGED b/fhem/CHANGED index 78e501a17..75008ef2b 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,7 @@ # 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: 30_MilightBridge: Minor change to ping code to try and resolve + crash when hostname not in dns - bugfix: pilight_ctrl: reset - clear send queue - feature: pilight_ctrl: add attribute SendTimeout for aborting sending commands - feature: FB_CALLMONITOR: add TR-064 support for remote phonebook reading diff --git a/fhem/FHEM/30_MilightBridge.pm b/fhem/FHEM/30_MilightBridge.pm index ec71b815c..611341f50 100644 --- a/fhem/FHEM/30_MilightBridge.pm +++ b/fhem/FHEM/30_MilightBridge.pm @@ -203,14 +203,12 @@ sub MilightBridge_State(@) # Do a ping check to see if bridge is reachable # check via ping - my $pingstatus = "ok"; + my $pingstatus = "unreachable"; my $p = Net::Ping->new('udp'); - if( $p->ping($hash->{HOST}, 2)) { - $pingstatus = "ok"; - } else { - $pingstatus = "unreachable"; - } + my $alive = $p->ping($hash->{HOST}, 2); $p->close(); + $pingstatus = "ok" if $alive; + # And update state readingsSingleUpdate($hash, "state", $pingstatus, 1);