change error handling, add attributs disable and disabledForIntervals
This commit is contained in:
parent
c28ae2e245
commit
4cd8b0ecea
@ -34,7 +34,7 @@ package main;
|
||||
use strict;
|
||||
use warnings;
|
||||
use utf8;
|
||||
use Meta;
|
||||
use FHEM::Meta;
|
||||
|
||||
use FHEM::backupToStorage;
|
||||
|
||||
@ -47,6 +47,7 @@ sub backupToStorage_Initialize {
|
||||
$hash->{DefFn} = \&FHEM::backupToStorage::Define;
|
||||
$hash->{NotifyFn} = \&FHEM::backupToStorage::Notify;
|
||||
$hash->{UndefFn} = \&FHEM::backupToStorage::Undef;
|
||||
$hash->{AttrFn} = \&FHEM::backupToStorage::Attr;
|
||||
$hash->{RenameFn} = \&FHEM::backupToStorage::Rename;
|
||||
$hash->{DeleteFn} = \&FHEM::backupToStorage::Delete;
|
||||
$hash->{ShutdownFn} = \&FHEM::backupToStorage::Shutdown;
|
||||
@ -178,7 +179,7 @@ sub backupToStorage_Initialize {
|
||||
],
|
||||
"release_status": "devepolment",
|
||||
"license": "GPL_2",
|
||||
"version": "v1.1.0",
|
||||
"version": "v1.2.0",
|
||||
"author": [
|
||||
"Marko Oldenburg <fhemsupport@cooltux.net>"
|
||||
],
|
||||
|
@ -1,2 +1,2 @@
|
||||
UPD 2020-10-24_10:07:46 6179 FHEM/98_backupToStorage.pm
|
||||
UPD 2020-10-24_10:05:11 16831 lib/FHEM/backupToStorage.pm
|
||||
UPD 2020-10-28_19:14:19 6242 FHEM/98_backupToStorage.pm
|
||||
UPD 2020-10-28_19:13:53 17356 lib/FHEM/backupToStorage.pm
|
||||
|
@ -318,6 +318,19 @@ sub Set {
|
||||
return;
|
||||
}
|
||||
|
||||
sub Attr {
|
||||
my $cmd = shift;
|
||||
my $name = shift;
|
||||
|
||||
my $attrName = shift;
|
||||
my $attrVal = shift;
|
||||
|
||||
if ( $cmd eq 'set' ) {
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
sub Rename {
|
||||
my $new = shift;
|
||||
my $old = shift;
|
||||
@ -438,11 +451,21 @@ sub FileUpload {
|
||||
. ' , returnString: '
|
||||
. $returnString . "\n"
|
||||
if ( $subprocess->{loglevel} > 4 );
|
||||
|
||||
$response->{ncUpload} = ( $returnCode == 72057594037927935
|
||||
&& $returnString eq ''
|
||||
? 'upload successfully'
|
||||
: $returnString );
|
||||
|
||||
|
||||
if ( $returnString =~ /100\s[0-9].*\s100\s[0-9].*/m
|
||||
and $returnString =~ /\s\s<o:hint xmlns:o="o:">(.*)<\/o:hint>/m ) {
|
||||
$response->{ncUpload} = $1;
|
||||
}
|
||||
elsif ( $returnString =~ /100\s[0-9].*\s100\s[0-9].*/m ) {
|
||||
$response->{ncUpload} = 'upload successfully';
|
||||
}
|
||||
elsif ( $returnString =~ /(curl:\s.*)/ ){
|
||||
$response->{ncUpload} = $1;
|
||||
}
|
||||
else {
|
||||
$response->{ncUpload} = 'unknown error';
|
||||
}
|
||||
}
|
||||
|
||||
my $json = eval { encode_json($response) };
|
||||
@ -461,7 +484,7 @@ sub ExecuteNCupload {
|
||||
my $subprocess = shift;
|
||||
|
||||
my $command = $subprocess->{curl};
|
||||
$command .= ' -s -u ';
|
||||
$command .= ' -u ';
|
||||
$command .= $subprocess->{user} . ':' . $subprocess->{pass};
|
||||
$command .= ' -T ' . $subprocess->{backupfile};
|
||||
$command .= ' "' . $subprocess->{proto} . '://';
|
||||
|
Loading…
x
Reference in New Issue
Block a user