|
|
@@ -83,14 +83,13 @@ class EquipmentController {
|
|
|
alarm: JSON.stringify(req.body.Alarm)
|
|
|
})
|
|
|
|
|
|
- if (req.body.Alarm.length > 0 && equipment.current_alarm_type == req.body.Alarm[0]) {
|
|
|
+ if (req.body.Alarm.length > 0 && equipment.current_alarm_type != req.body.Alarm[0]) {
|
|
|
sendAlarm(equipment.name, String(req.body.Alarm[0]))
|
|
|
} else {
|
|
|
sendUpdateRequest()
|
|
|
}
|
|
|
|
|
|
equipment.update({ current_alarm_type: req.body.Alarm.length > 0 ? req.body.Alarm[0] : null })
|
|
|
-
|
|
|
res.json({ message: 'ok' })
|
|
|
}
|
|
|
}
|