Merge pull request #977 from laf/issue-975

Added a new db field to record when custom high/low limits are set and stop them being overwrote
This commit is contained in:
Daniel Preussker
2015-05-13 19:00:54 +00:00
3 changed files with 6 additions and 5 deletions

View File

@@ -21,7 +21,7 @@ if(!is_numeric($_POST['device_id']) || !is_numeric($_POST['sensor_id']) || (empt
}
else
{
$update = dbUpdate(array($_POST['value_type'] => $_POST['data']), 'sensors', '`sensor_id` = ? AND `device_id` = ?', array($_POST['sensor_id'],$_POST['device_id']));
$update = dbUpdate(array($_POST['value_type'] => $_POST['data'], 'sensor_custom' => 'Yes'), 'sensors', '`sensor_id` = ? AND `device_id` = ?', array($_POST['sensor_id'],$_POST['device_id']));
if(!empty($update) || $update == '0')
{
echo('success');