2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-08 01:14:19 +00:00

WOL one more bugfix for refreshing the state

git-svn-id: https://svn.fhem.de/fhem/trunk@1208 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
klassm 2012-01-22 16:14:15 +00:00
parent 445d0e2d34
commit 34074cabb6

View File

@ -94,14 +94,14 @@ sub WOL_GetUpdate($)
my $ip = $hash->{IP};
#if (system("ping -q -c 1 $ip > /dev/null") == 0)
if (`ping -c 1 $ip` =~ m/0\% packet loss/)
{
$hash->{READINGS}{state}{VAL} = "on";
$hash->{READINGS}{isRunning}{VAL} = "true";
} else
if (`ping -c 1 $ip` =~ m/100/)
{
$hash->{READINGS}{state}{VAL} = "off";
$hash->{READINGS}{isRunning}{VAL} = "false";
} else
{
$hash->{READINGS}{state}{VAL} = "on";
$hash->{READINGS}{isRunning}{VAL} = "true";
}
$hash->{READINGS}{state}{TIME} = TimeNow();
$hash->{READINGS}{isRunning}{TIME} = TimeNow();