Add disable alarms as an alarm command

pull/3222/head
Isaac Connor 2021-04-12 15:58:15 -04:00
parent 29e91f48e6
commit 007dce45fb
1 changed files with 5 additions and 1 deletions

View File

@ -228,7 +228,7 @@ class MonitorsController extends AppController {
// arm/disarm alarms
// expected format: http(s):/portal-api-url/monitors/alarm/id:M/command:C.json
// where M=monitorId
// where C=on|off|status
// where C=on|off|status|disable
public function alarm() {
$id = $this->request->params['named']['id'];
if ( !$this->Monitor->exists($id) ) {
@ -245,6 +245,10 @@ class MonitorsController extends AppController {
$q = '-c';
$verbose = '-v';
break;
case 'disable':
$q = '-n';
$verbose = '-v';
break;
case 'status':
$verbose = ''; // zmu has a bug - gives incorrect verbose output in this case
$q = '-s';