Add Zones() to Monitor
This commit is contained in:
parent
69098ccdcb
commit
e32771c255
|
@ -35,6 +35,7 @@ require ZoneMinder::Storage;
|
|||
require ZoneMinder::Server;
|
||||
require ZoneMinder::Memory;
|
||||
require ZoneMinder::Monitor_Status;
|
||||
require ZoneMinder::Zone;
|
||||
|
||||
#our @ISA = qw(Exporter ZoneMinder::Base);
|
||||
use parent qw(ZoneMinder::Object);
|
||||
|
@ -226,6 +227,13 @@ sub Storage {
|
|||
return new ZoneMinder::Storage( $_[0]{StorageId} );
|
||||
} # end sub Storage
|
||||
|
||||
sub Zones {
|
||||
if (! exists $_[0]{Zones}) {
|
||||
$_[0]{Zones} = [ $_[0]{Id} ? ZoneMinder::Zone->find(MonitorId=>$_[0]{Id}) : () ];
|
||||
}
|
||||
return wantarray ? @{$_[0]{Zones}} : $_[0]{Zones};
|
||||
}
|
||||
|
||||
sub control {
|
||||
my $monitor = shift;
|
||||
my $command = shift;
|
||||
|
|
Loading…
Reference in New Issue