1
0

added some javascript to webserver\nsome debugging

This commit is contained in:
2022-03-06 01:30:33 +01:00
parent a2d2909a23
commit 9dde1c2d53
13 changed files with 230 additions and 179 deletions

View File

@ -78,6 +78,16 @@ class db extends mysqli
logger(INFO, sprintf(_("New value (%s) of property: '%s' of device: %s stored in database"), bool2string($value), $property, $device->friendlyName), __FILE__ . ":" . __LINE__);
}
}
function moyenne($deviceObject, $property, $time)
{
$query = "SELECT AVG(value) WHERE device='" . $deviceObject->ieeeAddress . "' AND property='" . $property . "' AND TIMEDIFF(NOW(), 'date') < " . $time;
if(!$this->result = $this->query($query))
{
logger(ERROR, _("mysql query errror: ") . $this->error, __FILE__ . ":" . __LINE__);
}
var_dump($this->result);
}
}
$mohaDB = new db();