fix: alert flags on wireless sensors table (#6556)

* fix: alert flags on wireless sensors table
Also check the low limit.

* Set null when the value is updated to a non-numeric or empty value.
This commit is contained in:
Tony Murray
2017-05-03 16:46:05 -05:00
committed by Neil Lathwood
parent 6b2ae00e27
commit 02d9b36720
5 changed files with 21 additions and 13 deletions

View File

@@ -24,7 +24,7 @@ if (!is_numeric($_POST['device_id']) || !is_numeric($_POST['sensor_id']) || !iss
exit;
} else {
$update = dbUpdate(
array($_POST['value_type'] => $_POST['data'], 'sensor_custom' => 'Yes'),
array($_POST['value_type'] => set_null($_POST['data'], array('NULL')), 'sensor_custom' => 'Yes'),
'sensors',
'`sensor_id` = ? AND `device_id` = ?',
array($_POST['sensor_id'], $_POST['device_id'])