Skip to content
Permalink
Browse files

Update magichome.class.php

  • Loading branch information...
directman66 committed Mar 11, 2019
1 parent 9d3f18c commit b7be7b074fbe8e62c1b958e1587fdf7d49e1d1d1
Showing with 5 additions and 10 deletions.
  1. +5 −10 modules/magichome/magichome.class.php
@@ -441,7 +441,10 @@ function search_devices(&$out) {
$ip=$mhdevices[$i]['IP'];
$lastping=$mhdevices[$i]['LASTPING'];
//echo time()-$lastping;
if (time()-$lastping>300) {
if ((!$lastping)||(time()-$lastping>300))
{
@@ -453,16 +456,8 @@ function search_devices(&$out) {
{SQLexec("update magichome_devices set ONLINE=0, LASTPING='.time().' where IP=\''.$ip.'\'");}
';
SetTimeOut('magichome_ping',$cmd, '1');
SetTimeOut('magichome_ping'.$i,$cmd, '1');
/*
$online=ping(processTitle($ip));
if ($online)
{SQLexec("update magichome_devices set ONLINE='1', LASTPING=".time()." where IP='$ip'");}
else
{SQLexec("update magichome_devices set ONLINE='0', LASTPING=".time()." where IP='$ip'");}
*/
}

0 comments on commit b7be7b0

Please sign in to comment.
You can’t perform that action at this time.