Add reboot, use parent get()

pull/4422/head
Isaac Connor 2025-08-12 19:51:59 -04:00
parent 31e497ec91
commit 46dc4f3f17
1 changed files with 10 additions and 13 deletions

View File

@ -131,6 +131,8 @@ sub open {
} else {
Debug('No headers line');
} # end if headers
# For parent get
$$self{BaseURL} = $uri->canonical();
} else {
Debug('Failed to open '.$uri->canonical().$url.' status: '.$res->status_line());
} # end if $res->status_line() eq '401 Unauthorized'
@ -140,19 +142,7 @@ sub sendCmd {
my $self = shift;
my $cmd = shift;
$self->printMsg($cmd, 'Tx');
my $url = $uri->canonical().$cmd;
my $res = $self->{ua}->get($url);
if ( $res->is_success ) {
Debug('sndCmd command: '.$url.' content: '.$res->content);
return !undef;
}
Error("Error cmd $url failed: '".$res->status_line()."'");
return undef;
return $self->get($url);
}
sub cameraReset {
@ -514,6 +504,13 @@ sub presetHome {
$self->sendCmd($cmd);
}
sub reboot {
my $self = shift;
$uri->path('/axis-cgi/restart.cgi');
my $response = $self->get($uri->canonical);
return $response->is_success;
}
1;
__END__
# Below is stub documentation for your module. You'd better edit it!